QuestionnaireResponse search based on answer(s)
# support
t
Hello medplum team, We just started working with medplum and we would like to be able to query QuestionnaireResponse(s) based on the answers but we haven't accomplished that. we tried both on the demo admin app and in the code through medplumClient. Is this possible? Thanks in advance and congrats for all this great work! example: something like this that I query with questionnaire and patient values works https://api.medplum.com/fhir/R4/QuestionnaireResponse?_count=20&_sort=-_lastUpdated&_total=accurate&patient=Patient%2F07081ad3-6171-415f-bb2f-bcf6f513fffe&questionnaire=Questionnaire%2F01948ea4-583e-727d-a838-a0cbb71020cf I am not sure hot structure the query to include an answer value (item[0] -> answer -> etc)
Copy code
{
  "resourceType": "QuestionnaireResponse",
  "status": "completed",
  "item": [
    {
      "id": "id-1",
      "linkId": "q1",
      "text": "true or false",
      "answer": [
        {
          "valueBoolean": true
        }
      ]
    }
  ],
  "questionnaire": "Questionnaire/01948ea4-583e-727d-a838-a0cbb71020cf",
  "source": {
    "reference": "Practitioner/e86bc1c8-41c6-438b-b173-afbc30091517",
    "display": "Thanos Vidakis"
  },
  "authored": "2025-01-22T15:32:20.717Z",
  "id": "01948ea4-9f88-77b9-89f7-9ed768f72b11",
  "meta": {
    "versionId": "01948ea4-9f88-77b9-89f7-a3081bb71f5e",
    "lastUpdated": "2025-01-22T15:32:21.000Z",
    "author": {
      "reference": "Practitioner/e86bc1c8-41c6-438b-b173-afbc30091517",
      "display": "Thanos Vidakis"
    },
    "project": "e1de3dfa-f305-4ea7-84ee-ddaa109ff30a",
    "compartment": [
      {
        "reference": "Project/e1de3dfa-f305-4ea7-84ee-ddaa109ff30a"
      }
    ]
  }
}
185 Views