Skip to content

Commit

Permalink
Updated Indicators, Profiles, DTs & Scenarios (#18)
Browse files Browse the repository at this point in the history
* Updated elements names (#36)

* Small fix to generated element comments

* WSG-90 HIV Indicators Update

Updated Common logic as well

* Updated naming and fixed some errors (#40)

* HIVB9DT (#42)

* WSG 97 indicators HIV.IND.28-35 (#41)

* Wsg 99 fixed (#45)

* IND 44

* IND 45

* Refactoring and updates to IND44 and IND45

* Updated Config file

* indicators 37-39

* Fixed IG Builder translation issues

* Elements and Common Refactoring Fixed (#46)

* Removed erroring include FHIRCommon

* Fixed EncounterElements

* Elements fixes

* Indicator fixes

* Validation fixes

* Review fixes

* Wsg 101 indicators 46 55 (#50)

* indicators 46-47

* HIVIND 46 - 52 updated

* indicators 46-55

* Implement B9 DT and B2 DT (#47)

* Start decision table logic for HIVB9DT; format HIVB7DTLogic

* Two HIV B decision tables

* Update HIVB2DTLogic.cql

* Fix sushi error

* WSG-102 Profile Authoring (#52)

* Profiling

* Previous work

* Fixed generation

* Unintended change removed

* Indicators 46-61 (#51)

* 62-63

* ind 63

* Updated FSH

---------

Co-authored-by: Patric Prado <pprado@caa.columbia.edu>
Co-authored-by: Ian <52504170+ibacher@users.noreply.github.com>
Co-authored-by: Mutesasira Moses <mozzymutesa@gmail.com>
  • Loading branch information
4 people authored Aug 18, 2024
1 parent a2b0687 commit 95ee9fb
Show file tree
Hide file tree
Showing 321 changed files with 19,687 additions and 15,075 deletions.
160 changes: 96 additions & 64 deletions input/cql/HIVB2DTLogic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -2,87 +2,119 @@
Library: HIV.B2.DT Logic
@DecisionID: HIV.B2.DT
@BusinessRule:
@Trigger:
@Description:
Check for signs of serious illness
Consolidated guidelines on HIV prevention, testing, treatment, service delivery and monitoring: recommendations for a public health approach (2021) Chapter 5: Advanced HIV Disease. Figure 5.1: Algorithm for providing a package of care for people with advanced HIV disease.
Should this just be for anyone with HIV?
Wouldn't other disease domains also code for general exam?
@BusinessRule: Check for signs of serious illness
@Trigger: HIV.B2 Check for signs of serious illness
@Trigger: HIV.D3 Check for signs of serious illness
@HitPolicy: Rule Order
@Description: Check for serious illness
Data Concepts:
* HIV.A.DE17: Age | Calculated age (number of years) of the client based on date of birth
* HIV.D.DE17: Signs of serious illness | Signs that may indicate the client has a serious illness and needs triage or an emergency referral
* HIV.D.DE9: Body temperature | Temperature of the client in Celsius
Consolidated guidelines on HIV prevention, testing, treatment, service delivery and monitoring: recommendations for a public health approach (2021) Chapter 5: Advanced HIV Disease. Figure 5.1: Algorithm for providing a package of care for people with advanced HIV disease.
*/

library HIVB2DTLogic

using FHIR version '4.0.1'

using FHIR version '4.0.1'

include HIVCommon version '0.0.1' called HIC
include FHIRHelpers version '4.0.1'
include WHOCommon called WCom
include FHIRCommon called FC
include HIVCommon version '0.0.1' called HIC
include HIVConcepts called Concepts
include HIVEncounterElements called Elements
include FHIRHelpers version '4.0.1'

valueset "Tachycardia": ''
valueset "Tachypnea": ''
valueset "Unable to walk unaided": ''
valueset "Body temperature = ≥ 39 °C": ''
valueset "Other sign of serious illness (specify)": ''
valueset "Lethargy": ''
valueset "Unconsciousness": ''
valueset "Convulsions": ''
valueset "Unable to breastfeed": ''
valueset "Unable to drink": ''
valueset "Repeated vomiting": ''
include WHOCommon called WCom

context Patient
context Patient

/*
* Age = ≥ 10 years
@input: "Age 10 or older"
@pseudocode: 'Age' >= 10 years
*/

define "Age_10_or_more":
define "Age 10 or older":
AgeInYearsAt(Today()) >= 10

/*
* Age < 10 years
@input: "Age under 10"
@pseudocode: 'Age' < 10 years
*/

define "Age_less_than_10":
define "Age under 10":
AgeInYearsAt(Today()) < 10

define "Take action or refer client showing signs of a serious illness":
exists(([Observation: "Tachycardia"]
union [Observation: "Tachypnea"]
union [Observation: "Unable to walk unaided"]) O
where Age_10_or_more
and O.status in { 'final', 'amended' })
or exists(([Observation: "Lethargy"]
union [Observation: "Unconsciousness"]
union [Observation: "Convulsions"]
union [Observation: "Unable to breastfeed"]
union [Observation: "Unable to drink"]
union [Observation: "Unconsciousness"]
union [Observation: "Repeated vomiting"]) O
where Age_less_than_10
and O.status in { 'final', 'amended' }
/*
@output: "Immediately take action or refer for care if a client is having this issue"
*/
define "Immediately take action or refer for care if a client is having this issue":
"Age 10 or older" and exists(
Elements."Signs of serious illness Observation" O
where O.value ~ Concepts."Tachycardia"
)

//plan definition Immediately take action or refer for care if a client is having this issue.
/*
@output "Immediately take action or refer for care if client is showing this sign of a serious illness."
*/
define "Immediately take action or refer for care if client is showing this sign of a serious illness":
"Signs of serious illness age 10 or older" or "Signs of serious illness age under 10"

/*
@output "Use clinical judgement and consider local epidemiology to determine if symptoms suggest client is seriously ill"
*/
define "Use clinical judgement and consider local epidemiology to determine if symptoms suggest client is seriously ill":
exists (([Observation: "Body temperature = ≥ 39 °C"]
union [Observation: "Other sign of serious illness (specify)"]) O
where Age_10_or_more
and O.status in { 'final', 'amended' })
// Please this condition needs to be fixed
// or exists((([Observation: "Body temperature = ≥ 39 °C"]
// intersect [Observation: "Tachycardia"])
// or ([Observation: "Body temperature = ≥ 39 °C"]
// intersect [Observation: "Tachypnea"])
// or [Observation: "Other sign of serious illness (specify)"]) O
// where Age_less_than_10
// and O.status in { 'final', 'amended' })
// )


//plan definition Use clinical judgement and consider local epidemiology to determine if symptoms suggest client is seriously ill.
"Signs of serious illness requiring clinical judgement age 10 or older" or "Signs of serious illness requiring clinical judgement age under 10"

/*
@dynamicValue: Guidance
*/
define "Guidance":
case
when "Immediately take action or refer for care if a client is having this issue"
then 'Immediately take action or refer for care if a client is having this issue.'
when "Immediately take action or refer for care if client is showing this sign of a serious illness" and "Age 10 or older"
then 'Immediately take action or refer for care if client is showing this sign of a serious illness.'
when "Immediately take action or refer for care if client is showing this sign of a serious illness" and "Age under 10"
then '''This is a sign and/or symptom of a serious health condition.
Immediately take action or refer for care if client is showing this sign of a serious illness.'''
else null
end

/*
Supporting Logic
*/
define "Signs of serious illness age 10 or older":
"Age 10 or older" and exists(
Elements."Signs of serious illness Observation" O
where
O.value ~ Concepts."Tachypnea" or
O.value ~ Concepts."Unable to walk unaided"
)

define "Signs of serious illness age under 10":
"Age under 10" and exists(
Elements."Signs of serious illness Observation" O
where
O.value ~ Concepts."Lethargy - HIV.D.DE22" or
O.value ~ Concepts."Unconsciousness" or
O.value ~ Concepts."Convulsions" or
O.value ~ Concepts."Unable to breastfeed" or
O.value ~ Concepts."Unable to drink" or
O.value ~ Concepts."Repeated vomiting"
)

define "Signs of serious illness requiring clinical judgement age 10 or older":
"Age 10 or older" and exists(
Elements."Signs of serious illness Observation" O
where
O.value ~ Concepts."Fever of 39 C or greater" or
O.value ~ Concepts."Other sign of serious illness"
)

define "Signs of serious illness requiring clinical judgement age under 10":
"Age under 10" and exists(
Elements."Signs of serious illness Observation" O
where
O.value ~ Concepts."Fever of 39 C or greater" or
O.value ~ Concepts."Other sign of serious illness"
)
2 changes: 1 addition & 1 deletion input/cql/HIVB7DTLogic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ valueset "Non-reactive": 'http://fhir.org/guides/who/hiv-dak/ValueSet/hiv-b-de10

include FHIRHelpers version '4.0.1'
include WHOCommon called WCom
include FHIRCommon called FC


//code "Assay 1 Reactive": 'HIV.B.DE95' from "TestresultofHIVassay1Codes" display 'Assay 1 reactive'
//code "Reactive": 'HIV.B.DE103' from "HIV_DAK_Codes" display 'Reactive'
Expand Down
Loading

0 comments on commit 95ee9fb

Please sign in to comment.