QuestionnaireResponse

QuestionnaireResponses are an essential part of Atticus. On this page, we'll dive into the different QuestionnaireResponse endpoints you can use to manage responses programmatically. We'll look at how to query, create, update, and delete responses.


The QuestionnaireResponse model

The QuestionnaireResponse model contains all responded answers to a questionnaire.

Properties

The QuestionnaireResponse model conforms to the FHIR QuestionnaireResponse resource. The following properties are available:

  • Name
    resourceType*
    Type
    'QuestionnaireResponse'
    Description

    The FHIR resource type. This must be set to 'QuestionnaireResponse'.

  • Name
    questionnaire*
    Type
    Canonical
    Description

    A FHIR Canonical url to the corresponding questionnaire (the form definition). For questionnaires (='templates') designed in Atticus Designer, this url will start with http://templates.tiro.health/templates/. Optionally, a version can be specified by appending |<version> to the url. This allows you to specify a specific version of the questionnaire: http://templates.tiro.health/templates/unreadable-unique-id|1.0.1.

  • Name
    identifier
    Type
    Identifier[]
    Description

    An array of Identifier objects for this questionnaire response. More information about identifiers in Atticus can be found here.

  • Name
    status*
    Type
    enum
    Description

    The status of the response. Possible values are:

    • in-progress (most common)
    • completed
    • amended
    • entered-in-error
  • Name
    subject*
    Type
    Reference
    Description

    A FHIR Reference object to the patient that is the subject of the response.

  • Name
    encounter
    Type
    Reference
    Description

    A FHIR Reference to the encounter to which this response is related.


POST/QuestionnaireResponse

Create a new QuestionnaireResponse

This endpoint allows you to create a new QuestionnaireResponse.

Request

POST
/QuestionnaireResponse
curl -X POST https://reports.tiro.health/fhir/r5/QuestionnaireResponse \
  -H "Authorization: Basic {{apikey}}" \
  -H "Content-Type: application/fhir+json" \
  -d '{
    "resourceType": "QuestionnaireResponse",
    "questionnaire": "http://templates.tiro.health/templates/unreadable-unique-id|1",
    "status": "in-progress",
    "identifier": [
      {
        "system": "http://example.com/my-hospital-reports/",
        "value": "123"
      }
    ],
    "subject": {
      "reference": "Patient/123"
    },
    "encounter": {
      "reference": "Encounter/456"
    }
  }'

Response

{
  "resourceType": "QuestionnaireResponse",
  "id": "1",
  "questionnaire": "http://templates.tiro.health/templates/unreadable-unique-id|1.0.1",
  "status": "in-progress",
  "identifier": [
    {
      "system": "http://example.com/my-hospital-reports/",
      "value": "123"
    }
  ],
  "subject": {
    "reference": "Patient/123"
  },
  "encounter": {
    "reference": "Encounter/456"
  }
}

GET/QuestionnaireResponse/:id

Get an existing QuestionnaireResponse

This endpoint allows you to retrieve an existing QuestionnaireResponse by providing the QuestionnaireResponse id.

Request

GET
/QuestionnaireResponse/1
curl -G https://reports.tiro.health/fhir/r5/QuestionnaireResponse/1 \
  -H "Authorization: Basic {{apikey}}" \
  -H "Content-Type: application/fhir+json" \

Response

{
  "resourceType": "QuestionnaireResponse",
  "id": "1",
  "questionnaire": "http://templates.tiro.health/templates/unreadable-unique-id|1.0.1",
  "status": "in-progress",
  "identifier": [
    {
      "system": "http://example.com/my-hospital-reports/",
      "value": "123"
    }
  ],
  "subject": {
    "reference": "Patient/123"
  },
  "encounter": {
    "reference": "Encounter/456"
  }
}

DELETE/QuestionnaireResponse/:id

Delete an existing QuestionnaireResponse

This endpoint allows you to delete an existing QuestionnaireResponse by providing the QuestionnaireResponse id. Once a QuestionnaireResponse is deleted, it cannot be recovered.

A successful deletion returns 204 No Content with an empty body.

Request

DELETE
/QuestionnaireResponse/1
curl -X DELETE https://reports.tiro.health/fhir/r5/QuestionnaireResponse/1 \
  -H "Authorization: Basic {{apikey}}" \
  -H "Content-Type: application/fhir+json" \

Response

HTTP/1.1 204 No Content

Special considerations in Response

A QuestionnaireResponse resource has some special response body properties that you should be aware of.

Versioning info

The questionnaire property of the response body contains the canonical reference to the corresponding questionnaire (the form definition). The full version is always appended in the response.

When sending a request with a partial version:

{
  "resourceType": "QuestionnaireResponse",
  //...
  "questionnaire": "http://templates.tiro.health/templates/unreadable-unique-id|1"
  //...
}

you will receive aresponse with a full version

{
  "resourceType": "QuestionnaireResponse",
  //...
  "questionnaire": "http://templates.tiro.health/templates/unreadable-unique-id|1.0.1"
  //...
}

Was this page helpful?