R4 Draft for Comment

This page is part of the FHIR Specification (v3.2.0: R4 Ballot 1). 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

Public Health and Emergency Response Work GroupMaturity Level: N/ABallot Status: Informative Compartments: Patient, Practitioner

R2 : R3 Conversion maps for Immunization.

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

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

uses "http://hl7.org/fhir/DSTU2/StructureDefinition/Immunization" alias ImmunizationR2 as source
uses "http://hl7.org/fhir/StructureDefinition/Immunization" alias Immunization as target

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

group for type+types  Immunization extends DomainResource
  input src : ImmunizationR2 as source
  input tgt : Immunization as target

  "Immunization-identifier" : for src.identifier make tgt.identifier
  "Immunization-status" : for src.status where $this = 'completed' or $this = 'entered-in-error' make tgt.status
  "Immunization-date" : for src.date make tgt.date
  "Immunization-vaccineCode" : for src.vaccineCode make tgt.vaccineCode
  "Immunization-patient" : for src.patient make tgt.patient
  "Immunization-wasNotGiven" : for src.wasNotGiven make tgt.notGiven
  "Immunization-performer" : for src.performer as v make tgt.practitioner as p, p.role = cc("http://hl7.org/fhir/v2/0443", "AP"), p.actor = v
  "Immunization-requester" : for src.requester as v make tgt.practitioner as p, p.role = cc("http://hl7.org/fhir/v2/0443", "OP"), p.actor = v
  "Immunization-encounter" : for src.encounter make tgt.encounter
  "Immunization-manufacturer" : for src.manufacturer make tgt.manufacturer
  "Immunization-location" : for src.location make tgt.location
  "Immunization-lotNumber" : for src.lotNumber make tgt.lotNumber
  "Immunization-expirationDate" : for src.expirationDate make tgt.expirationDate
  "Immunization-site" : for src.site make tgt.site
  "Immunization-route" : for src.route make tgt.route
  "Immunization-doseQuantity" : for src.doseQuantity make tgt.doseQuantity
  "Immunization-note" : for src.note make tgt.note
  "Immunization-explanation" : for src.explanation as vs0 make tgt.explanation as vt0 then immExplanation(vs0, vt0)
  "Immunization-reaction" : for src.reaction as vs0 make tgt.reaction as vt0 then immReaction(vs0, vt0)
  "Immunization-vaccinationProtocol" : for src.vaccinationProtocol as vs0 make tgt.vaccinationProtocol as vt0 then immProtocol(vs0, vt0)
endgroup

group immExplanation extends BackboneElement
  input src as source
  input tgt as target
  
  "Immunization.explanation-reason" : for src.reason make tgt.reason
  "Immunization.explanation-reasonNotGiven" : for src.reasonNotGiven make tgt.reasonNotGiven
endgroup

group immReaction extends BackboneElement
  input src as source
  input tgt as target
  
  "Immunization.reaction-date" : for src.date make tgt.date
  "Immunization.reaction-detail" : for src.detail make tgt.detail
  "Immunization.reaction-reported" : for src.reported make tgt.reported
endgroup

group immProtocol extends BackboneElement
  input src as source
  input tgt as target
  
  "Immunization.vaccinationProtocol-doseSequence" : for src.doseSequence make tgt.doseSequence
  "Immunization.vaccinationProtocol-description" : for src.description make tgt.description
  "Immunization.vaccinationProtocol-authority" : for src.authority make tgt.authority
  "Immunization.vaccinationProtocol-series" : for src.series make tgt.series
  "Immunization.vaccinationProtocol-seriesDoses" : for src.seriesDoses make tgt.seriesDoses
  "Immunization.vaccinationProtocol-targetDisease" : for src.targetDisease make tgt.targetDisease
  "Immunization.vaccinationProtocol-doseStatus" : for src.doseStatus make tgt.doseStatus
  "Immunization.vaccinationProtocol-doseStatusReason" : for src.doseStatusReason make tgt.doseStatusReason
endgroup
  

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

uses "http://hl7.org/fhir/StructureDefinition/Immunization" alias Immunization as source
uses "http://hl7.org/fhir/DSTU2/StructureDefinition/Immunization" alias ImmunizationR2 as target

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

group for type+types  Immunization extends DomainResource
  input src : Immunization as source
  input tgt : ImmunizationR2 as target

  "Immunization-identifier" : for src.identifier make tgt.identifier
  "Immunization-status" : for src.status make tgt.status
  "Immunization-date" : for src.date make tgt.date
  "Immunization-vaccineCode" : for src.vaccineCode make tgt.vaccineCode
  "Immunization-patient" : for src.patient make tgt.patient
  "Immunization-wasNotGiven" : for src.notGiven make tgt.wasNotGiven
  // can't translate reported
  "Immunization-performer" : for src.practitioner as v where v.role.coding.code.contains("AP") then {
    "Immunization-performer-inner" : for v.actor make tgt.performer 
  }
  "Immunization-requester" : for src.practitioner as v where v.role.coding.code.contains("OP") then {
    "Immunization-requester-inner" : for v.actor make tgt.requester 
  }
  "Immunization-encounter" : for src.encounter make tgt.encounter
  "Immunization-manufacturer" : for src.manufacturer make tgt.manufacturer
  "Immunization-location" : for src.location make tgt.location
  "Immunization-lotNumber" : for src.lotNumber make tgt.lotNumber
  "Immunization-expirationDate" : for src.expirationDate make tgt.expirationDate
  "Immunization-site" : for src.site make tgt.site
  "Immunization-route" : for src.route make tgt.route
  "Immunization-doseQuantity" : for src.doseQuantity make tgt.doseQuantity
  "Immunization-note" : for src.note make tgt.note
  "Immunization-explanation" : for src.explanation as vs0 make tgt.explanation as vt0 then immExplanation(vs0, vt0)
  "Immunization-reaction" : for src.reaction as vs0 make tgt.reaction as vt0 then immReaction(vs0, vt0)
  "Immunization-vaccinationProtocol" : for src.vaccinationProtocol as vs0 make tgt.vaccinationProtocol as vt0 then immProtocol(vs0, vt0)
endgroup

group immExplanation extends BackboneElement
  input src as source
  input tgt as target
  
  "Immunization.explanation-reason" : for src.reason make tgt.reason
  "Immunization.explanation-reasonNotGiven" : for src.reasonNotGiven make tgt.reasonNotGiven
endgroup

group immReaction extends BackboneElement
  input src as source
  input tgt as target
  
  "Immunization.reaction-date" : for src.date make tgt.date
  "Immunization.reaction-detail" : for src.detail make tgt.detail
  "Immunization.reaction-reported" : for src.reported make tgt.reported
endgroup

group immProtocol extends BackboneElement
  input src as source
  input tgt as target
  
  "Immunization.vaccinationProtocol-doseSequence" : for src.doseSequence make tgt.doseSequence
  "Immunization.vaccinationProtocol-description" : for src.description make tgt.description
  "Immunization.vaccinationProtocol-authority" : for src.authority make tgt.authority
  "Immunization.vaccinationProtocol-series" : for src.series make tgt.series
  "Immunization.vaccinationProtocol-seriesDoses" : for src.seriesDoses make tgt.seriesDoses
  "Immunization.vaccinationProtocol-targetDisease" : for src.targetDisease make tgt.targetDisease
  "Immunization.vaccinationProtocol-doseStatus" : for src.doseStatus make tgt.doseStatus
  "Immunization.vaccinationProtocol-doseStatusReason" : for src.doseStatusReason make tgt.doseStatusReason
endgroup
  

example
  • ERROR @ Immunization: Profile http://hl7.org/fhir/StructureDefinition/Immunization, Element 'Immunization.primarySource': minimum required = 1, but only found 0 (src = InstanceValidator)
notGiven
  • ERROR @ Immunization: Profile http://hl7.org/fhir/StructureDefinition/Immunization, Element 'Immunization.primarySource': minimum required = 1, but only found 0 (src = InstanceValidator)