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

Patient Care Work GroupMaturity Level: N/ABallot Status: Informative Compartments: Device, Encounter, Patient, Practitioner, RelatedPerson

R2 : R3 Conversion maps for CommunicationRequest.

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

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


conceptmap "CommunicationRequestStatus" {
  prefix s = "http://hl7.org/fhir/communication-request-status"
  prefix t = "http://hl7.org/fhir/communication-request-status"

  s:proposed = t:draft
  s:planned = t:draft
  s:requested = t:active
  s:received = t:active
  s:accepted = t:active
  s:"in-progress" = t:active
  s:completed = t:completed
  s:suspended = t:suspended	
  s:rejected = t:cancelled
  s:failed = t:cancelled
}


uses "http://hl7.org/fhir/DSTU2/StructureDefinition/CommunicationRequest" alias CommunicationRequestR2 as source
uses "http://hl7.org/fhir/StructureDefinition/CommunicationRequest" alias CommunicationRequest as target

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


group for type+types CommunicationRequest extends DomainResource
  input src : CommunicationRequestR2 as source
  input tgt : CommunicationRequest as target

  "CommunicationRequest-identifier" : for src.identifier make tgt.identifier
  "CommunicationRequest-category" : for src.category make tgt.category
  "CommunicationRequest-sender" : for src.sender make tgt.sender
  "CommunicationRequest-recipient" : for src.recipient make tgt.recipient
  "CommunicationRequest-payload" : for src.payload as vs0 make tgt.payload as vt0 then cmrPayload(vs0, vt0)
  "CommunicationRequest-medium" : for src.medium make tgt.medium
  "CommunicationRequest-requester" : for src.requester make tgt.requester
  "CommunicationRequest-status" : for src.status as v make tgt.status = translate(v, "#CommunicationRequestStatus", "code")
  "CommunicationRequest-context" : for src.encounter make tgt.context
  "CommunicationRequest-scheduled" : for src.scheduled make tgt.occurrence 
  "CommunicationRequest-reason" : for src.reason make tgt.reasonCode
  "CommunicationRequest-requestedOn" : for src.requestedOn make tgt.authoredOn
  "CommunicationRequest-subject" : for src.subject make tgt.subject
  "CommunicationRequest-priority" : for src.priority make tgt.priority
endgroup

group cmrPayload
  input src as source
  input tgt as target
  
  "CommunicationRequest.payload-content" : for src.content make tgt.content 
endgroup
map "http://hl7.org/fhir/StructureMap/CommunicationRequest3to2" = "R3 to R2 Conversion for CommunicationRequest"

uses "http://hl7.org/fhir/StructureDefinition/CommunicationRequest" alias CommunicationRequest as source
uses "http://hl7.org/fhir/DSTU2/StructureDefinition/CommunicationRequest" alias CommunicationRequestR2 as target

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

group for type+types  CommunicationRequest extends DomainResource
  input src : CommunicationRequest as source
  input tgt : CommunicationRequestR2 as target

  "CommunicationRequest-identifier" : for src.identifier make tgt.identifier
  "CommunicationRequest-category" : for src.category make tgt.category
  "CommunicationRequest-sender" : for src.sender make tgt.sender
  "CommunicationRequest-recipient" : for src.recipient make tgt.recipient
  "CommunicationRequest-payload" : for src.payload as vs0 make tgt.payload as vt0 then cmrPayload(vs0, vt0)
  "CommunicationRequest-medium" : for src.medium make tgt.medium
  "CommunicationRequest-requester" : for src.requester make tgt.requester
  "CommunicationRequest-status" : for src.status make tgt.status
  "CommunicationRequest-context" : for src.context make tgt.encounter
  "CommunicationRequest-scheduled" : for src.occurrence make tgt.scheduled 
  "CommunicationRequest-reason" : for src.reasonCode make tgt.reason
  "CommunicationRequest-requestedOn" : for src.authoredOn make tgt.requestedOn
  "CommunicationRequest-subject" : for src.subject make tgt.subject
  "CommunicationRequest-priority" : for src.priority make tgt.priority
endgroup

group cmrPayload
  input src as source
  input tgt as target
  
  "CommunicationRequest.payload-content" : for vs0.content make vt0.content 
endgroup
example
  • ERROR @ CommunicationRequest: Profile http://hl7.org/fhir/StructureDefinition/CommunicationRequest, Element 'CommunicationRequest.status': minimum required = 1, but only found 0 (src = InstanceValidator)