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: R4 to R3

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

ServiceRequestTransformsR4toR3

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

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

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

group ServiceRequest(source src : ServiceRequest, target tgt : ProcedureRequestR3) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.instantiatesCanonical -> tgt.definition;
  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.encounter -> tgt.context;
  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 -> tgt.agent as v then Reference(src, v) "agent";
  src.extension as e where url = 'http://hl7.org/fhir/3.0/StructureDefinition/extension-ProcedureRequest.requester.onBehalfOf' then {
    e.value -> tgt.onBehalfOf;
  };
}