DK EHMI SBDH IG
0.91.0 - ci-build Denmark flag

DK EHMI SBDH IG, published by MedCom. This guide is not an authorized publication; it is the continuous build for version 0.91.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/medcomdk/dk-ehmi-sbdh/ and changes regularly. See the Directory of published versions

StructureMap: Transformation specification of a MedCom FHIR Messsage to an ehmiSBDH Envelope

Official URL: http://medcomehmi.dk/ig/dk-ehmi-sbdh/StructureMap/MedComMessage2Sbdh-transform Version: 0.91.0
Draft as of 2024-12-10 Computable Name: MedComMessage2SbdhTransform

Transform from a MedCom FHIR Messsage to an ehmiSBDH Envelope

Generated Narrative: StructureMap MedComMessage2Sbdh-transform

map "http://medcomehmi.dk/ig/dk-ehmi-sbdh/StructureMap/MedComMessage2Sbdh-transform" = "MedComMessage2SbdhTransform"

// Transform from a MedCom FHIR Messsage to an ehmiSBDH Envelope

uses "http://medcomfhir.dk/ig/messaging/StructureDefinition/medcom-messaging-message" as source
uses "https://build.fhir.org/ig/medcomdk/dk-ehmi-sbdh/branches/v0.90.1-beta.1/ehmiSBDH/StandardBusinessDocumentHeader.xsd" as target

group HeaderVersion(source source : Bundle, target target : StandardBusinessDocumentHeader) {
  source as HeaderVersion -> target.HeaderVersion = copy() "HeaderVersion";
}

group SbdhSender(source source : Organization, target target : Sender) {
  source.[Bundle.entry[0].resource.sender.reference.resolve().identifier.where(system = 'https://www.gs1.org/gln').value] -> target.StandardBusinessDocumentHeader/Sender/identifier = copy() "SbdhSenderIdentifierValue";
  source as SbdhSenderIdentifierAuthority -> target.StandardBusinessDocumentHeader/Sender/identifier@Authority = copy() "SbdhSenderIdentifierAuthority";
}

group SbdhReceiver(source source : Organization, target target : Receiver) {
  source.[Bundle.entry[0].resource.destination.receiver.reference.resolve().identifier.where(system = 'https://www.gs1.org/gln').value] -> target.StandardBusinessDocumentHeader/Receiver/identifier = copy() "SbdhIdentifierValue";
  source as IdentifierAuthority -> target.StandardBusinessDocumentHeader/Receiver/identifier@Authority = copy() "SbdhReceiverIdentifierAuthority";
}

group SbdhDocumentIdentification(source source : MessageHeader, target target : DocumentIdentification) {
  source.MessageHeader.definition[pre|] -> target.StandardBusinessDocumentHeader/DocumentIdentification/Standard = copy() "SbdhDocumentIdentificationStandard";
  source.MessageHeader.definition[post|] -> target.StandardBusinessDocumentHeader/DocumentIdentification/TypeVersion = copy() "SbdhDocumentIdentificationTypeVersion";
  source as SbdhEnvelopeIdentifier -> target = copy() "SbdhDocumentIdentificationInstanceIdentifier";
  source as SbdhDocumentIdentificationType -> target.StandardBusinessDocumentHeader/DocumentIdentification/Type = copy() "SbdhDocumentIdentificationType";
}

group SbdhDocumentIdentificationCreationDateAndTime(source source : Provenance, target target : DocumentIdentification) {
  source.Provenance.recorded -> target.StandardBusinessDocumentHeader/DocumentIdentification/CreationDateAndTime = copy() "SbdhDocumentIdentificationCreationDateAndTime";
}

group BusinessScopeEdeliveryMessageCommunication(source source : Bundle, target target : sbdhBusinessScope) {
  source default "DOCUMENTID" -> target.Scope[DOCUMENTID]/Type = create() "ScopeDocumentType";
  source.Bundle.id -> target.Scope[DOCUMENTID]/InstanceIdentifier = copy() "ScopeDocumentInstanceIdentifier";
  source default "dk-medcom-messaging" -> target.Scope[DOCUMENTID]/Identifier = create() "ScopeDocumentIdentifier";
  source default "PROCESSID" -> target.Scope[PROCESSID]/Type = create() "ScopeProcessIdType";
  source default "sdn-emergence" -> target.Scope[PROCESSID]/InstanceIdentifier = create() "ScopeProcessIdInstanceIdentifier";
  source default "dk-medcom-messaging" -> target.Scope[PROCESSID]/Identifier = create() "ScopeProcessIdIdentifier";
}

group BusinessScopeHealthMessageCommunication(source source : Bundle, target target : sbdhBusinessScope) {
  source default "PATIENTID" -> target.Scope[PATIENTID]/Type = create() "ScopePatientIdType";
  source.MedComMessagingMessage(Bundle.entry.resource.ofType(Patient).identifier -> target.Scope[PATIENTID]/InstanceIdentifier = copy() "ScopePatientIdInstanceIdentifier";
  source default "dk-medcom-messaging" -> target.Scope[PATIENTID]/Identifier = create() "ScopePatientIdIdentifier";
  source default "SENDERID" -> target.Scope[SENDERID]/Type = create() "ScopeSenderIdType";
  source.MedComMessagingMessage(Bundle.entry.resource.ofType(SenderOrganization).identifier[SOR-ID].value -> target.Scope[SENDERID]/InstanceIdentifier = copy() "ScopeSenderIdInstanceIdentifier";
  source default "dk-medcom-messaging" -> target.Scope[SENDERID]/Identifier = create() "ScopeSenderIdIdentifier";
  source default "RECEIVERID" -> target.Scope[RECEIVERID]/Type = create() "ScopeReceiverIdType";
  source.MedComMessagingMessage(Bundle.entry.resource.ofType(ReceiverOrganization).identifier[SOR-ID].value -> target.Scope[RECEIVERID]/InstanceIdentifier = copy() "ScopeReceiverIdInstanceIdentifier";
  source default "dk-medcom-messaging" -> target.Scope[RECEIVERID]/Identifier = create() "ScopeReceiverIdIdentifier";
  source default "MESSAGEIDENTIFIER" -> target.Scope[MESSAGEIDENTIFIER]/Type = create() "ScopeMessageIdentiferType";
  source.MedComMessagingMessage(Bundle.entry[0].resource.id -> target.Scope[MESSAGEIDENTIFIER]/InstanceIdentifier = copy() "ScopeMessageIdentiferInstanceIdentifier";
  source default "dk-medcom-messaging" -> target.Scope[MESSAGEIDENTIFIER]/Identifier = create() "ScopeMessageIdentiferIdentifier";
  source default "MESSAGEENVELOPEIDENTIFIER" -> target.Scope[MESSAGEENVELOPEIDENTIFIER]/Type = create() "ScopeMessageEnvelopeIdentiferType";
  source.Bundle.id -> target.Scope[MESSAGEENVELOPEIDENTIFIER]/InstanceIdentifier = copy() "ScopeMessageEnvelopeIdentiferInstanceIdentifier";
  source default "dk-medcom-messaging" -> target.Scope[MESSAGEENVELOPEIDENTIFIER]/Identifier = create() "ScopeMessageEnvelopeIdentiferIdentifier";
  source default "ORIGINALMESSAGEIDENTIFIER" -> target.Scope[ORIGINALMESSAGEIDENTIFIER]/Type = create() "ScopeOriginalMessageIdentiferType";
  source.Bundle.id -> target.Scope[ORIGINALMESSAGEIDENTIFIER]/InstanceIdentifier = copy() "ScopeOriginalMessageIdentiferInstanceIdentifier";
  source default "dk-medcom-messaging" -> target.Scope[ORIGINALMESSAGEIDENTIFIER]/Identifier = create() "ScopeOriginalMessageIdentiferIdentifier";
  source default "ORIGINALENVELOPEIDENTIFIER" -> target.Scope[ORIGINALENVELOPEIDENTIFIER]/Type = create() "ScopeOriginalEnvelopeIdentiferType";
  source.Bundle.id -> target.Scope[ORIGINALENVELOPEIDENTIFIER]/InstanceIdentifier = copy() "ScopeOriginalEnvelopeIdentiferInstanceIdentifier";
  source default "dk-medcom-messaging" -> target.Scope[ORIGINALENVELOPEIDENTIFIER]/Identifier = create() "ScopeOriginalEnvelopeIdentiferIdentifier";
  source default "ORIGINALMESSAGESTANDARD" -> target.Scope[ORIGINALMESSAGESTANDARD]/Type = create() "ScopeOriginalMessageStandardType";
  source.Bundle.id -> target.Scope[ORIGINALMESSAGESTANDARD]/InstanceIdentifier = copy() "ScopeOriginalMessageStandardInstanceIdentifier";
  source default "dk-medcom-messaging" -> target.Scope[ORIGINALMESSAGESTANDARD]/Identifier = create() "ScopeOriginalMessageStandardIdentifier";
  source default "ORIGINALMESSAGEVERSION" -> target.Scope[ORIGINALMESSAGEVERSION]/Type = create() "ScopeOriginalMessageVersionType";
  source.Bundle.id -> target.Scope[ORIGINALMESSAGEVERSION]/InstanceIdentifier = copy() "ScopeOriginalMessageVersionInstanceIdentifier";
  source default "dk-medcom-messaging" -> target.Scope[ORIGINALMESSAGEVERSION]/Identifier = create() "ScopeOriginalMessageVersionIdentifier";
}

group BusinessScopeXdsMetadata(source source : Bundle, target target : sbdhBusinessScope) {
  source default "XDS-METADATA" -> target.Scope[XDS-METADATA]/Type = create() "ScopeXdsMetadataType";
  source.Bundle.id -> target.Scope[XDS-METADATA]/InstanceIdentifier = copy() "ScopeXdsMetadataInstanceIdentifier";
  source default "dk-medcom-messaging" -> target.Scope[XDS-METADATA]/Identifier = create() "ScopeXdsMetadataIdentifier";
}

group BusinessScopeSbdhReliableMessaging(source source : Bundle, target target : sbdhBusinessScopeReliableMessaging) {
  source default "EHMI-ReceiptAcknowledgement" -> target.Scope[ReceiptAcknowledgement]/Type = create() "ScopeReceiptAcknowledgement";
  source default "Request" -> target.Scope[ReceiptAcknowledgement]/InstanceIdentifier = create() "ScopeReceiptAcknowledgementInstanceIdentifier";
  source default "dk-medcom-messaging" -> target.Scope[ReceiptAcknowledgement]/Identifier = create() "ScopeReceiptAcknowledgementIdentifier";
  source default "RequestingDocumentCreationDateTime" -> target.CorrelationInformation/RequestingDocumentCreationDateTime = create() "CorrelationInformationRequestingDocumentCreationDateTime";
  source default "RequestingDocumentInstanceIdentifier" -> target.CorrelationInformation/RequestingDocumentInstanceIdentifier = create() "CorrelationInformationRequestingDocumentInstanceIdentifier";
  source default "ExpectedResponseDateTime" -> target.CorrelationInformation/ExpectedResponseDateTime = create() "CorrelationInformationExpectedResponseDateTime";
}

group BusinessServicesRequest(source source : Bundle, target target : sbdhBusinessScopeBusinessServices) {
  source default "EHMI-ReceiptAcknowledgement-Request" -> target.BusinessService/ServiceName = create() "BusinessServiceReceiptAcknowledgementRequest";
  source default "RequestingServiceTransaction" -> target.BusinessService/ServiceTransaction/TypeOfServiceTransaction = create() "ServiceTransactionTypeOfServiceTransaction";
  source default "false" -> target.BusinessService/ServiceTransaction/IsNonRepudiationRequired = create() "ServiceTransactionIsNonRepudiationRequired";
  source default "false" -> target.BusinessService/ServiceTransaction/IsAuthenticationRequired = create() "ServiceTransactionIsAuthenticationRequired";
  source default "false" -> target.BusinessService/ServiceTransaction/IsNonRepudiationOfReceiptRequired = create() "ServiceTransactionIsNonRepudiationOfReceiptRequired";
  source default "false" -> target.BusinessService/ServiceTransaction/IsIntelligibleCheckRequired = create() "ServiceTransactionIsIntelligibleCheckRequired";
  source default "false" -> target.BusinessService/ServiceTransaction/IsApplicationErrorResponseRequested = create() "ServiceTransactionIsApplicationErrorResponseRequested";
  source default "300000" -> target.BusinessService/ServiceTransaction/TimeToAcknowledgeReceipt = create() "ServiceTransactionTimeToAcknowledgeReceipt";
  source default "0" -> target.BusinessService/ServiceTransaction/TimeToAcknowledgeAcceptance = create() "ServiceTransactionTimeToAcknowledgeAcceptance";
  source default "0" -> target.BusinessService/ServiceTransaction/TimeToPerform = create() "ServiceTransactionTimeToPerform";
  source default "0" -> target.BusinessService/ServiceTransaction/Recurrence = create() "ServiceTransactionRecurrence";
}