US Core Implementation Guide
8.0.1 - STU 8 US

US Core Implementation Guide, published by HL7 International / Cross-Group Projects. This guide is not an authorized publication; it is the continuous build for version 8.0.1 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/US-Core/ and changes regularly. See the Directory of published versions

## Resource Profile: US Core QuestionnaireResponse Profile

Official URL: http://hl7.org/fhir/us/core/StructureDefinition/us-core-questionnaireresponse | Version: 8.0.1
Standards status: Trial-use | Maturity Level: 3 | Computable Name: USCoreQuestionnaireResponseProfile
Other Identifiers: OID:2.16.840.1.113883.4.642.40.2.42.54
Copyright/Legal: Used by permission of HL7 International, all rights reserved Creative Commons License

The US Core QuestionaireResponse Profile inherits from the Structured Data Capture (SDC) Questionnaire Response Profile. This profile sets minimum expectations for the QuestionnaireResponse resource to record, search, and fetch retrieve captures the responses to form/survey and assessment tools such as the Protocol for Responding to and Assessing Patients\u2019 Assets, Risks, and Experiences (PRAPARE) Survey. It specifies which core additional elements, extensions, vocabularies, and value sets SHALL be present and constrains how the elements are used. Before reviewing this profile, implementers are encouraged to read the Screening and Assessments guidance page, which documents the process of recording responses and capturing assertions/determinations resulting from surveys and questionnaires.

Example Usage Scenarios:

The following are example usage scenarios for this profile:

- Query for survey screening results for a patient.
- Record or update screening results results belonging to a Patient

### Mandatory and Must Support Data Elements

In addition to the Mandatory and Must Support data elements in the SDC QuestionnaireResponse Profile, the following data elements must always be present (Mandatory definition) or must be supported if the data is present in the sending system (Must Support definition). They are presented below in a simple human-readable explanation. Profile specific guidance and examples are provided as well. The Formal Views below provides the formal summary, definitions, and terminology requirements. Note that the Key Elements Table view aggregates all the Must Support elements between this profile and its parent profiles.

Each QuestionnaireResponse Must Have:

1. a reference back to the assessment upon which it is based
2. a status
3. a patient
4. the date the answers were gathered

Each QuestionnaireResponse Must Support:

1. a practitioner who recorded the answers*
2. the questions and decimal, string, and coded answers
   - each question must have an identifier pointing to the question

*see guidance below

Profile Specific Implementation Guidance:

- The SDC profile (from which this profile is derived) focuses on the constraints appropriate to capturing the "answer(s)" to a FHIR Questionnaire and demands that the Questionnaire's canonical URL be specified. If the QuestionnaireResponse is based on a non-FHIR form:
  1. Construct a FHIR Questionnaire representing at least the relevant metadata (in other words, the questions may be omitted).
  2. Communicates the identifier of the non-FHIR form instead of the canonical URI using the US Core Extension Questionnaire URI extension.
- See the Screening and Assessments guidance page for how this profile or Observations can represent SDOH assessments.
- QuestionnaireResponse can be searched using the standard FHIR RESTful API search parameters. Example searches are shown in the Quick Start section below. Although search chains through the associated Questionnaire can be used to query QuestionnaireResponse by item, individual responses are not directly searchable in QuestionnaireResponse. To search directly for individual responses, they must be "parsed" into a searchable form - i.e., to a local FHIR or non-FHIR data store such as a database or FHIR Observations.
- The basic workflow for creating, discovering, retrieving, and data-extracting FHIR Questionnaire and QuestionnaireResponse is thoroughly documented in the Structured Data Capture (SDC) implementation guide.

- *The profile elements `QuestionnaireResponse.author and QuestionnaireResponse.source` communicate the individual level provenance author data corresponding to the U.S. Core Data for Interoperability (USCDI) Provenance Author Data Elements.

Usages:

- Refer to this Profile: US Core Observation Screening Assessment Profile and US Core Simple Observation Profile
- Examples for this Profile: QuestionnaireResponse/AUDIT-C, QuestionnaireResponse/TAPS, QuestionnaireResponse/exercise-vital-sign, QuestionnaireResponse/glascow-coma-score... Show 3 more, QuestionnaireResponse/hunger-vital-sign-example, QuestionnaireResponse/phq-9-example and QuestionnaireResponse/prapare-example
- CapabilityStatements using this Profile: US Core Client CapabilityStatement and US Core Server CapabilityStatement

You can also check for usages in the FHIR IG Statistics

Changes since version 7.0.0:

- No changes

### Formal Views of Profile Content

Description of Profiles, Differentials, Snapshots and how the different presentations work.

- Key Elements Table
- Differential Table
- Snapshot Table
- Statistics/References
- All

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
QuestionnaireResponse | C | 0..* | SDCQuestionnaireResponse | US Core Profile based on SDC QuestionnaireResponse Constraints: sdcqr-1, sdcqr-2
implicitRules | ?!Σ | 0..1 | uri | A set of rules under which this content was created
Slices for extension |  |  |  | Content/Rules for all slices
extension:signature |  | 0..* | Signature | A signature attesting to the content URL: http://hl7.org/fhir/StructureDefinition/questionnaireresponse-signature
extension:completionMode |  | 0..1 | CodeableConcept | E.g. Verbal, written, electronic URL: http://hl7.org/fhir/StructureDefinition/questionnaireresponse-completionMode Binding: QuestionnaireResponseMode (required): Codes indicating how the questionnaire was completed.
modifierExtension | ?! | 0..* | Extension | Extensions that cannot be ignored
identifier | S Σ | 0..1 | Identifier | Unique id for this set of answers
questionnaire | S Σ | 1..1 | canonical(SDCBaseQuestionnaire) | Form being answered
Slices for extension |  |  |  | Content/Rules for all slices
extension:questionnaireDisplay | S | 0..1 | string | Display name for canonical reference URL: http://hl7.org/fhir/StructureDefinition/display
extension:url | S | 0..1 | uri | The location where a non-FHIR questionnaire/survey form can be found. URL: http://hl7.org/fhir/us/core/StructureDefinition/us-core-extension-questionnaire-uri
status | ?!S Σ | 1..1 | code | in-progress | completed | amended | entered-in-error | stopped Binding: QuestionnaireResponseStatus (required): Lifecycle status of the questionnaire response.
subject | S Σ | 1..1 | Reference(US Core Patient Profile S | Resource) | The subject of the questions
authored | S Σ | 1..1 | dateTime | Date the answers were gathered
author | S Σ | 0..1 | Reference(US Core Practitioner Profile S | US Core Organization Profile | US Core Patient Profile | PractitionerRole | Device | US Core RelatedPerson Profile) | Person who received and recorded the answers
item | S C | 0..* | BackboneElement | Groups and questions Constraints: qrs-1
Slices for extension |  |  |  | Content/Rules for all slices
extension:itemMedia |  | 0..1 | Attachment | Media to display URL: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemMedia
extension:ItemSignature |  | 0..* | Signature | A signature attesting to the content URL: http://hl7.org/fhir/StructureDefinition/questionnaireresponse-signature
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized
linkId | S | 1..1 | string | Pointer to specific item from Questionnaire
text | S | 0..1 | string | Name for group or question text
answer | S | 0..* | BackboneElement | The response(s) to the question
Slices for extension |  |  |  | Content/Rules for all slices
extension:itemAnswerMedia |  | 0..1 | Attachment | Answer Media to display URL: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemAnswerMedia
extension:ordinalValue |  | 0..1 | decimal | Assigned Ordinal Value URL: http://hl7.org/fhir/StructureDefinition/ordinalValue
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized
value[x] | S | 0..1 |  | Single-valued answer to the question Binding: QuestionnaireAnswerCodes (example): Code indicating the response provided for a question.
valueBoolean |  |  | boolean |
valueDate |  |  | date |
valueDateTime |  |  | dateTime |
valueTime |  |  | time |
valueDecimal |  |  | decimal S |
valueInteger |  |  | integer |
valueString |  |  | string S |
valueCoding |  |  | Coding S |
valueUri |  |  | uri |
valueQuantity |  |  | Quantity |
valueAttachment |  |  | Attachment |
valueReference |  |  | Reference(Any) |
item | S | 0..* | See item (QuestionnaireResponse) | Nested groups and questions
item | S | 0..* | See item (QuestionnaireResponse) | Nested questionnaire response items
Documentation for this format

#### Terminology Bindings

Path | Status | Usage | ValueSet | Version | Source
QuestionnaireResponse.​status | Base | required | QuestionnaireResponseStatus | 📍4.0.1 | FHIR Std.
QuestionnaireResponse.​item.answer.value[x] | Base | example | Questionnaire Answer Codes | 📍4.0.1 | FHIR Std.

#### Constraints

Id | Grade | Path(s) | Description | Expression
dom-2 | error | QuestionnaireResponse | If the resource is contained in another resource, it SHALL NOT contain nested Resources | `contained.contained.empty()`
dom-3 | error | QuestionnaireResponse | If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource | `contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()`
dom-4 | error | QuestionnaireResponse | If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated | `contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()`
dom-5 | error | QuestionnaireResponse | If a resource is contained in another resource, it SHALL NOT have a security label | `contained.meta.security.empty()`
dom-6 | best practice | QuestionnaireResponse | A resource should have narrative for robust management | `text.`div`.exists()`
ele-1 | error | **ALL** elements | All FHIR elements must have a @value or children | `hasValue() or (children().count() > id.count())`
ext-1 | error | **ALL** extensions | Must have either extensions or value[x], not both | `extension.exists() != value.exists()`
qrs-1 | error | QuestionnaireResponse.item | Nested item can't be beneath both item and answer | `(answer.exists() and item.exists()).not()`
sdcqr-1 | best practice | QuestionnaireResponse | Subject SHOULD be present (searching is difficult without subject). Almost all QuestionnaireResponses should be with respect to some sort of subject. | `subject.exists()`
sdcqr-2 | best practice | QuestionnaireResponse | When repeats=true for a group, it'll be represented with multiple items with the same linkId in the QuestionnaireResponse. For a question, it'll be represented by a single item with that linkId with multiple answers. | `(QuestionnaireResponse|repeat(answer|item)).select(item.where(answer.value.exists()).linkId.isDistinct()).allTrue()`

This structure is derived from SDCQuestionnaireResponse

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
QuestionnaireResponse |  | 0..* | SDCQuestionnaireResponse | US Core Profile based on SDC QuestionnaireResponse
questionnaire | S | 1..1 | canonical(SDCBaseQuestionnaire) | Form being answered
Slices for extension |  |  |  | Content/Rules for all slices
extension:url | S | 0..1 | uri | The location where a non-FHIR questionnaire/survey form can be found. URL: http://hl7.org/fhir/us/core/StructureDefinition/us-core-extension-questionnaire-uri
status | S | 1..1 | code | in-progress | completed | amended | entered-in-error | stopped
subject | S | 1..1 | Reference(US Core Patient Profile S | Resource) | The subject of the questions
authored | S | 1..1 | dateTime | Date the answers were gathered
author | S | 0..1 | Reference(US Core Practitioner Profile S | US Core Organization Profile | US Core Patient Profile | PractitionerRole | Device | US Core RelatedPerson Profile) | Person who received and recorded the answers
item | S | 0..* | BackboneElement | Groups and questions
linkId | S | 1..1 | string | Pointer to specific item from Questionnaire
answer |  |  |  |
value[x] | S | 0..1 |  | Single-valued answer to the question
valueBoolean |  |  | boolean |
valueDate |  |  | date |
valueDateTime |  |  | dateTime |
valueTime |  |  | time |
valueDecimal |  |  | decimal S |
valueInteger |  |  | integer |
valueString |  |  | string S |
valueCoding |  |  | Coding S |
valueUri |  |  | uri |
valueQuantity |  |  | Quantity |
valueAttachment |  |  | Attachment |
valueReference |  |  | Reference(Any) |
Documentation for this format

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
QuestionnaireResponse | C | 0..* | SDCQuestionnaireResponse | US Core Profile based on SDC QuestionnaireResponse Constraints: sdcqr-1, sdcqr-2
id | Σ | 0..1 | id | Logical id of this artifact
meta | Σ | 0..1 | Meta | Metadata about the resource
implicitRules | ?!Σ | 0..1 | uri | A set of rules under which this content was created
language |  | 0..1 | code | Language of the resource content Binding: CommonLanguages (preferred): A human language.
Additional Bindings | Purpose
AllLanguages | Max Binding
text |  | 0..1 | Narrative | Text summary of the resource, for human interpretation This profile does not constrain the narrative in regard to content, language, or traceability to data elements
contained |  | 0..* | Resource | Contained, inline Resources
Slices for extension |  | 0..* | Extension | Extension Slice: Unordered, Open by value:url
extension:signature |  | 0..* | Signature | A signature attesting to the content URL: http://hl7.org/fhir/StructureDefinition/questionnaireresponse-signature
extension:completionMode |  | 0..1 | CodeableConcept | E.g. Verbal, written, electronic URL: http://hl7.org/fhir/StructureDefinition/questionnaireresponse-completionMode Binding: QuestionnaireResponseMode (required): Codes indicating how the questionnaire was completed.
modifierExtension | ?! | 0..* | Extension | Extensions that cannot be ignored
identifier | S Σ | 0..1 | Identifier | Unique id for this set of answers
basedOn | Σ | 0..* | Reference(CarePlan | ServiceRequest) | Request fulfilled by this QuestionnaireResponse
partOf | Σ | 0..* | Reference(Observation | Procedure) | Part of this action
questionnaire | S Σ | 1..1 | canonical(SDCBaseQuestionnaire) | Form being answered
id |  | 0..1 | string | xml:id (or equivalent in JSON)
Slices for extension |  | 0..* | Extension | Extension Slice: Unordered, Open by value:url
extension:questionnaireDisplay | S | 0..1 | string | Display name for canonical reference URL: http://hl7.org/fhir/StructureDefinition/display
extension:url | S | 0..1 | uri | The location where a non-FHIR questionnaire/survey form can be found. URL: http://hl7.org/fhir/us/core/StructureDefinition/us-core-extension-questionnaire-uri
value |  | 0..1 | string | Primitive value for canonical
status | ?!S Σ | 1..1 | code | in-progress | completed | amended | entered-in-error | stopped Binding: QuestionnaireResponseStatus (required): Lifecycle status of the questionnaire response.
subject | S Σ | 1..1 | Reference(US Core Patient Profile S | Resource) | The subject of the questions
encounter | Σ | 0..1 | Reference(Encounter) | Encounter created as part of
authored | S Σ | 1..1 | dateTime | Date the answers were gathered
author | S Σ | 0..1 | Reference(US Core Practitioner Profile S | US Core Organization Profile | US Core Patient Profile | PractitionerRole | Device | US Core RelatedPerson Profile) | Person who received and recorded the answers
source | Σ | 0..1 | Reference(Patient | Practitioner | PractitionerRole | RelatedPerson) | The person who answered the questions
item | S C | 0..* | BackboneElement | Groups and questions Constraints: qrs-1
id |  | 0..1 | string | Unique id for inter-element referencing
Slices for extension |  | 0..* | Extension | Extension Slice: Unordered, Open by value:url
extension:itemMedia |  | 0..1 | Attachment | Media to display URL: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemMedia
extension:ItemSignature |  | 0..* | Signature | A signature attesting to the content URL: http://hl7.org/fhir/StructureDefinition/questionnaireresponse-signature
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized
linkId | S | 1..1 | string | Pointer to specific item from Questionnaire
definition |  | 0..1 | uri | ElementDefinition - details for the item
text | S | 0..1 | string | Name for group or question text
answer | S | 0..* | BackboneElement | The response(s) to the question
id |  | 0..1 | string | Unique id for inter-element referencing
Slices for extension |  | 0..* | Extension | Extension Slice: Unordered, Open by value:url
extension:itemAnswerMedia |  | 0..1 | Attachment | Answer Media to display URL: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemAnswerMedia
extension:ordinalValue |  | 0..1 | decimal | Assigned Ordinal Value URL: http://hl7.org/fhir/StructureDefinition/ordinalValue
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized
value[x] | S | 0..1 |  | Single-valued answer to the question Binding: QuestionnaireAnswerCodes (example): Code indicating the response provided for a question.
valueBoolean |  |  | boolean |
valueDate |  |  | date |
valueDateTime |  |  | dateTime |
valueTime |  |  | time |
valueDecimal |  |  | decimal S |
valueInteger |  |  | integer |
valueString |  |  | string S |
valueCoding |  |  | Coding S |
valueUri |  |  | uri |
valueQuantity |  |  | Quantity |
valueAttachment |  |  | Attachment |
valueReference |  |  | Reference(Any) |
item | S | 0..* | See item (QuestionnaireResponse) | Nested groups and questions
item | S | 0..* | See item (QuestionnaireResponse) | Nested questionnaire response items
Documentation for this format

#### Terminology Bindings

Path | Status | Usage | ValueSet | Version | Source
QuestionnaireResponse.​language | Base | preferred | Common Languages | 📍4.0.1 | FHIR Std.
QuestionnaireResponse.​status | Base | required | QuestionnaireResponseStatus | 📍4.0.1 | FHIR Std.
QuestionnaireResponse.​item.answer.value[x] | Base | example | Questionnaire Answer Codes | 📍4.0.1 | FHIR Std.

#### Constraints

Id | Grade | Path(s) | Description | Expression
dom-2 | error | QuestionnaireResponse | If the resource is contained in another resource, it SHALL NOT contain nested Resources | `contained.contained.empty()`
dom-3 | error | QuestionnaireResponse | If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource | `contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()`
dom-4 | error | QuestionnaireResponse | If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated | `contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()`
dom-5 | error | QuestionnaireResponse | If a resource is contained in another resource, it SHALL NOT have a security label | `contained.meta.security.empty()`
dom-6 | best practice | QuestionnaireResponse | A resource should have narrative for robust management | `text.`div`.exists()`
ele-1 | error | **ALL** elements | All FHIR elements must have a @value or children | `hasValue() or (children().count() > id.count())`
ext-1 | error | **ALL** extensions | Must have either extensions or value[x], not both | `extension.exists() != value.exists()`
qrs-1 | error | QuestionnaireResponse.item | Nested item can't be beneath both item and answer | `(answer.exists() and item.exists()).not()`
sdcqr-1 | best practice | QuestionnaireResponse | Subject SHOULD be present (searching is difficult without subject). Almost all QuestionnaireResponses should be with respect to some sort of subject. | `subject.exists()`
sdcqr-2 | best practice | QuestionnaireResponse | When repeats=true for a group, it'll be represented with multiple items with the same linkId in the QuestionnaireResponse. For a question, it'll be represented by a single item with that linkId with multiple answers. | `(QuestionnaireResponse|repeat(answer|item)).select(item.where(answer.value.exists()).linkId.isDistinct()).allTrue()`

This structure is derived from SDCQuestionnaireResponse

Summary

Mandatory: 1 element
Must-Support: 9 elements

Structures

This structure refers to these other structures:

- US Core Patient Profile (http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient)
- US Core Practitioner Profile (http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner)
- US Core Organization Profile (http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization)
- US Core RelatedPerson Profile (http://hl7.org/fhir/us/core/StructureDefinition/us-core-relatedperson)

Extensions

This structure refers to these extensions:

- http://hl7.org/fhir/us/core/StructureDefinition/us-core-extension-questionnaire-uri

Maturity: 3

Key Elements View

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
QuestionnaireResponse | C | 0..* | SDCQuestionnaireResponse | US Core Profile based on SDC QuestionnaireResponse Constraints: sdcqr-1, sdcqr-2
implicitRules | ?!Σ | 0..1 | uri | A set of rules under which this content was created
Slices for extension |  |  |  | Content/Rules for all slices
extension:signature |  | 0..* | Signature | A signature attesting to the content URL: http://hl7.org/fhir/StructureDefinition/questionnaireresponse-signature
extension:completionMode |  | 0..1 | CodeableConcept | E.g. Verbal, written, electronic URL: http://hl7.org/fhir/StructureDefinition/questionnaireresponse-completionMode Binding: QuestionnaireResponseMode (required): Codes indicating how the questionnaire was completed.
modifierExtension | ?! | 0..* | Extension | Extensions that cannot be ignored
identifier | S Σ | 0..1 | Identifier | Unique id for this set of answers
questionnaire | S Σ | 1..1 | canonical(SDCBaseQuestionnaire) | Form being answered
Slices for extension |  |  |  | Content/Rules for all slices
extension:questionnaireDisplay | S | 0..1 | string | Display name for canonical reference URL: http://hl7.org/fhir/StructureDefinition/display
extension:url | S | 0..1 | uri | The location where a non-FHIR questionnaire/survey form can be found. URL: http://hl7.org/fhir/us/core/StructureDefinition/us-core-extension-questionnaire-uri
status | ?!S Σ | 1..1 | code | in-progress | completed | amended | entered-in-error | stopped Binding: QuestionnaireResponseStatus (required): Lifecycle status of the questionnaire response.
subject | S Σ | 1..1 | Reference(US Core Patient Profile S | Resource) | The subject of the questions
authored | S Σ | 1..1 | dateTime | Date the answers were gathered
author | S Σ | 0..1 | Reference(US Core Practitioner Profile S | US Core Organization Profile | US Core Patient Profile | PractitionerRole | Device | US Core RelatedPerson Profile) | Person who received and recorded the answers
item | S C | 0..* | BackboneElement | Groups and questions Constraints: qrs-1
Slices for extension |  |  |  | Content/Rules for all slices
extension:itemMedia |  | 0..1 | Attachment | Media to display URL: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemMedia
extension:ItemSignature |  | 0..* | Signature | A signature attesting to the content URL: http://hl7.org/fhir/StructureDefinition/questionnaireresponse-signature
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized
linkId | S | 1..1 | string | Pointer to specific item from Questionnaire
text | S | 0..1 | string | Name for group or question text
answer | S | 0..* | BackboneElement | The response(s) to the question
Slices for extension |  |  |  | Content/Rules for all slices
extension:itemAnswerMedia |  | 0..1 | Attachment | Answer Media to display URL: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemAnswerMedia
extension:ordinalValue |  | 0..1 | decimal | Assigned Ordinal Value URL: http://hl7.org/fhir/StructureDefinition/ordinalValue
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized
value[x] | S | 0..1 |  | Single-valued answer to the question Binding: QuestionnaireAnswerCodes (example): Code indicating the response provided for a question.
valueBoolean |  |  | boolean |
valueDate |  |  | date |
valueDateTime |  |  | dateTime |
valueTime |  |  | time |
valueDecimal |  |  | decimal S |
valueInteger |  |  | integer |
valueString |  |  | string S |
valueCoding |  |  | Coding S |
valueUri |  |  | uri |
valueQuantity |  |  | Quantity |
valueAttachment |  |  | Attachment |
valueReference |  |  | Reference(Any) |
item | S | 0..* | See item (QuestionnaireResponse) | Nested groups and questions
item | S | 0..* | See item (QuestionnaireResponse) | Nested questionnaire response items
Documentation for this format

#### Terminology Bindings

Path | Status | Usage | ValueSet | Version | Source
QuestionnaireResponse.​status | Base | required | QuestionnaireResponseStatus | 📍4.0.1 | FHIR Std.
QuestionnaireResponse.​item.answer.value[x] | Base | example | Questionnaire Answer Codes | 📍4.0.1 | FHIR Std.

#### Constraints

Id | Grade | Path(s) | Description | Expression
dom-2 | error | QuestionnaireResponse | If the resource is contained in another resource, it SHALL NOT contain nested Resources | `contained.contained.empty()`
dom-3 | error | QuestionnaireResponse | If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource | `contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()`
dom-4 | error | QuestionnaireResponse | If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated | `contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()`
dom-5 | error | QuestionnaireResponse | If a resource is contained in another resource, it SHALL NOT have a security label | `contained.meta.security.empty()`
dom-6 | best practice | QuestionnaireResponse | A resource should have narrative for robust management | `text.`div`.exists()`
ele-1 | error | **ALL** elements | All FHIR elements must have a @value or children | `hasValue() or (children().count() > id.count())`
ext-1 | error | **ALL** extensions | Must have either extensions or value[x], not both | `extension.exists() != value.exists()`
qrs-1 | error | QuestionnaireResponse.item | Nested item can't be beneath both item and answer | `(answer.exists() and item.exists()).not()`
sdcqr-1 | best practice | QuestionnaireResponse | Subject SHOULD be present (searching is difficult without subject). Almost all QuestionnaireResponses should be with respect to some sort of subject. | `subject.exists()`
sdcqr-2 | best practice | QuestionnaireResponse | When repeats=true for a group, it'll be represented with multiple items with the same linkId in the QuestionnaireResponse. For a question, it'll be represented by a single item with that linkId with multiple answers. | `(QuestionnaireResponse|repeat(answer|item)).select(item.where(answer.value.exists()).linkId.isDistinct()).allTrue()`

Differential View

This structure is derived from SDCQuestionnaireResponse

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
QuestionnaireResponse |  | 0..* | SDCQuestionnaireResponse | US Core Profile based on SDC QuestionnaireResponse
questionnaire | S | 1..1 | canonical(SDCBaseQuestionnaire) | Form being answered
Slices for extension |  |  |  | Content/Rules for all slices
extension:url | S | 0..1 | uri | The location where a non-FHIR questionnaire/survey form can be found. URL: http://hl7.org/fhir/us/core/StructureDefinition/us-core-extension-questionnaire-uri
status | S | 1..1 | code | in-progress | completed | amended | entered-in-error | stopped
subject | S | 1..1 | Reference(US Core Patient Profile S | Resource) | The subject of the questions
authored | S | 1..1 | dateTime | Date the answers were gathered
author | S | 0..1 | Reference(US Core Practitioner Profile S | US Core Organization Profile | US Core Patient Profile | PractitionerRole | Device | US Core RelatedPerson Profile) | Person who received and recorded the answers
item | S | 0..* | BackboneElement | Groups and questions
linkId | S | 1..1 | string | Pointer to specific item from Questionnaire
answer |  |  |  |
value[x] | S | 0..1 |  | Single-valued answer to the question
valueBoolean |  |  | boolean |
valueDate |  |  | date |
valueDateTime |  |  | dateTime |
valueTime |  |  | time |
valueDecimal |  |  | decimal S |
valueInteger |  |  | integer |
valueString |  |  | string S |
valueCoding |  |  | Coding S |
valueUri |  |  | uri |
valueQuantity |  |  | Quantity |
valueAttachment |  |  | Attachment |
valueReference |  |  | Reference(Any) |
Documentation for this format

Snapshot View

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
QuestionnaireResponse | C | 0..* | SDCQuestionnaireResponse | US Core Profile based on SDC QuestionnaireResponse Constraints: sdcqr-1, sdcqr-2
id | Σ | 0..1 | id | Logical id of this artifact
meta | Σ | 0..1 | Meta | Metadata about the resource
implicitRules | ?!Σ | 0..1 | uri | A set of rules under which this content was created
language |  | 0..1 | code | Language of the resource content Binding: CommonLanguages (preferred): A human language.
Additional Bindings | Purpose
AllLanguages | Max Binding
text |  | 0..1 | Narrative | Text summary of the resource, for human interpretation This profile does not constrain the narrative in regard to content, language, or traceability to data elements
contained |  | 0..* | Resource | Contained, inline Resources
Slices for extension |  | 0..* | Extension | Extension Slice: Unordered, Open by value:url
extension:signature |  | 0..* | Signature | A signature attesting to the content URL: http://hl7.org/fhir/StructureDefinition/questionnaireresponse-signature
extension:completionMode |  | 0..1 | CodeableConcept | E.g. Verbal, written, electronic URL: http://hl7.org/fhir/StructureDefinition/questionnaireresponse-completionMode Binding: QuestionnaireResponseMode (required): Codes indicating how the questionnaire was completed.
modifierExtension | ?! | 0..* | Extension | Extensions that cannot be ignored
identifier | S Σ | 0..1 | Identifier | Unique id for this set of answers
basedOn | Σ | 0..* | Reference(CarePlan | ServiceRequest) | Request fulfilled by this QuestionnaireResponse
partOf | Σ | 0..* | Reference(Observation | Procedure) | Part of this action
questionnaire | S Σ | 1..1 | canonical(SDCBaseQuestionnaire) | Form being answered
id |  | 0..1 | string | xml:id (or equivalent in JSON)
Slices for extension |  | 0..* | Extension | Extension Slice: Unordered, Open by value:url
extension:questionnaireDisplay | S | 0..1 | string | Display name for canonical reference URL: http://hl7.org/fhir/StructureDefinition/display
extension:url | S | 0..1 | uri | The location where a non-FHIR questionnaire/survey form can be found. URL: http://hl7.org/fhir/us/core/StructureDefinition/us-core-extension-questionnaire-uri
value |  | 0..1 | string | Primitive value for canonical
status | ?!S Σ | 1..1 | code | in-progress | completed | amended | entered-in-error | stopped Binding: QuestionnaireResponseStatus (required): Lifecycle status of the questionnaire response.
subject | S Σ | 1..1 | Reference(US Core Patient Profile S | Resource) | The subject of the questions
encounter | Σ | 0..1 | Reference(Encounter) | Encounter created as part of
authored | S Σ | 1..1 | dateTime | Date the answers were gathered
author | S Σ | 0..1 | Reference(US Core Practitioner Profile S | US Core Organization Profile | US Core Patient Profile | PractitionerRole | Device | US Core RelatedPerson Profile) | Person who received and recorded the answers
source | Σ | 0..1 | Reference(Patient | Practitioner | PractitionerRole | RelatedPerson) | The person who answered the questions
item | S C | 0..* | BackboneElement | Groups and questions Constraints: qrs-1
id |  | 0..1 | string | Unique id for inter-element referencing
Slices for extension |  | 0..* | Extension | Extension Slice: Unordered, Open by value:url
extension:itemMedia |  | 0..1 | Attachment | Media to display URL: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemMedia
extension:ItemSignature |  | 0..* | Signature | A signature attesting to the content URL: http://hl7.org/fhir/StructureDefinition/questionnaireresponse-signature
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized
linkId | S | 1..1 | string | Pointer to specific item from Questionnaire
definition |  | 0..1 | uri | ElementDefinition - details for the item
text | S | 0..1 | string | Name for group or question text
answer | S | 0..* | BackboneElement | The response(s) to the question
id |  | 0..1 | string | Unique id for inter-element referencing
Slices for extension |  | 0..* | Extension | Extension Slice: Unordered, Open by value:url
extension:itemAnswerMedia |  | 0..1 | Attachment | Answer Media to display URL: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemAnswerMedia
extension:ordinalValue |  | 0..1 | decimal | Assigned Ordinal Value URL: http://hl7.org/fhir/StructureDefinition/ordinalValue
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized
value[x] | S | 0..1 |  | Single-valued answer to the question Binding: QuestionnaireAnswerCodes (example): Code indicating the response provided for a question.
valueBoolean |  |  | boolean |
valueDate |  |  | date |
valueDateTime |  |  | dateTime |
valueTime |  |  | time |
valueDecimal |  |  | decimal S |
valueInteger |  |  | integer |
valueString |  |  | string S |
valueCoding |  |  | Coding S |
valueUri |  |  | uri |
valueQuantity |  |  | Quantity |
valueAttachment |  |  | Attachment |
valueReference |  |  | Reference(Any) |
item | S | 0..* | See item (QuestionnaireResponse) | Nested groups and questions
item | S | 0..* | See item (QuestionnaireResponse) | Nested questionnaire response items
Documentation for this format

#### Terminology Bindings

Path | Status | Usage | ValueSet | Version | Source
QuestionnaireResponse.​language | Base | preferred | Common Languages | 📍4.0.1 | FHIR Std.
QuestionnaireResponse.​status | Base | required | QuestionnaireResponseStatus | 📍4.0.1 | FHIR Std.
QuestionnaireResponse.​item.answer.value[x] | Base | example | Questionnaire Answer Codes | 📍4.0.1 | FHIR Std.

#### Constraints

Id | Grade | Path(s) | Description | Expression
dom-2 | error | QuestionnaireResponse | If the resource is contained in another resource, it SHALL NOT contain nested Resources | `contained.contained.empty()`
dom-3 | error | QuestionnaireResponse | If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource | `contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()`
dom-4 | error | QuestionnaireResponse | If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated | `contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()`
dom-5 | error | QuestionnaireResponse | If a resource is contained in another resource, it SHALL NOT have a security label | `contained.meta.security.empty()`
dom-6 | best practice | QuestionnaireResponse | A resource should have narrative for robust management | `text.`div`.exists()`
ele-1 | error | **ALL** elements | All FHIR elements must have a @value or children | `hasValue() or (children().count() > id.count())`
ext-1 | error | **ALL** extensions | Must have either extensions or value[x], not both | `extension.exists() != value.exists()`
qrs-1 | error | QuestionnaireResponse.item | Nested item can't be beneath both item and answer | `(answer.exists() and item.exists()).not()`
sdcqr-1 | best practice | QuestionnaireResponse | Subject SHOULD be present (searching is difficult without subject). Almost all QuestionnaireResponses should be with respect to some sort of subject. | `subject.exists()`
sdcqr-2 | best practice | QuestionnaireResponse | When repeats=true for a group, it'll be represented with multiple items with the same linkId in the QuestionnaireResponse. For a question, it'll be represented by a single item with that linkId with multiple answers. | `(QuestionnaireResponse|repeat(answer|item)).select(item.where(answer.value.exists()).linkId.isDistinct()).allTrue()`

This structure is derived from SDCQuestionnaireResponse

Summary

Mandatory: 1 element
Must-Support: 9 elements

Structures

This structure refers to these other structures:

- US Core Patient Profile (http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient)
- US Core Practitioner Profile (http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner)
- US Core Organization Profile (http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization)
- US Core RelatedPerson Profile (http://hl7.org/fhir/us/core/StructureDefinition/us-core-relatedperson)

Extensions

This structure refers to these extensions:

- http://hl7.org/fhir/us/core/StructureDefinition/us-core-extension-questionnaire-uri

Maturity: 3

Other representations of profile: CSV, Excel, Schematron

### Notes:

Quick Start

Below is an overview of the required Server RESTful FHIR interactions for this profile - for example, search and read operations - when supporting the US Core interactions to access this profile's information (Profile Support + Interaction Support). Note that systems that support only US Core Profiles (Profile Only Support) are not required to support these interactions. See the US Core Server CapabilityStatement for a complete list of supported RESTful interactions for this IG.

- See the Scopes Format section for a description of the SMART scopes syntax.
- See the Search Syntax section for a description of the US Core search syntax.
- See the General Requirements section for additional rules and expectations when a Server requires status parameters.
- See the General Guidance section for additional guidance on searching for multiple patients.

#### US Core Scopes

Servers providing access to completed questionnnaire, survey and assessement data SHALL support these US Core SMART Scopes:

- resource level scopes: `<patient|user|system>/QuestionnaireResponse.rs`

#### Mandatory Search Parameters:

The following search parameters and search parameter combinations SHALL be supported:

1. SHALL support both read QuestionnaireResponse by `id` AND QuestionnaireResponse search using the `_id` search parameter:

   `GET [base]/QuestionnaireResponse/[id]` or `GET [base]/QuestionnaireResponse?_id=[id]`

   Example:

   1. GET [base]/!QuestionnaireResponse/AHC-HRSN-screening-example
   2. GET [base]/!QuestionnaireResponse/?_id=AHC-HRSN-screening-example

   Implementation Notes: (how to search by the logical id of the resource)

2. SHALL support searching for all questionnaireresponses for a patient using the `patient` search parameter:

   `GET [base]/QuestionnaireResponse?patient={Type/}[id]`

   Example:

   1. GET [base]/QuestionnaireResponse?patient=1032702

   Implementation Notes: Fetches a bundle of all QuestionnaireResponse resources for the specified patient (how to search by reference)

#### Optional Search Parameters:

The following search parameter combinations SHOULD be supported:

1. SHOULD support searching using the combination of the `patient` and `status` search parameters:
   - including support for OR search on `status` (e.g.`status={system|}[code],{system|}[code],...`)

   `GET [base]/QuestionnaireResponse?patient={Type/}[id]&status={system|}[code]{,{system|}[code],...}`

   Example:

   1. GET [base]/QuestionnaireResponse?patient=1137192&status=completed

   Implementation Notes: Fetches a bundle of all QuestionnaireResponse resources for the specified patient and status (how to search by reference and how to search by token)

2. SHOULD support searching using the combination of the `patient` and `authored` search parameters:
   - including support for these `authored` comparators: `gt,lt,ge,le`
   - including optional support for AND search on `authored` (e.g.`authored=[date]&authored=[date]]&...`)

   `GET [base]/QuestionnaireResponse?patient={Type/}[id]&authored={gt|lt|ge|le}[date]{&authored={gt|lt|ge|le}[date]&...}`

   Example:

   1. GET [base]/QuestionnaireResponse?patient=113192&date=ge2021

   Implementation Notes: Fetches a bundle of all QuestionnaireResponse resources for the specified patient and date (how to search by reference and how to search by date)

3. SHOULD support searching using the combination of the `patient` and `questionnaire` search parameters:

   `GET [base]/QuestionnaireResponse?patient={Type/}[id]&questionnaire={Type/}[id]`

   Example:

   1. GET [base]/QuestionnaireResponse?patient=113192&questionnaire=http://hl7.org/fhir/us/sdoh-clinicalcare/Questionnaire/SDOHCC-QuestionnaireHungerVitalSign

   Implementation Notes: Fetches a bundle of all QuestionnaireResponse resources for the specified patient that have been completed against a specified form. (how to search by reference)

#### Searching QuestionnaireResponse by Context

Searching a patient's QuestionnaireResponses by specific context such as those defined in US Core Category can be achieved by querying the metadata on the associated Questionnaire. Specifically, `Questionnaire.useContext` with a code="focus" and value of "sdoh"/"functionalStatus"/etc. could be accomplished using a chained search:

`GET [base]/QuestionnaireResponse?subject=Patient/123&questionnaire.context-type-value=focus$sdoh`