Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • X-Org-Public-ID is no longer required as a header. This has been replaced by x-team-id

QuestionnaireResponse search parameters (coming March 2024)

The QuestionnaireResponse endpoint does not currently support search parameters. We expect to implement the following search parameters in March 2024:

  • subject

  • authored

  • basedOn

  • status

Searching for a QuestionnaireResponse based on subject

The subject field on a QuestionnaireResponse represents the patient that the questionnaire was sent to. To search for all QuestionnaireResponses belonging to a particular patient in your team, include the subject search parameter in your API call to the QuestionnaireResponse endpoint:

Code Block
GET https://aggregated-fhir.sandbox.patientsknowbest.com/fhir/QuestionnaireResponse?_subject=PATIENT_ID

Note: The subject field only represents the patient that the questionnaire was sent to, not the patient that completed the answers. The source field represents the individual that answered the questions. At the moment, source and subject will always be the same. In the future, we will support carers completing questionnaires on behalf of patients. When this happens, the source and subject may be different.

Searching for a QuestionnaireResponse based on date

The authored field on a QuestionnaireResponse represents the date and time that the answers were provided. To search for all QuestionnaireResponse resources for your team from a particular day, include the authored search parameter in your API call to the QuestionnaireResponse endpoint:

Code Block
GET https://aggregated-fhir.sandbox.patientsknowbest.com/fhir/QuestionnaireResponse?_authored=2024-03-15

Searching for a QuestionnaireResponse based on questionnaire

To search for QuestionnaireResponse resources that were generated from a particular questionnaire, you can use a chained search on the basedOn field of the QuestionnaireResponse. The basedOn field contains a reference to the ServiceRequest resource that was generated when the questionnaire request was sent to the patient. One of the identifiers on the ServiceRequest represents the questionnaire.

To search for QuestionnaireResponses related to a particular questionnaire, construct a chained search using the basedOn field:

Code Block
GET https://aggregated-fhir.sandbox.patientsknowbest.com/fhir/QuestionnaireResponse?_basedOn:ServiceRequest.identifier=QUESTIONNAIRE_ID

Note: In previous versions of FHIR, the questionnaire field on a QuestionnaireResponse contained a direct reference to the Questionnaire resource that was sent to the patient. However, this questionnaire field has been replaced in FHIR R4 with a canonical reference, meaning it cannot be used in searches. This is the reason that a chained search on the ServiceRequest is now required.

Searching for a QuestionnaireResponse based on status

To return only QuestionnaireResponses that are complete, include the status search parameter in your API call. This will filter out any QuestionnaireResponses with a status of ‘in-progress’, which have not yet been submitted by the patient.

Code Block
GET https://aggregated-fhir.sandbox.patientsknowbest.com/fhir/QuestionnaireResponse?_status=completed