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

Orders and Observations Work GroupMaturity Level: N/ABallot Status: Informative Compartments: Device

R2 : R3 Conversion maps for Device.

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

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

conceptmap "DeviceStatus" {
  prefix s = "http://hl7.org/fhir/devicestatus"
  prefix t = "http://hl7.org/fhir/devicestatus"

  s:available	 = t:active 
  s:inactive = t:"not-available"
  s:"entered-in-error" = t:"entered-in-error"
}


uses "http://hl7.org/fhir/DSTU2/StructureDefinition/Device" alias DeviceR2 as source
uses "http://hl7.org/fhir/StructureDefinition/Device" alias Device as target

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

group for type+types  Device extends DomainResource
  input src : DeviceR2 as source
  input tgt : Device as target

  "Device-identifier" : for src.identifier make tgt.identifier
  "Device-type" : for src.type make tgt.type
  "Device-note" : for src.note make tgt.note
  "Device-status" : for src.status as v make tgt.status = translate(v, "#DeviceStatus", "code")
  "Device-manufacturer" : for src.manufacturer make tgt.manufacturer
  "Device-model" : for src.model make tgt.model
  "Device-version" : for src.version make tgt.version
  "Device-manufactureDate" : for src.manufactureDate make tgt.manufactureDate
  "Device-expirationDate" : for src.expiry make tgt.expirationDate
  "Device-udi" : for src.udi as u make tgt.udi as t, t.deviceIdentifier = u
  "Device-lotNumber" : for src.lotNumber make tgt.lotNumber
  "Device-owner" : for src.owner make tgt.owner
  "Device-location" : for src.location make tgt.location
  "Device-patient" : for src.patient make tgt.patient
  "Device-contact" : for src.contact make tgt.contact
  "Device-url" : for src.url make tgt.url
endgroup

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

conceptmap "DeviceStatus" {
  prefix s = "http://hl7.org/fhir/devicestatus"
  prefix t = "http://hl7.org/fhir/devicestatus"

  s:available	 = t:active 
  s:"not-available" = t:inactive 
  s:"entered-in-error" = t:"entered-in-error"
}

uses "http://hl7.org/fhir/StructureDefinition/Device" alias Device as source
uses "http://hl7.org/fhir/DSTU2/StructureDefinition/Device" alias DeviceR2 as target

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

group for type+types  Device extends DomainResource
  input src : Device as source
  input tgt : DeviceR2 as target

  "Device-identifier" : for src.identifier make tgt.identifier
  "Device-type" : for src.type make tgt.type
  "Device-note" : for src.note make tgt.note
  "Device-status" : for src.status as v make tgt.status = translate(v, "#DeviceStatus", "code")
  "Device-manufacturer" : for src.manufacturer make tgt.manufacturer
  "Device-model" : for src.model make tgt.model
  "Device-version" : for src.version make tgt.version
  "Device-manufactureDate" : for src.manufactureDate make tgt.manufactureDate
  "Device-expirationDate" : for src.expirationDate make tgt.expiry
  "Device-udi" : for src.udi as u then udi(u, tgt)
  "Device-lotNumber" : for src.lotNumber make tgt.lotNumber
  "Device-owner" : for src.owner make tgt.owner
  "Device-location" : for src.location make tgt.location
  "Device-patient" : for src.patient make tgt.patient
  "Device-contact" : for src.contact make tgt.contact
  "Device-url" : for src.url make tgt.url
endgroup

group udi 
  input src as source
  input tgt as target
  
  "udi" : for src.deviceIdentifier make tgt.udi
endgroup