-
Notifications
You must be signed in to change notification settings - Fork 299
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
Add candidateExpression extension #1038
Comments
Source: http://build.fhir.org/ig/HL7/sdc/StructureDefinition-sdc-questionnaire-candidateExpression.html Basically candidate expression will provide a list of possible answers using either CC: @f-odhiambo @ekigamba |
@fredhersch @jingtang10 @Tarun-Bhardwaj check the above comment from @RaaziaTarique |
Can you have the CQL or FHIRPath that makes up the candidateExpression use a value that was already entered in the Questionnaire (but has not yet been saved as a QuestionnaireResponse)? If yes, then we can implement dynamic cascading selects with this, and we can close/this will cover the functionality requested in #979 |
From the above comments by @RaaziaTarique and @pld, this issue/solution can be covered in issue #1039 and thus close it. Kindly advise |
@jingtang10 , could you please confirm if this issue can be closed basis that it will be addressed by #1039 ? |
#139 relies on something in draft, and also I do not think supported by the SDC, but even if it was do we feel ok relying on something in Draft stage? Seems safer to work off of |
Agreed here with @RaaziaTarique. I think in order to implement the example in http://build.fhir.org/ig/HL7/sdc/expressions.html#candidateExpression, we will need x fhir query support. I suggest we add a pacakge in fhir engine with an API that takes an xfhir query and return a list of fhir resources. Can we do this as a starting point? @maimoonak explained the real life use case of this in open srp while answering a question of child immunization the health worker might need to search for the mother of a child to link their records. That could be done via candidate expression. @fredhersch @f-odhiambo I think this ticket requires more effort than perhaps we expected. |
A couple other use cases:
CC @Gental-Giant @AnnieMungai @dubdabasoduba if you want to add other dynamic select use cases |
Just found this discussion and thought I'd include some of our use cases as well:
This extension is quite important for our project. For instance, as a workaround, we have tried to add all the locations (over 5000) as answerOptions to a choice widget but this is making the questionnaire too large and on some devices, the questionnaire fails to open at all and crashes the app. |
FYI - a pre-req to this and completion of answer-expression is #1479. i.e. x-fhir-query support. |
Waiting for answer expression work to be merged , as a pre-requirsite for this task to be implemented , has some reusable methods/funtions |
There is an overlap between https://build.fhir.org/ig/HL7/sdc/expressions.html#answerExpression & https://build.fhir.org/ig/HL7/sdc/expressions.html#candidateExpression there is a minor difference but both have x-fhir-query and choice-column use which is already done 1039. Thus the two tickets are related but not similar |
@f-odhiambo from my understanding, answerExpression is based on other answers in the questionnaire (as per the example), while candidate expressions can be based on information outside of the questionnaire itself. For instance, getting a list of patients to assign as a guardian of another patient. Does this sound correct? |
Update - This issue depends on #1480 being merged as it uses the choice column which is already done in 1480 |
@f-odhiambo any update on this issue? Is it being worked on currently? |
This issue depends on PR #1480 being merged as it uses the choice column which is already done in PR #1480. |
The candidate expression / details is a powerful extension that allows fetching data from database using x-fhir-query and using that to populate and control flow of information into various elements of questionnaire.
IMMUNIZATION REQUIREMENT
A quick solution by fixing bugs, and adding cqf-expression functionality has been implemented into PR #1958 #1959 and #1960. A complete questionnaire after merging all PRs can be run into catalog. This is done by using enableWhen-expression, cqf-expression, and answer-expression for each vaccine. The expressions are used to control skip logic and question title to make it a little dynamic in nature but not completely dynamic and robust as candidate-expression allows . @fredhersch @pld @dubdabasoduba @ekigamba @f-odhiambo @jingtang10 @owais-vd @omarismail94 |
thanks @maimoonak for an excellent write-up. the distinction you pointed out between answer and candidate expressions is spot-on. answer expression is to limit choices, where candidate expression is to suggest some answers. It is, however, still possible that a question has both answer and candidate expressions, in that case the candidate expression should probably suggest answers in the set defined by the answer expression. i see your point about population for child questions, but i don't see it as specific to candidate expression. you can populate child questions using expressions (perhaps define variables using variable expression?) without using candidate expression no? finally, i want to add that due to the nature of candidate expression, i don't think it makes sense to support it in every type of widget... it probably makes sense to support it in auto complete, or open choice questions, but i can't see us supporting candidate expression in other choice types. additionally, supporting it in widgets like date/datetime would pose some UI challenges (how do you suggest a date in the date input?). @maimoonak are there any mockups or examples of what you want candidate expressions to look like? @shelaghm i expect we'll need some support here. |
Discussed with @maimoonak: I've approved Owais's PR - we'll merge it after the small comments are adressed, it'll be adding candidate expression extension to the questionnaire item. We'll need possibly two follow-up PRs:
|
Is your feature request related to a problem? Please describe.
When populating a Questionnaire via the data capture library, I want to be able to provide answer options (this is different from setting the initial value) from resources that are related to the context (e.g. filling out a questionnaire based on a specific patient)
Describe the solution you'd like
SDC Library support for candidateExpression extension using FHIRPath - see specification
For example:
See sample questionnaire for additional examples
Additional context
This is related to issue #965
The text was updated successfully, but these errors were encountered: