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: ExampleScenario Transforms: R4 to R5

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

ExampleScenarioTransformsR4toR5

/// url = 'http://hl7.org/fhir/StructureMap/ExampleScenario4to5'
/// name = 'ExampleScenario4to5'
/// title = 'ExampleScenario Transforms: R4 to R5'
/// status = 'active'

uses "http://hl7.org/fhir/4.0/ExampleScenario" alias ExampleScenarioR4 as source
uses "http://hl7.org/fhir/5.0/ExampleScenario" alias ExampleScenarioR5 as target

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

group ExampleScenario(source src : ExampleScenarioR4, target tgt : ExampleScenarioR5) extends DomainResource <<type+>> {
  src.url -> tgt.url;
  src.identifier -> tgt.identifier;
  src.version -> tgt.version;
  src.name -> tgt.name;
  src.status as v -> tgt.status = translate(v, 'http://hl7.org/fhir/ConceptMap/ExampleScenario.status-R4toR5', 'code');
  src.experimental -> tgt.experimental;
  src.date -> tgt.date;
  src.publisher -> tgt.publisher;
  src.contact -> tgt.contact;
  src.useContext -> tgt.useContext;
  src.jurisdiction -> tgt.jurisdiction;
  src.purpose -> tgt.purpose;
  src.copyright -> tgt.copyright;
  src.actor as s -> tgt.actor as t then ExampleScenarioActor(s, t);
  src.instance as s -> tgt.instance as t then ExampleScenarioInstance(s, t);
  src.process as s -> tgt.process as t then ExampleScenarioProcess(s, t);
}

group ExampleScenarioActor(source src, target tgt) extends BackboneElement {
  src.actorId -> tgt.key;
  src.type as v -> tgt.type = translate(v, 'http://hl7.org/fhir/ConceptMap/ExampleScenario.actor.type-R4toR5', 'code');
  src.name -> tgt.title;
  src.description -> tgt.description;
}

group ExampleScenarioInstance(source src, target tgt) extends BackboneElement {
  src.resourceId -> tgt.key;
  src.resourceType as s ->  tgt.structureType = create('Coding') as t,  t.system = 'http://hl7.org/fhir/fhir-types',  t.code = s;
  src.version as s -> tgt.version as t then ExampleScenarioInstanceVersion(s, t);
  src.name -> tgt.title;
  src.description -> tgt.description;
  src.containedInstance as s -> tgt.containedInstance as t then ExampleScenarioInstanceContainedInstance(s, t);
}

group ExampleScenarioInstanceVersion(source src, target tgt) extends BackboneElement {
  src.versionId -> tgt.key;
  src.description -> tgt.description;
}

group ExampleScenarioInstanceContainedInstance(source src, target tgt) extends BackboneElement {
  src.resourceId -> tgt.instanceReference;
  src.versionId -> tgt.versionReference;
}

group ExampleScenarioProcess(source src, target tgt) extends BackboneElement {
  src.title -> tgt.title;
  src.description -> tgt.description;
  src.preConditions -> tgt.preConditions;
  src.postConditions -> tgt.postConditions;
  src.step as s -> tgt.step as t then ExampleScenarioProcessStep(s, t);
}

group ExampleScenarioProcessStep(source src, target tgt) extends BackboneElement {
  src.operation as s -> tgt.operation as t then ExampleScenarioProcessStepOperation(s, t);
  src.alternative as s -> tgt.alternative as t then ExampleScenarioProcessStepAlternative(s, t);
  src.pause -> tgt.pause;
}

group ExampleScenarioProcessStepOperation(source src, target tgt) extends BackboneElement {
  src.type -> tgt.title;
  src.initiator -> tgt.initiator;
  src.receiver -> tgt.receiver;
  src.description -> tgt.description;
  src.initiatorActive -> tgt.initiatorActive;
  src.receiverActive -> tgt.receiverActive;
}

group ExampleScenarioProcessStepAlternative(source src, target tgt) extends BackboneElement {
  src.title -> tgt.title;
  src.description -> tgt.description;
}