-
Notifications
You must be signed in to change notification settings - Fork 302
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
Dynamic answerExpression not working #2052
Comments
Hey @FikriMilano Could you give an example ? |
@MJ1998 thank you so much for the interest! |
Hi @MJ1998 |
Hi @FikriMilano |
@MJ1998 just to make sure, I would like to inquire whether you are currently working on this task. If not, I would be happy to pick this up, as it holds high priority for our team. |
Yes @FikriMilano, I am working on this. I hope a solution by tomorrow should be good ? If its urgent then please feel free to take this up. |
That's great news! thank you @MJ1998 :D Tomorrow is fine, please continue. It would be a shame if your 1 week of efforts is not getting merged. Looking forward for your code, thanks :D |
Alright I have a crude working solution. There are 2 errors:
Crude solution is to bypass 1 and replace variables in fhir-query expression with values evaluated. But from the other PR's comment you tagged me, it seems its better to modify the QuestionnaireViewItem API with |
@MJ1998 thanks for the update. Can you create a PR for the crude solution? I would like to review the code and test it on my end to determine if it can serve as a temporary solution. However, it is not necessary to merge it into the master branch. If we find it suitable, my team can pull the branch to our fork and proceed with our own release. For the better solution, we can create a separate branch for it, as I agree with @jingtang10's suggestion. Since FHIR provides multiple methods for adding answer options to an item, do you have an estimate for how long it will take to implement the better solution? |
@FikriMilano There you go! |
Thanks @MJ1998 :D |
Describe the bug
answerExpression doesn’t support accessing context from variable expression, it only can for launch context. This makes it not possible to have dynamic answer options.
So basically, the answer options within the dropdown widget is static once the app render the questionnaire.
Component
SDC library
To Reproduce
Steps to reproduce the behavior:
assets
folderhttps://github.com/google/android-fhir/blob/master/demo/src/main/java/com/google/android/fhir/demo/EditPatientViewModel.kt#L48
Expected behavior
answerExpression should be able to access other context including variable expression, therefore making the answer options dynamic, every time the variable updates.
Screenshots
device-2023-06-30-181824.webm
Smartphone (please complete the following information):
Additional context
https://drive.google.com/file/d/1aweK2JZ-3dzG9N7M2KoPwy_80sqZF9my/view?usp=sharing
Would you like to work on the issue?
N/A
The text was updated successfully, but these errors were encountered: