FHIR Cross-Version Mapping Pack
0.1.0 - Ballot for Release 5.1.0 International flag

FHIR Cross-Version Mapping Pack, published by HL7 International / FHIR Infrastructure. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/fhir-cross-version/ and changes regularly. See the Directory of published versions

StructureMap: ServiceRequest Transforms: R3 to R4

Official URL: http://hl7.org/fhir/StructureMap/ProcedureRequest3to4 Version: 0.1.0
Standards status: Draft Maturity Level: 1 Computable Name: ProcedureRequest3to4

ServiceRequestTransformsR3toR4

/// url = 'http://hl7.org/fhir/StructureMap/ProcedureRequest3to4'
/// name = 'ProcedureRequest3to4'
/// title = 'ServiceRequest Transforms: R3 to R4'
/// status = 'active'

uses "http://hl7.org/fhir/3.0/ProcedureRequest" alias ProcedureRequestR3 as source
uses "http://hl7.org/fhir/4.0/ServiceRequest" alias ServiceRequest as target

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

group ServiceRequest(source src : ProcedureRequestR3, target tgt : ServiceRequest) extends DomainResource <<type+>> {
  src as v ->  tgt.extension as vt,  vt.url = 'http://hl7.org/fhir/3.0/StructureDefinition/BaseType',  vt.value = 'ProcedureRequest' "ProcedureRequest";
  src.identifier -> tgt.identifier;
  src.definition -> tgt.instantiatesCanonical;
  src.basedOn -> tgt.basedOn;
  src.replaces -> tgt.replaces;
  src.requisition -> tgt.requisition;
  src.status -> tgt.status;
  src.intent -> tgt.intent;
  src.category -> tgt.category;
  src.priority -> tgt.priority;
  src.doNotPerform -> tgt.doNotPerform;
  src.code -> tgt.code;
  src.orderDetail -> tgt.orderDetail;
  src.subject -> tgt.subject;
  src.context -> tgt.encounter;
  src.occurrence : dateTime as vs -> tgt.occurrence = create('dateTime') as vt then dateTime(vs, vt);
  src.occurrence : Period as vs -> tgt.occurrence = create('Period') as vt then Period(vs, vt);
  src.occurrence : Timing as vs -> tgt.occurrence = create('Timing') as vt then Timing(vs, vt);
  src.asNeeded : boolean as vs -> tgt.asNeeded = create('boolean') as vt then boolean(vs, vt);
  src.asNeeded : CodeableConcept as vs -> tgt.asNeeded = create('CodeableConcept') as vt then CodeableConcept(vs, vt);
  src.authoredOn -> tgt.authoredOn;
  src.requester as vs -> tgt.requester as vt then requester(vs, vt);
  src.performerType -> tgt.performerType;
  src.performer -> tgt.performer;
  src.reasonCode -> tgt.reasonCode;
  src.reasonReference -> tgt.reasonReference;
  src.supportingInfo -> tgt.supportingInfo;
  src.specimen -> tgt.specimen;
  src.bodySite -> tgt.bodySite;
  src.note -> tgt.note;
  src.patientInstruction -> tgt.patientInstruction;
  src.relevantHistory -> tgt.relevantHistory;
}

group requester(source src, target tgt) {
  src.agent as v then Reference(v, tgt);
  src.onBehalfOf as v ->  tgt.extension as vt,  vt.url = 'http://hl7.org/fhir/3.0/StructureDefinition/extension-ProcedureRequest.requester.onBehalfOf',  vt.value = v;
}