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

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

CodeableConceptTransformsR4BtoR5

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

uses "http://hl7.org/fhir/4.3/string" alias stringR4B as source
uses "http://hl7.org/fhir/4.3/CodeableConcept" alias CodeableConceptR4B as source
uses "http://hl7.org/fhir/4.3/CodeableReference" alias CodeableReferenceR4B as source
uses "http://hl7.org/fhir/4.3/Coding" alias CodingR4B as source
uses "http://hl7.org/fhir/4.3/code" alias codeR4B as source
uses "http://hl7.org/fhir/5.0/CodeableConcept" alias CodeableConceptR5 as target
uses "http://hl7.org/fhir/5.0/CodeableReference" alias CodeableReferenceR5 as target
uses "http://hl7.org/fhir/5.0/Coding" alias CodingR5 as target
uses "http://hl7.org/fhir/5.0/code" alias codeR5 as target

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

group CodeableConcept(source src : CodeableConceptR4B, target tgt : CodeableConceptR5) extends Element <<type+>> {
  src.coding -> tgt.coding;
  src.text -> tgt.text;
}

group CodeableConcept2CodeableReference(source src : CodeableConceptR4B, target tgt : CodeableReferenceR5) extends Element <<types>> {
  src as s -> tgt.concept as t then CodeableConcept(s, t) "concept";
}

group CodeableReference2CodeableConcept(source src : CodeableReferenceR4B, target tgt : CodeableConceptR5) extends Element <<types>> {
  src.concept as s -> tgt then CodeableConcept(s, tgt);
}

group string2CodeableConcept(source src : stringR4B, target tgt : CodeableConceptR5) extends Element <<types>> {
  src.value as v -> tgt.text = v "string2CodeableConcept";
}

group string2CodeableReference(source src : stringR4B, target tgt : CodeableReferenceR5) extends Element <<types>> {
  src as s -> tgt.concept as t then string2CodeableConcept(s, t) "string2CodeableConcept";
}

group CodeableConcept2Coding(source src : CodeableConceptR4B, target tgt : CodingR5) extends Element <<types>> {
  src.coding as s -> tgt as t then Coding(s, t);
}

group Coding2CodeableConcept(source src : CodingR4B, target tgt : CodeableConceptR5) extends Element <<types>> {
  src as s -> tgt.coding as t then Coding(s, t) "Coding";
}

group Coding2CodeableReference(source src : CodingR4B, target tgt : CodeableReferenceR5) extends Element <<types>> {
  src as s ->  tgt.concept = create('CodeableConcept') as t,  t.coding as tc then Coding(s, tc) "Coding";
}

group CodeableConcept2code(source src : CodeableConceptR4B, target tgt : codeR5, source sysUrl : string) extends Element <<types>> {
  src.coding as s where s.system = sysUrl -> tgt then {
    s.code -> tgt.value;
  };
}

group code2CodeableConcept(source src : codeR4B, target tgt : CodeableConceptR5, source sysUrl : string) extends Element <<types>> {
  src.value as s ->  tgt.coding = create('Coding') as t,  t.system = sysUrl,  t.code = s;
}