FHIR Release 3 (STU) 4

This page is part of the FHIR Specification (v3.0.2: (v4.0.1: R4 - Mixed Normative and STU 3). ) in it's permanent home (it will always be available at this URL). The current version which supercedes this version is 5.0.0 . For a full list of available versions, see the Directory of published versions . Page versions: R5 R4B R4 R3 R4 R3

Vocabulary Work Group Maturity Level : N/A Ballot Standards Status : Informative Security Category : Anonymous Compartments : Not linked to any defined compartments

R2 : R3 Converson : R4 Conversion maps for ConceptMap.

Functional status for this map: 2 4 tests that all execute ok. All tests pass round-trip testing and 1 4 r3 resources are invalid (1 (0 errors). ( see documentation)

map "http://hl7.org/fhir/StructureMap/ConceptMap2to3" = "R2 to R3 Conversions for ConceptMap"

map "http://hl7.org/fhir/StructureMap/ConceptMap3to4" = "R3 to R4 Conversions for ConceptMap"


uses "http://hl7.org/fhir/DSTU2/StructureDefinition/ConceptMap" alias ConceptMapR2 as source
uses "http://hl7.org/fhir/StructureDefinition/ConceptMap" alias ConceptMap as target

uses "http://hl7.org/fhir/3.0/StructureDefinition/ConceptMap" alias ConceptMapR3 as source
uses "http://hl7.org/fhir/StructureDefinition/ConceptMap" alias ConceptMap as target


imports "http://hl7.org/fhir/StructureMap/primitives2to3"
imports "http://hl7.org/fhir/StructureMap/DomainResource2to3"
imports "http://hl7.org/fhir/StructureMap/CodeableConcept2to3"
imports "http://hl7.org/fhir/StructureMap/ContactPoint2to3"
imports "http://hl7.org/fhir/StructureMap/Identifier2to3"
imports "http://hl7.org/fhir/StructureMap/Reference2to3"

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


group for type+types  ConceptMap extends DomainResource
  input src : ConceptMapR2 as source
  input tgt : ConceptMap as target

group ConceptMap(source src : ConceptMapR3, target tgt : ConceptMap) 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 -> tgt.status;
  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.source : uri as vs0 -> tgt.source = create('uri') as vt0 then uri(vs0, vt0);
  src.source : Reference as vs0 -> tgt.source = create('canonical') as vt0 then Reference2Canonical(vs0, vt0);
  src.target : uri as vs0 -> tgt.target = create('uri') as vt0 then uri(vs0, vt0) "targetU";
  src.target : Reference as vs0 -> tgt.target = create('canonical') as vt0 then Reference2Canonical(vs0, vt0);
  src.group as vs0 -> tgt.group as vt0 then group(vs0, vt0);
}


  "ConceptMap-url" : for src.url make tgt.url
  "ConceptMap-identifier" : for src.identifier make tgt.identifier
  "ConceptMap-version" : for src.version make tgt.version
  "ConceptMap-name" : for src.name make tgt.name
  "ConceptMap-status" : for src.status make tgt.status
  "ConceptMap-experimental" : for src.experimental make tgt.experimental
  "ConceptMap-publisher" : for src.publisher make tgt.publisher
  "ConceptMap-contact" : for src.contact as vs0 make tgt.contact as vt0 then {
    "ContactDetail-name" : for vs0.name make vt0.name
    "ContactDetail-telecom" : for vs0.telecom make vt0.telecom
  }

group group(source src, target tgt) extends BackboneElement {
  src.source -> tgt.source;
  src.sourceVersion -> tgt.sourceVersion;
  src.target -> tgt.target;
  src.targetVersion -> tgt.targetVersion;
  src.element as vs0 -> tgt.element as vt0 then element(vs0, vt0);
  src.unmapped as vs0 -> tgt.unmapped as vt0 then unmapped(vs0, vt0);
}


  "ConceptMap-date" : for src.date make tgt.date
  "ConceptMap-description" : for src.description make tgt.description
  "ConceptMap-purpose" : for src.requirements make tgt.purpose
  "ConceptMap-copyright" : for src.copyright make tgt.copyright
  "ConceptMap-jurisdiction" : for src.useContext where coding.system = 'urn:iso:std:iso:3166' make tgt.jurisdiction
  "ConceptMap-useContext" : for src.useContext as vs where (coding.system = 'urn:iso:std:iso:3166').not() make  tgt.useContext as uc,  uc.code as ucc,  ucc.system = "http://hl7.org/fhir/usage-context-type",  ucc.code = "task",  uc.value = create("CodeableConcept") as vt then CodeableConcept(vs, vt)
  "ConceptMap-source" : for src.source make tgt.source
  "ConceptMap-target" : for src.target make tgt.target

group element(source src, target tgt) extends BackboneElement {
  src.code -> tgt.code;
  src.display -> tgt.display;
  src.target as vs0 -> tgt.target as vt0 then target(vs0, vt0);
}


  // ConceptMap-backbone:     group src.element as srcE by srcE.codeSystem as srcSCs, inner srcE.target as srcT by srcT.codeSystem as srcTCs make tgt.group as tgtGrp, tgtGrp.source = srcSCs, tgtGrp.target = srcTCs then {
  "ConceptMap-element-1" : for src.element as srcE then {
    "ConceptMap-element-2" : for srcE.target as srcT make tgt.group as tgtGrp, tgtGrp.element as tgtE, tgtE.target as tgtT then {
      "ConceptMap-element-3" : for srcE.codeSystem make tgtGrp.source
      "ConceptMap-element-4" : for srcT.codeSystem make tgtGrp.target
      "ConceptMap-element-code":  for srcE.code make tgtE.code
      "ConceptMap-target-element":  for srcT.code make tgtT.code
      "ConceptMap-target-equivalence":  for srcT.equivalence make tgtT.equivalence
      "ConceptMap-target-comments":  for srcT.comments make tgtT.comment
      "ConceptMap-target-dependsOn":  for srcT.dependsOn as vs make tgtT.dependsOn as vt then {
        "ConceptMap-target-dependsOn-element": for vs.element make vt.property
        "ConceptMap-target-dependsOn-codeSystem": for vs.codeSystem make vt.system
        "ConceptMap-target-dependsOn-code": for vs.code make vt.code
      }  
      "ConceptMap-target-product":  for srcT.product as vs make tgtT.product as vt then {
        "ConceptMap-target-product-element": for vs.element make vt.property
        "ConceptMap-target-product-codeSystem": for vs.codeSystem make vt.system
        "ConceptMap-target-product-code": for vs.code make vt.code
      }  
    }
  }     

group target(source src, target tgt) extends BackboneElement {
  src.code -> tgt.code;
  src.display -> tgt.display;
  src.code -> tgt.code;
  src.display -> tgt.display;
  src.equivalence -> tgt.equivalence;
  src.comment -> tgt.comment;
  src.dependsOn as vs0 -> tgt.dependsOn as vt0 then qualifier(vs0, vt0);
  src.product as vs0 -> tgt.product as vt0 then qualifier(vs0, vt0);
}

group qualifier(source src, target tgt) extends BackboneElement {
  src.property -> tgt.property;
  src.system -> tgt.system;
  src.code -> tgt.value;
  src.display -> tgt.display;
}

group unmapped(source src, target tgt) extends BackboneElement {
  src.mode -> tgt.mode;
  src.code -> tgt.code;
  src.display -> tgt.display;
  src.url -> tgt.url;
}


endgroup


map "http://hl7.org/fhir/StructureMap/ConceptMap3to2" = "R3 to R2 Conversion for ConceptMap"

map "http://hl7.org/fhir/StructureMap/ConceptMap4to3" = "R4 to R3 Conversion for ConceptMap"


uses "http://hl7.org/fhir/StructureDefinition/ConceptMap" alias ConceptMap as source
uses "http://hl7.org/fhir/DSTU2/StructureDefinition/ConceptMap" alias ConceptMapR2 as target

uses "http://hl7.org/fhir/StructureDefinition/ConceptMap" alias ConceptMap as source
uses "http://hl7.org/fhir/3.0/StructureDefinition/ConceptMap" alias ConceptMapR3 as target


imports "http://hl7.org/fhir/StructureMap/primitives3to2"
imports "http://hl7.org/fhir/StructureMap/DomainResource3to2"
imports "http://hl7.org/fhir/StructureMap/ContactPoint3to2"
imports "http://hl7.org/fhir/StructureMap/Identifier3to2"
imports "http://hl7.org/fhir/StructureMap/Reference3to2"
imports "http://hl7.org/fhir/StructureMap/CodeableConcept3to2"

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


group for type+types  ConceptMap extends DomainResource
  input src : ConceptMap as source
  input tgt : ConceptMapR2 as target

group ConceptMap(source src : ConceptMap, target tgt : ConceptMapR3) 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 -> tgt.status;
  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.source : uri as vs0 -> tgt.source = create('uri') as vt0 then uri(vs0, vt0);
  src.source : canonical as vs0 -> tgt.source = create('Reference') as vt0 then canonical2Reference(vs0, vt0);
  src.target : uri as vs0 -> tgt.target = create('uri') as vt0 then uri(vs0, vt0) "targetU";
  src.target : canonical as vs0 -> tgt.target = create('Reference') as vt0 then canonical2Reference(vs0, vt0);
  src.group as vs0 -> tgt.group as vt0 then group(vs0, vt0);
}


  "ConceptMap-url" : for src.url make tgt.url
  "ConceptMap-identifier" : for src.identifier make tgt.identifier
  "ConceptMap-version" : for src.version make tgt.version
  "ConceptMap-name" : for src.name make tgt.name
  "ConceptMap-status" : for src.status make tgt.status
  "ConceptMap-experimental" : for src.experimental make tgt.experimental
  "ConceptMap-publisher" : for src.publisher make tgt.publisher
  "ConceptMap-contact" : for src.contact as vs0 make tgt.contact as vt0 then {
    "ConceptMap.contact-name" : for vs0.name make vt0.name
    "ConceptMap.contact-telecom" : for vs0.telecom make vt0.telecom
  }

group group(source src, target tgt) extends BackboneElement {
  src.source -> tgt.source;
  src.sourceVersion -> tgt.sourceVersion;
  src.target -> tgt.target;
  src.targetVersion -> tgt.targetVersion;
  src.element as vs0 -> tgt.element as vt0 then element(vs0, vt0);
  src.unmapped as vs0 -> tgt.unmapped as vt0 then unmapped(vs0, vt0);
}


  "ConceptMap-date" : for src.date make tgt.date
  "ConceptMap-description" : for src.description make tgt.description
  "ConceptMap-useContext-1" : for src.jurisdiction make tgt.useContext
  "ConceptMap-useContext" : for src.useContext as vs then {
    "ConceptMap-useContext-value" : for vs.value make tgt.useContext
  }
  "ConceptMap-requirements" : for src.purpose make tgt.requirements
  "ConceptMap-copyright" : for src.copyright make tgt.copyright

group element(source src, target tgt) extends BackboneElement {
  src.code -> tgt.code;
  src.display -> tgt.display;
  src.target as vs0 -> tgt.target as vt0 then target(vs0, vt0);
}


  "ConceptMap-source" : for src.source make tgt.source
  "ConceptMap-target" : for src.target make tgt.target

group target(source src, target tgt) extends BackboneElement {
  src.code -> tgt.code;
  src.display -> tgt.display;
  src.code -> tgt.code;
  src.display -> tgt.display;
  src.equivalence -> tgt.equivalence;
  src.comment -> tgt.comment;
  src.dependsOn as vs0 -> tgt.dependsOn as vt0 then qualifier(vs0, vt0);
  src.product as vs0 -> tgt.product as vt0 then qualifier(vs0, vt0);
}

group qualifier(source src, target tgt) extends BackboneElement {
  src.property -> tgt.property;
  src.system -> tgt.system;
  src.value -> tgt.code "code";
  src.display -> tgt.display;
}

group unmapped(source src, target tgt) extends BackboneElement {
  src.mode -> tgt.mode;
  src.code -> tgt.code;
  src.display -> tgt.display;
  src.url -> tgt.url;
}


  "ConceptMap-group" : for src.group as grp then {
    "ConceptMap-group-element" : for grp.element as els make tgt.element as elt then {
      "ConceptMap-element-code" : for grp.source make elt.codeSystem
      "ConceptMap-element-code" : for els.code make elt.code
      "ConceptMap-element-target" : for els.target as srcT make elt.target as tgtT then  {
        "ConceptMap-target-codeSystem":  for grp.target make tgtT.codeSystem
        "ConceptMap-target-code":  for srcT.code make tgtT.code
        "ConceptMap-target-equivalence":  for srcT.equivalence make tgtT.equivalence
        "ConceptMap-target-comments":  for srcT.comment make tgtT.comments
        "ConceptMap-target-dependsOn":  for srcT.dependsOn as vs make tgtT.dependsOn as vt then {
          "ConceptMap-target-dependsOn-element": for vs.property make vt.element
          "ConceptMap-target-dependsOn-codeSystem": for vs.system make vt.codeSystem
          "ConceptMap-target-dependsOn-code": for vs.code make vt.code
        }  
        "ConceptMap-target-product":  for srcT.product as vs make tgtT.product as vt then {
          "ConceptMap-target-product-element": for vs.property make vt.element
          "ConceptMap-target-product-codeSystem": for vs.system make vt.codeSystem
          "ConceptMap-target-product-code": for vs.code make vt.code
        }  
      }
    }
  }
endgroup


102 WARNING @ ConceptMap.group[41].element.target.comment: value should not start or finish with whitespace (src = InstanceValidator) <p>No validation errors - all conversions are clean</p>