Info |
---|
See Questionnaire for introduction and use of the resources and its elements. |
Creating and Maintaining a Questionnaire
A Questionnaire are is created and updated through Questionnaire Create and Questionnaire Update, respectively.
Info |
---|
Later finding The ease with which appropriate Questionnaire resources can subsequently be found depends on the quality and granularity with which the Questionnaire elements are populated when created/updated. Consequently, effort should be made to ensure these elements are populated. Filtering applied on finding appropriate Questionnaire could involve the following elements of Questionnaire:
Possibly, the following elements (and others) could be used as well:
|
...
Info |
---|
The description here applies for Questionnaire resources where processing of corresponding QuestionnaireResponse involves extraction of answer(s) to certain questions in the Questionnaire. In the eHealth Infrastructure, such processing is performed through rules captured in Library resources. In order to make the rules robust and allow for change of question order and additional questions and answer options, the Questionnaire shall utilize defined questions in the form of DefinedQuestion resources. See DefinedQuestion for further details. |
When a question in Questionnaire.item
is eligible for extraction in a rule, a DefinedQuestion shall be either found or created and subsequently referenced in Questionnaire.item.definition
.
...
Expand | ||
---|---|---|
| ||
A Questionnaire containing a question suitable for calculating a Medical Research Council (MRC) score is to processed by a MRC score rule. Therefore the particular question must be identifiable in order to extract the answer value from a QuestionnaireResponse in a robust way. In the following it is given that the MRC score question has been defined (see #Managing-DefinedQuestion) as a DefinedQuestion with:
Preparing for robust extraction, the Questionnaire is defined with:
|
Info |
---|
As noted in DefinedQuestion, despite any reference through |
Preparing a Questionnaire with Embedded, Simple Calculations
A Questionnaire defined with the eHealth profile ehealth-questionnaire-advanced
(see https://ehealth.sundhed.dk/fhir/StructureDefinition-ehealth-questionnaire-advanced.html ) can contain zero, one or more expressions performing a calculation based on answers to questions in the Questionnaire. The expression can make use of zero, one or more variables which identify the particular question/answers more concisely.
Note |
---|
A Questionnaire defined with eHealth profile |
Defining a Variable
A variable intended for use in an expression (see below) is defined using the extension variable
. An example of a variable is shown below as an excerpt of a Questionnaire (in profile ehealth-questionnaire-advanced
) in JSON:
Code Block | ||
---|---|---|
| ||
{
"url": "http://hl7.org/fhir/StructureDefinition/variable",
"valueExpression": {
"name": "Count",
"language": "text/fhirpath",
"expression": "QuestionnaireResponse.repeat(item).where(linkId='1.2.208.176.1.5.1,7a481674-9016-46bb-8dd8-2ee49f5bbd53,Sundhedsdatastyrelsen').answer.valueInteger"
}
} |
The variable here is defined at Questionnaire root level referencing a particular question through its Questionnaire.item.linkId
. On evaluation in a QuestionnaireResponse, the variable will hold the integer value of the answer (presumably, the referenced Questionnaire.item
has integer answer type).
Info |
---|
A variable is supported for a question with answer type choice, integer and decimal provided that:
|
An example of a variable evaluating to an ordinal value is shown below as an excerpt of a Questionnaire (in profile ehealth-questionnaire-advanced
) in JSON:
Code Block | ||
---|---|---|
| ||
{
"url": "http://hl7.org/fhir/StructureDefinition/variable",
"valueExpression": {
"name": "BreathingDifficulty",
"language": "text/fhirpath",
"expression": "iif(QuestionnaireResponse.repeat(item).where(linkId='1.2.208.176.1.5.1,6e6bb131-debd-4675-803b-7d783a75acc6,Sundhedsdatastyrelsen').answer.valueString = 'Severe', 2,
iif(QuestionnaireResponse.repeat(item).where(linkId='1.2.208.176.1.5.1,6e6bb131-debd-4675-803b-7d783a75acc6,Sundhedsdatastyrelsen').answer.valueString = 'Normal', 1, {}))"
}
} |
The expression above relies on the definer to ensure consistency between the actual answer values (in Questionnaire.item.answerOption.value[x]
) and ordinal values possibly assigned in Questionnaire.item.answerOption.ordinalValue
.
Defining a Calculation Expression
An expression is defined in a separate Questionnaire.item
(or recursively, Questionnaire.item.item
) which shall have:
Questionnaire.item.readOnly
set totrue
Questionnaire.item.type
set todecimal
The expression itself is defined in the extension sdc-questionnaire-calculatedExpression
(see calculatedExpression) which is an Expression FHIR element type containing:
language
- the expression language. The supported language is a subset of FHIRPath described below. The expression language is specified as"text/fhirpath"
.expression
- the expression
An example calculation expression is shown below as an excerpt of a Questionnaire (in profile ehealth-questionnaire-advanced
) in JSON:
Code Block | ||
---|---|---|
| ||
"extension": [
{
"url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression",
"valueExpression": {
"language": "text/fhirpath",
"expression": "%Animal * %Count"
}
},
"linkId": "1.2.208.176.1.5.1,25d40dde-f91c-4f11-9477-c6cca71d4178,Sundhedsdatastyrelsen",
"text": "Total",
"type": "decimal",
"required": false,
"readOnly": true
} |
Info |
---|
The following runtime behavior is not performed when maintaining the Questionnaire but provides background. On evaluation in a QuestionnaireResponse, the |
Info |
---|
In case the expression is defined using one or more A
|
Expression Language
The supported expression language is the following subset of FHIRPath:
Arithmetic: multiplication, division, addition & subtraction only
Parentheses ‘
(
' and ')
'Constants
The equals operation (
=
) for primitive typesThe iif function
Releasing a Questionnaire
...
Info |
---|
Retiring a Questionnaire does not impact current or past use in resources referencing it. It signals that further use in new PlanDefinition/ActivityDefinition telemedicine packages should not happen. |
Maintaining and Using Codes for Questionnaire Groups, Questions and Answer Options
The eHealth Infrastructure has a Questionnaire Terminology Service for terminology used in certain elements of a Questionnaire.
Coded values maintained in one or more CodeSystem resources in the Questionnaire Terminology Service can be used for the following Questionnaire elements:
question group (in
Questionnaire.item.item.code
whereQuestionnaire.item.item.type
=group
)question (in
Questionnaire.item.item.item.code
whereQuestionnaire.item.item.item.type
=subtype ofquestion
)answer option (in
Questionnaire.item.item.item.answerOption.valueCoding
whereQuestionnaire.item.item.item.type
=choice
)
Info |
---|
This is possible for any Questionnaire but required for a Questionnaire where QuestionnaireResponse resources are intended to be registered as documents. |
The CodeSystem resources in the Questionnaire Terminology Service can be maintained by users with the Questionnaire Editor role, which has the required permissions.
Creation of CodeSystem and adding of concept (code) - This can be performed by the Questionnaire Editor role in the Terminology Administration Application (see https://ehealth-dk.atlassian.net/wiki/spaces/EDTW/pages/2063892483/eHealth+Applications#Terminology-Administration-Application).
For a CodeSystem with
status
draft
concepts can be modified and removed. Special care should be made the user to ensure use in any Questionnaire is not influenced.
Adding of concept (code) - This can also be performed in the questionnaire editor of the Clinical Administration Application.
Info |
---|
The Questionnaire Terminology Service is based on the generic Terminology Service and can therefore be interacted with in the same way. As it is also registered as a standalone FHIR server in the Terminology Administration Application, it can be chosen as the backend in the application for subsequent administration of questionnaire terminology. Choosing of backend is described in the Terminology Administration Application user manual (in Danish, see https://ehealth-dk.atlassian.net/wiki/spaces/EDTW/pages/2063892483/eHealth+Applications#Terminology-Administration-Application). |
Maintaining and Using Registries for Questionnaire Ids
The eHealth Infrastructure has a Questionnaire Terminology Service for terminology used in certain elements of a Questionnaire.
Info |
---|
Maintaining of registries (NamingSystem) in the Questionnaire Terminology Service is relevant only for use in Questionnaire where QuestionnaireResponse resources are intended to be registered as documents. |
For a Questionnaire where QuestionnaireResponse resources are intended for registering as documents, additional ids are required in:
question group (in
Questionnaire.item.item.externalIdentifier
whereQuestionnaire.item.item.type
=group
, that is, for an inner question group corresponding to a entry/organizer in QRD)question (in
Questionnaire.item.item.item.externalIdentifier
whereQuestionnaire.item.item.item.type
=subtype ofquestion
)enableBehavior (in
Questionnaire.item.item.item.enableBehavior.conditionId
). TheconditionId
is a string so the identifier must be encoded using the technique described in https://ehealth-dk.atlassian.net/wiki/spaces/EDTW/pages/390168637/Guidelines#Format-of-Questionnaire-linkId.
The system used for an externalIdentifier
(in Identifier.system
) must exist as a NamingSystem resource in the Questionnaire Terminology Service.
The same goes for a system encoded in a conditionId
.
Managing Defined Questions/Answers
Anchor | ||||
---|---|---|---|---|
|
Info |
---|
See DefinedQuestion for introduction and use of the resource and its elements. |
...
Expand | ||
---|---|---|
| ||
|
Upload an External Questionnaire Definition to the Infrastructure
Info |
---|
See Relationship between FHIR Questionnaire/QuestionnaireResponse and External Representations for overview and details on how a FHIR Questionnaire in the eHealth Infrastructure can be related to an external document representation as a Questionnaire Forms Definition Document (QFDD). |
Upload of a questionnaire definition represented as a Questionnaire Forms Definition Document (QFDD) to the eHealth Infrastructure is relevant as a preparation for either or both of:
supporting transformation of a FHIR QuestionnaireResponse to a Questionnaire Response Document (QRD)
supporting document registration of a FHIR QuestionnaireResponse as a QRD (implicitly, this involves the before-mentioned transformation as well)
As described in Prerequisites for document registering of QuestionnaireResponse resources to national document sharing infrastructure, the corresponding questionnaire definition must be available as format Questionnaire Forms Definition Document (QFDD) and accessible to external systems in general. In addition, the QFDD must be available within the eHealth Infrastructure and its document id must be referenced from a FHIR Questionnaire that is a near approximation (see Relationship between FHIR Questionnaire/QuestionnaireResponse and External Representations ) of the QFDD, that is, essentially represents the same questionnaire definition.
The steps involved are:
Upload the QFDD representation of the questionnaire definition
Associate a FHIR Questionnaire with the uploaded QFDD representation
Note |
---|
The eHealth Infrastructure does not enforce or validate whether a FHIR Questionnaire associated with a QFDD is indeed a near approximation. It is the responsibility of the user making the association to ensure that the FHIR Questionnaire either is or is updated to be the near approximation. |
Uploading the QFDD
The QFDD must be represented in a DocumentReference and uploaded to the Document-transformation service by the operation $upload-qfdd
described in https://ehealth.sundhed.dk/fhir/OperationDefinition--s-upload-QFDD.html .
Info |
---|
Please note that the description of the operation is valid as of v3.0.0 of the eHealth Infrastructure Implementation Guide (IG) even though the link is to the IG continuous build. Please refer to the latest released version of the IG for all other purposes. |
The requirements for the DocumentReference:
DocumentReference.status
must becurrent
.DocumentReference.type
must be Coding for QFDD (system
="http://loinc.org"
andvalue
="74468-0"
).DocumentReference.description
should contain the title of the questionnaire description. If not assigned, the title within the QFDD document is used (in the service operation$upload-qfdd
).DocumentReference.content.attachment.data
must contain the QFDD (as its xml representation).
Info |
---|
See Uploading and Associating a QFDD for how to associate a FHIR Questionnaire with a QFDD in the Clinical Administration Application. |
Associating a FHIR Questionnaire with the QFDD
As described in Relationship between FHIR Questionnaire/QuestionnaireResponse and External Representations the FHIR Questionnaire must be or ultimately made to be a near approximation of the QFDD for the association to be correct.
To associate a FHIR Questionnaire with a QFDD, the Questionnaire.identifier
must contain the unique document id of the QFDD:
Identifier.system
set tourn:oid:
<Attributeroot
in/ClinicalDocument/id
of the QFDD>Identifier.value
set to <Attributeextension
in/ClinicalDocument/id
of the QFDD>
Note |
---|
The QFDD must be uploaded to the eHealth Infrastructure and associated with a FHIR Questionnaire before a FHIR QuestionnaireResponse can be document registered as a Questionnaire Response Document (QRD). |
Info |
---|
The |
Info |
---|
See Uploading and Associating a QFDD for how to associate a FHIR Questionnaire with a QFDD in the Clinical Administration Application. |