FHIR Release 3 (STU) Current Build
This page is part of FHIR STU 3 (v3.0.1) in it's permanent home (it will always be available at this URL). It has been superceded by R4 . For a full list of available versions, see the Directory of published versions .
Orders and Observations Work Group Maturity Level : N/A Ballot Standards Status : Informative Security Category : Patient Compartments : Device , Patient

R2 : R3 Converson : R4 Conversion maps for DeviceUseStatement.

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

map "http://hl7.org/fhir/StructureMap/DeviceUseStatement2to3" = "R2 to R3 Conversions for DeviceUseStatement"
map "http://hl7.org/fhir/StructureMap/DeviceUseStatement3to4" = "R3 to R4 Conversions for DeviceUseStatement"
uses "http://hl7.org/fhir/DSTU2/StructureDefinition/DeviceUseStatement" alias DeviceUseStatementR2 as source

uses "http://hl7.org/fhir/3.0/StructureDefinition/DeviceUseStatement" alias DeviceUseStatementR3 as source

uses "http://hl7.org/fhir/StructureDefinition/DeviceUseStatement" alias DeviceUseStatement as target
imports "http://hl7.org/fhir/StructureMap/*2to3"

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

group for type+types  DeviceUseStatement extends DomainResource
  input src : DeviceUseStatementR2 as source
  input tgt : DeviceUseStatement as target

group DeviceUseStatement(source src : DeviceUseStatementR3, target tgt : DeviceUseStatement) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.status -> tgt.status;
  src.subject -> tgt.subject;
  src.whenUsed as v ->  tgt.extension as vt,  vt.url = 'http://hl7.org/fhir/3.0/StructureDefinition/extension-DeviceUseStatement.whenUsed',  vt.value = v;
  src.timing : Timing as vs -> tgt.timing = create('Timing') as vt then Timing(vs, vt);
  src.timing : Period as vs -> tgt.timing = create('Period') as vt then Period(vs, vt);
  src.timing : dateTime as vs -> tgt.timing = create('dateTime') as vt then dateTime(vs, vt);
  src.recordedOn -> tgt.recordedOn;
  src.source -> tgt.source;
  src.device -> tgt.device;
  src.indication -> tgt.reasonCode;
  src.bodySite -> tgt.bodySite;
  src.note -> tgt.note;
}

  "DeviceUseStatement-bodySite" : for src.bodySiteCodeableConcept make tgt.bodySite
  "DeviceUseStatement-whenUsed" : for src.whenUsed make tgt.whenUsed
  "DeviceUseStatement-device" : for src.device make tgt.device
  "DeviceUseStatement-identifier" : for src.identifier make tgt.identifier
  "DeviceUseStatement-indication" : for src.indication make tgt.indication
  "DeviceUseStatement-notes" : for src.notes as v make tgt.note as n, n.text = v
  "DeviceUseStatement-recordedOn" : for src.recordedOn make tgt.recordedOn
  "DeviceUseStatement-subject" : for src.subject make tgt.subject
  "DeviceUseStatement-timing" : for src.timing make tgt.timing
endgroup

map "http://hl7.org/fhir/StructureMap/DeviceUseStatement3to2" = "R3 to R2 Conversion for DeviceUseStatement"
map "http://hl7.org/fhir/StructureMap/DeviceUseStatement4to3" = "R4 to R3 Conversion for DeviceUseStatement"
uses "http://hl7.org/fhir/StructureDefinition/DeviceUseStatement" alias DeviceUseStatement as source
uses "http://hl7.org/fhir/DSTU2/StructureDefinition/DeviceUseStatement" alias DeviceUseStatementR2 as target
imports "http://hl7.org/fhir/StructureMap/*3to2"
group for type+types  DeviceUseStatement extends DomainResource
  input src : DeviceUseStatement as source
  input tgt : DeviceUseStatementR2 as target

uses "http://hl7.org/fhir/3.0/StructureDefinition/DeviceUseStatement" alias DeviceUseStatementR3 as target

  "DeviceUseStatement-bodySite-CodeableConcept" : for src.bodySite : CodeableConcept as vs make tgt.bodySite = create("CodeableConcept") as vt then CodeableConcept(vs, vt)
  "DeviceUseStatement-whenUsed" : for src.whenUsed make tgt.whenUsed
  "DeviceUseStatement-device" : for src.device make tgt.device
  "DeviceUseStatement-identifier" : for src.identifier make tgt.identifier
  "DeviceUseStatement-indication" : for src.indication make tgt.indication
  "DeviceUseStatement-notes" : for src.note as n then dusNote(n, tgt)
  "DeviceUseStatement-recordedOn" : for src.recordedOn make tgt.recordedOn
  "DeviceUseStatement-subject" : for src.subject make tgt.subject
  "DeviceUseStatement-timing" : for src.timing make tgt.timing
endgroup

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

group dusNote extends BackboneElement
  input src as source
  input tgt as target

group DeviceUseStatement(source src : DeviceUseStatement, target tgt : DeviceUseStatementR3) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.status -> tgt.status;
  src.subject -> tgt.subject;
  src.extension as e where url = 'http://hl7.org/fhir/3.0/StructureDefinition/extension-DeviceUseStatement.whenUsed' then {
    e.value -> tgt.whenUsed;
  };
  src.timing : Timing as vs -> tgt.timing = create('Timing') as vt then Timing(vs, vt);
  src.timing : Period as vs -> tgt.timing = create('Period') as vt then Period(vs, vt);
  src.timing : dateTime as vs -> tgt.timing = create('dateTime') as vt then dateTime(vs, vt);
  src.recordedOn -> tgt.recordedOn;
  src.source -> tgt.source;
  src.device -> tgt.device;
  src.reasonCode -> tgt.indication "indication";
  src.bodySite -> tgt.bodySite;
  src.note -> tgt.note;
}

  "DeviceUseStatement.note-notes" : for src.text make tgt.notes
endgroup

example ERROR @ DeviceUseStatement: Profile http://hl7.org/fhir/StructureDefinition/DeviceUseStatement, Element 'DeviceUseStatement.status': minimum required = 1, but only found 0 (src = InstanceValidator) <p>No validation errors - all conversions are clean</p>