-
Notifications
You must be signed in to change notification settings - Fork 249
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
Handle required fields in questionnaires #470
Comments
Hello @jingtang10 , this is my first appearance in this community. If you don't mind, can I give this issue a try? I have been searching issue with "good first issue" tag on it and finally found one 😄 |
Sorry @FikriMilano we assigned this item to @kunjan8794. Please take another look at the open issues. thanks! |
That's alright @jingtang10 , I will find one eventually. Best of luck @kunjan8794 👍 |
@jingtang10 Do we need to display a warning when the user is filling the questionnaire, or essentially only after user clicks on the SUBMIT button? |
I think it makes sense to display a warning when the item loses focus (in the case of an edit text at least). In the case of radio button or other types, it's harder. I agree we might need to reply on validation upon page change or upon submission. But that can be left to do in a follow-up. |
I think we will need to look at how to support custom error messages and translations
|
Thanks @kunjan8794 For handling the error messages back to the UI, we agreed to define a set of CONSTANTS within the strings.xml for each field type that can then be translated by implementers @jingtang10 to propose update to FHIR Spec to handle this in the future |
@jingtang10 I might have to pass the Context to the Validators in order to access string resources. I was able to do that but was confused and unable to do that in the unit tests. Can you suggest something here? |
do you have a draft PR? i think in the test you normally have access to the test context too? if not can you mock it? |
Is your feature request related to a problem? Please describe.
Handle the required field in the questionnaires: https://www.hl7.org/fhir/questionnaire-definitions.html#Questionnaire.item.required
Describe the solution you'd like
Add a validator so that if a required field is not filled in display some kind of warning.
Describe alternatives you've considered
NA
Additional context
NA
Would you like to work on the issue?
NA
The text was updated successfully, but these errors were encountered: