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

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

#
# (C) Copyright IBM Corp. 2020, 2022
#
# SPDX-License-Identifier: Apache-2.0
#
---
resourceType: Condition
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:
  valueOf: datatype/Identifier
  generateList: true
  expressionType: resource
  vars:
    system: SYSTEM_URL, $sys
    value: BUILD_IDENTIFIER_FROM_CWE, DG1.3
  constants:
    sys: "urn:id:extID"

identifier_3:
  valueOf: datatype/Identifier
  expressionType: resource
  vars:
    system: SYSTEM_URL, $sys
    value: PRB.4.1
  constants:
    sys: "urn:id:extID"

identifier_4:
  valueOf: datatype/Identifier
  expressionType: resource
  vars:
    system: SYSTEM_URL, DG1.20.2
    value: DG1.20.1

identifier_5:
  valueOf: datatype/Identifier
  expressionType: resource
  vars:
    system: SYSTEM_URL, DG1.20.4
    value: DG1.20.3

# category uses the condition-category
# if there is a problem id (and thus a PRB segment) we use the problem-list-item
category_x1:
   valueOf: datatype/CodeableConcept_var
   generateList: true
   expressionType: resource
   condition:  $source NOT_NULL
   vars:
     source: PRB.3
   constants:
     display: 'Problem List Item'
     code: 'problem-list-item'
     text: 'Problem List Item'
     system: 'http://terminology.hl7.org/CodeSystem/condition-category'
     type: problem-list-item

# otherwise we use encounter-diagnosis (which uses a DG1 segment)
category_x2:
   valueOf: datatype/CodeableConcept_var
   generateList: true
   expressionType: resource
   condition:  $source NULL
   vars:
     source: PRB.3
   constants:
     display: 'Encounter Diagnosis'
     code: 'encounter-diagnosis'
     text: 'Encounter Diagnosis'
     system: 'http://terminology.hl7.org/CodeSystem/condition-category'
     type: encounter-diagnosis

severity:
  valueOf: datatype/CodeableConcept
  generateList: true
  expressionType: resource
  specs: PRB.26

code:
   valueOf: datatype/CodeableConcept
   generateList: true
   expressionType: resource
   specs: PRB.3 | DG1.3

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

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

evidence:
  valueOf: secondary/evidence
  generateList: true
  expressionType: resource
  specs: $Observation
  useGroup: true

asserter:
   condition: $asserterVal NOT_NULL
   valueOf: resource/Practitioner
   generateList: true
   expressionType: reference
   specs: DG1.16
   vars:
     asserterVal: DG1.16

recordedDate:
  type: STRING
  valueOf: 'GeneralUtils.dateTimeWithZoneId(dateTimeIn,ZONEID)'
  expressionType: JEXL
  vars: 
    dateTimeIn: DG1.19 | PRB.2      

abatementDateTime:
  type: STRING
  valueOf: 'GeneralUtils.dateTimeWithZoneId(dateTimeIn,ZONEID)'
  expressionType: JEXL
  vars: 
    dateTimeIn: PRB.9 

onsetDateTime:
  type: STRING
  valueOf: 'GeneralUtils.dateTimeWithZoneId(dateTimeIn,ZONEID)'
  expressionType: JEXL
  vars: 
    dateTimeIn: PRB.16 | DG1.5    

onsetString:
  condition: $onsetDateTime NULL
  type: STRING
  valueOf: PRB.17
  expressionType: HL7Spec
  vars:
    onsetDateTime: PRB.16  #DG1.5 not referenced for onsetDateTime as there is currently not a fallback DG1 segment to use for a onset string

extension:
   generateList: true
   valueOf: extension/Extension
   expressionType: resource
   vars:
      value: PRB.7, GeneralUtils.dateTimeWithZoneId(value,ZONEID)  
   constants:
      KEY_NAME_SUFFIX: DateTime
      urlValue: condition-assertedDate

# We don't populate this optional field if the value is invalid.
# CONDITION_VERIFICATION_STATUS_FHIR filters only valid values.
verificationStatus:
  condition: $coding NOT_NULL
  valueOf: datatype/CodeableConcept
  expressionType: resource
  vars:
    coding: CONDITION_VERIFICATION_STATUS_FHIR, PRB.13
    text: String, PRB.13.2

# We don't populate this optional field if the value is invalid.
# Use CONDITION_CLINICAL_STATUS_FHIR to filter out invalid values.
clinicalStatus_1:
  condition: $coding NOT_NULL
  valueOf: datatype/CodeableConcept
  expressionType: resource
  vars:
    coding: CONDITION_CLINICAL_STATUS_FHIR, PRB.14
    text: String, PRB.14.2

# If PRB 14 is empty or invalid, AND PRB.9 has data, set to "resolved"
# CONDITION_CLINICAL_STATUS_FHIR returns null if the value is invalid or null.
clinicalStatus_2:
  condition: $prb9 NOT_NULL && $validCoding NULL
  valueOf: datatype/CodeableConcept_var
  expressionType: resource
  vars:
    validCoding: CONDITION_CLINICAL_STATUS_FHIR, PRB.14.1
    prb9: PRB.9
  constants: 
    code: 'resolved' 
    display: 'Resolved'
    system: 'http://terminology.hl7.org/CodeSystem/condition-clinical'

note:
   valueOf: datatype/Annotation
   condition: $annotationText NOT_NULL
   expressionType: resource
   vars:
      annotationText: NTE.3 *&, GeneralUtils.concatenateWithChar(annotationText, '  \n')            




© 2015 - 2024 Weber Informatics LLC | Privacy Policy