hl7.resource.Patient.yml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hl7v2-fhir-converter Show documentation
Show all versions of hl7v2-fhir-converter Show documentation
FHIR converter is a Java based library that enables converting Hl7v2 messages to FHIR resources
#
# (C) Copyright IBM Corp. 2020, 2022
#
# SPDX-License-Identifier: Apache-2.0
#
resourceType: Patient
# Represents data that needs to be extracted for a Patient Resource in FHIR
# reference: https://www.hl7.org/fhir/patient.html
id:
type: STRING
valueOf: UUID.randomUUID()
expressionType: JEXL
identifier_1:
valueOf: datatype/Identifier_SystemID
generateList: true
expressionType: resource
specs: PID.3
vars:
assignerSystem: String, PID.3.4
# NOTE: indentifier_2a and indentifier_2b can be combined when complex boolean conditions supported
# When the Coverage.subscriber is not self use PID.19 for SSN identifier
identifier_2a:
condition: $valueIn NOT_NULL && $subscriberIsSelf NOT_EQUALS TRUE
valueOf: datatype/Identifier_var
generateList: true
expressionType: resource
vars:
valueIn: String, PID.19 # subscriber SSN
subscriberIsSelf: SUBSCRIBER_IS_SELF, IN1.17 | IN2.72 # subscriber relationship
constants:
system: http://terminology.hl7.org/CodeSystem/v2-0203
code: SS
display: Social Security number
# There is no text for PID.19
# When the Coverage.subscriber is null use PID.19 for SSN identifier
identifier_2b:
condition: $valueIn NOT_NULL && $subscriberIsSelf NULL
valueOf: datatype/Identifier_var
generateList: true
expressionType: resource
vars:
valueIn: String, PID.19 # subscriber SSN
subscriberIsSelf: SUBSCRIBER_IS_SELF, IN1.17 | IN2.72 # subscriber relationship
constants:
system: http://terminology.hl7.org/CodeSystem/v2-0203
code: SS
display: Social Security number
# There is no text for PID.19
# When the Coverage.subscriber is self use PID.19 / IN2.2 for SSN identifier
identifier_2c:
condition: $valueIn NOT_NULL && $subscriberIsSelf EQUALS TRUE
valueOf: datatype/Identifier_var
generateList: true
expressionType: resource
vars:
valueIn: String, PID.19 | IN2.2 # subscriber SSN
subscriberIsSelf: SUBSCRIBER_IS_SELF, IN1.17 | IN2.72 # subscriber relationship
constants:
system: http://terminology.hl7.org/CodeSystem/v2-0203
code: SS
display: Social Security number
# There is no text for PID.19
identifier_3:
condition: $valueIn NOT_NULL
valueOf: datatype/Identifier_var
generateList: true
# There is no authority for PID.19
expressionType: resource
# Gets the Driver's license from PID.20, formats and adds it as an ID
vars:
valueIn: String, PID.20.1
constants:
system: http://terminology.hl7.org/CodeSystem/v2-0203
code: DL
display: Driver's license number
# There is no text for PID.20
identifier_4:
condition: $mrgIdentifier NOT_NULL
valueOf: datatype/Identifier_SystemID
generateList: true
expressionType: resource
specs: MRG.1
constants:
use: old
mrgIdentifier: MRG.1
# Add the old MR # from the MRG segment
identifier_5:
condition: $valueIn NOT_NULL
valueOf: datatype/Identifier_var
generateList: true
expressionType: resource
specs: IN1.49
vars:
valueIn: String, IN1.49.1
systemCX: IN1.49.4
code: IN1.49.5
constants:
system: http://terminology.hl7.org/CodeSystem/v2-0203
# only include when the subscriber is self
identifier_6:
condition: $valueIn NOT_NULL && $subscriberIsSelf EQUALS TRUE
valueOf: datatype/Identifier_var
generateList: true
expressionType: resource
vars:
valueIn: IN2.61 | IN1.36
subscriberIsSelf: SUBSCRIBER_IS_SELF, IN1.17 | IN2.72 # subscriber relationship
# No systemCX set for this identifier
constants:
system: "http://terminology.hl7.org/CodeSystem/v2-0203"
code: "MB"
display: "Member Number"
identifier_7:
condition: $valueIn NOT_NULL
valueOf: datatype/Identifier_var
generateList: true
expressionType: resource
vars:
valueIn: IN2.8
# No systemCX set for this identifier
constants:
system: "http://terminology.hl7.org/CodeSystem/v2-0203"
code: "MA"
display: "Patient Medicaid number"
identifier_8:
condition: $valueIn NOT_NULL
valueOf: datatype/Identifier_var
generateList: true
expressionType: resource
vars:
valueIn: IN2.6
# No systemCX set for this identifier
constants:
system: "http://terminology.hl7.org/CodeSystem/v2-0203"
code: "MC"
display: "Patient's Medicare number"
name:
valueOf: datatype/HumanName
generateList: true
expressionType: resource
specs: PID.5
gender:
type: ADMINISTRATIVE_GENDER
valueOf: PID.8
expressionType: HL7Spec
address:
valueOf: datatype/Address
generateList: true
expressionType: resource
specs: PID.11
telecom_1:
condition: $pid14 NOT_NULL
valueOf: datatype/ContactPoint
generateList: true
expressionType: resource
specs: PID.14
vars:
pid14: PID.14
constants:
use: work
telecom_2:
condition: $pid13 NOT_NULL
valueOf: datatype/ContactPoint
generateList: true
expressionType: resource
specs: PID.13
vars:
pid13: PID.13
constants:
use: home
# The yaml is processed in reverse order, therefore
# Put the PID.13 last in yaml so it is first to be processed
birthDate:
type: DATE
valueOf: PID.7
expressionType: HL7Spec
multipleBirthBoolean_1:
condition: $multBool NOT_NULL && $multInt NULL
type: BOOLEAN
valueOf: PID.24
expressionType: HL7Spec
vars:
multBool: PID.24
multInt: PID.25
multipleBirthBoolean_2:
condition: $multBool EQUALS N
type: BOOLEAN
valueOf: PID.24
expressionType: HL7Spec
vars:
multBool: String, PID.24
multInt: PID.25
multipleBirthInteger_1:
condition: $multBool NULL && $multInt NOT_NULL
type: INTEGER
valueOf: PID.25
expressionType: HL7Spec
vars:
multBool: String, PID.24
multInt: PID.25
multipleBirthInteger_2:
condition: $multBool EQUALS Y && $multInt NOT_NULL
type: INTEGER
valueOf: PID.25
expressionType: HL7Spec
vars:
multBool: String, PID.24
multInt: PID.25
deceasedBoolean:
condition: $deceasedBool NOT_NULL && $deceasedDateTime NULL
type: BOOLEAN
valueOf: PID.30
expressionType: HL7Spec
vars:
deceasedBool: PID.30
deceasedDateTime: PID.29
deceasedDateTime:
condition: $deceasedDateTime NOT_NULL
type: DATE_TIME
valueOf: PID.29
expressionType: HL7Spec
vars:
deceasedDateTime: PID.29
maritalStatus:
valueOf: datatype/CodeableConcept
expressionType: resource
condition: $coding NOT_NULL
vars:
coding: MARITAL_STATUS, PID.16
text: String, PID.16.2
generalPractitioner:
condition: $practitionerVal NOT_NULL
valueOf: resource/Practitioner
generateList: true
expressionType: reference
specs: PD1.4
vars:
practitionerVal: PD1.4
extension:
generateList: true
expressionType: nested
expressions:
- condition: $value NOT_NULL
valueOf: extension/Extension
expressionType: resource
vars:
value: String, PID.6.1
constants:
KEY_NAME_SUFFIX: String
urlValue: mothersMaidenName
- expressionType: nested
expressionsMap:
url:
type: SYSTEM_URL
value: 'religion'
valueCodeableConcept:
valueOf: datatype/CodeableConcept
expressionType: resource
condition: $coding NOT_NULL
vars:
coding: RELIGIOUS_AFFILIATION_CC, PID.17
text: String, PID.17.2
- expressionType: nested
specs: PID.10
generateList: true
expressionsMap:
url:
type: SYSTEM_URL
value: 'race'
valueCodeableConcept:
valueOf: datatype/CodeableConcept
expressionType: resource
specs: CWE
communication:
condition: $language NOT_NULL
valueOf: secondary/Communication
expressionType: resource
vars:
language: PID.15
active:
condition: $mrgSegment NOT_NULL
type: BOOLEAN
valueOf: true
vars:
mrgSegment: MRG
link:
generateList: true
evaluateLater: true
expressionType: nested
condition: $mrgSegment NOT_NULL
vars:
mrgSegment: MRG
expressionsMap:
type:
type: STRING
valueOf: 'replaces'
other:
required: true
valueOf: resource/PatientMRG
expressionType: reference