R4 Ballot #1 #2 (Mixed Normative/Trial use)

This page is part of the FHIR Specification (v3.3.0: (v3.5.0: R4 Ballot 2). #2). 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

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

R2 : R3 : R4 Conversion maps for ConceptMap.

Functional status for this map: 2 4 tests that all execute ok. All tests pass 4 fail 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/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


  "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
  }


  "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

  // 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 ConceptMap extends DomainResource
  input src : ConceptMapR3 as source
  input tgt : ConceptMap as target


  "ConceptMap.url" : for src.url as vs make tgt.url as vt
  "ConceptMap.identifier" : for src.identifier as vs make tgt.identifier as vt
  "ConceptMap.version" : for src.version as vs make tgt.version as vt
  "ConceptMap.name" : for src.name as vs make tgt.name as vt
  "ConceptMap.title" : for src.title as vs make tgt.title as vt
  "ConceptMap.status" : for src.status as vs make tgt.status as vt
  "ConceptMap.experimental" : for src.experimental as vs make tgt.experimental as vt
  "ConceptMap.date" : for src.date as vs make tgt.date as vt
  "ConceptMap.publisher" : for src.publisher as vs make tgt.publisher as vt
  "ConceptMap.contact" : for src.contact as vs make tgt.contact as vt
  "ConceptMap.description" : for src.description as vs make tgt.description as vt
  "ConceptMap.useContext" : for src.useContext as vs make tgt.useContext as vt
  "ConceptMap.jurisdiction" : for src.jurisdiction as vs make tgt.jurisdiction as vt
  "ConceptMap.purpose" : for src.purpose as vs make tgt.purpose as vt
  "ConceptMap.copyright" : for src.copyright as vs make tgt.copyright as vt
  "ConceptMap.group" : for src.group as vs0 make tgt.group as vt0 then {
    "ConceptMap.group.source" : for vs0.source as vs make vt0.source as vt
    "ConceptMap.group.sourceVersion" : for vs0.sourceVersion as vs make vt0.sourceVersion as vt
    "ConceptMap.group.target" : for vs0.target as vs make vt0.target as vt
    "ConceptMap.group.targetVersion" : for vs0.targetVersion as vs make vt0.targetVersion as vt
  }

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


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"

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


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

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


  "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
  }


  "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


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

group ConceptMap extends DomainResource
  input src : ConceptMap as source
  input tgt : ConceptMapR3 as target


  "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
        }  
      }
    }

  "ConceptMap.url" : for src.url as vs make tgt.url as vt
  "ConceptMap.identifier" : for src.identifier as vs make tgt.identifier as vt
  "ConceptMap.version" : for src.version as vs make tgt.version as vt
  "ConceptMap.name" : for src.name as vs make tgt.name as vt
  "ConceptMap.title" : for src.title as vs make tgt.title as vt
  "ConceptMap.status" : for src.status as vs make tgt.status as vt
  "ConceptMap.experimental" : for src.experimental as vs make tgt.experimental as vt
  "ConceptMap.date" : for src.date as vs make tgt.date as vt
  "ConceptMap.publisher" : for src.publisher as vs make tgt.publisher as vt
  "ConceptMap.contact" : for src.contact as vs make tgt.contact as vt
  "ConceptMap.description" : for src.description as vs make tgt.description as vt
  "ConceptMap.useContext" : for src.useContext as vs make tgt.useContext as vt
  "ConceptMap.jurisdiction" : for src.jurisdiction as vs make tgt.jurisdiction as vt
  "ConceptMap.purpose" : for src.purpose as vs make tgt.purpose as vt
  "ConceptMap.copyright" : for src.copyright as vs make tgt.copyright as vt
  "ConceptMap.source-uri" : for src.source  : uri as vs make tgt.source = create("uri") as vt then uri(vs,vt)
  "ConceptMap.target-uri" : for src.target  : uri as vs make tgt.target = create("uri") as vt then uri(vs,vt)
  "ConceptMap.group" : for src.group as vs0 make tgt.group as vt0 then {
    "ConceptMap.group.source" : for vs0.source as vs make vt0.source as vt
    "ConceptMap.group.sourceVersion" : for vs0.sourceVersion as vs make vt0.sourceVersion as vt
    "ConceptMap.group.target" : for vs0.target as vs make vt0.target as vt
    "ConceptMap.group.targetVersion" : for vs0.targetVersion as vs make vt0.targetVersion as vt

  }
endgroup



102 WARNING @ ConceptMap.group[41].element.target.comment: value should not start or finish with whitespace (src = InstanceValidator)