Search code examples
hl7-fhir

FHIR: How to create a FHIR http request to find patients that have questionnaire data with a given response


Is there a way I can query a FHIR Patient server to find all patients that have a questionaire resource with a given answer.

For example, how do I query for patients that have a response for "/93042-0/71802-3" of LA30190-5 ("I do not have housing (staying with others, in a hotel, in a shelter, living outside on the street, on a beach, in a car, or in a park)")

http://build.fhir.org/ig/HL7/fhir-sdoh-clinicalcare/Questionnaire-SDOHCC-QuestionnairePRAPARE.html


Solution

  • In short, no. This is by design. If there's a desire to search based on information within a Questionnaire, it needs to be extracted into Observation or other appropriate resources for standardized query/filtering/analysis. QuestionnaireResponse is intended purely as a data capture tool, not a data retrieval tool.

    The practical implications of filtering a QuestionnaireResponse based on the answers within it is that we'd essentially have to define a search language to drill down into the QuestionnaireResponse with conditional 'where' clauses for all parent data elements to ensure that, for example, the "phone number area code" extracted is one that belongs to a particular care provider and not the patient or one of their relatives. This was deemed to be too complex as well as potentially unsafe.

    You'll note that the SDOH IG provides mechanisms for extracting QuestionnaireResponse information to Observations already. If there is more information from within the form you feel should be extracted, that feedback should be provided to the implementation guide.