Some FHIR resources in the eHealth Infrastructure are transformed to document form and registered in national document sharing infrastructure. This way, the patient and other healthcare professionals can access the health data registered through other health systems while subjected to various access controls and audit logging.
The document registering process involves:
determining whether criteria for document registering are met
assembly to a volatile (in-memory) FHIR Composition (as described in https://ehealth-dk.atlassian.net/wiki/spaces/EDTW/pages/2242281473/Performing+Document+Query+and+Retrieve+and+Using+Transformations#Preparing-Transformations-by-Assembling-Required-FHIR-Resources )
transformation of assembled FHIR Composition to Danish profiles of Clinical Document Architecture (CDA) documents (as described in https://ehealth-dk.atlassian.net/wiki/spaces/EDTW/pages/2242281473/Performing+Document+Query+and+Retrieve+and+Using+Transformations#Transformation-Details ) to a document
extract of document metadata from the document and context
registering of document and document metadata in the national document sharing infrastructure.
Primary FHIR Resource Type | Assembling of Resources for Transformation | Transformation | Registered as Document Type |
---|---|---|---|
https://ehealth.sundhed.dk/fhir/OperationDefinition--s-transform-to-PHMR.html | |||
https://ehealth.sundhed.dk/fhir/OperationDefinition--s-transform-to-QRD.html | |||
https://ehealth.sundhed.dk/fhir/OperationDefinition--s-transform-to-APD.html | APD |
This description below focuses on the criteria for this registration to take place.
Content
Table of Content Zone | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||
Prerequisites for Document Registering of Observation ResourcesPrerequisites for registering a document about a FHIR Observation are all of:
Prerequisites for Document Registering of QuestionnaireResponse ResourcesPrerequisites for registering a document about a FHIR QuestionnaireResponse are all of:
Prerequisites for Document Registering of Appointment ResourcesPrerequisites for registering a document about an Appointment are all of:
Document Transformation and Registration ProcessingThe transformation of resources to documents and the subsequent registration to the national document sharing infrastructure is an automatic procedure split in two different processes. The initial process is event driven and is the first attempt at transforming and registering the transformed document. However, a periodic job will attempt to retry the transformation and registration of documents that failed due to either a lack of organizational identification using SOR-ID or a failed registration. Event Triggered Transformation and RegistrationThe event driven process goes through the five steps outlined at the top of the page.
If an error occurs during the processing of a resource, the event that triggered it is rolled back. The event is then automatically retried for some time before being put aside on a dead-letter-queue (DLQ) if it keeps failing. The only two exceptions to this are:
Book-keeping of attempts is done internally in the Document-Transformation service in the form of FHIR DocumentReference resources formatted specifically to indicate how far in the process it came:
The following three distinct progressions in the transformation and registration process can be discerned using these elements:
Periodic Retry of Transformation and RegistrationThe periodic retry job starts by finding the DocumentReference resources for retry based on their distinct qualities (see above). Two different flows are used depending on whether the resources should retry just registration or both transformation and registration. However, the flows both start by checking that the attempt has not been superseded by another successful attempt or a newer document. If so, the DocumentReference is persisted with If only registration is retried, then there are only two primary steps.
Should the registration fail once again, an error message is persisted in the DocumentReference, but is still retried again in next period of the periodic retry job. If both transformation and registration needs to be retried, the process is very similar to that of the event driven procedure.
If the SOR-ID is still missing, the retry of the DocumentReference is abandoned, but is retried again the next time. However, should the transformation happen to fail due to something else, after the missing SOR-ID has been corrected, the error will be persisted in the DocumentReference resource and will not be retried again in the future, as only the SOR-ID transformation error is currently expected to be correctable (here by external correction in municipal organizational registration, see above). |
Document Metadata for Document Registering
The eHealth Infrastructure prepares document metadata that adhere to:
Version 0.96 dated 24 October 2018 of XDS Metadata for Document Profile, Danish Profile
Version 1.0.1 of XDS Metadata ValueSet, Danish Profile
The document metadata described here are those prepared in the IHE XDS.b DocumentEntry structure cf. XDS Metadata for Document Profile, Danish Profile, consisting of a number of attributes.
For the most part, document metadata attributes associated with a document reflects values within the document. Notably, there are the following two exceptions:
DocumentEntry attribute practiceSettingCode - which reflects the clinical specialty in which the document was authored. The eHealth Infrastructure uses an organisational specialty, as described below.
DocumentEntry attribute healthcareFacilityTypeCode - which reflects the organisational unit type
Determining the Organisational Context
The organisational context to use as source for the two document metadata attributes depends on the FHIR resource type which served as the primary driver of the document content:
For FHIR Observation and FHIR QuestionnaireResponse resources, the FHIR Organization is the one referenced from the
ClinicalImpression.assessorOrganization
of the FHIR ClinicalImpression approving document sharing.For FHIR Appointment resources, the FHIR Organization is the one referenced in
Appointment.responsibleOrganization
.
Determining the practiceSettingCode Attribute Value
Whether a FHIR Organization specialty is primary or regular is determined from the Organization.specialty.primaryIndicator
, see https://ehealth.sundhed.dk/fhir/StructureDefinition-ehealth-organization-specialty.html .
Info |
---|
After release 2024.4
|
If the FHIR Organization has SOR source (has been imported from SOR), then the first primary specialty found on that specific Organization is used, if no primary specialty is present the first regular specialty is used.
The determined specialty code is validated against the IHE XDS ValueSet https://ehealth.sundhed.dk/fhir/ValueSet-dk-ihe-practicesettingcode-vs.html . When valid, the value is used, otherwise the document registering is terminated.
Determining the healthcareFacilityTypeCode Attribute Value
The value of Organization.type
is validated against the IHE XDS ValueSet https://ehealth.sundhed.dk/fhir/ValueSet-dk-ihe-healthcarefacilitytypecode-vs.html . When valid, the value is used, otherwise the document registering is terminated.