Closed f-odhiambo closed 2 years ago
@f-odhiambo I thought the validation could be based on questionnaire specification and apply all types of form.
@f-odhiambo I thought the validation could be based on questionnaire specification and apply all types of form.
This is accurate. This ticket is to track that implemention once SDK implemention is ready
Cool, it's possible this'll be baked into the SDC and all we need to do to close this issue is verify that's functioning as expected
I think the latest SDK release should include this
SDK ticket related to this is https://github.com/google/android-fhir/issues/577
Sounds like we need to implement our own validation in FHIR Core in the mean time, doesn't look like anyone's working on that broader issue
Jing shared the link to QuestionnaireResponseValidator in SDK and mentioned that this might be the functionality we are looking for but also mentioned that there might be a bug in this class where link-id may not be working properly. Going through the class looks like we can use this for our purpose however, I need to test and explore it further.
Instead of showing a popup, can we disable the "Save" button until validation passes?
Actually the validation triggers on clicking save button. I did not find anything triggering validate in QuestionnaireFragment which keep a global status updated. Let me confirm it again but problem is we do have control over widgets in form.
OK I see, so in that case, would we need an SDK change allow us to tie handlers to the QuestionnaireFragment?
If that's so, let's open the issue on the SDK, and go with this approach for now.
I checked this validation looks like is under progress on SDK and one of the variable which tracks state of widgets is 'internal' i.e. not accessible to external projects. Have dropped a message to Jing as well and once he responds would create ticket on SDK
Cool, thanks for looking into this, current approach sounds good for what we can do now
Acceptance criteria
NB. This is a good candidate to also test validation of required fields based on the SDC library. This ticket will be used to track the FHIRCore implementation