Description
Is your feature request related to a problem? Please describe.
In the SDC lib, we validate answers in a questionnaire response by going through the value constraint extensions. Our code is pretty clean :): https://github.com/google/android-fhir/tree/master/datacapture/src/main/java/com/google/android/fhir/datacapture/validation.
However, as SDC IG evolves, there is an ongoing need for maintainance of validation code to keep up with any new extensions. Given that there is an existing FHIR validator in Java that already does validation (which includes questionnaire validation), we should look into using that validator.
Describe the solution you'd like
Our validator validates on a per-question level. And as far as I know, the FHIR validator only has an API on the per-resource level. Given that we actually do validation for each key stroke when the user fills the questionnaire, this might be an issue and in our evaluation we need to pay special attention to this aspect.
The other thing we need to do is to attribute any error message back to individual questions - and the FHIR validator will include the link id in the context. There is a small issue though - link id in questionnaire is not unique (surprisingly!) if there are nested questions under either a repeated group or a question with repeated answers (since the nested questions will be duplicated for each instance of the repeated groups or the repeated answers). We might need to raise a feature request for the validator to enrich the context field to be a linkid/index chain.
Describe alternatives you've considered
status quo (validation code in sdc lib) - works well but duplication of effort
other validation libs? - if so they probably should use the FHIR validator instead?
Additional context
https://confluence.hl7.org/display/FHIR/Using+the+FHIR+Validator
Would you like to work on the issue?
probably :)
Metadata
Metadata
Assignees
Type
Projects
Status