Examples

Search for responses to a specific questionnaire, completed by a specific patient

This example demonstrates how to find responses to a specific questionnaire, completed by a specific patient.
  1. Generate an access token by following the OAuth2 walkthrough
    1. The example below assumes you have been granted an access token of: aaaaa-bbbbb
  2. Confirm the Questionnaire reference
    1. The example below assumes a reference of: Questionnaire/f1a841f1-6f3a-43fc-830f-e1417b4ff13d
  3. Confirm the Patient reference
    1. The example below assumes a reference of: Patient/3d8afd18-0844-459a-b3c2-355d02e54c0a
  4. Make the call as detailed below, replacing the access token and search parameters with your own values
  5. The matching QuestionnaireResponse resources will be returned

Example Request

This example is written for sandbox.patientsknowbest.com; replace the URL as needed if you are connecting to a different environment.

ExampleDetails
Absolute URLhttps://sandbox.patientsknowbest.com/fhir/QuestionnaireResponse?questionnaire=Questionnaire/f1a841f1-6f3a-43fc-830f-e1417b4ff13d&patient=Patient/3d8afd18-0844-459a-b3c2-355d02e54c0a
curlcurl -X GET --header "Accept: application/fhir+json" --header "Authorization: Bearer aaaaa-bbbbb" "https://sandbox.patientsknowbest.com/fhir/QuestionnaireResponse?questionnaire=Questionnaire/f1a841f1-6f3a-43fc-830f-e1417b4ff13d&patient=Patient/3d8afd18-0844-459a-b3c2-355d02e54c0a"

Example Response

Note: whilst every effort has been made to ensure that the examples are correct and useful, they do not form part of the official specification.

{
  "resourceType": "Bundle",
  "id": "6d7847cc-408d-48db-9c3e-6bc847058d13",
  "meta": {
    "lastUpdated": "2019-08-27T10:48:35.114+00:00"
  },
  "type": "searchset",
  "total": 1,
  "link": [
    {
      "relation": "self",
      "url": "/QuestionnaireResponse?questionnaire=Questionnaire/f1a841f1-6f3a-43fc-830f-e1417b4ff13d&patient=Patient/3d8afd18-0844-459a-b3c2-355d02e54c0a"
    }
  ],
  "entry": [
    {
      "fullUrl": "https://sandbox.patientsknowbest.com/fhir/QuestionnaireResponse/9badcf07-1357-45c0-9520-52e3b13ddee5",
      "resource": {
        "resourceType": "QuestionnaireResponse",
        "id": "9badcf07-1357-45c0-9520-52e3b13ddee5",
        "meta": {
          "lastUpdated": "2019-06-10T11:12:13.123Z",
          "security": [
            {
              "system": "http://fhir.patientsknowbest.com/codesystem/privacy-label",
              "code": "GENERAL_HEALTH"
            }
          ]
        },
        "basedOn": [
          {
            "reference": "ProcedureRequest/8c32ca4b-a55a-4e4d-9622-a8acad851a93"
          }
        ],
        "questionnaire": {
          "reference": "Questionnaire/f1a841f1-6f3a-43fc-830f-e1417b4ff13d",
          "display": "IBD Control PROM"
        },
        "status": "completed",
        "subject": {
          "reference": "Patient/3d8afd18-0844-459a-b3c2-355d02e54c0a",
          "display": "Mr Test Patient"
        },
        "authored": "2019-06-10T11:12:13.123Z",
        "item": [
          {
            "linkId": "2",
            "text": "a. Your IBD has been well controlled in the past two weeks?",
            "answer": [
              {
                "valueString": "Yes"
              }
            ]
          },
          {
            "linkId": "3",
            "text": "b. Your current treatment is useful in controlling your IBD?",
            "answer": [
              {
                "valueString": "Yes"
              }
            ]
          },
          {
            "linkId": "4",
            "text": "(if you are not taking any treatment, please tick this box)",
            "answer": [
              {
                "valueString": "Not taking any treatment"
              }
            ]
          },
          {
            "linkId": "5",
            "text": "2. Over the past 2 weeks, have your bowel symptoms been getting worse, getting better or not changed?",
            "answer": [
              {
                "valueString": "Better"
              }
            ]
          },
          {
            "linkId": "7",
            "text": "a. Miss any planned activities because of IBD? (e.g. attending school/college, going to work or a social event)",
            "answer": [
              {
                "valueString": "Yes"
              }
            ]
          },
          {
            "linkId": "8",
            "text": "b. Wake up at night because of symptoms of IBD?",
            "answer": [
              {
                "valueString": "Yes"
              }
            ]
          },
          {
            "linkId": "9",
            "text": "c. Suffer from significant pain or discomfort?",
            "answer": [
              {
                "valueString": "Yes"
              }
            ]
          },
          {
            "linkId": "10",
            "text": "d. Often feel lacking in energy (fatigued) (by ‘often’ we mean more than half of the time)",
            "answer": [
              {
                "valueString": "Yes"
              }
            ]
          },
          {
            "linkId": "11",
            "text": "e. Feel anxious or depressed because of your IBD?",
            "answer": [
              {
                "valueString": "Yes"
              }
            ]
          },
          {
            "linkId": "12",
            "text": "f. Think you needed a change to your treatment?",
            "answer": [
              {
                "valueString": "Yes"
              }
            ]
          },
          {
            "linkId": "14",
            "text": "a. Alternative types of drug for controlling IBD",
            "answer": [
              {
                "valueString": "Yes"
              }
            ]
          },
          {
            "linkId": "15",
            "text": "b. Ways to adjust your own treatment",
            "answer": [
              {
                "valueString": "Yes"
              }
            ]
          },
          {
            "linkId": "16",
            "text": "c. Side effects or difficulties with using your medicines",
            "answer": [
              {
                "valueString": "Yes"
              }
            ]
          },
          {
            "linkId": "17",
            "text": "d. New symptoms that have developed since your last visit",
            "answer": [
              {
                "valueString": "Yes"
              }
            ]
          },
          {
            "linkId": "18",
            "text": "5 How would you rate the OVERALL control of your IBD in the past two weeks?",
            "answer": [
              {
                "valueString": "0- Worst possible control"
              }
            ]
          }
        ]
      },
      "search": {
        "mode": "match"
      }
    }
  ]
}
Comments