Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support questionnaire-constraint Extension #1849

Closed
delcroip opened this issue Feb 7, 2023 · 6 comments · Fixed by #2199
Closed

Support questionnaire-constraint Extension #1849

delcroip opened this issue Feb 7, 2023 · 6 comments · Fixed by #2199
Assignees
Labels
effort:large Large effort - 5 to 10 days P2 Medium priority issue type:enhancement New feature or request

Comments

@delcroip
Copy link
Collaborator

delcroip commented Feb 7, 2023

Is your feature request related to a problem? Please describe.
I need to set validation a bit more complex than max/min on question there is an extension available
http://hl7.org/fhir/StructureDefinition/questionnaire-constraint

Describe the solution you'd like
Support of the extension and run add it to the form validation
Must support reference to the item value through:

  • getValue()
  • %qitem

Neither are supported today (GetValue() return always null, %qitem throw a Fhirpath exception) might be related to #1246

Describe alternatives you've considered
Min /Max

but the issue it can only do numeric validation

also the message cannot be customised

Additional context
here a simple example (like a max)

{
                        "extension": [
                            {
                                "extension": [
                                    {
                                        "url": "key",
                                        "valueId": "EmCare.A.DE13.a"
                                    },
                                    {
                                        "url": "expression",
                                        "valueExpression": {
                                            "language": "text/fhirpath",
                                            "expression": "getValue().empty() or getValue()>=0 and getValue()<4"
                                        }
                                    },
                                    {
                                        "url": "severity",
                                        "valueCode": "error"
                                    },
                                    {
                                        "url": "human",
                                        "valueString": "the number of year cannot be above 4"
                                    }
                                ],
                                "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-constraint"
                            },
                            {
                                "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression",
                                "valueExpression": {
                                    "language": "text/fhirpath",
                                    "expression": "%resource.repeat(item).where(linkId='EmCare.A.DE12').answer.first().value.code = 'EmCare.A.DE13'"
                                }
                            }
                        ],
                        "linkId": "EmCare.A.DE13.a",
                        "text": "Age in years",
                        "type": "quantity",
                        "required": false,
                        "repeats": false
                    },

Would you like to work on the issue?
no, I don't have the skills

@delcroip
Copy link
Collaborator Author

delcroip commented Feb 8, 2023

Update on other alternatives: Min / Max is not supportted for Quantity type

@delcroip
Copy link
Collaborator Author

I think qitem should be part of that list

@jingtang10
Copy link
Collaborator

Please see in #2003 for additional comments.

Assigned to @FikriMilano. Thanks for taking this Fikri.

@ndegwamartin
Copy link
Collaborator

I think qitem should be part of that list

+1 on this. Additionally questionnaire because of %questionnaire?

@FikriMilano
Copy link
Collaborator

+1 on this. Additionally questionnaire because of %questionnaire?

I'm happy to have this in a separate PR, it will be super small change, that way it can be merged quick.

@FikriMilano
Copy link
Collaborator

@ndegwamartin @delcroip here's the ticket #2477

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort:large Large effort - 5 to 10 days P2 Medium priority issue type:enhancement New feature or request
Projects
Status: Complete
Development

Successfully merging a pull request may close this issue.

5 participants