Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

$transform-to-PHMR

https://

docs.

ehealth.sundhed.dk/

latest-released/ig

fhir/OperationDefinition--s-transform-to-PHMR.html

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.

$transform-to-QRD

https://

docs.

ehealth.sundhed.dk/

latest-released

fhir/

ig/

OperationDefinition--s-transform-to-QRD.html

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.

$transform-to-QFDD

https://

docs.

ehealth.sundhed.dk/

latest-released/ig

fhir/OperationDefinition--s-transform-to-QFDD.html

Bundle of FHIR resources.

The primary source of information is the FHIR Questionnaire.

QFDD v1.1 XML document

$transform-to-APD

https://

docs.

ehealth.sundhed.dk/

latest-released

fhir/

ig/

OperationDefinition--s-transform-to-APD.html

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.

$transform-from-PHMR

https://

docs.

ehealth.sundhed.dk/

latest-released/ig

fhir/OperationDefinition--s-transform-from-PHMR.html

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.

$transform-from-QRD

https://

docs.

ehealth.sundhed.dk/

latest-released/ig

fhir/OperationDefinition--s-transform-from-QRD.html

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.

$transform-from-QRD-based-on-questionnaire

https://docs.ehealth.sundhed.dk/latest/ig/OperationDefinition--s-transform-from-QRD-based-on-questionnaire.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.

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.

$transform-from-QFDD

https://

docs.

ehealth.sundhed.dk/

latest-released/ig

fhir/OperationDefinition--s-transform-from-QFDD.html

QFDD v1.1 XML document

Bundle of FHtheR resources.

The primary source of information is the FHIR Questionnaire.

$transform-from-APD

https://

docs.

ehealth.sundhed.dk/

latest-released/ig

fhir/OperationDefinition--s-transform-from-APD.html

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,
Personal Healthcare Monitoring Report (PHMR),
(Danish profile – PHMR DK),

Release 1.3 31. March 2014,
Updated 24. April 2018

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,
Questionnaire Response Document,
(Danish profile – DK QRD),

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,
Questionnaire Form Definition Document,
(Danish profile – DK QFDD),

Draft,
Release 1.1 May 19th 2015,
Updated September 28th 2016

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,
Appointment Document,
(Danish profile – DK APD),

Draft for Trial Use,
Release 2.0 November 4th 2019

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 Observation.device)

Medical Equipment Section

Possible details about device(s) used.

Patient (referenced from ClinicalImpression.subject)

Patient Identification

Patient identifier (CPR number), name (given & family), gender, birth date, telecom

EpisodeOfCare (referenced from ClinicalImpression.episodeOfCare)

See Author Organization below

https://docs.ehealth.sundhed.dk/latest-released/igfhir/StructureDefinition-ehealth-clinicalimpression-definitions.html#ClinicalImpression.extension:episodeOfCare

Organization (referenced from EpisodeOfCare.managingOrganization)

Custodian Organization

SOR ID, name, telecom, address

Practitioner (possibly referenced from ClinicalImpression.assessor)

Author, Author Individual

Organization (referenced from ClinicalImpression.assessorOrganization)

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:

  • Document identifier

    • value = randomUUID

    • system = urn:oid: + OID value from NamingSystem.uniqueId.value (where uniqueId.type is oid) from eHealthIdentifier

    • assigner = the value of NamingSystem.publisher in eHealthIdentifier

  • title = “Hjemmemonitorering for “ + <Patient’s CPR identifier value

  • date = ClinicalImpression.effective[x] if present, else now (time of assembly)

  • attester is created if episodeOfCare.caremanagerOrganization is present with:

    • mode set to Composition.CompositionAttestationMode.LEGAL,

    • the party is set to episodeOfCare.CareManagerOrganization

    • time set to the time of assembly

Practitioner/Patient/RelatedPerson/Organization

Author of observation note

When the Observation.note.author contains a reference, the referenced resource needs to be present in the bundle.

Practitioner (possibly referenced from Observation.performer)

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 = QuestionnaireResponse.authored (dateTime)

Patient (referenced from ClinicalImpression.subject)

Patient identification

identifier (CPR number), name (given & family), gender, birth date, telecom

EpisodeOfCare (referenced from ClinicalImpression.episodeOfCare)

See Author Organization below

https://docs.ehealth.sundhed.dk/latest-releasedfhir/ig/StructureDefinition-ehealth-clinicalimpression-definitions.html#ClinicalImpression.extension:episodeOfCare

Organization (referenced from EpisodeOfCare.managingOrganization)

Custodian Organization

SOR ID, name, telecom, address

Practitioner (referenced from ClinicalImpression.assessor)

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 ClinicalImpression.assessorOrganization)

Author organization

The origin of this Organization is dependent on sharingApprovalPolicy in the ServiceRequest

  • If sharing approval is manual this is the organization from the approver's context.

  • If sharing approval is automatic this is the organization from either CarePlan.author or from EpisodeOfCare.caremanagerOrganization in that order.

If the FHIR Organization has no SOR type identifier, it is checked if it contains a SOR-relation in Organization.ehealth-organization-relatedTo.

Composition (created as part of the assembly)

Document header (CDA Header)

FHIR Resource to represent document fixed values

  • Document id

    • value=randomUUID

    • system=” urn:oid: + OID value from NamingSystem.uniqueId.value (where uniqueId.type is oid) from eHealthIdentifier

    • assigner: the value of NamingSystem.publisher in eHealthIdentifier

  • title = same as Questionnaire.title

  • effectiveTime = now (time of assembly)

Questionnaire (referenced from QuestionnaireResponse.questionnaire)

Used in Document header (CDA Header) above

Questionnaire.identifier must contain the unique QFDD document id:

  • Identifier.system set to urn:oid: + <Attribute root in QFDD /ClinicalDocument/id>

  • Identifier.value set to <Attribute extension in QFDD /ClinicalDocument/id>

Note on prerequisites for document registering:

  • The QFDD must be uploaded to the infrastructure before document registration of QRD.

  • The Questionnaire.identifier can contain multiple identifiers but only the identifier for QFDD is allowed to have an Identifier.system starting with the prefix urn:oid:

DocumentReference (soft reference from Questionnaire.identifier )

QFDD

DocumentReference.masterIdentifier shall contain the QFDD document ID (matched in the Questionnaire Questionnaire.identifier).

DocumentReference.status shall be current.

DocumentReference.type must be Coding for QFDD type: system = http://loinc.org and value = 74468-0).

DocumentReference.content.attachment.data shall contain the QFDD XML content.

...

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

  • Document identifier

    • value = randomUUID

    • system =urn:oid: + OID value from NamingSystem.uniqueId.value (where uniqueId.type is oid) from eHealthIdentifier

    • assigner = the value of NamingSystem.publisher in eHealthIdentifier

<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

Composition.subject referencing a Patient

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

Composition.authorOrganization

Author, Author Organization

/ClinicalDocument/author/assignedAuthor/id

/ClinicalDocument/author/assignedAuthor/addr

/ClinicalDocument/author/assignedAuthor/telecom

/ClinicalDocument/author/assignedAuthor/representedOrganization/name

If QuestionnaireResponse.source is a patient, the author is the patient and the ID will be CPR number.

If QuestionnaireResponse.source is a practitioner, the author is a practitioner and it will be a SOR organization.

Composition.custodian

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/

Observation.identifier

(if an Observation.identifier has a system resolvable to OID type)

  • Measurement id

/ClinicalDocument/component/structuredBody/component[2]/section/entry/organizer/component/ovservation/id

id@extension is set to Observation.identifier.value.

id@root is set to OID value resolved from Observation.identifier.system.

Resolving as OID type system is either (in order):

  • Observation.identifier.system prefixed with urn:oid:

  • Observation.identifier.system can be matched to FHIR NamingSystem (in terminology service) which has NamingSystem.uniqueId.value where uniqueId.type is oid

A random UUID

(Observation.identifier has no system resolvable to OID type)

id@extension is set to random UUID

id@root is set to "1.2.208.176.7.200.1" (which is OID type in https://docs.ehealth.sundhed.dk/latest-released/igfhir/NamingSystem-ehealth-identifier.html )

Observation.effective[x]

  • Measurement time

/ClinicalDocument/component/structuredBody/component[2]/section/entry/organizer/effectiveTime

Start date of observation.

If Observation.effective is a Period, the Period.start value is used if present, otherwise it is set to the Period.end.

If Observation.effective is a DateTime or InstantType the value is used.

Observation.code

  • Measurement type

/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

Observation.valueQuantity

  • Measured value, unit

/ClinicalDocument/component/structuredBody/component[2]/section/entry/organizer/component/observation/value

Value and unit in percent are converted to unitless decimals (fraction).

Observation.performer

  • Measurement Method and Measured By (MethodCode)

/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.

Observation.quality

Observation.referenceRange

  • Reference Range

/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.

If the reference ranges are exclusive we encode this in fhir by subtracting or adding a small constant. For the same reason, we are not able to handle values with more than 7 decimals. So we check if any referenceRange value has more than 7 decimals and if that is the case we throw an exception and stop the translation.

Observation.note

Observation.note.authorReference (referencing a Practitioner or Organization)

Comment on observation

/ClinicalDocument/component/structuredBody/component/section/entry/organizer/component/observation/entryRelationship/act

An entryRelationship is added to the observation with LOINC code for Annotation comment (code=48767-8, codeSystem=2.16.840.1.113883.6.1).

The author of the note is mapped like Author Organization and/or Author Individual, depending on Observation.note.authorReference.

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

Device.serialNumber

Device.lotNumber

  • Device identifier

/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 Device.serialNumber or Device.lotNumber is present, the determined device type code is used, with assigningAuthority: "MedCom" and root: "1.2.208.184".

Device.type

Device.manufacturer

Device.deviceName

Device.modelNumber

Device.version.value

  • Device type code

/ClinicalDocument/component/structuredBody/component[3]/section/entry/organizer/participant/participantRole/playingDevice/code/translation

If a MedCom Instrument Code matches:
Device.type
Device.manufacturer
Device.deviceName
Device.modelNumber
Device.version.value

can be found, it is used. Otherwise set to the nullflavor NI

Device.manufacturer

Device.deviceName

Device.modelNumber

  • Manufacturer and Model Name

/ClinicalDocument/component/structuredBody/component[3]/section/entry/organizer/participant/participantRole/playingDevice/manufacturerModelName

Encoded string comprised of:

  • Device manufacturer

  • Device model and model number

Device.serialNumber

Device.lotNumber

Device.version

  • Software Name

/ClinicalDocument/component/structuredBody/component[3]/section/entry/organizer/participant/participantRole/playingDevice/softwareName

Encoded string, comprised of device.version and device.serialNumber or device.lotNumber depending on which is present.

n/a

External References

Not used

...

Situation

Error message

Observation.quality is empty or contains no ehealth-quality with:

  • qualityType = UQ (Usage Quality)

  • qualityCode = http://ehealth.sundhed.dk/cs/usage-quality | automatically-transferred or http://ehealth.sundhed.dk/cs/usage-quality | entered-manullay

Method codes for performerType and provisionMethod for observation with id {observationId} could not be established

Observation.performer references ehealth-organization or ehealth-relatedperson.

Method codes for performerType and provisionMethod for observation with id {observationId} could not be established

Observation.effective is of type Timing. Valid types are: dateTime, Period and instant.

Invalid Observation.effective, expecting DateTime, Period or Instant

Observation.value is missing or is not of type Quantity.

The Value should be Quantity type and not null

Observation.referenceRange component contains both low and high values.

Observation ranges should not have both High and Low set when transforming to PHRM, but High is: {high}, and Low is: {low}

Observation.referenceRange component value contains more than 7 decimals.

The Value should have no more than 7 decimals but is: {value}

Patient.identifier contains no CPR (Danish citizen identifier).

CPR is mandatory for patients but not present in the fhir bundle

Observation.note.author is not of type Reference(Practitioner | Patient | RelatedPerson | Organization) | string.

Unknown author type: {authorType}

Composition.author is missing or is not of type Patient | Practitioner.

Composition.author should either be a Patient or a Practitioner

Composition.authorOrganization does not contain a SOR identifier.

Composition.authorOrganization must contain SOR identifier

Composition.attester organization does not contain a SOR identifier.

Composition.attester.party must contain SOR identifier

Composition.custodian organization does not contain a SOR identifier.

Custodian organization must contain SOR identifier

Composition.authorOrganization is missing.

Composition.authorOrganization is mandatory for transformation

Composition.custodian is missing.

Custodian is mandatory for transformation

Composition.identifier is missing.

Identifier on composition is mandatory

Composition.confidentiality is missing.

Composition.confidentiality is mandatory

Composition.subject is not of type Patient.

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:

...