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

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

#
# (C) Copyright IBM Corp. 2020, 2022
#
# SPDX-License-Identifier: Apache-2.0
#
---
resourceType: Encounter
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"

identifier_2:
  condition: $valueIn NOT_NULL
  valueOf: datatype/Identifier_var
  generateList: true
  expressionType: resource
  vars:
    valueIn: PV1.50
  constants:
    system: "http://terminology.hl7.org/CodeSystem/v2-0203"
    code: "VN"
    display: "Visit number"

status:
    type: STRING
    valueOf: 'GeneralUtils.getEncounterStatus(vars1,vars2,vars3)'
    required: true
    expressionType: JEXL
    vars: 
      vars1: String, PV1.45
      vars2: String, PV1.44
      vars3: String, PV2.16

class:
    type: ACT_ENCOUNTER
    specs: PV1.2
    expressionType: HL7Spec

type:
   valueOf: datatype/CodeableConcept
   generateList: true
   expressionType: resource
   specs: PV1.4

serviceType:
   valueOf: datatype/CodeableConcept
   expressionType: resource
   specs: PV1.10

priority:
   valueOf: datatype/CodeableConcept
   expressionType: resource
   specs: PV2.25

episodeOfCare:
   type: STRING
   valueOf: PV1.54 | PV1.53
   expressionType: HL7Spec

period: 
    valueOf: datatype/Period
    expressionType: resource
    vars: 
       start: PV1.44 | EVN.6 | EVN.2
       end: PV1.45

length:
    valueOf: datatype/Duration
    expressionType: resource
    vars: 
      pv2time: STRING, PV2.11
      pv1length: PV1, GeneralUtils.pv1DurationLength(pv1length,ZONEID)

reasonCode_1:
    valueOf: datatype/CodeableConcept
    generateList: true
    expressionType: resource
    specs: EVN.4

reasonCode_2:
  valueOf: datatype/CodeableConcept
  generateList: true
  expressionType: resource
  specs: PV2.3
  vars:
    code: PV2.3

reasonReference_1:
   valueOf: datatype/Reference
   condition: $Condition NOT_NULL 
   evaluateLater: true
   generateList: true
   expressionType: resource
   specs: $Condition

reasonReference_2:
   valueOf: datatype/Reference
   condition: $Observation NOT_NULL
   evaluateLater: true
   generateList: true
   expressionType: resource
   specs: $Observation

hospitalization:
    valueOf: secondary/Hospitalization
    expressionType: resource

subject:
    valueOf: datatype/Reference
    expressionType: resource
    specs: $Patient

# Diagnosis is a list of References to each Condition.
# This uses a nested expression to cause an effective inner and outer loop.
# We use the Condition.identifier generated from DG1-3 (outer loop) to get the correct Condition from the Condition list in the expressionsMap spec (inner loop).
diagnosis:
   expressionType: nested
   evaluateLater: true
   generateList: true
   specs: DG1
   vars:
      refDG13: BUILD_IDENTIFIER_FROM_CWE, DG1.3 # Creates an identifier in $refDG13 from DG1.3 for each time we cycle through the specs: DG1
   expressionsMap:
     condition:
       valueOf: datatype/Reference
       expressionType: resource
       condition: $refconditionId EQUALS_STRING $refDG13 # Inner loop (refconditionId) matches outer loop (refDG13)
       specs: $Condition # Loops over the entire list of Condition resources
       vars:
         # RefconditionId is calculated by pattern matching to find identifier that contains urn:id:extID as the system
         refconditionId: $BASE_VALUE, GeneralUtils.extractAttribute(refconditionId,"$.identifier[?(@.system==\"urn:id:extID\")].value","String")
     use:
        valueOf: datatype/CodeableConcept
        expressionType: resource
        specs: DG1.6
        vars:
           coding: DIAGNOSIS_USE, DG1.6
     rank:
        type: STRING
        valueOf: DG1.15
        expressionType: HL7Spec

text:
   condition: $text NOT_NULL
   valueOf: datatype/Narrative
   expressionType: resource
   vars:
      text: PV2.12
   constants:
      status: "additional"

participant_1:
   condition: $practionerSpec NOT_NULL
   valueOf: secondary/Participant
   generateList: true
   expressionType: resource
   specs: PV1.7
   vars:
      practionerSpec: PV1.7
   constants:
      codeableConceptCode: 'ATND'
      codeableConceptText: 'attender'

participant_2:
   condition: $practionerSpec NOT_NULL
   valueOf: secondary/Participant
   generateList: true
   specs: PV1.8
   expressionType: resource
   vars:
      practionerSpec: PV1.8
   constants:
      codeableConceptCode: 'REF'
      codeableConceptText: 'referrer'

participant_3:
   condition: $practionerSpec NOT_NULL
   valueOf: secondary/Participant
   generateList: true
   specs: PV1.9
   expressionType: resource
   vars:
      practionerSpec: PV1.9
   constants:
      codeableConceptCode: 'CON'
      codeableConceptText: 'consultant'

participant_4:
   condition: $practionerSpec NOT_NULL
   valueOf: secondary/Participant
   generateList: true
   specs: PV1.17
   expressionType: resource
   vars:
      practionerSpec: PV1.17
   constants:
      codeableConceptCode: 'ADM'
      codeableConceptText: 'admitter'

extension_1:
   generateList: true
   expressionType: nested
   vars:
      code: String, PV2.38.1
      displayLookup: ENCOUNTER_MODE_ARRIVAL_DISPLAY, PV2.38.1
   expressions:
      - condition: $code NOT_NULL && $displayLookup NOT_NULL
        expressionType: nested
        vars:
            system: SYSTEM_URL, $system_code
            display: $displayLookup
        constants:
            system_code: 'mode-of-arrival-system'
        expressionsMap:
            url:
               type: SYSTEM_URL
               value: 'encounter-modeOfArrival-extension'
            valueCoding:
               valueOf: datatype/Coding
               expressionType: resource

      - condition: $code NOT_NULL && $displayLookup NULL && $coding NOT_NULL
        expressionType: nested
        vars:
           coding: CODING_SYSTEM_V2, PV2.38
        expressionsMap:
            url:
               type: SYSTEM_URL
               value: 'encounter-modeOfArrival-extension'
            valueCoding:
               valueOf: $coding
               specs: CWE

serviceProvider:
  condition: $orgIdValue NOT_NULL
  valueOf: resource/Organization
  expressionType: reference
  generateList: true
  vars:
    orgName: String, PV2.23.1 | PV1.3.4.1
    orgIdValue: String, PV2.23.8 | PV1.3.4.1  # used for Id and Identifier
  constants:   
    orgIdSystem: 'extID'  # 'urn:id:' added by SystemCX processing




© 2015 - 2024 Weber Informatics LLC | Privacy Policy