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: CodeSystem Transforms: R5 to R4B

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

CodeSystemTransformsR5toR4B

/// url = 'http://hl7.org/fhir/StructureMap/CodeSystem5to4B'
/// name = 'CodeSystem5to4B'
/// title = 'CodeSystem Transforms: R5 to R4B'
/// status = 'active'

uses "http://hl7.org/fhir/5.0/CodeSystem" alias CodeSystemR5 as source
uses "http://hl7.org/fhir/4.0/CodeSystem" alias CodeSystemR4B as target

imports "http://hl7.org/fhir/StructureMap/*5to4B"

group CodeSystem(source src : CodeSystemR5, target tgt : CodeSystemR4B) extends DomainResource <<type+>> {
  src.url -> tgt.url;
  src.identifier -> tgt.identifier;
  src.version -> tgt.version;
  src.name -> tgt.name;
  src.title -> tgt.title;
  src.status as v -> tgt.status = translate(v, 'http://hl7.org/fhir/ConceptMap/CodeSystem.status-R5toR4', 'code');
  src.experimental -> tgt.experimental;
  src.date -> tgt.date;
  src.publisher -> tgt.publisher;
  src.contact -> tgt.contact;
  src.description -> tgt.description;
  src.useContext -> tgt.useContext;
  src.jurisdiction -> tgt.jurisdiction;
  src.purpose -> tgt.purpose;
  src.copyright -> tgt.copyright;
  src.caseSensitive -> tgt.caseSensitive;
  src.valueSet -> tgt.valueSet;
  src.hierarchyMeaning as v -> tgt.hierarchyMeaning = translate(v, 'http://hl7.org/fhir/ConceptMap/CodeSystem.hierarchyMeaning-R5toR4', 'code');
  src.compositional -> tgt.compositional;
  src.versionNeeded -> tgt.versionNeeded;
  src.content as v -> tgt.content = translate(v, 'http://hl7.org/fhir/ConceptMap/CodeSystem.content-R5toR4', 'code');
  src.supplements -> tgt.supplements;
  src.count -> tgt.count;
  src.filter as s -> tgt.filter as t then CodeSystemFilter(s, t);
  src.property as s -> tgt.property as t then CodeSystemProperty(s, t);
  src.concept as s -> tgt.concept as t then CodeSystemConcept(s, t);
}

group CodeSystemFilter(source src, target tgt) extends BackboneElement {
  src.code -> tgt.code;
  src.description -> tgt.description;
  src.operator as v -> tgt.operator = translate(v, 'http://hl7.org/fhir/ConceptMap/CodeSystem.filter.operator-R5toR4', 'code');
  src.value -> tgt.value;
}

group CodeSystemProperty(source src, target tgt) extends BackboneElement {
  src.code -> tgt.code;
  src.uri -> tgt.uri;
  src.description -> tgt.description;
  src.type as v -> tgt.type = translate(v, 'http://hl7.org/fhir/ConceptMap/CodeSystem.property.type-R5toR4', 'code');
}

group CodeSystemConcept(source src, target tgt) extends BackboneElement {
  src.code -> tgt.code;
  src.display -> tgt.display;
  src.definition -> tgt.definition;
  src.designation as s -> tgt.designation as t then CodeSystemConceptDesignation(s, t);
  src.property as s -> tgt.property as t then CodeSystemConceptProperty(s, t);
  src.concept as s -> tgt.concept as t then CodeSystemConcept(s, t);
}

group CodeSystemConceptDesignation(source src, target tgt) extends BackboneElement {
  src.language -> tgt.language;
  src.use -> tgt.use;
  src.value -> tgt.value;
}

group CodeSystemConceptProperty(source src, target tgt) extends BackboneElement {
  src.code -> tgt.code;
  src.value : code -> tgt.value;
  src.value : Coding -> tgt.value;
  src.value : string -> tgt.value;
  src.value : integer -> tgt.value;
  src.value : boolean -> tgt.value;
  src.value : dateTime -> tgt.value;
  src.value : decimal -> tgt.value;
}