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 .
Structured Documents Work Group Maturity Level : N/A Ballot Standards Status : Informative Security Category : Not Classified Compartments : Device , Encounter , Patient , Practitioner , RelatedPerson

R2 : R3 Converson : R4 Conversion maps for DocumentManifest.

Functional status for this map: 1 test that all execute ok. 1 2 tests of which 2 fail round-trip testing and all r3 resources are valid. to execute . ( see documentation)

map "http://hl7.org/fhir/StructureMap/DocumentManifest2to3" = "R2 to R3 Conversions for DocumentManifest"
map "http://hl7.org/fhir/StructureMap/DocumentManifest3to4" = "R3 to R4 Conversions for DocumentManifest"
uses "http://hl7.org/fhir/DSTU2/StructureDefinition/DocumentManifest" alias DocumentManifestR2 as source

uses "http://hl7.org/fhir/3.0/StructureDefinition/DocumentManifest" alias DocumentManifestR3 as source

uses "http://hl7.org/fhir/StructureDefinition/DocumentManifest" alias DocumentManifest as target
imports "http://hl7.org/fhir/StructureMap/*2to3"

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

group for type+types  DocumentManifest extends DomainResource
  input src : DocumentManifestR2 as source
  input tgt : DocumentManifest as target

group DocumentManifest(source src : DocumentManifestR3, target tgt : DocumentManifest) extends DomainResource <<type+>> {
  src.masterIdentifier -> tgt.masterIdentifier;
  src.identifier -> tgt.identifier;
  src.status -> tgt.status;
  src.type -> tgt.type;
  src.subject -> tgt.subject;
  src.created -> tgt.created;
  src.author as s -> tgt.agent as t then DocumentManifestAgent(s, t);
  src.recipient -> tgt.recipient;
  src.source -> tgt.source;
  src.description -> tgt.description;
  src.content as s -> tgt.content as t then content(s, t);
  src.related as s -> tgt.related as t then DocumentManifestRelated(s, t);
}

  "DocumentManifest-masterIdentifier" : for src.masterIdentifier make tgt.masterIdentifier
  "DocumentManifest-identifier" : for src.identifier make tgt.identifier
  "DocumentManifest-subject" : for src.subject make tgt.subject
  "DocumentManifest-recipient" : for src.recipient make tgt.recipient
  "DocumentManifest-type" : for src.type make tgt.type
  "DocumentManifest-author" : for src.author make tgt.author
  "DocumentManifest-created" : for src.created make tgt.created
  "DocumentManifest-source" : for src.source make tgt.source
  "DocumentManifest-status" : for src.status make tgt.status
  "DocumentManifest-description" : for src.description make tgt.description
  "DocumentManifest-content" : for src.content as src make tgt.content as vt0 then dmContent(src, vt0)
  "DocumentManifest-related" : for src.related as src make tgt.related as vt0 then dmRelated(src, vt0)
endgroup

group DocumentManifestAgent(source src, target tgt) extends BackboneElement {
  src ->  tgt.type as cc,  cc.coding as c,  c.system = 'http://terminology.hl7.org/CodeSystem/v3-ParticipationType',  c.code = 'AUT' "author";
  src -> tgt.who as vt0 then Reference(src, vt0) "who";
}

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

group content(source src, target tgt) extends Element {
  src.p : Attachment as s ->  tgt.extension as ext,  ext.url = 'http://hl7.org/fhir/3.0/StructureDefinition/extension-DocumentManifest.content.p_Attachment',  ext.value = s;
  src.p : Reference as s then Reference(s, tgt);
}

  "DocumentManifest.content-p-Attachment" : for src.p make tgt.p 
endgroup  
  
group dmRelated extends BackboneElement
  input src as source
  input tgt as target

group DocumentManifestRelated(source src, target tgt) extends BackboneElement {
  src.identifier -> tgt.identifier;
  src.ref -> tgt.ref;
}

  "DocumentManifest.related-identifier" : for src.identifier make tgt.identifier
  "DocumentManifest.related-ref" : for src.ref make tgt.ref
endgroup  

map "http://hl7.org/fhir/StructureMap/DocumentManifest3to2" = "R3 to R2 Conversion for DocumentManifest"
map "http://hl7.org/fhir/StructureMap/DocumentManifest4to3" = "R4 to R3 Conversion for DocumentManifest"
uses "http://hl7.org/fhir/StructureDefinition/DocumentManifest" alias DocumentManifest as source
uses "http://hl7.org/fhir/DSTU2/StructureDefinition/DocumentManifest" alias DocumentManifestR2 as target

uses "http://hl7.org/fhir/3.0/StructureDefinition/DocumentManifest" alias DocumentManifestR3 as target

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

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

group for type+types  DocumentManifest extends DomainResource
  input src : DocumentManifest as source
  input tgt : DocumentManifestR2 as target

group DocumentManifest(source src : DocumentManifestR3, target tgt : DocumentManifest) extends DomainResource <<type+>> {
  src.masterIdentifier -> tgt.masterIdentifier;
  src.identifier -> tgt.identifier;
  src.status -> tgt.status;
  src.type -> tgt.type;
  src.subject -> tgt.subject;
  src.created -> tgt.created;
  src.agent as s where type.coding.where((system = 'http://terminology.hl7.org/CodeSystem/v3-ParticipationType') and (code = 'AUT')).exists() -> tgt.author as t then DocumentManifestAgent(s, t);
  src.recipient -> tgt.recipient;
  src.source -> tgt.source;
  src.description -> tgt.description;
  src.content as s -> tgt.content as t then content(s, t);
  src.related as s -> tgt.related as t then DocumentManifestRelated(s, t);
}

  "DocumentManifest-masterIdentifier" : for src.masterIdentifier make tgt.masterIdentifier
  "DocumentManifest-identifier" : for src.identifier make tgt.identifier
  "DocumentManifest-subject" : for src.subject make tgt.subject
  "DocumentManifest-recipient" : for src.recipient make tgt.recipient
  "DocumentManifest-type" : for src.type make tgt.type
  "DocumentManifest-author" : for src.author make tgt.author
  "DocumentManifest-created" : for src.created make tgt.created
  "DocumentManifest-source" : for src.source make tgt.source
  "DocumentManifest-status" : for src.status make tgt.status
  "DocumentManifest-description" : for src.description make tgt.description
  "DocumentManifest-content" : for src.content as src make tgt.content as vt0 then dmContent(src, vt0)
  "DocumentManifest-related" : for src.related as src make tgt.related as vt0 then dmRelated(src, vt0)
endgroup

group DocumentManifestAgent(source src, target tgt) extends BackboneElement {
  src.who as vs0 then Reference(vs0, tgt);
}

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

group content(source src, target tgt) extends Element {
  src.extension as s where url = 'http://hl7.org/fhir/3.0/StructureDefinition/extension-DocumentManifest.content.p_Attachment' then contentAttachment(s, tgt);
  src where extension.where(url = 'http://hl7.org/fhir/3.0/StructureDefinition/extension-DocumentManifest.content.p_Attachment').empty() -> tgt.p = create('Reference') as p then Reference(src, p) "attachment";
}

  "DocumentManifest.content-p-Attachment" : for src.p make tgt.p 
endgroup  
  
group dmRelated extends BackboneElement
  input src as source
  input tgt as target

group contentAttachment(source src, target tgt) extends Element {
  src.value : Attachment as s -> tgt.p = create('Attachment') as t then Attachment(s, t);
}
group DocumentManifestRelated(source src, target tgt) extends BackboneElement {
  src.identifier -> tgt.identifier;
  src.ref -> tgt.ref;
}

  "DocumentManifest.related-identifier" : for src.identifier make tgt.identifier
  "DocumentManifest.related-ref" : for src.ref make tgt.ref
endgroup  

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