WHO SMART Guidelines - HIV
0.3.0 - ci-build
WHO SMART Guidelines - HIV - Local Development build (v0.3.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions
Draft as of 2024-10-30 |
{
"resourceType" : "Library",
"id" : "HIVB2DTLogic",
"meta" : {
"profile" : [
🔗 "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablelibrary"🔗 ,
"http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablelibrary"🔗 ,
"http://hl7.org/fhir/uv/cql/StructureDefinition/cql-library"🔗 ,
"http://hl7.org/fhir/uv/cql/StructureDefinition/cql-module"
]
},
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: Library HIVB2DTLogic</b></p><a name=\"HIVB2DTLogic\"> </a><a name=\"hcHIVB2DTLogic\"> </a><a name=\"HIVB2DTLogic-en-US\"> </a><h2>Contents</h2><p><code>text/cql</code></p><pre><code class=\"language-sql\">/**\nLibrary: HIV.B2.DT Logic\n\n@DecisionID: HIV.B2.DT\n@BusinessRule: Check for signs of serious illness\n@Trigger: HIV.B2 Check for signs of serious illness\n@Trigger: HIV.D3 Check for signs of serious illness\n@HitPolicy: Rule Order\n@Description: Check for serious illness\n\nData Concepts:\n * HIV.A.DE17: Age | Calculated age (number of years) of the client based on date of birth\n * HIV.D.DE17: Signs of serious illness | Signs that may indicate the client has a serious illness and needs triage or an emergency referral\n * HIV.D.DE9: Body temperature | Temperature of the client in Celsius\n\nConsolidated 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.\n*/\n\nlibrary HIVB2DTLogic\n\nusing FHIR version '4.0.1'\n\ninclude HIVCommon version '0.0.1' called HIC\ninclude HIVConcepts called Concepts\ninclude HIVEncounterElements called Elements\ninclude FHIRHelpers version '4.0.1'\n\ninclude WHOCommon called WCom\n\ncontext Patient\n\n /*\n @input: "Age 10 or older"\n @pseudocode: 'Age' >= 10 years\n */\ndefine "Age 10 or older":\n AgeInYearsAt(Today()) >= 10\n\n /*\n @input: "Age under 10"\n @pseudocode: 'Age' < 10 years\n */\ndefine "Age under 10":\n AgeInYearsAt(Today()) < 10\n\n/*\n @output: "Immediately take action or refer for care if a client is having this issue"\n */\ndefine "Immediately take action or refer for care if a client is having this issue":\n "Age 10 or older" and exists(\n Elements."Signs of serious illness Observation" O\n where O.value ~ Concepts."Tachycardia"\n )\n\n/*\n @output "Immediately take action or refer for care if client is showing this sign of a serious illness."\n */\ndefine "Immediately take action or refer for care if client is showing this sign of a serious illness":\n "Signs of serious illness age 10 or older" or "Signs of serious illness age under 10"\n\n/*\n @output "Use clinical judgement and consider local epidemiology to determine if symptoms suggest client is seriously ill"\n */\ndefine "Use clinical judgement and consider local epidemiology to determine if symptoms suggest client is seriously ill":\n "Signs of serious illness requiring clinical judgement age 10 or older" or "Signs of serious illness requiring clinical judgement age under 10"\n\n/*\n @dynamicValue: Guidance\n */\ndefine "Guidance":\n case \n when "Immediately take action or refer for care if a client is having this issue" \n then 'Immediately take action or refer for care if a client is having this issue.'\n when "Immediately take action or refer for care if client is showing this sign of a serious illness" and "Age 10 or older"\n then 'Immediately take action or refer for care if client is showing this sign of a serious illness.'\n when "Immediately take action or refer for care if client is showing this sign of a serious illness" and "Age under 10"\n then '''This is a sign and/or symptom of a serious health condition.\n \nImmediately take action or refer for care if client is showing this sign of a serious illness.'''\n else null\n end\n\n/*\n Supporting Logic\n*/\ndefine "Signs of serious illness age 10 or older":\n "Age 10 or older" and exists(\n Elements."Signs of serious illness Observation" O\n where\n O.value ~ Concepts."Tachypnea" or\n O.value ~ Concepts."Unable to walk unaided"\n )\n\ndefine "Signs of serious illness age under 10":\n "Age under 10" and exists(\n Elements."Signs of serious illness Observation" O\n where\n O.value ~ Concepts."Lethargy - HIV.D.DE22" or\n O.value ~ Concepts."Unconsciousness" or\n O.value ~ Concepts."Convulsions" or\n O.value ~ Concepts."Unable to breastfeed" or\n O.value ~ Concepts."Unable to drink" or\n O.value ~ Concepts."Repeated vomiting"\n )\n\ndefine "Signs of serious illness requiring clinical judgement age 10 or older":\n "Age 10 or older" and exists(\n Elements."Signs of serious illness Observation" O\n where\n O.value ~ Concepts."Fever of 39 C or greater" or\n O.value ~ Concepts."Other sign of serious illness"\n )\n\ndefine "Signs of serious illness requiring clinical judgement age under 10":\n "Age under 10" and exists(\n Elements."Signs of serious illness Observation" O\n where\n O.value ~ Concepts."Fever of 39 C or greater" or\n O.value ~ Concepts."Other sign of serious illness"\n )\n</code></pre><p><code>No Content</code> (<code>application/elm+xml</code>)</p></div>"
},
"extension" : [
{
"url" : "http://hl7.org/fhir/StructureDefinition/cqf-knowledgeCapability",
"valueCode" : "computable"
}
],
"url" : "http://smart.who.int/hiv/Library/HIVB2DTLogic",
"version" : "0.3.0",
"name" : "HIVB2DTLogic",
"title" : "HIV.B2.DT Logic",
"status" : "draft",
"experimental" : true,
"type" : {
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/library-type",
"code" : "logic-library"
}
]
},
"date" : "2024-10-30T19:04:31+00:00",
"publisher" : "WHO",
"contact" : [
{
"name" : "WHO",
"telecom" : [
{
"system" : "url",
"value" : "http://who.int"
}
]
}
],
"description" : "HIV.B2.DT Logic",
"content" : [
{
"contentType" : "text/cql",
"data" : "LyoqCkxpYnJhcnk6IEhJVi5CMi5EVCBMb2dpYwoKQERlY2lzaW9uSUQ6IEhJVi5CMi5EVApAQnVzaW5lc3NSdWxlOiBDaGVjayBmb3Igc2lnbnMgb2Ygc2VyaW91cyBpbGxuZXNzCkBUcmlnZ2VyOiBISVYuQjIgQ2hlY2sgZm9yIHNpZ25zIG9mIHNlcmlvdXMgaWxsbmVzcwpAVHJpZ2dlcjogSElWLkQzIENoZWNrIGZvciBzaWducyBvZiBzZXJpb3VzIGlsbG5lc3MKQEhpdFBvbGljeTogUnVsZSBPcmRlc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