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

: HIV.B2.DT Logic - JSON Representation

Draft as of 2024-10-30

Raw json | Download

{
  "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: &quot;Age 10 or older&quot;\n  @pseudocode: 'Age' &gt;= 10 years\n  */\ndefine &quot;Age 10 or older&quot;:\n  AgeInYearsAt(Today()) &gt;= 10\n\n /*\n  @input: &quot;Age under 10&quot;\n  @pseudocode: 'Age' &lt; 10 years\n  */\ndefine &quot;Age under 10&quot;:\n  AgeInYearsAt(Today()) &lt; 10\n\n/*\n @output: &quot;Immediately take action or refer for care if a client is having this issue&quot;\n */\ndefine &quot;Immediately take action or refer for care if a client is having this issue&quot;:\n  &quot;Age 10 or older&quot; and exists(\n    Elements.&quot;Signs of serious illness Observation&quot; O\n      where O.value ~ Concepts.&quot;Tachycardia&quot;\n  )\n\n/*\n @output &quot;Immediately take action or refer for care if client is showing this sign of a serious illness.&quot;\n */\ndefine &quot;Immediately take action or refer for care if client is showing this sign of a serious illness&quot;:\n  &quot;Signs of serious illness age 10 or older&quot; or &quot;Signs of serious illness age under 10&quot;\n\n/*\n @output &quot;Use clinical judgement and consider local epidemiology to determine if symptoms suggest client is seriously ill&quot;\n */\ndefine &quot;Use clinical judgement and consider local epidemiology to determine if symptoms suggest client is seriously ill&quot;:\n  &quot;Signs of serious illness requiring clinical judgement age 10 or older&quot; or &quot;Signs of serious illness requiring clinical judgement age under 10&quot;\n\n/*\n @dynamicValue: Guidance\n */\ndefine &quot;Guidance&quot;:\n  case \n  when &quot;Immediately take action or refer for care if a client is having this issue&quot; \n    then 'Immediately take action or refer for care if a client is having this issue.'\n  when &quot;Immediately take action or refer for care if client is showing this sign of a serious illness&quot; and &quot;Age 10 or older&quot;\n    then 'Immediately take action or refer for care if client is showing this sign of a serious illness.'\n  when &quot;Immediately take action or refer for care if client is showing this sign of a serious illness&quot; and &quot;Age under 10&quot;\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 &quot;Signs of serious illness age 10 or older&quot;:\n  &quot;Age 10 or older&quot; and exists(\n    Elements.&quot;Signs of serious illness Observation&quot; O\n      where\n        O.value ~ Concepts.&quot;Tachypnea&quot; or\n        O.value ~ Concepts.&quot;Unable to walk unaided&quot;\n  )\n\ndefine &quot;Signs of serious illness age under 10&quot;:\n  &quot;Age under 10&quot; and exists(\n    Elements.&quot;Signs of serious illness Observation&quot; O\n      where\n        O.value ~ Concepts.&quot;Lethargy - HIV.D.DE22&quot; or\n        O.value ~ Concepts.&quot;Unconsciousness&quot; or\n        O.value ~ Concepts.&quot;Convulsions&quot; or\n        O.value ~ Concepts.&quot;Unable to breastfeed&quot; or\n        O.value ~ Concepts.&quot;Unable to drink&quot; or\n        O.value ~ Concepts.&quot;Repeated vomiting&quot;\n    )\n\ndefine &quot;Signs of serious illness requiring clinical judgement age 10 or older&quot;:\n  &quot;Age 10 or older&quot; and exists(\n    Elements.&quot;Signs of serious illness Observation&quot; O\n      where\n        O.value ~ Concepts.&quot;Fever of 39 C or greater&quot; or\n        O.value ~ Concepts.&quot;Other sign of serious illness&quot;\n  )\n\ndefine &quot;Signs of serious illness requiring clinical judgement age under 10&quot;:\n  &quot;Age under 10&quot; and exists(\n    Elements.&quot;Signs of serious illness Observation&quot; O\n      where\n        O.value ~ Concepts.&quot;Fever of 39 C or greater&quot; or\n        O.value ~ Concepts.&quot;Other sign of serious illness&quot;\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" : "LyoqCkxpYnJhcnk6IEhJVi5CMi5EVCBMb2dpYwoKQERlY2lzaW9uSUQ6IEhJVi5CMi5EVApAQnVzaW5lc3NSdWxlOiBDaGVjayBmb3Igc2lnbnMgb2Ygc2VyaW91cyBpbGxuZXNzCkBUcmlnZ2VyOiBISVYuQjIgQ2hlY2sgZm9yIHNpZ25zIG9mIHNlcmlvdXMgaWxsbmVzcwpAVHJpZ2dlcjogSElWLkQzIENoZWNrIGZvciBzaWducyBvZiBzZXJpb3VzIGlsbG5lc3MKQEhpdFBvbGljeTogUnVsZSBPcmRlcgpARGVzY3JpcHRpb246IENoZWNrIGZvciBzZXJpb3VzIGlsbG5lc3MKCkRhdGEgQ29uY2VwdHM6CiAqIEhJVi5BLkRFMTc6IEFnZSB8IENhbGN1bGF0ZWQgYWdlIChudW1iZXIgb2YgeWVhcnMpIG9mIHRoZSBjbGllbnQgYmFzZWQgb24gZGF0ZSBvZiBiaXJ0aAogKiBISVYuRC5ERTE3OiBTaWducyBvZiBzZXJpb3VzIGlsbG5lc3MgfCBTaWducyB0aGF0IG1heSBpbmRpY2F0ZSB0aGUgY2xpZW50IGhhcyBhIHNlcmlvdXMgaWxsbmVzcyBhbmQgbmVlZHMgdHJpYWdlIG9yIGFuIGVtZXJnZW5jeSByZWZlcnJhbAogKiBISVYuRC5ERTk6IEJvZHkgdGVtcGVyYXR1cmUgfCBUZW1wZXJhdHVyZSBvZiB0aGUgY2xpZW50IGluIENlbHNpdXMKCkNvbnNvbGlkYXRlZCBndWlkZWxpbmVzIG9uIEhJViBwcmV2ZW50aW9uLCB0ZXN0aW5nLCB0cmVhdG1lbnQsIHNlcnZpY2UgZGVsaXZlcnk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