All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hl7.resource.Immunization.yml Maven / Gradle / Ivy

#
# (C) Copyright IBM Corp. 2020, 2022
#
# SPDX-License-Identifier: Apache-2.0
#
resourceType: Immunization
id:
  type: STRING
  valueOf: "GeneralUtils.generateResourceId()"
  expressionType: JEXL

identifier:
  valueOf: datatype/Identifier
  generateList: true
  expressionType: resource
  vars:
    system: SYSTEM_URL, $sys
    value: BUILD_IDENTIFIER_FROM_CWE, RXA.5
  constants:
    sys: "urn:id:extID"

status:
  valueOf: "GeneralUtils.getImmunizationStatus(rxa18,rxa20,orc5)"
  expressionType: JEXL
  vars:
    rxa18: RXA.18
    rxa20: RXA.20
    orc5: ORC.5

statusReason_1:
  condition: $rxa18 NOT_NULL
  valueOf: datatype/CodeableConcept
  expressionType: resource
  specs: RXA.18
  vars:
    rxa18: RXA.18

statusReason_2:
  valueOf: datatype/CodeableConcept_var
  expressionType: resource
  condition: $rxa18 NULL && $statCode EQUALS RE
  vars:
    rxa18: RXA.18
    statCode: STRING, RXA.20
  constants:
    code: "PATOBJ"
    display: "Patient Refusal"
    system: "http://terminology.hl7.org/CodeSystem/v3-ActReason"

# 3a & 3b together make complex $rxa20 NULL || $rxa20 NOT_EQUALS RE
statusReason_3a:
  valueOf: datatype/CodeableConcept
  expressionType: resource
  condition: $rxa18 NULL && $rxa20 NULL && $obx31 EQUALS 30945-0
  specs: OBX.3
  vars:
    rxa18: RXA.18
    rxa20: RXA.20
    obx31: String, OBX.3.1
  constants:
    alternateCode: "MEDPREC"
    alternateDisplay: "medical precaution"
    alternateSystem: "http://terminology.hl7.org/CodeSystem/v3-ActReason"

statusReason_3b:
  valueOf: datatype/CodeableConcept
  expressionType: resource
  condition: $rxa18 NULL && $rxa20 NOT_EQUALS RE && $obx31 EQUALS 30945-0
  specs: OBX.3
  vars:
    rxa18: RXA.18
    rxa20: String, RXA.20
    obx31: String, OBX.3.1
  constants:
    alternateCode: "MEDPREC"
    alternateDisplay: "medical precaution"
    alternateSystem: "http://terminology.hl7.org/CodeSystem/v3-ActReason"

# 4a & 4b together make complex $rxa20 NULL || $rxa20 NOT_EQUALS RE
statusReason_4a:
  valueOf: datatype/CodeableConcept
  expressionType: resource
  condition: $rxa18 NULL && $rxa20 NULL && $obx31 EQUALS 59784-9
  specs: OBX.3
  vars:
    rxa18: RXA.18
    rxa20: RXA.20
    obx31: String, OBX.3.1
  constants:
    alternateCode: "IMMUNE"
    alternateDisplay: "immunity"
    alternateSystem: "http://terminology.hl7.org/CodeSystem/v3-ActReason"

statusReason_4b:
  valueOf: datatype/CodeableConcept
  expressionType: resource
  condition: $rxa18 NULL && $rxa20 NOT_EQUALS RE && $obx31 EQUALS 59784-9
  specs: OBX.3
  vars:
    rxa18: RXA.18
    rxa20: String, RXA.20
    obx31: String, OBX.3.1
  constants:
    alternateCode: "IMMUNE"
    alternateDisplay: "immunity"
    alternateSystem: "http://terminology.hl7.org/CodeSystem/v3-ActReason"

vaccineCode_1:
  valueOf: datatype/CodeableConcept
  expressionType: resource
  specs: RXA.5
  vars:
    code: RXA.5

vaccineCode_2:
  expressionType: nested
  condition: $obx31 EQUALS 30956-7 && $rxa5 NULL
  specs: OBX # Repeat for all OBX records
  vars:
    rxa5: RXA.5
    obx31: String, OBX.3.1
  expressions:
    - valueOf: datatype/CodeableConcept
      expressionType: resource
      specs: OBX.5

patient:
  valueOf: datatype/Reference
  required: true
  expressionType: resource
  specs: $Patient

encounter:
  valueOf: datatype/Reference
  expressionType: resource
  specs: $Encounter

occurrenceDateTime:
  required: true
  type: STRING
  valueOf: "GeneralUtils.dateTimeWithZoneId(dateTimeIn,ZONEID)"
  expressionType: JEXL
  vars:
    dateTimeIn: RXA.3

primarySource:
  value: true
  condition: $rxa9 NOT_NULL
  vars:
    rxa9: RXA.9

reportOrigin:
  valueOf: datatype/CodeableConcept
  expressionType: resource
  specs: RXA.9

manufacturer:
  condition: $rxa17 NOT_NULL
  valueOf: resource/Organization
  expressionType: reference
  specs: RXA.17
  vars:
    rxa17: RXA.17

lotNumber:
  type: STRING
  valueOf: RXA.15
  expressionType: HL7Spec

expirationDate:
  type: STRING
  valueOf: "GeneralUtils.dateTimeWithZoneId(dateTimeIn,ZONEID)"
  expressionType: JEXL
  vars:
    dateTimeIn: RXA.16

site:
  valueOf: datatype/CodeableConcept
  expressionType: resource
  specs: RXR.2

route:
  valueOf: datatype/CodeableConcept
  expressionType: resource
  specs: RXR.1

doseQuantity:
  condition: $value NOT_NULL
  valueOf: datatype/Quantity
  expressionType: resource
  specs: RXA.6 | RXA.7
  vars:
    value: DOSE_VALUE, RXA.6
    unit: RXA.7.1
    code: RXA.7.1
    sys: DOSE_SYSTEM, RXA.7.3

performer_1:
  valueOf: secondary/Performer
  generateList: true
  expressionType: resource
  vars:
    orderingProvider: ORC.12

performer_2:
  valueOf: secondary/Performer
  generateList: true
  expressionType: resource
  vars:
    administeringProvider: RXA.10

# This performer is an organization. One will be created.
performer_3:
  valueOf: secondary/Performer
  generateList: true
  expressionType: resource
  vars:
    administeringProviderOrganization: RXA.27.4 | PV1.3.4.1 | RXA.11.4

note:
  valueOf: datatype/Annotation
  expressionType: resource
  condition: $obx3 EQUALS 48767-8
  specs: OBX
  vars:
    obx3: STRING, OBX.3.1
    annotationText: STRING, OBX.5

reasonReference:
  valueOf: datatype/Reference
  expressionType: resource
  generateList: true
  specs: $Observation
  useGroup: true

isSubpotent:
  value: true
  condition: $rxa20 EQUALS PA
  vars:
    rxa20: String, RXA.20

programEligibility:
  expressionType: nested
  condition: $obx3 EQUALS 64994-7
  specs: OBX # Repeat for all OBX records
  vars:
    obx3: String, OBX.3.1
  expressions:
    - valueOf: datatype/CodeableConcept
      expressionType: resource
      specs: OBX.5

fundingSource:
  expressionType: nested
  condition: $obx3 EQUALS 30963-3
  specs: OBX # Repeat for all OBX records
  vars:
    obx3: String, OBX.3.1
  expressions:
    - valueOf: datatype/CodeableConcept
      expressionType: resource
      specs: OBX.5

reasonCode:
  valueOf: datatype/CodeableConcept
  expressionType: resource
  specs: RXA.19

recorded:
  type: STRING
  valueOf: "GeneralUtils.dateTimeWithZoneId(dateTimeIn,ZONEID)"
  expressionType: JEXL
  vars:
    dateTimeIn: RXA.22 | ORC.9

reaction:
  condition: $obx31 EQUALS 31044-1
  valueOf: secondary/ImmunizationReaction
  generateList: true
  expressionType: resource
  specs: OBX
  vars:
    obx31: String, OBX.3.1

# NOTES on Immunization.education rules.  Immunization.education information is contained in
# multiple OBX records connected by a group indicator in OBX.4.  The converter only processes
# one record at time, therefore special data handlers are used to search sibling records
# for the related group information. There isn't a way to keep track of which records in a related
# group have been processed, therefore the conditions below create four handling Cases,
# to ensure all group records are handled, but no duplicate education objects are created.

# Case 1: If documentType (69764-9), look at siblings of same group.
# Find publicationDate (29768-9) and presentationDate(29769-7).
# We don't have a good way to use reference if it's not a URN, so at this time it is ignored.
# (Placement in code noted for possible future changes.)
education_1:
  expressionType: nested
  condition: $obx31 EQUALS 69764-9 # DocType
  generateList: true
  specs: OBX
  vars:
    obx31: String, OBX.3.1
  expressions:
    # Putting evaluations in nesting, evaluates only when outer condition is true.
    # This avoids unnecessary evaluation.
    - valueOf: secondary/Education
      expressionType: resource
      vars:
        documentType: FIND_EDUCATION_DOCUMENT_TYPE_TEXT, OBX
        # referenceString: FIND_EDUCATION_REFERENCE_TEXT, OBX  # Reference not used when there is a documentType but may be in future
        pubDateString: FIND_EDUCATION_PUBLICATION_DATE, OBX
        presDateString: FIND_EDUCATION_PRESENTATION_DATE, OBX

# Case 2: If reference (30956-7), look at siblings of same group.
# Process only if documentType (69764-9) does not exist, because if it exists, already handled by Case 1.
# Find publicationDate (29768-9), presentationDate(29769-7).
# Use the reference content as DocumentType, and leave Education.reference empty.
education_2:
  expressionType: nested
  condition: $obx31 EQUALS 30956-7 # Reference
  generateList: true
  specs: OBX
  vars:
    obx31: String, OBX.3.1
  expressions:
    - valueOf: secondary/Education
      condition: $docTypeString NULL # Process only if documentType (69764-9) does not exist, see notes above.
      expressionType: resource
      vars:
        documentType: FIND_EDUCATION_REFERENCE_TEXT, OBX # Use reference text as document type, there is no document OBX
        docTypeString: FIND_EDUCATION_DOCUMENT_TYPE_TEXT, OBX # Look for absense of document type, see logic notes above.
        pubDateString: FIND_EDUCATION_PUBLICATION_DATE, OBX
        presDateString: FIND_EDUCATION_PRESENTATION_DATE, OBX

# Case 3: If publicationDate (29768-9), look at siblings of same group.
# Process only if documentType (69764-9) and reference (30956-7) do not exist,
# because if either exists, already handled by Case 1 or 2.
# Also find presentationDate (29769-7). Set documentType as 'unspecified'.
education_3:
  expressionType: nested
  condition: $obx31 EQUALS 29768-9 # publicationDate
  generateList: true
  specs: OBX
  vars:
    obx31: String, OBX.3.1
  expressions:
    - valueOf: secondary/Education
      condition: $docTypeString NULL && referenceString NULL
      expressionType: resource
      vars:
        referenceString: FIND_EDUCATION_REFERENCE_TEXT, OBX # Used to check if applicable
        docTypeString: FIND_EDUCATION_DOCUMENT_TYPE_TEXT, OBX # Used to check if applicable
        pubDateString: FIND_EDUCATION_PUBLICATION_DATE, OBX
        presDateString: FIND_EDUCATION_PRESENTATION_DATE, OBX
      constants:
        documentType: "unspecified" # no document type or reference found, so use unspecified as default

# Case 4: If presentationDate (29769-7) look at siblings of same group.
# Process only if documentType (69764-9), reference (30956-7) and publicationDate (29768-9) do not exist,
# because if any exists, already handled by Case 1, 2, or 3.
# Set documentType as 'unspecified'.
education_4:
  expressionType: nested
  condition: $obx31 EQUALS 29769-7 # presentationDate
  generateList: true
  specs: OBX
  vars:
    obx31: String, OBX.3.1
  expressions:
    - valueOf: secondary/Education
      condition: $docTypeString NULL && referenceString NULL && pubDateString NULL
      expressionType: resource
      vars:
        referenceString: FIND_EDUCATION_REFERENCE_TEXT, OBX # Used to check if this case is applicable
        docTypeString: FIND_EDUCATION_DOCUMENT_TYPE_TEXT, OBX # Used to check if this case is applicable
        pubDateString: FIND_EDUCATION_PUBLICATION_DATE, OBX # Used to check if this case is applicable
        presDateString: FIND_EDUCATION_PRESENTATION_DATE, OBX
      constants:
        documentType: "unspecified" # no document type or reference found, so use unspecified as default




© 2015 - 2024 Weber Informatics LLC | Privacy Policy