...
Transformations Operations between FHIR resources and Danish CDA Profiles
The Document Transformation Service https://ehealth.sundhed.dk/fhir/CapabilityStatement-document-transformation.html
provides operations for transforming documents between FHIR Resources and 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 | ||
|
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. | |||
| 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. | ||
|
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 | 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 |
...
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:
|
Practitioner/Patient/RelatedPerson/Organization | Author of observation note | When the |
Practitioner (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-releasedfhir/ig/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-released/igfhir/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 |
...
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:
...