FHIR Cross-Version Mapping Pack
0.1.0 - Ballot for Release 5.1.0 International flag

FHIR Cross-Version Mapping Pack, published by HL7 International / FHIR Infrastructure. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/fhir-cross-version/ and changes regularly. See the Directory of published versions

StructureMap: DocumentReference Transforms: R2 to R3

Official URL: http://hl7.org/fhir/StructureMap/DocumentReference2to3 Version: 0.1.0
Standards status: Draft Maturity Level: 1 Computable Name: DocumentReference2to3

DocumentReferenceTransformsR2toR3

/// url = 'http://hl7.org/fhir/StructureMap/DocumentReference2to3'
/// name = 'DocumentReference2to3'
/// title = 'DocumentReference Transforms: R2 to R3'
/// status = 'active'

uses "http://hl7.org/fhir/1.0/DocumentReference" alias DocumentReferenceR2 as source
uses "http://hl7.org/fhir/3.0/DocumentReference" alias DocumentReference as target

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

group DocumentReference(source src : DocumentReferenceR2, target tgt : DocumentReference) extends DomainResource <<type+>> {
  src.masterIdentifier -> tgt.masterIdentifier "DocumentReference-masterIdentifier";
  src.identifier -> tgt.identifier "DocumentReference-identifier";
  src.subject -> tgt.subject "DocumentReference-subject";
  src.type -> tgt.type "DocumentReference-type";
  src.class -> tgt.class "DocumentReference-class";
  src.author -> tgt.author "DocumentReference-author";
  src.custodian -> tgt.custodian "DocumentReference-custodian";
  src.authenticator -> tgt.authenticator "DocumentReference-authenticator";
  src.created -> tgt.created "DocumentReference-created";
  src.indexed -> tgt.indexed "DocumentReference-indexed";
  src.status -> tgt.status "DocumentReference-status";
  src.docStatus as v then {
    v.coding as v1 where v1.system = 'http://hl7.org/fhir/composition-status' -> tgt.docStatus = (v1.code) "DocumentReference-docStatus-inner";
  } "DocumentReference-docStatus";
  src.relatesTo as vs0 -> tgt.relatesTo as vt0 then drRelatesTo(vs0, vt0) "DocumentReference-relatesTo";
  src.description -> tgt.description "DocumentReference-description";
  src.securityLabel -> tgt.securityLabel "DocumentReference-securityLabel";
  src.content as vs0 -> tgt.content as vt0 then drContent(vs0, vt0) "DocumentReference-content";
  src.context as vs0 -> tgt.context as vt0 then drContext(vs0, vt0) "DocumentReference-context";
}

group drRelatesTo(source src, target tgt) extends BackboneElement {
  src.code -> tgt.code "relatesTo-code";
  src.target -> tgt.target "relatesTo-target";
}

group drContent(source src, target tgt) extends BackboneElement {
  src.attachment -> tgt.attachment "content-attachment";
  src.format -> tgt.format "content-format";
}

group drContext(source src, target tgt) extends BackboneElement {
  src.encounter -> tgt.encounter "context-encounter";
  src.event -> tgt.event "context-event";
  src.period -> tgt.period "context-period";
  src.facilityType -> tgt.facilityType "context-facilityType";
  src.practiceSetting -> tgt.practiceSetting "context-practiceSetting";
  src.sourcePatientInfo -> tgt.sourcePatientInfo "context-sourcePatientInfo";
  src.related as vs0 -> tgt.related as vt0 then drrelated(vs0, vt0) "context-related";
}

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