Skip to content

Commit

Permalink
Implement B9 DT and B2 DT (#47)
Browse files Browse the repository at this point in the history
* Start decision table logic for HIVB9DT; format HIVB7DTLogic

* Two HIV B decision tables

* Update HIVB2DTLogic.cql

* Fix sushi error

---------

Co-authored-by: Mutesasira Moses <mozzymutesa@gmail.com>
  • Loading branch information
ibacher and mozzy11 authored Aug 14, 2024
1 parent 50c82eb commit 41e9f94
Show file tree
Hide file tree
Showing 7 changed files with 218 additions and 176 deletions.
71 changes: 39 additions & 32 deletions input/cql/HIVB2DTLogic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ library HIVB2DTLogic
using FHIR version '4.0.1'

include HIVCommon version '0.0.1' called HIC
include HIVConcepts called HCx
include HIVConcepts called Concepts
include HIVEncounterElements called Elements
include FHIRHelpers version '4.0.1'

Expand All @@ -47,9 +47,10 @@ define "Age under 10":
@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":
exists(Elements."Signs of serious illness" O
where "Age 10 or older"
and O.value ~ HCx."Tachycardia")
"Age 10 or older" and exists(
Elements."Signs of serious illness Observation" O
where O.value ~ Concepts."Tachycardia"
)

/*
@output "Immediately take action or refer for care if client is showing this sign of a serious illness."
Expand All @@ -69,45 +70,51 @@ define "Use clinical judgement and consider local epidemiology to determine if s
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."
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."
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.
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."""
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 Elements."Signs of serious illness" O
where
O.value ~ HCx."Tachypnea" or
O.value ~ HCx."Unable to walk unaided"
"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 Elements."Signs of serious illness" O
where
O.value in {
HCx."Lethargy - HIV.D.DE22",
HCx."Unconsciousness",
HCx."Convulsions",
HCx."Unable to breastfeed",
HCx."Unable to drink",
HCx."Repeated vomiting"
}
"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 Elements."Signs of serious illness" O
where
O.value ~ HCx."Fever of 39 C or greater" or
O.value ~ HCx."Other sign of serious illness"

"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 Elements."Signs of serious illness" O
where
O.value ~ HCx."Fever of 39 C or greater" or
O.value ~ HCx."Other sign of serious illness"
"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"
)
1 change: 0 additions & 1 deletion input/cql/HIVB9DTLogic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ include WHOCommon called WCom
include WHOConcepts called WCx
include WHOEncounterElements called WElm


context Patient

/*
Expand Down
1 change: 1 addition & 0 deletions input/cql/HIVConceptsCustom.cql
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ codesystem "SNOMEDCT:2018-03": 'urn:oid:2.16.840.1.113883.6.96' version 'urn:hl7
codesystem "SNOMEDCT": 'urn:oid:2.16.840.1.113883.6.96'
codesystem "AdverseEventSeverity": 'http://terminology.hl7.org/CodeSystem/adverse-event-severity'
codesystem "RoleCode": 'http://terminology.hl7.org/CodeSystem/v3-RoleCode'

code "encounter-diagnosis": 'encounter-diagnosis' from "ConditionCategoryCodes" display 'Encounter Diagnosis'

// Related Person
Expand Down
2 changes: 1 addition & 1 deletion input/fsh/libraries/HIVB2DTLogic.fsh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Instance: HIVB2DTLogic
InstanceOf: Library
Title: "HIV.B2.DT Logic"
Description: "Description not yet available for HIV.B2.DT Logic."
Description: "HIV.B2.DT Signs of Serious Illness Logic"
Usage: #definition
* meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablelibrary"
* meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablelibrary"
Expand Down
2 changes: 1 addition & 1 deletion input/fsh/libraries/HIVB9DTLogic.fsh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Instance: HIVB9DTLogic
InstanceOf: Library
Title: "HIV.B9.DT Logic"
Description: "Description not yet available for HIV.B9.DT Logic."
Description: "HIV.B9.DT Re-test Recommendations Logic"
Usage: #definition
* meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablelibrary"
* meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablelibrary"
Expand Down
33 changes: 33 additions & 0 deletions input/fsh/plandefinition/HIVB2DT.fsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Instance: HIVB2DT
InstanceOf: http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-recommendationdefinition
Title: "HIV.B2.DT Check for signs of serious illness"
Description: "Check for signs of serious illness"
Usage: #definition
* meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareableplandefinition"
* meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishableplandefinition"
* library = Canonical(HIVB2DTLogic)
* extension[+]
* url = "http://hl7.org/fhir/StructureDefinition/cqf-knowledgeCapability"
* valueCode = #computable
* url = "http://smart.who.int/hiv/PlanDefinition/HIVB2DT"
* name = "HIVB2DT"
* status = #draft
* experimental = true
* publisher = "World Health Organization (WHO)"
* relatedArtifact[+]
* type = #citation
* citation = "Consolidated Guidelines on HIV Testing Services (2019)"
* action[+]
* textEquivalent = "Check for signs of serious illness"
* action[+]
* textEquivalent = "Take appropriate action for client showing signs of serious illness"
* condition[+]
* kind = #applicability
* expression
* language = #text/cql
* expression = "exists(Guidance)"
* dynamicValue[+]
* path = "description"
* expression
* language = #text/cql-identifier
* expression = "Guidance"
Loading

0 comments on commit 41e9f94

Please sign in to comment.