-
Notifications
You must be signed in to change notification settings - Fork 250
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
Use initial expressions to select the initial value from a dropdown list populated using answer expressions #1830
Comments
@KhumboLihonga I can replicate your issue using the questionnaire I defined below, which works with resources fetched from the public Will continue to debug
|
@KhumboLihonga I created PR #1831 to propose fixing. Please check out and lmk if you have any thoughts |
Hey @omarismail94, my colleague tested your PR and was unable to verify that the issue was fixed. This is the comment he left. Is there any update on this? |
Hey @KhumboLihonga and @sevenreup , please see the attached video of the fix working: Where is the app crashing for you, and what are the logs that you are getting? I also had to implement the DataCaptureConfig.Provider interface in the FhirApplication class to provide an xFhirQueryResolver: device-2023-02-16-111350.mp4 |
@omarismail94 the initial expression is working when I use the example questionnaire you gave here, it only shows the resource reference as a label. {
"resourceType": "Questionnaire",
"id": "test-questionnaire",
"language": "en",
"title": "Test Questionnaire",
"status": "active",
"publisher": "mcore",
"contact": [
{
"name": "http:https://www.d-tree.org"
}
],
"item": [
{
"extension": [
{
"url": "http:https://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
"valueCodeableConcept": {
"coding": [
{
"system": "http:https://hl7.org/fhir/questionnaire-item-control",
"code": "drop-down",
"display": "Drop down"
}
],
"text": "Drop down"
}
},
{
"url": "http:https://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
"valueExpression": {
"language": "text/fhirpath",
"expression": "Patient.id"
}
},
{
"url": "http:https://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-answerExpression",
"valueExpression": {
"expression": "Patient?address-city=NAIROBI",
"language": "application/x-fhir-query"
}
},
{
"url": "http:https://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-choiceColumn",
"extension": [
{
"url": "path",
"valueString": "name.given"
},
{
"url": "label",
"valueString": "text"
},
{
"url": "forDisplay",
"valueBoolean": true
}
]
}
],
"linkId": "district",
"text": "District",
"type": "reference",
"required": true
}
]
} |
@sevenreup hmm, is |
It is a valid path. Even when I use |
We want what we have defined as the |
If I understand correctly, you want what is defined in the I think that is a different issue than what this Issue was opened for. Would you agree? My understanding of this opened issue is to set the initial value using the initial expression extension |
@omarismail94 I feel there are two issues here:
I believe point 1 is still a part of this PR while point 2 would be a separate PR. What do you think? |
@omarismail94 Just following up on this issue. What do you think about my comment above? |
@omarismail94 following up on this once again. Let me know your thoughts on the comment above so we can decide how to best proceed. |
Is your feature request related to a problem? Please describe.
When I populate a dropdown using the answer expression extension as per this example, I cannot set the initial value using the initial expression extension. This is due to the item being of a reference type and the type I'm trying to populate is a string type.
Describe the solution you'd like
I should be able to use initial expressions to set the initial value
Describe alternatives you've considered
Instead of using answer expressions, I can populate the dropdown with answer options instead but this is challenging where there are a large number of options.
Additional context
Here is the questionnaire I tried and this is the logcat. If there is another way to do this, please point me in the right direction.
The text was updated successfully, but these errors were encountered: