DK EHMI SBDH IG
1.0.2 - release Denmark flag

DK EHMI SBDH IG, published by MedCom. This guide is not an authorized publication; it is the continuous build for version 1.0.2 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

: Transform a MedcomMessagingMessage to an ehmiSBDH-Envelope - XML Representation

Draft as of 2025-09-03

Raw xml | Download


<StructureMap xmlns="http://hl7.org/fhir">
  <id value="MedComMessagingMessage2ehmiSbdh-transform"/>
  <text>
    <status value="generated"/>
    <div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: StructureMap MedComMessagingMessage2ehmiSbdh-transform</b></p><a name="MedComMessagingMessage2ehmiSbdh-transform"> </a><a name="hcMedComMessagingMessage2ehmiSbdh-transform"> </a><pre class="fml">
<b>map</b><span style="color: navy"> &quot;</span>http://medcomehmi.dk/ig/dk-ehmi-sbdh/StructureMap/MedcomMessagingMessage2Sbdh-transform<span style="color: navy">&quot; = &quot;</span>MedcomMessagingMessage2SbdhTransform<span style="color: navy">&quot;

</span><span style="color: navy">// </span><span style="color: green">Transform from a MedCom Messaging Messsage to an ehmiSBDH-Envelope</span>

<b>uses</b><span style="color: navy"> &quot;</span><a href="https://build.fhir.org/ig/medcomdk/dk-medcom-messaging/StructureDefinition-medcom-messaging-message.html" title="MedComMessagingMessage">http://medcomfhir.dk/ig/messaging/StructureDefinition/medcom-messaging-message</a><span style="color: navy">&quot; </span><b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> &quot;</span>https://build.fhir.org/ig/medcomdk/dk-ehmi-sbdh/ehmiSBDH/StandardBusinessDocumentHeader.xsd<span style="color: navy">&quot; </span><b>as </b><b>target</b>

<b>group </b>HeaderVersion<span style="color: navy">(</span><b>source</b> <span style="color: maroon">source</span><span style="color: navy"> : </span>Bundle, <b>target</b> <span style="color: maroon">target</span><span style="color: navy"> : </span>StandardBusinessDocumentHeader<span style="color: navy">)</span><span style="color: navy"> {
</span>  source<b> default </b>&quot;1.0&quot;<b> as </b><span style="color: maroon">HeaderVersion</span><span style="color: navy"><b> -&gt; </b></span>target.StandardBusinessDocumentHeader/HeaderVersion = <b>create</b><span style="color: navy">(</span><span style="color: navy">)</span> <i>&quot;HeaderVersion&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>SbdhSender<span style="color: navy">(</span><b>source</b> <span style="color: maroon">source</span><span style="color: navy"> : </span>Organization, <b>target</b> <span style="color: maroon">target</span><span style="color: navy"> : </span>Sender<span style="color: navy">)</span><span style="color: navy"> {
</span>  source.[Bundle.entry[0].resource.sender.reference.resolve().identifier.where(system = 'https://www.gs1.org/gln').value]<span style="color: navy"><b> -&gt; </b></span>target.StandardBusinessDocumentHeader/Sender/identifier = <b>copy</b><span style="color: navy">(</span><span style="color: navy">)</span> <i>&quot;SbdhSenderIdentifierValue&quot;</i><span style="color: navy">;</span>
  source<b> default </b>&quot;iso6523-actorid-upis&quot;<b> as </b><span style="color: maroon">SbdhSenderIdentifierAuthority</span><span style="color: navy"><b> -&gt; </b></span>target.StandardBusinessDocumentHeader/Sender/identifier@Authority = <b>create</b><span style="color: navy">(</span><span style="color: navy">)</span> <i>&quot;SbdhSenderIdentifierAuthority&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>SbdhReceiver<span style="color: navy">(</span><b>source</b> <span style="color: maroon">source</span><span style="color: navy"> : </span>Organization, <b>target</b> <span style="color: maroon">target</span><span style="color: navy"> : </span>Receiver<span style="color: navy">)</span><span style="color: navy"> {
</span>  source.[Bundle.entry[0].resource.destination.receiver.reference.resolve().identifier.where(system = 'https://www.gs1.org/gln').value]<span style="color: navy"><b> -&gt; </b></span>target.StandardBusinessDocumentHeader/Receiver/identifier = <b>copy</b><span style="color: navy">(</span><span style="color: navy">)</span> <i>&quot;SbdhIdentifierValue&quot;</i><span style="color: navy">;</span>
  source<b> default </b>&quot;iso6523-actorid-upis&quot;<b> as </b><span style="color: maroon">IdentifierAuthority</span><span style="color: navy"><b> -&gt; </b></span>target.StandardBusinessDocumentHeader/Receiver/identifier@Authority = <b>create</b><span style="color: navy">(</span><span style="color: navy">)</span> <i>&quot;SbdhReceiverIdentifierAuthority&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>SbdhDocumentIdentification<span style="color: navy">(</span><b>source</b> <span style="color: maroon">source</span><span style="color: navy"> : </span>MessageHeader, <b>target</b> <span style="color: maroon">target</span><span style="color: navy"> : </span>DocumentIdentification<span style="color: navy">)</span><span style="color: navy"> {
</span>  source.MessageHeader.definition[pre|]<span style="color: navy"><b> -&gt; </b></span>target.StandardBusinessDocumentHeader/DocumentIdentification/Standard = <b>copy</b><span style="color: navy">(</span><span style="color: navy">)</span> <i>&quot;SbdhDocumentIdentificationStandard&quot;</i><span style="color: navy">;</span>
  source.MessageHeader.definition[post|]<span style="color: navy"><b> -&gt; </b></span>target.StandardBusinessDocumentHeader/DocumentIdentification/TypeVersion = <b>copy</b><span style="color: navy">(</span><span style="color: navy">)</span> <i>&quot;SbdhDocumentIdentificationTypeVersion&quot;</i><span style="color: navy">;</span>
  source<b> as </b><span style="color: maroon">SbdhEnvelopeIdentifier</span><span style="color: navy"><b> -&gt; </b></span>target = <b>copy</b><span style="color: navy">(</span><span style="color: navy">)</span> <i>&quot;SbdhDocumentIdentificationInstanceIdentifier&quot;</i><span style="color: navy">;</span>
  source<b> default </b>&quot;Bundle&quot;<b> as </b><span style="color: maroon">SbdhDocumentIdentificationType</span><span style="color: navy"><b> -&gt; </b></span>target.StandardBusinessDocumentHeader/DocumentIdentification/Type = <b>copy</b><span style="color: navy">(</span><span style="color: navy">)</span> <i>&quot;SbdhDocumentIdentificationType&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>SbdhDocumentIdentificationCreationDateAndTime<span style="color: navy">(</span><b>source</b> <span style="color: maroon">source</span><span style="color: navy"> : </span>Provenance, <b>target</b> <span style="color: maroon">target</span><span style="color: navy"> : </span>DocumentIdentification<span style="color: navy">)</span><span style="color: navy"> {
</span>  source.Provenance.recorded<span style="color: navy"><b> -&gt; </b></span>target.StandardBusinessDocumentHeader/DocumentIdentification/CreationDateAndTime = <b>copy</b><span style="color: navy">(</span><span style="color: navy">)</span> <i>&quot;SbdhDocumentIdentificationCreationDateAndTime&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>BusinessScopeEdeliveryMessageCommunication<span style="color: navy">(</span><b>source</b> <span style="color: maroon">source</span><span style="color: navy"> : </span>Bundle, <b>target</b> <span style="color: maroon">target</span><span style="color: navy"> : </span>sbdhBusinessScope<span style="color: navy">)</span><span style="color: navy"> {
</span>  source<b> default </b>&quot;DOCUMENTID&quot;<span style="color: navy"><b> -&gt; </b></span>target.Scope[DOCUMENTID]/Type = <b>create</b><span style="color: navy">(</span><span style="color: navy">)</span> <i>&quot;ScopeDocumentType&quot;</i><span style="color: navy">;</span>
  source.Bundle.id<span style="color: navy"><b> -&gt; </b></span>target.Scope[DOCUMENTID]/InstanceIdentifier = <b>copy</b><span style="color: navy">(</span><span style="color: navy">)</span> <i>&quot;ScopeDocumentInstanceIdentifier&quot;</i><span style="color: navy">;</span>
  source<b> default </b>&quot;dk-medcom-messaging&quot;<span style="color: navy"><b> -&gt; </b></span>target.Scope[DOCUMENTID]/Identifier = <b>create</b><span style="color: navy">(</span><span style="color: navy">)</span> <i>&quot;ScopeDocumentIdentifier&quot;</i><span style="color: navy">;</span>
  source<b> default </b>&quot;PROCESSID&quot;<span style="color: navy"><b> -&gt; </b></span>target.Scope[PROCESSID]/Type = <b>create</b><span style="color: navy">(</span><span style="color: navy">)</span> <i>&quot;ScopeProcessIdType&quot;</i><span style="color: navy">;</span>
  source<b> default </b>&quot;sdn-emergence&quot;<span style="color: navy"><b> -&gt; </b></span>target.Scope[PROCESSID]/InstanceIdentifier = <b>create</b><span style="color: navy">(</span><span style="color: navy">)</span> <i>&quot;ScopeProcessIdInstanceIdentifier&quot;</i><span style="color: navy">;</span>
  source<b> default </b>&quot;dk-medcom-messaging&quot;<span style="color: navy"><b> -&gt; </b></span>target.Scope[PROCESSID]/Identifier = <b>create</b><span style="color: navy">(</span><span style="color: navy">)</span> <i>&quot;ScopeProcessIdIdentifier&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

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

</span><b>group </b>BusinessScopeXdsMetadata<span style="color: navy">(</span><b>source</b> <span style="color: maroon">source</span><span style="color: navy"> : </span>Bundle, <b>target</b> <span style="color: maroon">target</span><span style="color: navy"> : </span>sbdhBusinessScope<span style="color: navy">)</span><span style="color: navy"> {
</span>  source<b> default </b>&quot;XDS-METADATA&quot;<span style="color: navy"><b> -&gt; </b></span>target.Scope[XDS-METADATA]/Type = <b>create</b><span style="color: navy">(</span><span style="color: navy">)</span> <i>&quot;ScopeXdsMetadataType&quot;</i><span style="color: navy">;</span>
  source.Bundle.id<span style="color: navy"><b> -&gt; </b></span>target.Scope[XDS-METADATA]/InstanceIdentifier = <b>copy</b><span style="color: navy">(</span><span style="color: navy">)</span> <i>&quot;ScopeXdsMetadataInstanceIdentifier&quot;</i><span style="color: navy">;</span>
  source<b> default </b>&quot;dk-medcom-messaging&quot;<span style="color: navy"><b> -&gt; </b></span>target.Scope[XDS-METADATA]/Identifier = <b>create</b><span style="color: navy">(</span><span style="color: navy">)</span> <i>&quot;ScopeXdsMetadataIdentifier&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>BusinessScopeSbdhReliableMessaging<span style="color: navy">(</span><b>source</b> <span style="color: maroon">source</span><span style="color: navy"> : </span>Bundle, <b>target</b> <span style="color: maroon">target</span><span style="color: navy"> : </span>sbdhBusinessScopeReliableMessaging<span style="color: navy">)</span><span style="color: navy"> {
</span>  source<b> default </b>&quot;EHMI-ReceiptAcknowledgement&quot;<span style="color: navy"><b> -&gt; </b></span>target.Scope[ReceiptAcknowledgement]/Type = <b>create</b><span style="color: navy">(</span><span style="color: navy">)</span> <i>&quot;ScopeReceiptAcknowledgement&quot;</i><span style="color: navy">;</span>
  source<b> default </b>&quot;Request&quot;<span style="color: navy"><b> -&gt; </b></span>target.Scope[ReceiptAcknowledgement]/InstanceIdentifier = <b>create</b><span style="color: navy">(</span><span style="color: navy">)</span> <i>&quot;ScopeReceiptAcknowledgementInstanceIdentifier&quot;</i><span style="color: navy">;</span>
  source<b> default </b>&quot;dk-medcom-messaging&quot;<span style="color: navy"><b> -&gt; </b></span>target.Scope[ReceiptAcknowledgement]/Identifier = <b>create</b><span style="color: navy">(</span><span style="color: navy">)</span> <i>&quot;ScopeReceiptAcknowledgementIdentifier&quot;</i><span style="color: navy">;</span>
  source<b> default </b>&quot;RequestingDocumentCreationDateTime&quot;<span style="color: navy"><b> -&gt; </b></span>target.CorrelationInformation/RequestingDocumentCreationDateTime = <b>create</b><span style="color: navy">(</span><span style="color: navy">)</span> <i>&quot;CorrelationInformationRequestingDocumentCreationDateTime&quot;</i><span style="color: navy">;</span>
  source<b> default </b>&quot;RequestingDocumentInstanceIdentifier&quot;<span style="color: navy"><b> -&gt; </b></span>target.CorrelationInformation/RequestingDocumentInstanceIdentifier = <b>create</b><span style="color: navy">(</span><span style="color: navy">)</span> <i>&quot;CorrelationInformationRequestingDocumentInstanceIdentifier&quot;</i><span style="color: navy">;</span>
  source<b> default </b>&quot;ExpectedResponseDateTime&quot;<span style="color: navy"><b> -&gt; </b></span>target.CorrelationInformation/ExpectedResponseDateTime = <b>create</b><span style="color: navy">(</span><span style="color: navy">)</span> <i>&quot;CorrelationInformationExpectedResponseDateTime&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

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

</span></pre></div>
  </text>
  <url
       value="http://medcomehmi.dk/ig/dk-ehmi-sbdh/StructureMap/MedcomMessagingMessage2Sbdh-transform"/>
  <version value="1.0.2"/>
  <name value="MedcomMessagingMessage2SbdhTransform"/>
  <title
         value="Transformation specification of a MedcomMessagingMessage to an ehmiSBDH-Envelope "/>
  <status value="draft"/>
  <date value="2025-09-03T09:35:04+00:00"/>
  <publisher value="MedCom"/>
  <contact>
    <name value="MedCom"/>
    <telecom>
      <system value="url"/>
      <value value="http://medcom.dk"/>
    </telecom>
  </contact>
  <description
               value="Transform from a MedCom Messaging Messsage to an ehmiSBDH-Envelope"/>
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166"/>
      <code value="DK"/>
      <display value="Denmark"/>
    </coding>
  </jurisdiction>
  <structure>
    <url
         value="http://medcomfhir.dk/ig/messaging/StructureDefinition/medcom-messaging-message"/>
    <mode value="source"/>
  </structure>
  <structure>
    <url
         value="https://build.fhir.org/ig/medcomdk/dk-ehmi-sbdh/ehmiSBDH/StandardBusinessDocumentHeader.xsd"/>
    <mode value="target"/>
  </structure>
  <group>
    <name value="HeaderVersion"/>
    <typeMode value="none"/>
    <input>
      <name value="source"/>
      <type value="Bundle"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="target"/>
      <type value="StandardBusinessDocumentHeader"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="HeaderVersion"/>
      <source>
        <context value="source"/>
        <defaultValueString value="1.0"/>
        <variable value="HeaderVersion"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="StandardBusinessDocumentHeader/HeaderVersion"/>
        <transform value="create"/>
      </target>
    </rule>
  </group>
  <group>
    <name value="SbdhSender"/>
    <typeMode value="none"/>
    <input>
      <name value="source"/>
      <type value="Organization"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="target"/>
      <type value="Sender"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="SbdhSenderIdentifierValue"/>
      <source>
        <context value="source"/>
        <element
                 value="[Bundle.entry[0].resource.sender.reference.resolve().identifier.where(system = 'https://www.gs1.org/gln').value]"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="StandardBusinessDocumentHeader/Sender/identifier"/>
        <transform value="copy"/>
      </target>
    </rule>
    <rule>
      <name value="SbdhSenderIdentifierAuthority"/>
      <source>
        <context value="source"/>
        <defaultValueString value="iso6523-actorid-upis"/>
        <variable value="SbdhSenderIdentifierAuthority"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element
                 value="StandardBusinessDocumentHeader/Sender/identifier@Authority"/>
        <transform value="create"/>
      </target>
    </rule>
  </group>
  <group>
    <name value="SbdhReceiver"/>
    <typeMode value="none"/>
    <input>
      <name value="source"/>
      <type value="Organization"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="target"/>
      <type value="Receiver"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="SbdhIdentifierValue"/>
      <source>
        <context value="source"/>
        <element
                 value="[Bundle.entry[0].resource.destination.receiver.reference.resolve().identifier.where(system = 'https://www.gs1.org/gln').value]"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="StandardBusinessDocumentHeader/Receiver/identifier"/>
        <transform value="copy"/>
      </target>
    </rule>
    <rule>
      <name value="SbdhReceiverIdentifierAuthority"/>
      <source>
        <context value="source"/>
        <defaultValueString value="iso6523-actorid-upis"/>
        <variable value="IdentifierAuthority"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element
                 value="StandardBusinessDocumentHeader/Receiver/identifier@Authority"/>
        <transform value="create"/>
      </target>
    </rule>
  </group>
  <group>
    <name value="SbdhDocumentIdentification"/>
    <typeMode value="none"/>
    <input>
      <name value="source"/>
      <type value="MessageHeader"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="target"/>
      <type value="DocumentIdentification"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="SbdhDocumentIdentificationStandard"/>
      <source>
        <context value="source"/>
        <element value="MessageHeader.definition[pre|]"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element
                 value="StandardBusinessDocumentHeader/DocumentIdentification/Standard"/>
        <transform value="copy"/>
      </target>
    </rule>
    <rule>
      <name value="SbdhDocumentIdentificationTypeVersion"/>
      <source>
        <context value="source"/>
        <element value="MessageHeader.definition[post|]"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element
                 value="StandardBusinessDocumentHeader/DocumentIdentification/TypeVersion"/>
        <transform value="copy"/>
      </target>
    </rule>
    <rule>
      <name value="SbdhDocumentIdentificationInstanceIdentifier"/>
      <source>
        <context value="source"/>
        <variable value="SbdhEnvelopeIdentifier"/>
      </source>
      <target
              id="StandardBusinessDocumentHeader/DocumentIdentification/InstanceIdentifier">
        <context value="target"/>
        <contextType value="variable"/>
        <transform value="copy"/>
      </target>
    </rule>
    <rule>
      <name value="SbdhDocumentIdentificationType"/>
      <source>
        <context value="source"/>
        <defaultValueCode value="Bundle"/>
        <variable value="SbdhDocumentIdentificationType"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element
                 value="StandardBusinessDocumentHeader/DocumentIdentification/Type"/>
        <transform value="copy"/>
      </target>
    </rule>
  </group>
  <group>
    <name value="SbdhDocumentIdentificationCreationDateAndTime"/>
    <typeMode value="none"/>
    <input>
      <name value="source"/>
      <type value="Provenance"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="target"/>
      <type value="DocumentIdentification"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="SbdhDocumentIdentificationCreationDateAndTime"/>
      <source>
        <context value="source"/>
        <element value="Provenance.recorded"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element
                 value="StandardBusinessDocumentHeader/DocumentIdentification/CreationDateAndTime"/>
        <transform value="copy"/>
      </target>
    </rule>
  </group>
  <group>
    <name value="BusinessScopeEdeliveryMessageCommunication"/>
    <typeMode value="none"/>
    <input>
      <name value="source"/>
      <type value="Bundle"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="target"/>
      <type value="sbdhBusinessScope"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="ScopeDocumentType"/>
      <source>
        <context value="source"/>
        <defaultValueString value="DOCUMENTID"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[DOCUMENTID]/Type"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeDocumentInstanceIdentifier"/>
      <source>
        <context value="source"/>
        <element value="Bundle.id"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[DOCUMENTID]/InstanceIdentifier"/>
        <transform value="copy"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeDocumentIdentifier"/>
      <source>
        <context value="source"/>
        <defaultValueString value="dk-medcom-messaging"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[DOCUMENTID]/Identifier"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeProcessIdType"/>
      <source>
        <context value="source"/>
        <defaultValueString value="PROCESSID"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[PROCESSID]/Type"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeProcessIdInstanceIdentifier"/>
      <source>
        <context value="source"/>
        <defaultValueString value="sdn-emergence"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[PROCESSID]/InstanceIdentifier"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeProcessIdIdentifier"/>
      <source>
        <context value="source"/>
        <defaultValueString value="dk-medcom-messaging"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[PROCESSID]/Identifier"/>
        <transform value="create"/>
      </target>
    </rule>
  </group>
  <group>
    <name value="BusinessScopeHealthMessageCommunication"/>
    <typeMode value="none"/>
    <input>
      <name value="source"/>
      <type value="Bundle"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="target"/>
      <type value="sbdhBusinessScope"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="ScopePatientIdType"/>
      <source>
        <context value="source"/>
        <defaultValueString value="PATIENTID"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[PATIENTID]/Type"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ScopePatientIdInstanceIdentifier"/>
      <source>
        <context value="source"/>
        <element
                 value="MedComMessagingMessage(Bundle.entry.resource.ofType(Patient).identifier"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[PATIENTID]/InstanceIdentifier"/>
        <transform value="copy"/>
      </target>
    </rule>
    <rule>
      <name value="ScopePatientIdIdentifier"/>
      <source>
        <context value="source"/>
        <defaultValueString value="dk-medcom-messaging"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[PATIENTID]/Identifier"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeSenderIdType"/>
      <source>
        <context value="source"/>
        <defaultValueString value="SENDERID"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[SENDERID]/Type"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeSenderIdInstanceIdentifier"/>
      <source>
        <context value="source"/>
        <element
                 value="MedComMessagingMessage(Bundle.entry.resource.ofType(SenderOrganization).identifier[SOR-ID].value"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[SENDERID]/InstanceIdentifier"/>
        <transform value="copy"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeSenderIdIdentifier"/>
      <source>
        <context value="source"/>
        <defaultValueString value="dk-medcom-messaging"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[SENDERID]/Identifier"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeReceiverIdType"/>
      <source>
        <context value="source"/>
        <defaultValueString value="RECEIVERID"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[RECEIVERID]/Type"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeReceiverIdInstanceIdentifier"/>
      <source>
        <context value="source"/>
        <element
                 value="MedComMessagingMessage(Bundle.entry.resource.ofType(ReceiverOrganization).identifier[SOR-ID].value"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[RECEIVERID]/InstanceIdentifier"/>
        <transform value="copy"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeReceiverIdIdentifier"/>
      <source>
        <context value="source"/>
        <defaultValueString value="dk-medcom-messaging"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[RECEIVERID]/Identifier"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeMessageIdentiferType"/>
      <source>
        <context value="source"/>
        <defaultValueString value="MESSAGEIDENTIFIER"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[MESSAGEIDENTIFIER]/Type"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeMessageIdentiferInstanceIdentifier"/>
      <source>
        <context value="source"/>
        <element value="MedComMessagingMessage(Bundle.entry[0].resource.id"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[MESSAGEIDENTIFIER]/InstanceIdentifier"/>
        <transform value="copy"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeMessageIdentiferIdentifier"/>
      <source>
        <context value="source"/>
        <defaultValueString value="dk-medcom-messaging"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[MESSAGEIDENTIFIER]/Identifier"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeMessageEnvelopeIdentiferType"/>
      <source>
        <context value="source"/>
        <defaultValueString value="MESSAGEENVELOPEIDENTIFIER"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[MESSAGEENVELOPEIDENTIFIER]/Type"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeMessageEnvelopeIdentiferInstanceIdentifier"/>
      <source>
        <context value="source"/>
        <element value="Bundle.id"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[MESSAGEENVELOPEIDENTIFIER]/InstanceIdentifier"/>
        <transform value="copy"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeMessageEnvelopeIdentiferIdentifier"/>
      <source>
        <context value="source"/>
        <defaultValueString value="dk-medcom-messaging"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[MESSAGEENVELOPEIDENTIFIER]/Identifier"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeOriginalMessageIdentiferType"/>
      <source>
        <context value="source"/>
        <defaultValueString value="ORIGINALMESSAGEIDENTIFIER"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[ORIGINALMESSAGEIDENTIFIER]/Type"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeOriginalMessageIdentiferInstanceIdentifier"/>
      <source>
        <context value="source"/>
        <element value="Bundle.id"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[ORIGINALMESSAGEIDENTIFIER]/InstanceIdentifier"/>
        <transform value="copy"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeOriginalMessageIdentiferIdentifier"/>
      <source>
        <context value="source"/>
        <defaultValueString value="dk-medcom-messaging"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[ORIGINALMESSAGEIDENTIFIER]/Identifier"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeOriginalEnvelopeIdentiferType"/>
      <source>
        <context value="source"/>
        <defaultValueString value="ORIGINALENVELOPEIDENTIFIER"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[ORIGINALENVELOPEIDENTIFIER]/Type"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeOriginalEnvelopeIdentiferInstanceIdentifier"/>
      <source>
        <context value="source"/>
        <element value="Bundle.id"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element
                 value="Scope[ORIGINALENVELOPEIDENTIFIER]/InstanceIdentifier"/>
        <transform value="copy"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeOriginalEnvelopeIdentiferIdentifier"/>
      <source>
        <context value="source"/>
        <defaultValueString value="dk-medcom-messaging"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[ORIGINALENVELOPEIDENTIFIER]/Identifier"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeOriginalMessageStandardType"/>
      <source>
        <context value="source"/>
        <defaultValueString value="ORIGINALMESSAGESTANDARD"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[ORIGINALMESSAGESTANDARD]/Type"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeOriginalMessageStandardInstanceIdentifier"/>
      <source>
        <context value="source"/>
        <element value="Bundle.id"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[ORIGINALMESSAGESTANDARD]/InstanceIdentifier"/>
        <transform value="copy"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeOriginalMessageStandardIdentifier"/>
      <source>
        <context value="source"/>
        <defaultValueString value="dk-medcom-messaging"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[ORIGINALMESSAGESTANDARD]/Identifier"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeOriginalMessageVersionType"/>
      <source>
        <context value="source"/>
        <defaultValueString value="ORIGINALMESSAGEVERSION"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[ORIGINALMESSAGEVERSION]/Type"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeOriginalMessageVersionInstanceIdentifier"/>
      <source>
        <context value="source"/>
        <element value="Bundle.id"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[ORIGINALMESSAGEVERSION]/InstanceIdentifier"/>
        <transform value="copy"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeOriginalMessageVersionIdentifier"/>
      <source>
        <context value="source"/>
        <defaultValueString value="dk-medcom-messaging"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[ORIGINALMESSAGEVERSION]/Identifier"/>
        <transform value="create"/>
      </target>
    </rule>
  </group>
  <group>
    <name value="BusinessScopeXdsMetadata"/>
    <typeMode value="none"/>
    <input>
      <name value="source"/>
      <type value="Bundle"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="target"/>
      <type value="sbdhBusinessScope"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="ScopeXdsMetadataType"/>
      <source>
        <context value="source"/>
        <defaultValueString value="XDS-METADATA"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[XDS-METADATA]/Type"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeXdsMetadataInstanceIdentifier"/>
      <source>
        <context value="source"/>
        <element value="Bundle.id"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[XDS-METADATA]/InstanceIdentifier"/>
        <transform value="copy"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeXdsMetadataIdentifier"/>
      <source>
        <context value="source"/>
        <defaultValueString value="dk-medcom-messaging"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[XDS-METADATA]/Identifier"/>
        <transform value="create"/>
      </target>
    </rule>
  </group>
  <group>
    <name value="BusinessScopeSbdhReliableMessaging"/>
    <typeMode value="none"/>
    <input>
      <name value="source"/>
      <type value="Bundle"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="target"/>
      <type value="sbdhBusinessScopeReliableMessaging"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="ScopeReceiptAcknowledgement"/>
      <source>
        <context value="source"/>
        <defaultValueString value="EHMI-ReceiptAcknowledgement"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[ReceiptAcknowledgement]/Type"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeReceiptAcknowledgementInstanceIdentifier"/>
      <source>
        <context value="source"/>
        <defaultValueString value="Request"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[ReceiptAcknowledgement]/InstanceIdentifier"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ScopeReceiptAcknowledgementIdentifier"/>
      <source>
        <context value="source"/>
        <defaultValueString value="dk-medcom-messaging"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="Scope[ReceiptAcknowledgement]/Identifier"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="CorrelationInformationRequestingDocumentCreationDateTime"/>
      <source>
        <context value="source"/>
        <defaultValueString value="RequestingDocumentCreationDateTime"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element
                 value="CorrelationInformation/RequestingDocumentCreationDateTime"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name
            value="CorrelationInformationRequestingDocumentInstanceIdentifier"/>
      <source>
        <context value="source"/>
        <defaultValueString value="RequestingDocumentInstanceIdentifier"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element
                 value="CorrelationInformation/RequestingDocumentInstanceIdentifier"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="CorrelationInformationExpectedResponseDateTime"/>
      <source>
        <context value="source"/>
        <defaultValueString value="ExpectedResponseDateTime"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="CorrelationInformation/ExpectedResponseDateTime"/>
        <transform value="create"/>
      </target>
    </rule>
  </group>
  <group>
    <name value="BusinessServicesRequest"/>
    <typeMode value="none"/>
    <input>
      <name value="source"/>
      <type value="Bundle"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="target"/>
      <type value="sbdhBusinessScopeBusinessServices"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="BusinessServiceReceiptAcknowledgementRequest"/>
      <source>
        <context value="source"/>
        <defaultValueString value="EHMI-ReceiptAcknowledgement-Request"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="BusinessService/ServiceName"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ServiceTransactionTypeOfServiceTransaction"/>
      <source>
        <context value="source"/>
        <defaultValueString value="RequestingServiceTransaction"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element
                 value="BusinessService/ServiceTransaction/TypeOfServiceTransaction"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ServiceTransactionIsNonRepudiationRequired"/>
      <source>
        <context value="source"/>
        <defaultValueString value="false"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element
                 value="BusinessService/ServiceTransaction/IsNonRepudiationRequired"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ServiceTransactionIsAuthenticationRequired"/>
      <source>
        <context value="source"/>
        <defaultValueString value="false"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element
                 value="BusinessService/ServiceTransaction/IsAuthenticationRequired"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ServiceTransactionIsNonRepudiationOfReceiptRequired"/>
      <source>
        <context value="source"/>
        <defaultValueString value="false"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element
                 value="BusinessService/ServiceTransaction/IsNonRepudiationOfReceiptRequired"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ServiceTransactionIsIntelligibleCheckRequired"/>
      <source>
        <context value="source"/>
        <defaultValueString value="false"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element
                 value="BusinessService/ServiceTransaction/IsIntelligibleCheckRequired"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ServiceTransactionIsApplicationErrorResponseRequested"/>
      <source>
        <context value="source"/>
        <defaultValueString value="false"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element
                 value="BusinessService/ServiceTransaction/IsApplicationErrorResponseRequested"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ServiceTransactionTimeToAcknowledgeReceipt"/>
      <source>
        <context value="source"/>
        <defaultValueString value="300000"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element
                 value="BusinessService/ServiceTransaction/TimeToAcknowledgeReceipt"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ServiceTransactionTimeToAcknowledgeAcceptance"/>
      <source>
        <context value="source"/>
        <defaultValueString value="0"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element
                 value="BusinessService/ServiceTransaction/TimeToAcknowledgeAcceptance"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ServiceTransactionTimeToPerform"/>
      <source>
        <context value="source"/>
        <defaultValueString value="0"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="BusinessService/ServiceTransaction/TimeToPerform"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="ServiceTransactionRecurrence"/>
      <source>
        <context value="source"/>
        <defaultValueString value="0"/>
      </source>
      <target>
        <context value="target"/>
        <contextType value="variable"/>
        <element value="BusinessService/ServiceTransaction/Recurrence"/>
        <transform value="create"/>
      </target>
    </rule>
  </group>
</StructureMap>