FHIR Release 3 (STU) Current Build
This page is part of FHIR STU 3 (v3.0.1) in it's permanent home (it will always be available at this URL). It has been superceded by R4 . For a full list of available versions, see the Directory of published versions .
Infrastructure And Messaging Work Group Maturity Level : N/A Ballot Standards Status : Informative Security Category : Not Classified Compartments : Device , Practitioner

R2 : R3 Converson : R4 Conversion maps for MessageHeader.

Functional status for this map: 1 test that all execute ok. All tests pass round-trip testing and all 1 r3 resources are valid. invalid (0 errors). ( see documentation)

map "http://hl7.org/fhir/StructureMap/MessageHeader2to3" = "R2 to R3 Conversions for MessageHeader"
map "http://hl7.org/fhir/StructureMap/MessageHeader3to4" = "R3 to R4 Conversions for MessageHeader"
uses "http://hl7.org/fhir/DSTU2/StructureDefinition/MessageHeader" alias MessageHeaderR2 as source

uses "http://hl7.org/fhir/3.0/StructureDefinition/MessageHeader" alias MessageHeaderR3 as source

uses "http://hl7.org/fhir/StructureDefinition/MessageHeader" alias MessageHeader as target
imports "http://hl7.org/fhir/StructureMap/*2to3"
group for type+types  MessageHeader extends DomainResource
  input src : MessageHeaderR2 as source
  input tgt : MessageHeader as target
  "MessageHeader-timestamp" : for src.timestamp make tgt.timestamp
  "MessageHeader-event" : for src.event make tgt.event
  "MessageHeader-response" : for src.response as vs0 make tgt.response as vt0 then mshResponse(vs0, vt0)
  "MessageHeader-source" : for src.source as vs0 make tgt.source as vt0 then mshSource(vs0, vt0)
  "MessageHeader-destination" : for src.destination as vs0 make tgt.destination as vt0 then mshDestination(vs0, vt0)
  "MessageHeader-enterer" : for src.enterer make tgt.enterer
  "MessageHeader-author" : for src.author make tgt.author
  "MessageHeader-receiver" : for src.receiver make tgt.receiver
  "MessageHeader-responsible" : for src.responsible make tgt.responsible
  "MessageHeader-reason" : for src.reason make tgt.reason
  "MessageHeader-data" : for src.data make tgt.focus
endgroup
group mshResponse extends BackboneElement
  input src as source
  input tgt as target

imports "http://hl7.org/fhir/StructureMap/*3to4"

  "MessageHeader.response-identifier" : for src.identifier make tgt.identifier
  "MessageHeader.response-code" : for src.code make tgt.code
  "MessageHeader.response-details" : for src.details make tgt.details
endgroup

group MessageHeader(source src : MessageHeaderR3, target tgt : MessageHeader) extends DomainResource <<type+>> {
  src.event -> tgt.event;
  src.destination as vs0 -> tgt.destination as vt0 then destination(vs0, vt0, src);
  src.sender -> tgt.sender;
  src.timestamp as vs ->  tgt.extension as ext,  ext.url = 'http://hl7.org/fhir/3.0/StructureDefinition/extension-MessageHeader.timestamp',  ext.value = vs;
  src.enterer -> tgt.enterer;
  src.author -> tgt.author;
  src.source as vs0 -> tgt.source as vt0 then source(vs0, vt0);
  src.responsible -> tgt.responsible;
  src.reason -> tgt.reason;
  src.response as vs0 -> tgt.response as vt0 then response(vs0, vt0);
  src.focus -> tgt.focus;
}

group mshSource extends BackboneElement
  input src as source
  input tgt as target

group destination(source src, target tgt, source msrc) extends BackboneElement {
  src.name -> tgt.name;
  src.target -> tgt.target;
  src.endpoint -> tgt.endpoint;
  msrc.receiver -> tgt.receiver;
}

  "MessageHeader.source-name" : for src.name make tgt.name
  "MessageHeader.source-software" : for src.software make tgt.software
  "MessageHeader.source-version" : for src.version make tgt.version
  "MessageHeader.source-contact" : for src.contact make tgt.contact
  "MessageHeader.source-endpoint" : for src.endpoint make tgt.endpoint
endgroup

group source(source src, target tgt) extends BackboneElement {
  src.name -> tgt.name;
  src.software -> tgt.software;
  src.version -> tgt.version;
  src.contact -> tgt.contact;
  src.endpoint -> tgt.endpoint;
}

group mshDestination extends BackboneElement
  input src as source
  input tgt as target

group response(source src, target tgt) extends BackboneElement {
  src.identifier -> tgt.identifier;
  src.code -> tgt.code;
  src.details -> tgt.details;
}

  "MessageHeader.source-name" : for src.name make tgt.name
  "MessageHeader.source-target" : for src.target make tgt.target
  "MessageHeader.source-endpoint" : for src.endpoint make tgt.endpoint
endgroup

map "http://hl7.org/fhir/StructureMap/MessageHeader3to2" = "R3 to R2 Conversion for MessageHeader"
map "http://hl7.org/fhir/StructureMap/MessageHeader4to3" = "R4 to R3 Conversion for MessageHeader"
uses "http://hl7.org/fhir/StructureDefinition/MessageHeader" alias MessageHeader as source
uses "http://hl7.org/fhir/DSTU2/StructureDefinition/MessageHeader" alias MessageHeaderR2 as target
imports "http://hl7.org/fhir/StructureMap/*3to2"
group for type+types  MessageHeader extends DomainResource
  input src : MessageHeader as source
  input tgt : MessageHeaderR2 as target
  "MessageHeader-timestamp" : for src.timestamp make tgt.timestamp
  "MessageHeader-event" : for src.event make tgt.event
  "MessageHeader-response" : for src.response as vs0 make tgt.response as vt0 then mshResponse(vs0, vt0)
  "MessageHeader-source" : for src.source as vs0 make tgt.source as vt0 then mshSource(vs0, vt0)
  "MessageHeader-destination" : for src.destination as vs0 make tgt.destination as vt0 then mshDestination(vs0, vt0)
  "MessageHeader-enterer" : for src.enterer make tgt.enterer
  "MessageHeader-author" : for src.author make tgt.author
  "MessageHeader-receiver" : for src.receiver make tgt.receiver
  "MessageHeader-responsible" : for src.responsible make tgt.responsible
  "MessageHeader-reason" : for src.reason make tgt.reason
  "MessageHeader-data" : for src.focus make tgt.data
endgroup

uses "http://hl7.org/fhir/3.0/StructureDefinition/MessageHeader" alias MessageHeaderR3 as target

group mshResponse extends BackboneElement
  input src as source
  input tgt as target

imports "http://hl7.org/fhir/StructureMap/*4to3"

  "MessageHeader.response-identifier" : for src.identifier make tgt.identifier
  "MessageHeader.response-code" : for src.code make tgt.code
  "MessageHeader.response-details" : for src.details make tgt.details
endgroup

group MessageHeader(source src : MessageHeader, target tgt : MessageHeaderR3) extends DomainResource <<type+>> {
  src.event -> tgt.event;
  src.destination as vs0 -> tgt.destination as vt0 then destination(vs0, vt0, tgt);
  src.sender -> tgt.sender;
  src.extension as ext where url = 'http://hl7.org/fhir/3.0/StructureDefinition/extension-MessageHeader.timestamp' then {
    ext.value -> tgt.timestamp "timestamp2";
  } "timestamp";
  src.enterer -> tgt.enterer;
  src.author -> tgt.author;
  src.source as vs0 -> tgt.source as vt0 then source(vs0, vt0);
  src.responsible -> tgt.responsible;
  src.reason -> tgt.reason;
  src.response as vs0 -> tgt.response as vt0 then response(vs0, vt0);
  src.focus -> tgt.focus;
}

group mshSource extends BackboneElement
  input src as source
  input tgt as target

group destination(source src, target tgt, target mtgt) extends BackboneElement {
  src.name -> tgt.name;
  src.target -> tgt.target;
  src.endpoint -> tgt.endpoint;
  src.receiver -> mtgt.receiver;
}

  "MessageHeader.source-name" : for src.name make tgt.name
  "MessageHeader.source-software" : for src.software make tgt.software
  "MessageHeader.source-version" : for src.version make tgt.version
  "MessageHeader.source-contact" : for src.contact make tgt.contact
  "MessageHeader.source-endpoint" : for src.endpoint make tgt.endpoint
endgroup

group source(source src, target tgt) extends BackboneElement {
  src.name -> tgt.name;
  src.software -> tgt.software;
  src.version -> tgt.version;
  src.contact -> tgt.contact;
  src.endpoint -> tgt.endpoint;
}

group mshDestination extends BackboneElement
  input src as source
  input tgt as target

group response(source src, target tgt) extends BackboneElement {
  src.identifier -> tgt.identifier;
  src.code -> tgt.code;
  src.details -> tgt.details;
}

  "MessageHeader.source-name" : for src.name make tgt.name
  "MessageHeader.source-target" : for src.target make tgt.target
  "MessageHeader.source-endpoint" : for src.endpoint make tgt.endpoint
endgroup

<p>No validation errors - all conversions are clean</p>