Excerpt | ||
---|---|---|
| ||
The eHealth Infrastructure document-query and document-transformation services provide integrations to the Danish national document-sharing infrastructure. This page describes the eHealth infrastructure capabilities for
|
...
These operations are supported through the following eHealth infrastructure operations provided by the document-query service:
DocumentReference?<query>
see https://docs.ehealth.sundhed.dk/latest-released/igfhir/ehealth-documentreference-search.htmlBinary/$retrieve-document
return document as CDA. See https://docs.ehealth.sundhed.dk/latest-released/igfhir/OperationDefinition-Binary-t-retrieve-document.htmlBinary/$retrieve-and-transform-QRD
return document as FHIR resource. See https://docs.ehealth.sundhed.dk/latest-released/igfhir/OperationDefinition-Bundle-t-retrieve-and-transform-QRD.html. This operation is a little special as it requires QFDD to be present in the infrastructure and the corresponding FHIR Questionnaire. See below.Binary/$retrieve-and-transform-PHMR
return document as FHIR resource. See https://docs.ehealth.sundhed.dk/latest-released/igfhir/OperationDefinition-Bundle-t-retrieve-and-transform-PHMR.htmlBinary/$retrieve-and-transform-APD
return document as FHIR resource. See https://docs.ehealth.sundhed.dk/latest-released/igfhir/OperationDefinition-Bundle-t-retrieve-and-transform-APD.html
Querying document metadata is a necessary step before retrieving the actual document.
...
Transformations Operations between FHIR resources and Danish CDA Profiles
The Document Transformation Service provides operations for transforming documents between FHIR Resources and Danish CDA Profiles. https://ehealth.sundhed.dk/fhir/CapabilityStatement-document-transformation.html
provides operations for transforming documents between FHIR Resources and Danish CDA Profiles.
Details on the transformations are provided in the table below, which includes references to Danish CDA profiles.
...
The transformations are idempotent (except for generated identifiers such as the CDA document ID in the output).
The transformations do not provide access to any FHIR resources. Client Applications must supply the necessary FHIR resources as input. This design prevents security breaches.
Transformation | Source (XML document in FHIR DocumentReference) | Target (XML document in FHIR DocumentReference) | Comment |
---|---|---|---|
|
Bundle of FHIR resources. The primary source of information is a FHIR Observation. | PHMR v1.3 XML document. | Used in assembly, transformation and upload of FHIR Observation transformed to PHMR to XDS-based document sharing infrastructure as described in Sharing through Registering Documents in National Document Sharing Infrastructure. | |
|
Bundle of FHIR resources. The primary source of information is an FHIR QuestionnaireResponse. | QRD v1.3 XML document | Used in assembly, transformation and upload of FHIR QuestionnaireResponse transformed to QRD to XDS-based document sharing infrastructure as described in Sharing through Registering Documents in National Document Sharing Infrastructure. | |
|
Bundle of FHIR resources. The primary source of information is the FHIR Questionnaire. | QFDD v1.1 XML document | ||||
TODO: new link | Bundle of FHIR resources. The primary source of information is the FHIR Questionnaire. | QFDD v1.2 XML document | |||
|
Bundle of FHIR resources. The primary source of information is a FHIR Appointment. | APD v2.0 XML document | Used in assembly, transformation and upload of FHIR Appointment transformed to APD to XDS-based document sharing infrastructure as described in Sharing through Registering Documents in National Document Sharing Infrastructure. | |
|
PHMR v1.3 XML document. | Bundle of FHIR resources. The most significant information is within an FHIR Observation. | The resultingtion(s) is not guaranteed to be a valid FHIR Observation. | |
|
QRD v1.3 XML document | Bundle of FHIR resources. The most significant information is within a FHIR QuestionnaireResponse. | The resulting QuestionnaireResponse is not guaranteed to be a valid FHIR QuestionnaireResponse. | |
|
OperationDefinition--s-transform-from-QRD-based-on-questionnaire.html
| QRD v1.3 XML document | Bundle of FHIR resources Most significant information is within an FHIR QuestionnaireResponse with a structure matching the Questionnaire given as input. The QuestionnaireResponse will have linkIDs matching the corresponding Questionnaire. | The resulting QuestionnaireResponse is not guaranteed to be a valid FHIR QuestionnaireResponse. | ||
|
QFDD v1.1 XML document | Bundle of FHtheR resources. The primary source of information is the FHIR Questionnaire. | ||||
Todo: new link | QFDD v1.2 XML document | The primary resource in the return bundle is the FHIR Questionnaire. | |||
|
APD v2.0 XML document | Bundle of FHIR resources. The primary source of information is a FHIR Appointment. | The resulting Appointment is not guaranteed to be a valid FHIR Appointment. |
HL7 DK CDA Profile | Description | Specification | ||
---|---|---|---|---|
PHMR v1.3 | HL7 Implementation Guide for CDA Release 2.0, Release 1.3 31. March 2014, | http://svn.medcom.dk/svn/releases/Standarder/HL7/PHMR/Dokumentation/PHMR-DK-Profile-v1.3.pdf (Note: The available v1.3 is now updated as of March 2, 2020) | ||
QRD v1.3 | HL7 Implementation Guide for CDA Release 2.0, Release 1.3 February 11th 2022 | https://svn.medcom.dk/svn/drafts/Standarder/HL7/PRO/QRD/Dokumentation/DK-QRD-v1.3.pdf | ||
QFDD v1.1 | HL7 Implementation Guide for CDA Release 2.0, Draft, | http://svn.medcom.dk/svn/releases/Standarder/HL7/PRO/QFDD/Dokumentation/DK-QFDD-v1.1.pdf (Note: The available v1.1 is now updated as of June 11, 2021)APD v2.0 | ||
QFDD v.1.2 | HL7 Implementation Guide for CDA Release 2.0, Draft for Trial Use, | https://svn.medcom.dk/svn/releasesdrafts/Standarder/HL7/PRO/AppointmentQFDD/Dokumentation/DK-APDQFDD-v2v1.0.pdf |
...
APD v2.0 | HL7 Implementation Guide for CDA Release 2.0, Draft for Trial Use, | http://svn.medcom.dk/svn/releases/Standarder/HL7/Appointment/Dokumentation/DK-APD-v2.0.pdf |
Preparing Transformations by Assembling Required FHIR Resources
...
FHIR Resource | Logical Part in Transformation | Comment |
---|---|---|
Observation (referenced from ClinicalImpression) | Observation Details | The Observation is the primary driver of the information contained in the generated PHMR document, including observation code, measured value, reference ranges and so on. |
DocumentationOf (CDA Header) | ||
Device (referenced from | Medical Equipment Section | Possible details about device(s) used. |
Patient (referenced from | Patient Identification | Patient identifier (CPR number), name (given & family), gender, birth date, telecom |
EpisodeOfCare (referenced from | See Author Organization below | https://docs.ehealth.sundhed.dk/latest-released/igfhir/StructureDefinition-ehealth-clinicalimpression-definitions.html#ClinicalImpression.extension:episodeOfCare |
Organization (referenced from | Custodian Organization | SOR ID, name, telecom, address |
Practitioner (possibly referenced from | Author, Author Individual | |
Organization (referenced from | Author, Author Organization | |
Composition (created as part of the assembly) | Document header (CDA Header) | The FHIR Composition resource represents the document and has fixed values as follows:
|
Organization possibly referenced from |
| |
Practitioner/Patient/RelatedPerson/Organization referenced from | Author of observation note | When the |
Practitioner (/Patient possibly referenced from | Observation performer | If the observation performer is of type Practitioner it must be included in the bundle. |
...
FHIR Resource | Logical Part in Transformation | Comment |
---|---|---|
QuestionnaireResponse (referenced from ClinicalImpression) | Question/answer details | The QuestionnaireResponse is the primary driver of the information contained in QRD. |
DocumentationOf (CDA Header) | effectiveTime = | |
Patient (referenced from | Patient identification | identifier (CPR number), name (given & family), gender, birth date, telecom |
EpisodeOfCare (referenced from | See Author Organization below | https://docs.ehealth.sundhed.dk/latest-released/igfhir/StructureDefinition-ehealth-clinicalimpression-definitions.html#ClinicalImpression.extension:episodeOfCare |
Organization (referenced from | Custodian Organization | SOR ID, name, telecom, address |
Practitioner (referenced from | Author Individual | A consequence is that the Practitioner will appear as working in the context of the Author Organization (which is not necessarily the case). |
Organization (referenced from | Author organization | The origin of this Organization is dependent on sharingApprovalPolicy in the
If the FHIR Organization has no SOR type identifier, it is checked if it contains a SOR-relation in |
Composition (created as part of the assembly) | Document header (CDA Header) | FHIR Resource to represent document fixed values
|
Questionnaire (referenced from | Used in Document header (CDA Header) above |
Note on prerequisites for document registering:
|
DocumentReference (soft reference from | QFDD |
|
...
Source (typically FHIR Resource) | Logical Part in Transformation | CDA Document | Details |
---|---|---|---|
Random UUID and details from the Infrastructure’s NamingSystem https://docs.ehealth.sundhed.dk/latest-releasedfhir/ig/NamingSystem-ehealth-identifier.html | Document id | /ClinicalDocument/id |
|
<specific to document type> | Document title | /ClinicalDocument/title | |
System time at the time of transformation | Time of document creation | /ClinicalDocument/effectiveTime | |
<specific to document type> | DocumentationOf (CDA Header) | /ClinicalDocument/documentationOf[0, 1, …] | Code(s) and DateTime |
| Patient identification | /ClinicalDocument/recordTarget/patientRole | CPR-number (identification), name (given & family), gender, birth date, telecom |
<specific to document type> | Author, Author Individual | /ClinicalDocument/author/assignedAuthor/assignedPerson | Name (given & family), prefix |
| Author, Author Organization | /ClinicalDocument/author/assignedAuthor/id /ClinicalDocument/author/assignedAuthor/addr /ClinicalDocument/author/assignedAuthor/telecom /ClinicalDocument/author/assignedAuthor/representedOrganization/name | If If |
| Custodian Organization | /ClinicalDocument/custodian/assignedCustodian/representedCustodianOrganization | |
<specific to document type> | Legal Authenticator | /ClinicalDocument/legalAuthenticator | (Not generally used but depends on the document type) |
n/a | Information Recipient | /ClinicalDocument/informationRecipientOptional | Not used |
n/a | Authenticator | /ClinicalDocument/authenticator | Not used |
n/a | Optional Participant | /ClinicalDocument/participantOptional | Not used |
n/a | Optional In Fulfillment Of | /ClinicalDocument/inFulfillmentOfOptional | Not used |
...
Source (typically FHIR Resource) | Logical Part in Transformation | CDA Document | Details |
---|---|---|---|
n/a | Observation(s) Section - Results | /ClinicalDocument/component/structuredBody/component[2]/section (title=Results) | Grouping of zero, one or more Observations/Observation components |
Observation | Per Observation (or Observation and Observation.component) | /ClinicalDocument/component/structuredBody/component[2]/section/entry/organizer/component/observation/ | |
(if an |
| /ClinicalDocument/component/structuredBody/component[2]/section/entry/organizer/component/ovservation/id | id@extension is set to id@root is set to OID value resolved from Resolving as OID type system is either (in order):
|
A random UUID ( | id@extension is set to random UUID id@root is set to | ||
|
| /ClinicalDocument/component/structuredBody/component[2]/section/entry/organizer/effectiveTime | Start date of observation. If |
|
| /ClinicalDocument/component/structuredBody/component[2]/section/entry/organizer/component/observation/code | SNOMED CT system with value set to nullFlavor. |
/ClinicalDocument/component/structuredBody/component[2]/section/entry/organizer/component/observation/code/translation | |||
|
| /ClinicalDocument/component/structuredBody/component[2]/section/entry/organizer/component/observation/value | Value and unit in percent are converted to unitless decimals (fraction). |
|
| /ClinicalDocument/component/structuredBody/component[2]/section/entry/organizer/component/observation/methodCode | The details for deciding the two method codes can be found in the table below. |
| |||
|
| /ClinicalDocument/component/structuredBody/component[2]/section/entry/organizer/component/observation/referenceRange | As mentioned above, the PHMR reference ranges are inverted ranges compared to the fhir format, so we need to invert the ranges when transforming to fhir. If a yellow range is present we check if there is also a red range, if so we map the yellow range to an interval between the start of the yellow range and the start of the red range. Otherwise, the ranges are open-ended. |
| Comment on observation | /ClinicalDocument/component/structuredBody/component/section/entry/organizer/component/observation/entryRelationship/act | An |
n/a | Observation(s) Section - Vital Signs | /ClinicalDocument/component/structuredBody/component[x]/section (title=Vital Signs) | Grouping of zero, one or more Observations/Observation components. Not used. Empty section created as specified in PHMR profile. |
n/a | Medical Equipment Section | /ClinicalDocument/component/structuredBody/component[3]/section (title=Medical Equipment) | Grouping of one or more Device details |
Device | Per Device in use | /ClinicalDocument/component/structuredBody/component[3]/section/entry/organizer | |
|
| /ClinicalDocument/component/structuredBody/component[3]/section/entry/organizer/participant/participantRole/id | If a serial number or lot number is present on the Device, the id is set to the number with assigningAuthority being the number type and the root: “1.2.208.184“ |
the determined device type code (see below | When no | ||
|
| /ClinicalDocument/component/structuredBody/component[3]/section/entry/organizer/participant/participantRole/playingDevice/code/translation | If a MedCom Instrument Code matches: can be found, it is used. Otherwise set to the nullflavor NI |
|
| /ClinicalDocument/component/structuredBody/component[3]/section/entry/organizer/participant/participantRole/playingDevice/manufacturerModelName | Encoded string comprised of:
|
|
| /ClinicalDocument/component/structuredBody/component[3]/section/entry/organizer/participant/participantRole/playingDevice/softwareName | Encoded string, comprised of |
n/a | External References | Not used |
...
Situation | Error message |
---|---|
| Method codes for performerType and provisionMethod for observation with id {observationId} could not be established |
| Method codes for performerType and provisionMethod for observation with id {observationId} could not be established |
| Invalid Observation.effective, expecting DateTime, Period or Instant |
| The Value should be Quantity type and not null |
| Observation ranges should not have both High and Low set when transforming to PHRM, but High is: {high}, and Low is: {low} |
| The Value should have no more than 7 decimals but is: {value} |
| CPR is mandatory for patients but not present in the fhir bundle |
| Unknown author type: {authorType} |
| Composition.author should either be a Patient or a Practitioner |
| Composition.authorOrganization must contain SOR identifier |
| Composition.attester.party must contain SOR identifier |
| Custodian organization must contain SOR identifier |
| Composition.authorOrganization is mandatory for transformation |
| Custodian is mandatory for transformation |
| Identifier on composition is mandatory |
| Composition.confidentiality is mandatory |
| Composition.subject should be a Patient
|
A Narrative in the Results section and/or Medical Equipment section cannot be generated due to unexpected issues. | Can't generate a narrative for: medical equipment OR Can't generate a narrative for: results |
...
Errors and issues
When transforming from FHIR resources to a PHMR document it is important to ensure the PHMR document is valid while no information is lost during the transformation, therefore an error is thrown when the transformation is not possible. However when transforming from a PHMR document to a FHIR representation, the goal is to preserve as much information as possible and there are no hard requirements for validity . Therefore when of the produced FHIR resources. When it is not possible to translate specific data in the PHMR data document to the FHIR model, instead of throwing an error, an issue describing the situation or missing information is added to the a FHIR OperationOutcome resource which is included in the return bundleBundle. Except for cases where it is not possible to translate the measurement values. In these cases the system throws an error and aborts the transformation.
The situations where an error is thrown and the transformation is aborted:
Situation | Error message |
---|---|
A measurement with type Observation Media is present | Measurement was of media type. This was not translated to an observation since it is not supported in FHIR |
A measurement range with more than 7 decimals is present | Could not transform measurement with reference range Low: %s and High: %s since we cannot correctly translate more than 7 decimals. |
The situations where an issue is raised as a warning in the OperationOutcome:
Situation | Issue message |
---|---|
A method code denoting the provision method is missing | Measurement provision method code is missing |
A method code denoting that the provision method was “typed in by relative” | Provision method of measurement was marked as typed by relative, it is not possible to reflect this in the FHIR model. The usage quality is marked as manually entered. |
A method code denoting that the provision method was “typed in by health care professional” and method code denoting that performer was not “health care professional” | Provision method of measurement was marked as typed by healthcare professional, it is not possible to reflect this in the FHIR model. The usage quality is marked as manually entered. |
A method code denoting that the provision method was “typed in by care giver” and method code denoting that performer was not “care giver” | Provision method of measurement was marked as typed by caregiver, it is not possible to reflect this in the FHIR model. The usage quality is marked as manually entered. |
A method code denoting that the provision method was “typed in by citizen” and method code denoting that performer was not “citizen” | Provision method of measurement was marked as typed by citizen, it is not possible to reflect this in the FHIR model. The usage quality is marked as manually entered. |
A method code denoting that the performer is care giver | It is not possible to discern between care giver and health care professional in the FHIR model. The method code indicated the performer was a care giver. |
A method code denoting that the performer is health care professional | It is not possible to discern between care giver and health care professional in the FHIR model. The method code indicated the performer was a health care professional. |
A method code denoting the performer is missing | Measurement performer code is missing |
The confidentiality code is missing | Confidentiality code is missing |
The confidentiality code is not “N” | Confidentiality code is not supported |
A measurement with a value interval | Measurement contained an interval value. This was not translated to an observation since it is not supported in FHIR |
...
The following are prerequisites for a FHIR Questionnaire (shortened Questionnaire and covering both the ehealth-questionnaire and ehealth-questionnaire-advanced profiles) to be an approximation of a QFDD:
Info |
---|
With FUT-I Release 2024.3_RC-Medcom:
|
At root level of the FHIR Questionnaire, the number of question groups (
Questionnaire.item
withitem.type
set togroup
) shall match the number of QFDD sections for all but QFDD copyright section.Rationale: Copyright is placed in
Questionnaire.copyright
.
For each QFDD section except Information Only sections, the number of FHIR Questionnaire subgroups (
Questionnaire.item.item
withitem.type
set togroup
) shall match the number of QFDD organizers inside the section.The
Questionnaire.item
.item.externalIdentifier
(on a subgroup) shall match the QFDD organizer id.
For each QFDD question within an organizer there shall be a FHIR Questionnaire question item (
Questionnaire.item.item.item
)The
Questionnaire.item
.item.item.externalIdentifier
shall match the QFDD question id.A QFDD question with associated text shall have the associated text represented as a separate FHIR Questionnaire question item (
Questionnaire.item.item.item
)
Calculation type
Questionnaire.item
at any level are allowed in the FHIR Questionnaire without counterpart in the QFDDRationale: Calculations and formulas are not represented in QFDD.
...
Logical Part | QRD Document | Details |
---|---|---|
Numeric Response Pattern Observation | /ClinicalDocument/component/structuredBody/component/section/entry/organizer/component/observation | An item inside a subgroup
Numeric Response if
|
Id | …/observation/id | Uses Id from QFFD question Validating if Questionnaire item( |
Code | …/observation/code | Uses code from Questionnaire item Code: CodeSystem: if CodeSystemName: is fetched from CodeSystem in Questionnaire Terminology. Value is taken in the following order: codeSystem.title, codeSystem.name, codeSystem.url or “Unknown“. Display: OriginalText: Question text ( |
Answer | …/observation/value | Value: For For For QRD Type:
|
Help text Image | …/observation/entryRelationship | Is added if Questionnaire item has one or more extensions: |
External reference | …/observation/reference | The QFDD unique id. From id element and the property 'extension' |
Range | …/observation/referenceRange | If |
...
Logical Part | QRD Document | Details |
---|---|---|
Analog Slider Response Pattern Observation | /ClinicalDocument/component/structuredBody/component/section/entry/organizer/component/observation | An item inside a subgroup
Analog Slider Response if
Properties: id, code, value, entryRelationship and reference is the same configuration as for numeric Response |
Id | …/observation/id | Uses Id from QFFD question Validating if Questionnaire item( |
Code | …/observation/code | Uses code from Questionnaire item Code: CodeSystem: if CodeSystemName: is fetched from CodeSystem in Questionnaire Terminology. Value is taken in the following order: codeSystem.title, codeSystem.name, codeSystem.url or “Unknown“. Display: OriginalText: Question text ( |
Answer | …/observation/value | Value: For For Type:
|
Help text Image | …/observation/entryRelationship | Is added if Questionnaire item has one or more extensions: |
External reference | …/observation/reference | The QFDD unique id. From id element and the property 'extension' |
Range | …/referenceRange/observationRange/ | Denominator: Head: Increment: |
Text Response Pattern Observation
Logical Part | QRD Document | Details |
---|---|---|
Text Response Pattern Observation | /ClinicalDocument/component/structuredBody/component/section/entry/organizer/component/observation | An item inside a subgroup
Test Response if
|
Id | …/observation/id | Uses Id from QFFD question Validating if Questionnaire item( |
Code | …/observation/code | Uses code from Questionnaire item Code: CodeSystem: if CodeSystemName: is fetched from CodeSystem in Questionnaire Terminology. Value is taken in the following order: codeSystem.title, codeSystem.name, codeSystem.url or “Unknown“. Display: OriginalText: Question text ( |
Answer | …/observation/value | Value: For Type: ST |
Help text Image | …/observation/entryRelationship | Is added if Questionnaire item has one or more extensions: |
External reference | …/observation/reference | Value from QFDD. From id element and the property 'extension' |
...
Logical Part | QRD Document | Details |
---|---|---|
Multiple Choice Response Pattern Observation | /ClinicalDocument/component/structuredBody/component/section/entry/organizer/component/observation | An item inside a subgroup
Multiple Choice Response if
|
Id | …/observation/id | Uses Id from QFFD question Validating if Questionnaire item( |
Code | …/observation/code | Uses code from Questionnaire item Code: CodeSystem: if CodeSystemName: is fetched from CodeSystem in Questionnaire Terminology. Value is taken in the following order: codeSystem.title, codeSystem.name, codeSystem.url or “Unknown“. Display: OriginalText: Question text ( |
Answer | …/observation/value | Value: from For Code: CodeSystem: if CodeSystemName: is fetched from CodeSystem in Questionnaire Terminology. Value is taken in the following order: codeSystem.title, codeSystem.name, codeSystem.url or “Unknown“. Display: |
Help text Image Associated text question | …/observation/entryRelationship | Is added if Questionnaire item has one or more extensions:
And if QFDD has associated text question and preconditions are fulfilled. Structure for associated text question in FHIR Questionnaire:
OBS: Supported precondition for Associated text question:
|
External reference | …/observation/reference | The QFDD unique id. From id element and the property 'extension' |
Range | …/observation/referenceRange | If |
...
Logical Part | QRD Document | Details |
---|---|---|
Discrete Slider Response Pattern Observation | /ClinicalDocument/component/structuredBody/component/section/entry/organizer/component/observation | An item inside a subgroup
Multiple Choice Response if
|
Id | …/observation/id | Uses Id from QFFD question Validating if Questionnaire item( |
Code | …/observation/code | Uses code from Questionnaire item Code: CodeSystem: if CodeSystemName: is fetched from CodeSystem in Questionnaire Terminology. Value is taken in the following order: codeSystem.title, codeSystem.name, codeSystem.url or “Unknown“. Display: OriginalText: Question text ( |
Value | …/observation/value | Value: from For Code: CodeSystem: if CodeSystemName: is fetched from CodeSystem in Questionnaire Terminology. Value is taken in the following order: codeSystem.title, codeSystem.name, codeSystem.url or “Unknown“. Display: |
Max occurrence Min occurrence Help text Image | …/observation/entryRelationship | Low: http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs High: http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs always 1 (1 only allowed value for Discrete Slider type) Is added if Questionnaire item has one or more extensions: |
QFDD reference | …/observation/reference | The QFDD unique id. From id element and the property 'extension' |
...
FHIR Questionnaire.item.type | QRD Response Pattern Observation |
---|---|
text, string, openchoice | Text Response Pattern Observation |
choice | Multiple Choice Response Pattern Observation Discrete Slider Response Pattern Observation (when |
decimal, integer | Numeric Response Pattern Observation Analog Slider Response Pattern Observation (when |
datetime | Numeric Response Pattern Observation |
...
QFDD Element | FHIR Questionnaire | Comment |
---|---|---|
Information Only Section | A A single child item | |
Question Section (with one or more Question Organizer) | A For each QFDD Question Organizer: A single child item For each question in the group/QFDD Question Organizer: A single child item | |
Not transformed as algorithms and expressions are not supported in QFDD. | A | A Calculated expression within the questionnaire, see https://ehealth-dk.atlassian.net/wiki/spaces/EDTW/pages/1716060177/Managing+Questionnaires#Defining-a-Calculation-Expression |
...
Info |
---|
With release 2024.3 |
To QFDD Transformation
The operation $transform-to-QFDD
transforms a FHIR Questionnaire resource to a DK-HL7 Questionnaire Form Definition Document (QFDD). The section below describes the transformation in more details.
Structure
As a QFDD is structured by sections, organizers and questions, the FHIR Questionnaire must be structured in a specified way to match the QFDD definition. The table below gives a quick overview of the structure.
QFDD Element | FHIR Questionnaire | Comment | ||
---|---|---|---|---|
Information Only Section | A A single child item | |||
Question Section (with one or more Question Organizer) | A | Root-level group | ||
For each QFDD Question Organizer: A single child item | Subgroup of root-level group | |||
For each question in the group/QFDD Question Organizer: A single child item | Question type item in subgroup of root-level group. For subtypes of | |||
Copyright Section | A
One or more child items
| |||
Not transformed as algorithms and expressions are not supported in QFDD. | A | A Calculated expression within the FHIR Questionnaire, see https://ehealth-dk.atlassian.net/wiki/spaces/EDTW/pages/1716060177/Managing+Questionnaires#Defining-a-Calculation-Expression |
The sub sections below describe the structure and information needed in more details.
Information Only Section
Logical Part | QFDD Document | Details |
---|---|---|
Information Only Section | /ClinicalDocument/component/structuredBody/component/section (with (./templateId | A root-level item with:
|
| …/component/section/title |
|
| …/component/section/text | A child item in the group with:
|
| /ClinicalDocument/languageCode |
|
Narrative guidelines and limitations
FHIR Questionnaire.item.text.xhtml
has type XHTML and QFDD narrative has type XML Markup. Therefore the transformation must convert XHTML to XML Markup which is performed with limitations as described below.
Limitations on conversion of formatted text from FHIR XHTML to XML Markup
The converter supports:
Paragraphs
Headings - converts to paragraphs
Bold, italics, underline
Ordered and unordered list
Line break
Table (might not support all functionality)
Anchor tag ( from a -> linkHTML)
Span (converted to content)
Subscript and superscript
Be aware:
Stylings like color are not supported.
A single root div shall be present
Sanitizer
Info |
---|
SanitizerIn some scenarios, the Questionnaire Editor in the Clinical Administration Application produces XHTML that cannot be converted to CDA XML Markup. Unclosed tags, missing root element or unsupported children elements have been encountered. During conversion, a sanitizer remedies common, encountered scenarios:
|
Note |
---|
DisclaimerUse of copy'n'paste of rich text into the rich text editor in the Questionnaire Editor increases the probability of resulting in incompatible formatted text. The sanitizer handles a limited set of the endless combinations where XHTML and CDA XML Markup do not support the same functionality and structure. |
Questionnaire Form Definition Section
Logical Part | QFDD Document | Details |
---|---|---|
Questionnaire Response Section | /ClinicalDocument/component/structuredBody/component/section | A root item on |
Title | …/component/section/title | From root item |
Narrative | …/component/section/text | The narrative text for the section is created automatically by the transformation . The narrative contains all the questions inside the section. Additional narrative content:
|
Language | languageCode |
|
Questions Organizer
Logical Part | QFDD Document | Details |
---|---|---|
Response Organizer | /ClinicalDocument/component/structuredBody/component/section/entry/organizer | An item of type Only items of type OBS: Items with calculated expression are allowed but is ignored during transformation. |
Id | …/section/entry/organizer/id |
|
Code | …/section/entry/organizer/code | Uses code from Questionnaire item Code: CodeSystem: if CodeSystemName: is fetched from CodeSystem in Questionnaire Terminology. Value is taken in the following order: codeSystem.title, codeSystem.name, codeSystem.url or “Unknown“. Display: OriginalText: Question text ( |
Precondition | …/section/entry/organizer/precondition | See Preconditions |
Numeric Question Pattern Observation
Logical Part | QFDD Document | Details |
---|---|---|
Numeric Response Pattern Observation | /ClinicalDocument/component/structuredBody/component/section/entry/organizer/component/observation | An item inside a subgroup (see Questions Organizer )
Numeric Response if
|
Id | …/observation/id |
|
Code | …/observation/code | Uses code from Questionnaire item Code: CodeSystem: if CodeSystemName: is fetched from CodeSystem in Questionnaire Terminology. Value is taken in the following order: codeSystem.title, codeSystem.name, codeSystem.url or “Unknown“. Display: OriginalText: Question text ( |
Help text Image | …/observation/entryRelationship | Is added if Questionnaire item has one or more extensions: |
Feedback | …/observation/entryRelationship | Not supported |
Range | …/observation/referenceRange | If |
Precondition | See Preconditions |
Analog Slider Question Pattern Observation
Logical Part | QFDD Document | Details |
---|---|---|
Analog Slider Question Pattern Observation | /ClinicalDocument/component/structuredBody/component/section/entry/organizer/component/observation | An item inside a subgroup
Analog Slider if
Properties: id, code, help text, image and precondition is the same configuration as for Numeric Question |
Feedback | …/observation/entryRelationship | Not supported |
Range | …/referenceRange/observationRange/ | Denominator: Head: Increment:
|
Text Question Pattern Observation
Logical Part | QFDD Document | Details |
---|---|---|
Text Question Pattern Observation | /ClinicalDocument/component/structuredBody/component/section/entry/organizer/component/observation | An item inside a subgroup
Test Response if
|
Id | …/observation/id |
|
Code | …/observation/code | Uses code from Questionnaire item Code: CodeSystem: if CodeSystemName: is fetched from CodeSystem in Questionnaire Terminology. Value is taken in the following order: codeSystem.title, codeSystem.name, codeSystem.url or “Unknown“. Display: OriginalText: Question text ( |
Help text Image | …/observation/entryRelationship | Is added if Questionnaire item has one or more extensions: |
Precondition | See Preconditions |
Multiple Choice Question Pattern Observation
Logical Part | QFDD Document | Details |
---|---|---|
Multiple Choice Question Pattern Observation | /ClinicalDocument/component/structuredBody/component/section/entry/organizer/component/observation | An item inside a subgroup
Multiple Choice if
|
Id | …/observation/id |
|
Code | …/observation/code | Uses code from Questionnaire item Code: CodeSystem: if CodeSystemName: is fetched from CodeSystem in Questionnaire Terminology. Value is taken in the following order: codeSystem.title, codeSystem.name, codeSystem.url or “Unknown“. Display: OriginalText: Question text ( |
Options |
| |
Help text Image | …/observation/entryRelationship | Is added if Questionnaire item has one or more extensions: |
Associated text question | Not supported | |
Feedback | Not supported | |
Range | …/observation/referenceRange | Range is based on
See more regarding min and max: https://docs.ehealth.sundhed.dk/latest-released/ig/StructureDefinition-ehealth-questionnaire.html#setting-minimal-and-maximal-number-of-permitted-choices |
Precondition | See Preconditions |
Discrete Slider Question Pattern Observation
Logical Part | QFDD Document | Details |
---|---|---|
Discrete Slider Question Pattern Observation | /ClinicalDocument/component/structuredBody/component/section/entry/organizer/component/observation | An item inside a subgroup
Multiple Choice if
Properties: id, code, help text, image and precondition is the same configuration as for Multiple Choice |
Id | …/observation/id | Uses Id from QFFD question Validating if Questionnaire item( |
Code | …/observation/code | Uses code from Questionnaire item Code: CodeSystem: if CodeSystemName: is fetched from CodeSystem in Questionnaire Terminology. Value is taken in the following order: codeSystem.title, codeSystem.name, codeSystem.url or “Unknown“. Display: OriginalText: Question text ( |
Range | …/observation/entryRelationship | Range is based on Low: http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs High: http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs always 1 (1 only allowed value for Discrete Slider type) See more regarding min and max: https://docs.ehealth.sundhed.dk/latest-released/ig/StructureDefinition-ehealth-questionnaire.html#setting-minimal-and-maximal-number-of-permitted-choices |
Copyright Section
Logical Part | QFDD Document | Details |
---|---|---|
Copyright Section | /ClinicalDocument/component/structuredBody/component/section | Copyright section uses |
...
Info |
---|
With Release 2024.3_RC-Medcom |
Logical Part | QFDD Document | Details |
---|---|---|
Copyright Section | /ClinicalDocument/component/structuredBody/component/section (with (./templateId | A root-level item with:
|
Title | …/component/section/title |
|
Narrative | …/component/section/text | The narrative is automatically generated by the transformation and contains the plain text from each copyright text(entry) separated by three <br/>. Note: When transforming from QFDD to FHIR Questionnaire the narrative is not transformed. |
Entry | ../entry/observation/value | One or more child items in the group with:
Note: When transforming from QFDD the display items will contain the plain text. |
| /ClinicalDocument/languageCode |
|
...
Supported types
FHIR Questionnaire.item.type | QRD Response Pattern Observation |
---|---|
text, string | Text Question Pattern Observation. |
choice | Multiple Choice Question Pattern Observation. Discrete Slider Question Pattern Observation when |
decimal, integer | Numeric Question Pattern Observation. Analog Slider Question Pattern Observation when |
datetime | Numeric Question Pattern Observation |
Validation
The returned Bundle from the operation can contain an OperationOutcome with warnings and errors. In case of validation errors no QFDD will be generated.
Errors
Errors can occur if for instance some mandatory information is missing or the FHIR questionnaire structure is not compatible with the QFDD structure.
Examples:
Invalid root item in questionnaire. Only items of type 'group' and calculated expression items are allowed. Type was: '%s'. LinkId: %s
NamingSystem publisher is missing. Oid: '%s'. Referenced by items with following LinkIds: %s
Item enableWhen refers to item with linkId: '%s' which is of type '%s' but the operator: '%s' is not supported. LinkId: %s
Warnings
Warnings can occur if some information is missing but not mandatory or maybe a fallback value is used instead.
Examples:
CodeSystem title is missing. Will use the first non-null value as CodeSystemName: 'NamingSystem.name', 'NamingSystem.url' or 'unknown'. CodeSystem url: '%s'. Used by items with the following linkIds: %s
CodeSystem title is missing for choice option. Will use the first non-null value as CodeSystemName: 'NamingSystem.name', 'NamingSystem.url' or 'unknown'. CodeSystem url: '%s'. LinkIds: %s
Preconditions
In some scenarios a questions should only be asked to the user based on answers given to other questions. The sections below describes the rules and limitations regarding preconditions.
Precondition rules
As the modeling of preconditions in FHIR questionnaire and QFDD is not 1 to 1 the table below describes which combination of preconditions that are supported.
Question refers to question of type | Condition | |
---|---|---|
Numeric (FHIR type: integer, decimal, timestamp) | If specifying both ">=" and "<=" to the same question then |
|
| ||
If specifying only one operator either ">=" or "<=" to the same numeric question then |
| |
if specifying "=" to a numeric question then |
| |
Choice (FHIR type: choice) | When specifying "=" to a choice question then |
|
text, string | Precondition to text or string questions are not supported. |
Precondition is only allowed on FHIR sub groups(item.item (QFDD organizer)) and questions (item.item.item (QFDD Question)).
If enablebehavior is ‘all’(AllTrue) and no condition-id is specified then the preconditions will be created as QFDD Criterion(s). If condition-id is specified and/or the boolean expression is either ‘all’(AllTrue) or ‘any’(AtLeastOneTrue) then the preconditions will be created as QFDD Precondition Extension Pattern.
Supported operators
FHIR Questionnaire (enableWhen operators) | Comments |
---|---|
exists | Not supported |
= | Supported. If numeric:
If multiple choice
|
!= | Not supported |
> | Not supported |
< | Not supported |
>= | if numeric:
If multiple choice
|
<= | if numeric:
If multiple choice
|
From QFDD Transformation
The operation $transform-from-QFDD
transforms a DK-HL7 Questionnaire Form Definition Document (QFDD) to a FHIR Questionnaire resource. The below sections describes the transformation in more details.
Structure
The transformation generates a FHIR questionnaire which structure is describes in below table. See more details regarding the structure here https://ehealth-dk.atlassian.net/wiki/spaces/EDTW/pages/edit-v2/2242281473#Structure.
QFDD Element | FHIR Questionnaire | Comment | ||
---|---|---|---|---|
Information Only Section | A A single child item | |||
Question Section (with one or more Question Organizer) | A For each QFDD Question Organizer: A single child item For each question in the group/QFDD Question Organizer: A single child item | |||
Copyright Section | A
One or more child items
| |||
Not transformed as algorithms and expressions are not supported in QFDD. | A | A Calculated expression within the questionnaire, see https://ehealth-dk.atlassian.net/wiki/spaces/EDTW/pages/1716060177/Managing+Questionnaires#Defining-a-Calculation-Expression |
Details regarding converting from CDA XML Markup to XHTML - Information Only Section
All CDA XML elements are supported but with some exceptions,
CDA XML element | FHIR XHTML |
---|---|
footnote | p, with a data attribute: data-cda-tag = "footnote" |
footnoteRef | a, with a data attribute data-cda-tag="footnoteRef" |
renderMultiMedia | Limitation: The base64 image to be inside @referencedObject attribute, and not a reference to an existing image from other section from QFDD document. We don't search the image. |
Attributes:
CDA XML attributes | Comment |
---|---|
revised | Attribute on <content> in CDA XML has no corresponding match in XHTML. A custom data attribute has been added ‘data-cda-revised’. |
name | Attribute on <linkHTML> is not supported as NarrativeBlock documentation states “DO NOT USE THIS”. |
language | Always assigned lang=”da”. |
mediaType | Omitted. From NarrativeBlock documentation: mediaType is akin to mimeType. This is a fixed value in the CDA narrative block, and so can be omitted. |
Validation
The returned Bundle from the operation can contain an OperationOutcome with information, warnings and errors. In case of validation errors no FHIR questionnaire will be generated.
Errors
Errors can occur if for instance some mandatory information is missing or QFDD content is not supported in FHIR questionnaire.
Examples:
Unsupported question type: '%s'
(safeguard against future question types supported in CDA Builder. Currently(August 2024) all question types are supported)Choice option is missing either code, codeSystem. Question id: %s
Question is missing id. Organizer id: %s
Precondition group type: '%s' is not supported. Question id: %s
Precondition group type: '%s' is not supported for conditions referring to numeric questions. Only 'AllTrue' is supported. Question id: %s
Warnings
Warnings can occur if some information is missing but not mandatory or content which will not be transformed as it is not supported.
Examples:
Numeric question has no interval. Cannot determine type. Setting item.type to 'decimal'. Question id: %s
Feedback will not be transformed to FHIR questionnaire. Question id: %s
Information
Message unrelated to the transformation success.
Examples:
Question with id: '%s' has associated text question with id: '%s'. The questions will be split into two separate question items in Fhir questionnaire.
Preconditions
In some scenarios a questions should only be asked to the user based on answers given to other questions. The sections below describes the rules and limitations regarding preconditions.
Precondition rules
As the modeling of preconditions in FHIR questionnaire and QFDD is not 1 to 1 the table below describes which combination of preconditions that are supported.
Condition | Rules |
---|---|
If one or more precondition refers to numeric question then | AllTrue(all) is supported. |
If no precondition refers to a numeric question then | AllTrue(all) and AtLeastOneTrue(any) is supported. |
Not supported:
The following precondition types is not supported: AllFalse, AtLeastOneFalse, OnlyOneTrue, OnlyOneFalse.
Multiple grouper (Only one grouper is supported eg. AllTrue).
Additional information
Associated text question which can be part of Multiple Choice and Discrete Slider question will be created as two items in FHIR questionnaire. The item for the associated text question will contain the preconditions specified in the QFDD.
As QFDD Numeric Question do not have a type, reference range is used to determine if it is integer, decimal or timestamp. If no reference range is specified the question item is created with
item.type
‘decimal’.Analog Slider Question is created with
item.type
‘decimal’.Feedback is not supported