hl7.resource.ServiceRequest.yml Maven / Gradle / Ivy
#
# (C) Copyright IBM Corp. 2021, 2022
#
# SPDX-License-Identifier: Apache-2.0
#
resourceType: ServiceRequest
id:
type: STRING
valueOf: "GeneralUtils.generateResourceId()"
expressionType: JEXL
identifier_1:
condition: $valueIn NOT_NULL
valueOf: datatype/Identifier_var
generateList: true
expressionType: resource
vars:
valueIn: PV1.19.1 | PID.18.1 | MSH.7
systemCX: PV1.19.4 | PID.18.4
constants:
system: "http://terminology.hl7.org/CodeSystem/v2-0203"
code: "VN"
display: "Visit number"
# The logic for Filler appears it should be:
# valueIn: ORC.3.1 | OBR.3.1
# systemCX: ORC.3.2 | OBR.3.2
# But if ORC.3.1 has a value and ORC.3.2 is empty but OBR.3.2 has a value,
# it results in mismatched code and system values.
# The code below forces the value and the system to be of the same pair.
# Similar settings for Placer.
identifier_2a:
condition: $valueIn NOT_NULL
valueOf: datatype/Identifier_var
generateList: true
useGroup: true
expressionType: resource
vars:
valueIn: ORC.3.1
systemCX: ORC.3.2
constants:
system: "http://terminology.hl7.org/CodeSystem/v2-0203"
code: "FILL"
display: "Filler Identifier"
identifier_2b:
condition: $valueInORC NULL && $valueIn NOT_NULL
valueOf: datatype/Identifier_var
generateList: true
useGroup: true
expressionType: resource
vars:
valueIn: OBR.3.1
systemCX: OBR.3.2
valueInORC: ORC.3.1
constants:
system: "http://terminology.hl7.org/CodeSystem/v2-0203"
code: "FILL"
display: "Filler Identifier"
identifier_3a:
condition: $valueIn NOT_NULL
valueOf: datatype/Identifier_var
generateList: true
useGroup: true
expressionType: resource
vars:
valueIn: ORC.2.1
systemCX: ORC.2.2
constants:
system: "http://terminology.hl7.org/CodeSystem/v2-0203"
code: "PLAC"
display: "Placer Identifier"
identifier_3b:
condition: $valueInORC NULL && $valueIn NOT_NULL
valueOf: datatype/Identifier_var
generateList: true
useGroup: true
expressionType: resource
vars:
valueIn: OBR.2.1
systemCX: OBR.2.2
valueInORC: ORC.2.1
constants:
system: "http://terminology.hl7.org/CodeSystem/v2-0203"
code: "PLAC"
display: "Placer Identifier"
status:
type: SERVICE_REQUEST_STATUS
default: "unknown"
valueOf: ORC.5
expressionType: HL7Spec
intent:
type: STRING
valueOf: $default
expressionType: HL7Spec
constants:
default: "order"
subject:
valueOf: datatype/Reference
expressionType: resource
specs: $Patient
# Requisition was removed because PGN does not currently validate with HAPI HL7 parser using system http://terminology.hl7.org/CodeSystem/v2-0203.
# The only known possible alternative system: http://terminology.hl7.org/2.1.0/CodeSystem/v2-0203 fails to validate with HAPI FHIR validator.
authoredOn:
type: STRING
valueOf: "GeneralUtils.dateTimeWithZoneId(dateTimeIn,ZONEID)"
expressionType: JEXL
vars:
dateTimeIn: ORC.9 | OBR.6
occurrenceDateTime:
type: STRING
valueOf: "GeneralUtils.dateTimeWithZoneId(dateTimeIn,ZONEID)"
expressionType: JEXL
vars:
dateTimeIn: ORC.15 | OBR.7 | OBR.27.4
requester:
condition: $request NOT_NULL
valueOf: resource/Practitioner
expressionType: reference
specs: ORC.12 | OBR.16
vars:
request: ORC.12 | OBR.16
referenceDisplay: PERSON_DISPLAY_NAME, ORC.12 | OBR.16
reasonCode:
condition: $reasonCWE NOT_NULL
valueOf: datatype/CodeableConcept
generateList: true
expressionType: resource
specs: OBR.31 | ORC.16
vars:
reasonCWE: OBR.31 | ORC.16
code:
condition: $codeCWE NOT_NULL
valueOf: datatype/CodeableConcept
expressionType: resource
specs: OBR.4
vars:
codeCWE: OBR.4
note:
valueOf: datatype/Annotation
condition: $annotationText NOT_NULL
expressionType: resource
vars:
annotationText: NTE.3 *&, GeneralUtils.concatenateWithChar(annotationText, ' \n')