Open Health Hub FHIR Implementation Guide
0.1.0 - v0.1.0

Open Health Hub FHIR Implementation Guide - Local Development build (v0.1.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

## Resource Profile: OHH Encrypted QuestionnaireResponse

Official URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/EncryptedQuestionnaireResponse | Version: 0.1.0
Active as of 2025-12-03 | Computable Name: EncryptedQuestionnaireResponse

A QuestionnaireResponse that contains encrypted answers.

## Scope and Usage

All answers in our QuestionnaireResponse are encrypted, so they can’t be read unless you have the correct private key to decrypt the responses.

Usages:

- Examples for this Profile: QuestionnaireResponse/f443939b-439e-4fa9-a243-de27d1544b69
- CapabilityStatements using this Profile: OHH FHIR API

You can also check for usages in the FHIR IG Statistics

### Formal Views of Profile Content

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

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

This structure is derived from SDCQuestionnaireResponse

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
QuestionnaireResponse |  | 0..* | SDCQuestionnaireResponse | SDC Questionnaire Response
contained |  | 1..1 | OhhPatient | Information about an individual or animal receiving health care services
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encryptedAnswers |  | 1..1 | string | Encrypted Answers Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encryptedAnswers
identifier |  | 1..1 | Identifier | Unique id for this set of answers
value |  | 1..1 | string | The value that is unique
basedOn |  | 0..1 | Reference(CarePlan) | Request fulfilled by this QuestionnaireResponse
questionnaire |  | 1..1 | canonical(Ohh Questionnaire Profile) | Form being answered
status |  | 1..1 | code | in-progress | completed | amended | entered-in-error | stopped Fixed Value: completed
subject |  | 1..1 | Reference(Patient) | The subject of the questions
reference |  | 0..1 | string | Literal reference, Relative, internal or absolute URL Required Pattern: #patient
source | S C | 1..1 | Reference(Patient | Practitioner) | The person who answered the questions Constraints: source-reference-pattern
item |  |  |  |
answer |  |  |  |
Slices for value[x] |  | 0..1 | boolean, date, dateTime, time, decimal, integer, string, Coding, uri, Quantity, Attachment, Reference() | Single-valued answer to the question Slice: Unordered, Open by type:$this
value[x]:valueString |  | 0..1 | string | Single-valued answer to the question
Slices for extension | C | 0..* | Extension | Extension Slice: Unordered, Closed by value:url Constraints: answer-string-extension-slice
extension:encrypted-stringType |  | 0..1 | string | Encrypted String Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-stringType
extension:encrypted-openChoiceType |  | 0..1 | string | Encrypted Open Choice Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-openChoiceType
value[x]:valueInteger |  | 0..1 | integer | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-integerType |  | 1..1 | string | Encrypted Integer Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-integerType
value[x]:valueDecimal |  | 0..1 | decimal | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-decimalType |  | 1..1 | string | Encrypted Decimal Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-decimalType
value[x]:valueDate |  | 0..1 | date | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-dateType |  | 1..1 | string | Encrypted Date Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-dateType
value[x]:valueDateTime |  | 0..1 | dateTime | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-dateTimeType |  | 1..1 | string | Encrypted Date Time Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-dateTimeType
value[x]:valueTime |  | 0..1 | time | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-timeType |  | 1..1 | string | Encrypted Time Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-timeType
value[x]:valueAttachment |  | 0..1 | Attachment | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-attachment |  | 1..1 | string | Encrypted Attachment Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-attachment
value[x]:valueBoolean |  | 0..1 | boolean | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-booleanType |  | 1..1 | string | Encrypted Boolean Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-booleanType
value[x]:valueCoding |  | 0..1 | Coding | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-coding |  | 1..1 | string | Encrypted Coding Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-coding
Documentation for this format

#### Constraints

Id | Grade | Path(s) | Description | Expression
answer-string-extension-slice | error | QuestionnaireResponse.item.answer.value[x]:valueString.extension | Must have either encrypted-stringType or encrypted-openChoiceType extension, but not both | `url.exists() and (url.matches('https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-stringType') or url.matches('https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-openChoiceType'))`
source-reference-pattern | error | QuestionnaireResponse.source | Source reference must be either #patient or start with Practitioner/<respondentUuid> | `reference.matches('^(#patient|Practitioner/.+)$')`

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
QuestionnaireResponse | C | 0..* | SDCQuestionnaireResponse | SDC Questionnaire Response Constraints: sdcqr-1, sdcqr-2
implicitRules | ?!Σ | 0..1 | uri | A set of rules under which this content was created
contained |  | 1..1 | OhhPatient | Information about an individual or animal receiving health care services
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed 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.
extension:encryptedAnswers |  | 1..1 | string | Encrypted Answers Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encryptedAnswers
modifierExtension | ?! | 0..* | Extension | Extensions that cannot be ignored
identifier | S Σ | 1..1 | Identifier | Unique id for this set of answers
use | ?!Σ | 0..1 | code | usual | official | temp | secondary | old (If known) Binding: IdentifierUse (required): Identifies the purpose for this identifier, if known .
value | Σ | 1..1 | string | The value that is unique Example General: 123456
basedOn | Σ | 0..1 | Reference(CarePlan) | Request fulfilled by this QuestionnaireResponse
questionnaire | S Σ | 1..1 | canonical(Ohh Questionnaire Profile) | 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
status | ?!S Σ | 1..1 | code | in-progress | completed | amended | entered-in-error | stopped Binding: QuestionnaireResponseStatus (required): Lifecycle status of the questionnaire response. Fixed Value: completed
subject | S Σ | 1..1 | Reference(Patient) | The subject of the questions
reference | Σ C | 0..1 | string | Literal reference, Relative, internal or absolute URL Required Pattern: #patient
authored | S Σ | 1..1 | dateTime | Date the answers were gathered
author | S Σ | 0..1 | Reference(Device | Practitioner | PractitionerRole | Patient | RelatedPerson | Organization) | Person who received and recorded the answers
source | S Σ C | 1..1 | Reference(Patient | Practitioner) | The person who answered the questions Constraints: source-reference-pattern
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
Slices for value[x] | S | 0..1 |  | Single-valued answer to the question Slice: Unordered, Open by type:$this Binding: QuestionnaireAnswerCodes (example): Code indicating the response provided for a question.
valueBoolean |  |  | boolean |
valueDate |  |  | date |
valueDateTime |  |  | dateTime |
valueTime |  |  | time |
valueDecimal |  |  | decimal |
valueInteger |  |  | integer |
valueString |  |  | string |
valueCoding |  |  | Coding |
valueUri |  |  | uri |
valueQuantity |  |  | Quantity |
valueAttachment |  |  | Attachment |
valueReference |  |  | Reference(Any) |
value[x]:valueString | S | 0..1 | string | Single-valued answer to the question Binding: QuestionnaireAnswerCodes (example): Code indicating the response provided for a question.
Slices for extension | C | 0..* | Extension | Extension Slice: Unordered, Closed by value:url Constraints: answer-string-extension-slice
extension:encrypted-stringType |  | 0..1 | string | Encrypted String Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-stringType
extension:encrypted-openChoiceType |  | 0..1 | string | Encrypted Open Choice Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-openChoiceType
value[x]:valueInteger | S | 0..1 | integer | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-integerType |  | 1..1 | string | Encrypted Integer Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-integerType
value[x]:valueDecimal | S | 0..1 | decimal | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-decimalType |  | 1..1 | string | Encrypted Decimal Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-decimalType
value[x]:valueDate | S | 0..1 | date | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-dateType |  | 1..1 | string | Encrypted Date Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-dateType
value[x]:valueDateTime | S | 0..1 | dateTime | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-dateTimeType |  | 1..1 | string | Encrypted Date Time Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-dateTimeType
value[x]:valueTime | S | 0..1 | time | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-timeType |  | 1..1 | string | Encrypted Time Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-timeType
value[x]:valueAttachment | S | 0..1 | Attachment | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-attachment |  | 1..1 | string | Encrypted Attachment Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-attachment
value[x]:valueBoolean | S | 0..1 | boolean | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-booleanType |  | 1..1 | string | Encrypted Boolean Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-booleanType
value[x]:valueCoding | S | 0..1 | Coding | Single-valued answer to the question Binding: QuestionnaireAnswerCodes (example): Code indicating the response provided for a question.
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-coding |  | 1..1 | string | Encrypted Coding Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-coding
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.​identifier.use | Base | required | IdentifierUse | 📍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.
QuestionnaireResponse.​item.answer.value[x]:valueString | Base | example | Questionnaire Answer Codes | 📍4.0.1 | FHIR Std.
QuestionnaireResponse.​item.answer.value[x]:valueCoding | Base | example | Questionnaire Answer Codes | 📍4.0.1 | FHIR Std.

#### Constraints

Id | Grade | Path(s) | Description | Expression
answer-string-extension-slice | error | QuestionnaireResponse.item.answer.value[x]:valueString.extension | Must have either encrypted-stringType or encrypted-openChoiceType extension, but not both | `url.exists() and (url.matches('https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-stringType') or url.matches('https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-openChoiceType'))`
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()`
source-reference-pattern | error | QuestionnaireResponse.source | Source reference must be either #patient or start with Practitioner/<respondentUuid> | `reference.matches('^(#patient|Practitioner/.+)$')`

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
QuestionnaireResponse | C | 0..* | SDCQuestionnaireResponse | SDC Questionnaire Response 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 |  | 1..1 | OhhPatient | Information about an individual or animal receiving health care services
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed 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.
extension:encryptedAnswers |  | 1..1 | string | Encrypted Answers Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encryptedAnswers
modifierExtension | ?! | 0..* | Extension | Extensions that cannot be ignored
identifier | S Σ | 1..1 | Identifier | Unique id for this set of answers
id |  | 0..1 | string | Unique id for inter-element referencing
extension |  | 0..* | Extension | Additional content defined by implementations Slice: Unordered, Open by value:url
use | ?!Σ | 0..1 | code | usual | official | temp | secondary | old (If known) Binding: IdentifierUse (required): Identifies the purpose for this identifier, if known .
type | Σ | 0..1 | CodeableConcept | Description of identifier Binding: Identifier Type Codes (extensible): A coded type for an identifier that can be used to determine which identifier to use for a specific purpose.
system | Σ | 0..1 | uri | The namespace for the identifier value Example General: http://www.acme.com/identifiers/patient
value | Σ | 1..1 | string | The value that is unique Example General: 123456
period | Σ | 0..1 | Period | Time period when id is/was valid for use
assigner | Σ | 0..1 | Reference(Organization) | Organization that issued id (may be just text)
basedOn | Σ | 0..1 | Reference(CarePlan) | Request fulfilled by this QuestionnaireResponse
partOf | Σ | 0..* | Reference(Observation | Procedure) | Part of this action
questionnaire | S Σ | 1..1 | canonical(Ohh Questionnaire Profile) | 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
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. Fixed Value: completed
subject | S Σ | 1..1 | Reference(Patient) | The subject of the questions
id |  | 0..1 | string | Unique id for inter-element referencing
extension |  | 0..* | Extension | Additional content defined by implementations Slice: Unordered, Open by value:url
reference | Σ C | 0..1 | string | Literal reference, Relative, internal or absolute URL Required Pattern: #patient
type | Σ | 0..1 | uri | Type the reference refers to (e.g. "Patient") Binding: ResourceType (extensible): Aa resource (or, for logical models, the URI of the logical model).
identifier | Σ | 0..1 | Identifier | Logical reference, when literal reference is not known
display | Σ | 0..1 | string | Text alternative for the resource
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(Device | Practitioner | PractitionerRole | Patient | RelatedPerson | Organization) | Person who received and recorded the answers
source | S Σ C | 1..1 | Reference(Patient | Practitioner) | The person who answered the questions Constraints: source-reference-pattern
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
Slices for value[x] | S | 0..1 |  | Single-valued answer to the question Slice: Unordered, Open by type:$this Binding: QuestionnaireAnswerCodes (example): Code indicating the response provided for a question.
valueBoolean |  |  | boolean |
valueDate |  |  | date |
valueDateTime |  |  | dateTime |
valueTime |  |  | time |
valueDecimal |  |  | decimal |
valueInteger |  |  | integer |
valueString |  |  | string |
valueCoding |  |  | Coding |
valueUri |  |  | uri |
valueQuantity |  |  | Quantity |
valueAttachment |  |  | Attachment |
valueReference |  |  | Reference(Any) |
value[x]:valueString | S | 0..1 | string | Single-valued answer to the question Binding: QuestionnaireAnswerCodes (example): Code indicating the response provided for a question.
id |  | 0..1 | string | xml:id (or equivalent in JSON)
Slices for extension | C | 0..* | Extension | Extension Slice: Unordered, Closed by value:url Constraints: answer-string-extension-slice
extension:encrypted-stringType |  | 0..1 | string | Encrypted String Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-stringType
extension:encrypted-openChoiceType |  | 0..1 | string | Encrypted Open Choice Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-openChoiceType
value |  | 0..1 | string | Primitive value for string Max Length:1048576
value[x]:valueInteger | S | 0..1 | integer | Single-valued answer to the question
id |  | 0..1 | string | xml:id (or equivalent in JSON)
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-integerType |  | 1..1 | string | Encrypted Integer Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-integerType
value |  | 0..1 | integer | Primitive value for integer
value[x]:valueDecimal | S | 0..1 | decimal | Single-valued answer to the question
id |  | 0..1 | string | xml:id (or equivalent in JSON)
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-decimalType |  | 1..1 | string | Encrypted Decimal Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-decimalType
value |  | 0..1 | decimal | Primitive value for decimal
value[x]:valueDate | S | 0..1 | date | Single-valued answer to the question
id |  | 0..1 | string | xml:id (or equivalent in JSON)
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-dateType |  | 1..1 | string | Encrypted Date Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-dateType
value |  | 0..1 | date | Primitive value for date
value[x]:valueDateTime | S | 0..1 | dateTime | Single-valued answer to the question
id |  | 0..1 | string | xml:id (or equivalent in JSON)
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-dateTimeType |  | 1..1 | string | Encrypted Date Time Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-dateTimeType
value |  | 0..1 | dateTime | Primitive value for dateTime
value[x]:valueTime | S | 0..1 | time | Single-valued answer to the question
id |  | 0..1 | string | xml:id (or equivalent in JSON)
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-timeType |  | 1..1 | string | Encrypted Time Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-timeType
value |  | 0..1 | time | Primitive value for time
value[x]:valueAttachment | S | 0..1 | Attachment | Single-valued answer to the question
id |  | 0..1 | string | Unique id for inter-element referencing
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-attachment |  | 1..1 | string | Encrypted Attachment Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-attachment
contentType | Σ | 0..1 | code | Mime type of the content, with charset etc. Binding: Mime Types (required): The mime type of an attachment. Any valid mime type is allowed. Example General: text/plain; charset=UTF-8, image/png
language | Σ | 0..1 | code | Human language of the content (BCP-47) Binding: CommonLanguages (preferred): A human language.
Additional Bindings | Purpose
AllLanguages | Max Binding
Example General: en-AU
data |  | 0..1 | base64Binary | Data inline, base64ed
url | Σ | 0..1 | url | Uri where the data can be found Example General: http://www.acme.com/logo-small.png
size | Σ | 0..1 | unsignedInt | Number of bytes of content (if url provided)
hash | Σ | 0..1 | base64Binary | Hash of the data (sha-1, base64ed)
title | Σ | 0..1 | string | Label to display in place of the data Example General: Official Corporate Logo
creation | Σ | 0..1 | dateTime | Date attachment was first created
value[x]:valueBoolean | S | 0..1 | boolean | Single-valued answer to the question
id |  | 0..1 | string | xml:id (or equivalent in JSON)
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-booleanType |  | 1..1 | string | Encrypted Boolean Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-booleanType
value |  | 0..1 | boolean | Primitive value for boolean
value[x]:valueCoding | S | 0..1 | Coding | Single-valued answer to the question Binding: QuestionnaireAnswerCodes (example): Code indicating the response provided for a question.
id |  | 0..1 | string | Unique id for inter-element referencing
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-coding |  | 1..1 | string | Encrypted Coding Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-coding
system | Σ | 0..1 | uri | Identity of the terminology system
version | Σ | 0..1 | string | Version of the system - if relevant
code | Σ | 0..1 | code | Symbol in syntax defined by the system
display | Σ | 0..1 | string | Representation defined by the system
userSelected | Σ | 0..1 | boolean | If this coding was chosen directly by the user
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.​identifier.use | Base | required | IdentifierUse | 📍4.0.1 | FHIR Std.
QuestionnaireResponse.​identifier.type | Base | extensible | IdentifierType | 📍4.0.1 | FHIR Std.
QuestionnaireResponse.​status | Base | required | QuestionnaireResponseStatus | 📍4.0.1 | FHIR Std.
QuestionnaireResponse.​subject.type | Base | extensible | ResourceType | 📍4.0.1 | FHIR Std.
QuestionnaireResponse.​item.answer.value[x] | Base | example | Questionnaire Answer Codes | 📍4.0.1 | FHIR Std.
QuestionnaireResponse.​item.answer.value[x]:valueString | Base | example | Questionnaire Answer Codes | 📍4.0.1 | FHIR Std.
QuestionnaireResponse.​item.answer.value[x]:valueAttachment.​contentType | Base | required | MimeType | 📍4.0.1 | FHIR Std.
QuestionnaireResponse.​item.answer.value[x]:valueAttachment.​language | Base | preferred | Common Languages | 📍4.0.1 | FHIR Std.
QuestionnaireResponse.​item.answer.value[x]:valueCoding | Base | example | Questionnaire Answer Codes | 📍4.0.1 | FHIR Std.

#### Constraints

Id | Grade | Path(s) | Description | Expression
answer-string-extension-slice | error | QuestionnaireResponse.item.answer.value[x]:valueString.extension | Must have either encrypted-stringType or encrypted-openChoiceType extension, but not both | `url.exists() and (url.matches('https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-stringType') or url.matches('https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-openChoiceType'))`
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()`
source-reference-pattern | error | QuestionnaireResponse.source | Source reference must be either #patient or start with Practitioner/<respondentUuid> | `reference.matches('^(#patient|Practitioner/.+)$')`

This structure is derived from SDCQuestionnaireResponse

Summary

Mandatory: 7 elements(16 nested mandatory elements)
Must-Support: 1 element
Fixed: 1 element

Structures

This structure refers to these other structures:

- Ohh Patient Profile (https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/ohh-patient)
- Ohh Questionnaire Profile (https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/ohh-questionnaire)

Extensions

This structure refers to these extensions:

- https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encryptedAnswers
- https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-stringType
- https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-openChoiceType
- https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-integerType
- https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-decimalType
- https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-dateType
- https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-dateTimeType
- https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-timeType
- https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-attachment
- https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-booleanType
- https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-coding

Slices

This structure defines the following Slices:

- The element 1 is sliced based on the value of QuestionnaireResponse.item.answer.value[x]

Differential View

This structure is derived from SDCQuestionnaireResponse

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
QuestionnaireResponse |  | 0..* | SDCQuestionnaireResponse | SDC Questionnaire Response
contained |  | 1..1 | OhhPatient | Information about an individual or animal receiving health care services
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encryptedAnswers |  | 1..1 | string | Encrypted Answers Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encryptedAnswers
identifier |  | 1..1 | Identifier | Unique id for this set of answers
value |  | 1..1 | string | The value that is unique
basedOn |  | 0..1 | Reference(CarePlan) | Request fulfilled by this QuestionnaireResponse
questionnaire |  | 1..1 | canonical(Ohh Questionnaire Profile) | Form being answered
status |  | 1..1 | code | in-progress | completed | amended | entered-in-error | stopped Fixed Value: completed
subject |  | 1..1 | Reference(Patient) | The subject of the questions
reference |  | 0..1 | string | Literal reference, Relative, internal or absolute URL Required Pattern: #patient
source | S C | 1..1 | Reference(Patient | Practitioner) | The person who answered the questions Constraints: source-reference-pattern
item |  |  |  |
answer |  |  |  |
Slices for value[x] |  | 0..1 | boolean, date, dateTime, time, decimal, integer, string, Coding, uri, Quantity, Attachment, Reference() | Single-valued answer to the question Slice: Unordered, Open by type:$this
value[x]:valueString |  | 0..1 | string | Single-valued answer to the question
Slices for extension | C | 0..* | Extension | Extension Slice: Unordered, Closed by value:url Constraints: answer-string-extension-slice
extension:encrypted-stringType |  | 0..1 | string | Encrypted String Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-stringType
extension:encrypted-openChoiceType |  | 0..1 | string | Encrypted Open Choice Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-openChoiceType
value[x]:valueInteger |  | 0..1 | integer | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-integerType |  | 1..1 | string | Encrypted Integer Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-integerType
value[x]:valueDecimal |  | 0..1 | decimal | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-decimalType |  | 1..1 | string | Encrypted Decimal Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-decimalType
value[x]:valueDate |  | 0..1 | date | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-dateType |  | 1..1 | string | Encrypted Date Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-dateType
value[x]:valueDateTime |  | 0..1 | dateTime | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-dateTimeType |  | 1..1 | string | Encrypted Date Time Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-dateTimeType
value[x]:valueTime |  | 0..1 | time | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-timeType |  | 1..1 | string | Encrypted Time Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-timeType
value[x]:valueAttachment |  | 0..1 | Attachment | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-attachment |  | 1..1 | string | Encrypted Attachment Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-attachment
value[x]:valueBoolean |  | 0..1 | boolean | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-booleanType |  | 1..1 | string | Encrypted Boolean Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-booleanType
value[x]:valueCoding |  | 0..1 | Coding | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-coding |  | 1..1 | string | Encrypted Coding Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-coding
Documentation for this format

#### Constraints

Id | Grade | Path(s) | Description | Expression
answer-string-extension-slice | error | QuestionnaireResponse.item.answer.value[x]:valueString.extension | Must have either encrypted-stringType or encrypted-openChoiceType extension, but not both | `url.exists() and (url.matches('https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-stringType') or url.matches('https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-openChoiceType'))`
source-reference-pattern | error | QuestionnaireResponse.source | Source reference must be either #patient or start with Practitioner/<respondentUuid> | `reference.matches('^(#patient|Practitioner/.+)$')`

Key Elements View

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
QuestionnaireResponse | C | 0..* | SDCQuestionnaireResponse | SDC Questionnaire Response Constraints: sdcqr-1, sdcqr-2
implicitRules | ?!Σ | 0..1 | uri | A set of rules under which this content was created
contained |  | 1..1 | OhhPatient | Information about an individual or animal receiving health care services
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed 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.
extension:encryptedAnswers |  | 1..1 | string | Encrypted Answers Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encryptedAnswers
modifierExtension | ?! | 0..* | Extension | Extensions that cannot be ignored
identifier | S Σ | 1..1 | Identifier | Unique id for this set of answers
use | ?!Σ | 0..1 | code | usual | official | temp | secondary | old (If known) Binding: IdentifierUse (required): Identifies the purpose for this identifier, if known .
value | Σ | 1..1 | string | The value that is unique Example General: 123456
basedOn | Σ | 0..1 | Reference(CarePlan) | Request fulfilled by this QuestionnaireResponse
questionnaire | S Σ | 1..1 | canonical(Ohh Questionnaire Profile) | 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
status | ?!S Σ | 1..1 | code | in-progress | completed | amended | entered-in-error | stopped Binding: QuestionnaireResponseStatus (required): Lifecycle status of the questionnaire response. Fixed Value: completed
subject | S Σ | 1..1 | Reference(Patient) | The subject of the questions
reference | Σ C | 0..1 | string | Literal reference, Relative, internal or absolute URL Required Pattern: #patient
authored | S Σ | 1..1 | dateTime | Date the answers were gathered
author | S Σ | 0..1 | Reference(Device | Practitioner | PractitionerRole | Patient | RelatedPerson | Organization) | Person who received and recorded the answers
source | S Σ C | 1..1 | Reference(Patient | Practitioner) | The person who answered the questions Constraints: source-reference-pattern
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
Slices for value[x] | S | 0..1 |  | Single-valued answer to the question Slice: Unordered, Open by type:$this Binding: QuestionnaireAnswerCodes (example): Code indicating the response provided for a question.
valueBoolean |  |  | boolean |
valueDate |  |  | date |
valueDateTime |  |  | dateTime |
valueTime |  |  | time |
valueDecimal |  |  | decimal |
valueInteger |  |  | integer |
valueString |  |  | string |
valueCoding |  |  | Coding |
valueUri |  |  | uri |
valueQuantity |  |  | Quantity |
valueAttachment |  |  | Attachment |
valueReference |  |  | Reference(Any) |
value[x]:valueString | S | 0..1 | string | Single-valued answer to the question Binding: QuestionnaireAnswerCodes (example): Code indicating the response provided for a question.
Slices for extension | C | 0..* | Extension | Extension Slice: Unordered, Closed by value:url Constraints: answer-string-extension-slice
extension:encrypted-stringType |  | 0..1 | string | Encrypted String Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-stringType
extension:encrypted-openChoiceType |  | 0..1 | string | Encrypted Open Choice Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-openChoiceType
value[x]:valueInteger | S | 0..1 | integer | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-integerType |  | 1..1 | string | Encrypted Integer Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-integerType
value[x]:valueDecimal | S | 0..1 | decimal | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-decimalType |  | 1..1 | string | Encrypted Decimal Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-decimalType
value[x]:valueDate | S | 0..1 | date | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-dateType |  | 1..1 | string | Encrypted Date Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-dateType
value[x]:valueDateTime | S | 0..1 | dateTime | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-dateTimeType |  | 1..1 | string | Encrypted Date Time Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-dateTimeType
value[x]:valueTime | S | 0..1 | time | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-timeType |  | 1..1 | string | Encrypted Time Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-timeType
value[x]:valueAttachment | S | 0..1 | Attachment | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-attachment |  | 1..1 | string | Encrypted Attachment Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-attachment
value[x]:valueBoolean | S | 0..1 | boolean | Single-valued answer to the question
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-booleanType |  | 1..1 | string | Encrypted Boolean Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-booleanType
value[x]:valueCoding | S | 0..1 | Coding | Single-valued answer to the question Binding: QuestionnaireAnswerCodes (example): Code indicating the response provided for a question.
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-coding |  | 1..1 | string | Encrypted Coding Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-coding
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.​identifier.use | Base | required | IdentifierUse | 📍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.
QuestionnaireResponse.​item.answer.value[x]:valueString | Base | example | Questionnaire Answer Codes | 📍4.0.1 | FHIR Std.
QuestionnaireResponse.​item.answer.value[x]:valueCoding | Base | example | Questionnaire Answer Codes | 📍4.0.1 | FHIR Std.

#### Constraints

Id | Grade | Path(s) | Description | Expression
answer-string-extension-slice | error | QuestionnaireResponse.item.answer.value[x]:valueString.extension | Must have either encrypted-stringType or encrypted-openChoiceType extension, but not both | `url.exists() and (url.matches('https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-stringType') or url.matches('https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-openChoiceType'))`
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()`
source-reference-pattern | error | QuestionnaireResponse.source | Source reference must be either #patient or start with Practitioner/<respondentUuid> | `reference.matches('^(#patient|Practitioner/.+)$')`

Snapshot View

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
QuestionnaireResponse | C | 0..* | SDCQuestionnaireResponse | SDC Questionnaire Response 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 |  | 1..1 | OhhPatient | Information about an individual or animal receiving health care services
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed 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.
extension:encryptedAnswers |  | 1..1 | string | Encrypted Answers Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encryptedAnswers
modifierExtension | ?! | 0..* | Extension | Extensions that cannot be ignored
identifier | S Σ | 1..1 | Identifier | Unique id for this set of answers
id |  | 0..1 | string | Unique id for inter-element referencing
extension |  | 0..* | Extension | Additional content defined by implementations Slice: Unordered, Open by value:url
use | ?!Σ | 0..1 | code | usual | official | temp | secondary | old (If known) Binding: IdentifierUse (required): Identifies the purpose for this identifier, if known .
type | Σ | 0..1 | CodeableConcept | Description of identifier Binding: Identifier Type Codes (extensible): A coded type for an identifier that can be used to determine which identifier to use for a specific purpose.
system | Σ | 0..1 | uri | The namespace for the identifier value Example General: http://www.acme.com/identifiers/patient
value | Σ | 1..1 | string | The value that is unique Example General: 123456
period | Σ | 0..1 | Period | Time period when id is/was valid for use
assigner | Σ | 0..1 | Reference(Organization) | Organization that issued id (may be just text)
basedOn | Σ | 0..1 | Reference(CarePlan) | Request fulfilled by this QuestionnaireResponse
partOf | Σ | 0..* | Reference(Observation | Procedure) | Part of this action
questionnaire | S Σ | 1..1 | canonical(Ohh Questionnaire Profile) | 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
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. Fixed Value: completed
subject | S Σ | 1..1 | Reference(Patient) | The subject of the questions
id |  | 0..1 | string | Unique id for inter-element referencing
extension |  | 0..* | Extension | Additional content defined by implementations Slice: Unordered, Open by value:url
reference | Σ C | 0..1 | string | Literal reference, Relative, internal or absolute URL Required Pattern: #patient
type | Σ | 0..1 | uri | Type the reference refers to (e.g. "Patient") Binding: ResourceType (extensible): Aa resource (or, for logical models, the URI of the logical model).
identifier | Σ | 0..1 | Identifier | Logical reference, when literal reference is not known
display | Σ | 0..1 | string | Text alternative for the resource
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(Device | Practitioner | PractitionerRole | Patient | RelatedPerson | Organization) | Person who received and recorded the answers
source | S Σ C | 1..1 | Reference(Patient | Practitioner) | The person who answered the questions Constraints: source-reference-pattern
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
Slices for value[x] | S | 0..1 |  | Single-valued answer to the question Slice: Unordered, Open by type:$this Binding: QuestionnaireAnswerCodes (example): Code indicating the response provided for a question.
valueBoolean |  |  | boolean |
valueDate |  |  | date |
valueDateTime |  |  | dateTime |
valueTime |  |  | time |
valueDecimal |  |  | decimal |
valueInteger |  |  | integer |
valueString |  |  | string |
valueCoding |  |  | Coding |
valueUri |  |  | uri |
valueQuantity |  |  | Quantity |
valueAttachment |  |  | Attachment |
valueReference |  |  | Reference(Any) |
value[x]:valueString | S | 0..1 | string | Single-valued answer to the question Binding: QuestionnaireAnswerCodes (example): Code indicating the response provided for a question.
id |  | 0..1 | string | xml:id (or equivalent in JSON)
Slices for extension | C | 0..* | Extension | Extension Slice: Unordered, Closed by value:url Constraints: answer-string-extension-slice
extension:encrypted-stringType |  | 0..1 | string | Encrypted String Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-stringType
extension:encrypted-openChoiceType |  | 0..1 | string | Encrypted Open Choice Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-openChoiceType
value |  | 0..1 | string | Primitive value for string Max Length:1048576
value[x]:valueInteger | S | 0..1 | integer | Single-valued answer to the question
id |  | 0..1 | string | xml:id (or equivalent in JSON)
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-integerType |  | 1..1 | string | Encrypted Integer Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-integerType
value |  | 0..1 | integer | Primitive value for integer
value[x]:valueDecimal | S | 0..1 | decimal | Single-valued answer to the question
id |  | 0..1 | string | xml:id (or equivalent in JSON)
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-decimalType |  | 1..1 | string | Encrypted Decimal Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-decimalType
value |  | 0..1 | decimal | Primitive value for decimal
value[x]:valueDate | S | 0..1 | date | Single-valued answer to the question
id |  | 0..1 | string | xml:id (or equivalent in JSON)
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-dateType |  | 1..1 | string | Encrypted Date Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-dateType
value |  | 0..1 | date | Primitive value for date
value[x]:valueDateTime | S | 0..1 | dateTime | Single-valued answer to the question
id |  | 0..1 | string | xml:id (or equivalent in JSON)
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-dateTimeType |  | 1..1 | string | Encrypted Date Time Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-dateTimeType
value |  | 0..1 | dateTime | Primitive value for dateTime
value[x]:valueTime | S | 0..1 | time | Single-valued answer to the question
id |  | 0..1 | string | xml:id (or equivalent in JSON)
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-timeType |  | 1..1 | string | Encrypted Time Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-timeType
value |  | 0..1 | time | Primitive value for time
value[x]:valueAttachment | S | 0..1 | Attachment | Single-valued answer to the question
id |  | 0..1 | string | Unique id for inter-element referencing
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-attachment |  | 1..1 | string | Encrypted Attachment Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-attachment
contentType | Σ | 0..1 | code | Mime type of the content, with charset etc. Binding: Mime Types (required): The mime type of an attachment. Any valid mime type is allowed. Example General: text/plain; charset=UTF-8, image/png
language | Σ | 0..1 | code | Human language of the content (BCP-47) Binding: CommonLanguages (preferred): A human language.
Additional Bindings | Purpose
AllLanguages | Max Binding
Example General: en-AU
data |  | 0..1 | base64Binary | Data inline, base64ed
url | Σ | 0..1 | url | Uri where the data can be found Example General: http://www.acme.com/logo-small.png
size | Σ | 0..1 | unsignedInt | Number of bytes of content (if url provided)
hash | Σ | 0..1 | base64Binary | Hash of the data (sha-1, base64ed)
title | Σ | 0..1 | string | Label to display in place of the data Example General: Official Corporate Logo
creation | Σ | 0..1 | dateTime | Date attachment was first created
value[x]:valueBoolean | S | 0..1 | boolean | Single-valued answer to the question
id |  | 0..1 | string | xml:id (or equivalent in JSON)
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-booleanType |  | 1..1 | string | Encrypted Boolean Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-booleanType
value |  | 0..1 | boolean | Primitive value for boolean
value[x]:valueCoding | S | 0..1 | Coding | Single-valued answer to the question Binding: QuestionnaireAnswerCodes (example): Code indicating the response provided for a question.
id |  | 0..1 | string | Unique id for inter-element referencing
Slices for extension |  | 1..* | Extension | Extension Slice: Unordered, Closed by value:url
extension:encrypted-coding |  | 1..1 | string | Encrypted Coding Extension URL: https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-coding
system | Σ | 0..1 | uri | Identity of the terminology system
version | Σ | 0..1 | string | Version of the system - if relevant
code | Σ | 0..1 | code | Symbol in syntax defined by the system
display | Σ | 0..1 | string | Representation defined by the system
userSelected | Σ | 0..1 | boolean | If this coding was chosen directly by the user
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.​identifier.use | Base | required | IdentifierUse | 📍4.0.1 | FHIR Std.
QuestionnaireResponse.​identifier.type | Base | extensible | IdentifierType | 📍4.0.1 | FHIR Std.
QuestionnaireResponse.​status | Base | required | QuestionnaireResponseStatus | 📍4.0.1 | FHIR Std.
QuestionnaireResponse.​subject.type | Base | extensible | ResourceType | 📍4.0.1 | FHIR Std.
QuestionnaireResponse.​item.answer.value[x] | Base | example | Questionnaire Answer Codes | 📍4.0.1 | FHIR Std.
QuestionnaireResponse.​item.answer.value[x]:valueString | Base | example | Questionnaire Answer Codes | 📍4.0.1 | FHIR Std.
QuestionnaireResponse.​item.answer.value[x]:valueAttachment.​contentType | Base | required | MimeType | 📍4.0.1 | FHIR Std.
QuestionnaireResponse.​item.answer.value[x]:valueAttachment.​language | Base | preferred | Common Languages | 📍4.0.1 | FHIR Std.
QuestionnaireResponse.​item.answer.value[x]:valueCoding | Base | example | Questionnaire Answer Codes | 📍4.0.1 | FHIR Std.

#### Constraints

Id | Grade | Path(s) | Description | Expression
answer-string-extension-slice | error | QuestionnaireResponse.item.answer.value[x]:valueString.extension | Must have either encrypted-stringType or encrypted-openChoiceType extension, but not both | `url.exists() and (url.matches('https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-stringType') or url.matches('https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-openChoiceType'))`
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()`
source-reference-pattern | error | QuestionnaireResponse.source | Source reference must be either #patient or start with Practitioner/<respondentUuid> | `reference.matches('^(#patient|Practitioner/.+)$')`

This structure is derived from SDCQuestionnaireResponse

Summary

Mandatory: 7 elements(16 nested mandatory elements)
Must-Support: 1 element
Fixed: 1 element

Structures

This structure refers to these other structures:

- Ohh Patient Profile (https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/ohh-patient)
- Ohh Questionnaire Profile (https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/ohh-questionnaire)

Extensions

This structure refers to these extensions:

- https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encryptedAnswers
- https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-stringType
- https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-openChoiceType
- https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-integerType
- https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-decimalType
- https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-dateType
- https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-dateTimeType
- https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-timeType
- https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-attachment
- https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-booleanType
- https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-coding

Slices

This structure defines the following Slices:

- The element 1 is sliced based on the value of QuestionnaireResponse.item.answer.value[x]

Other representations of profile: CSV, Excel, Schematron

### Notes:

## Encrypting QuestionnaireResponse

Encrypting QuestionnaireResponses can be done in 2 separate ways:

### Using our javascript SDK

To help you with creating an encrypted QuestionnaireResponse we offer a npm package with a single function which inputs the QuestionnaireResponse and a list of Practitioners and which will output a Bundle that can be posted to our Bundle endpoint.

The following fields should already be set before passing the response through the encrypt function:

- `identifier` should be set to the identifier as set in the QuestionnaireResponse in the `CarePlan.activity` this response fulfills.
- `basedOn` should be set to a CarePlan reference with the correct ID (e.g. `CarePlan/123`).
- `source` should reference the Patient (as contained resource). The patient should have one identifier with system `urn:ietf:rfc:3986`. ( can be taken from the originating CarePlan)

The practitioners can be retrieved as part of the CarePlan, as part of a CareTeam, or as a list of Practitioners in a CareTeam.

### Encrypting answers yourself

If you want to handle the encryption yourself

Every answer should be encrypted in the item -> answer field, using an extension with the prefix `http://openhealthhub.com/fhir/StructureDefinition/encrypted-` followed by the type of the answer (e.g. `decimalType`, `stringType`, `attachment`).

Because decrypting all answers one-by-one can have a big impact on performance, we also want all answers in an encrypted JSON object. This should be added as an extension at the top level of the QuestionnaireResponse with url `http://openhealthhub.com/StructureDefinition/encryptedAnswers`.

All answers should be encrypted as a JSON object. The format of this object is as follows:

    ```json
    {
        "value": "Raspberry",
        "codes": [{
            "code": "7658-8",
            "system": "https://fhir.loinc.org/CodeSystem/loinc",
            "display": "Raspberry BasoBnd Ab Qn",
            "version": "2.71"
        }],
        "text": "Raspberry label"
    }
    ```

Field explanation:

- The `value` property contains a single value of the answer.
- `codes`: If the answer has codes linked to it (as entered in Improve Designer), they should be put in the `codes` array.
- The `text` field holds a text representation of the answer if available (e.g. for ‘choice’ type questions).

If the answer has multiple values (e.g. in case of a multiple select question) there should be multiple answer objects. Most questionnaire items should have a one-to-one match between their linkIds and the ids for the answer value objects. For result questionnaire items `result_<result_index>_formula_<formula_index>` should be created to indicate first which item (`result_<result_index>`) and second (`formula_<formula_index>`) which result sub-item the answer is for. Finally, all formula results should also be emitted as `formula_<formula_id>`.

The JSON object with all the combined answers should be an object, with a property for every question with key the `linkId` of the question. The value should be an array of answer objects as described above (also in case of single answer).

For a complete example please have a look at the JavaScript FHIR QuestionnaireResponse Client Example

## Decrypting QuestionnaireResponse

All answers in our QuestionnaireResponse are encrypted, so they can’t be read unless you have the correct private key to decrypt the responses. The answers are encrypted in 2 separate ways.

Every answer is encrypted in the `item.answer` field, using an extension with the prefix `https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encrypted-` followed by the type of the answer (e.g. `decimalType`, `stringType`, `attachment`). Refer to the example JSON of the implementation guide for a complete example.

Because decrypting all answers one-by-one can have a big impact on performance, we also emit all answers in an encrypted JSON object. This is emitted in an extension at the top level of the QuestionnaireResponse with url `https://api.openhealthhub.com/OpenHealthhub/fhir/4/StructureDefinition/encryptedAnswers`.

All answers are emitted as a JSON object with a `value` property that contains the actual value of the answer. If the answer has codes linked to it (as entered in the Form Designer), they will be put in a `codes` array. Most questionnaire items will have a one-to-one match between their linkids and the ids for the answer value objects. For result questionnaire items `result_<result_index>_formula_<formula_index>` will be created to indicate first which item (`result_<result_index>`) and second (`formula_<formula_index>`) which result sub-item the answer is for. Finally, all formula results will also be emitted as `formula_<formula_id>`.

For a complete example on how to decrypt the answers, refer to our FhirClient example respository where examples can be found for several popular programming languages.