FHIR Chat · Validation of QuestionnaireResponse against a Questionnaire · hapi

Stream: hapi

Topic: Validation of QuestionnaireResponse against a Questionnaire


view this post on Zulip Morten Ernebjerg (Nov 25 2020 at 10:37):

We are using HAPI to build a validation module and already use it for validation against profiles. Now we want to extend it to check QuestionnaireReponses against the corresponding Questionnaires. Looking at this validation test case, I gather it can be done with a custom validation support. But I wanted to check whether there is a standard/pre-defined way to do this (haven't found one so far), since it would seem to be a relatively common use case. In other words, I am wondering if there is some pre-defined validation support that does this, along the lines of PrePopulatedValidationSupport but with an addQuestionnaire method.

view this post on Zulip Grahame Grieve (Nov 25 2020 at 12:48):

well, the validator does it, if you turn the option on, and if the questionnaire is in the context. I don't know what that means in the HAPI context

view this post on Zulip Morten Ernebjerg (Dec 04 2020 at 11:41):

Update for anyone stumbling over this: We got it working by defining a custom validation support. We modelled it on PrePopulatedValidationSupport, but additionally overrode the fetchResource method to make it return the questionnaires we have stored in the support (default implementation in IValidationSupport interface does not do that).


Last updated: Apr 12 2022 at 19:14 UTC