diff --git a/input/cql/HIVB2DTLogic.cql b/input/cql/HIVB2DTLogic.cql index a5c62b05c3..eb6da91e30 100644 --- a/input/cql/HIVB2DTLogic.cql +++ b/input/cql/HIVB2DTLogic.cql @@ -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' @@ -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." @@ -69,13 +70,13 @@ 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 @@ -83,31 +84,37 @@ Immediately take action or refer for care if client is showing this sign of a se 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" + ) diff --git a/input/cql/HIVB9DTLogic.cql b/input/cql/HIVB9DTLogic.cql index cb12b45fb4..5c3d707418 100644 --- a/input/cql/HIVB9DTLogic.cql +++ b/input/cql/HIVB9DTLogic.cql @@ -35,7 +35,6 @@ include WHOCommon called WCom include WHOConcepts called WCx include WHOEncounterElements called WElm - context Patient /* diff --git a/input/cql/HIVConceptsCustom.cql b/input/cql/HIVConceptsCustom.cql index d3db50471c..9ef4767334 100644 --- a/input/cql/HIVConceptsCustom.cql +++ b/input/cql/HIVConceptsCustom.cql @@ -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 diff --git a/input/fsh/libraries/HIVB2DTLogic.fsh b/input/fsh/libraries/HIVB2DTLogic.fsh index 8c4305d0ef..7d79357424 100644 --- a/input/fsh/libraries/HIVB2DTLogic.fsh +++ b/input/fsh/libraries/HIVB2DTLogic.fsh @@ -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" diff --git a/input/fsh/libraries/HIVB9DTLogic.fsh b/input/fsh/libraries/HIVB9DTLogic.fsh index 8853d4bc1d..ba76428953 100644 --- a/input/fsh/libraries/HIVB9DTLogic.fsh +++ b/input/fsh/libraries/HIVB9DTLogic.fsh @@ -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" diff --git a/input/fsh/plandefinition/HIVB2DT.fsh b/input/fsh/plandefinition/HIVB2DT.fsh new file mode 100644 index 0000000000..c01f8e6856 --- /dev/null +++ b/input/fsh/plandefinition/HIVB2DT.fsh @@ -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" diff --git a/input/fsh/plandefinition/HIVB9DT.fsh b/input/fsh/plandefinition/HIVB9DT.fsh index 8b9ac5abe2..5d81073c3f 100644 --- a/input/fsh/plandefinition/HIVB9DT.fsh +++ b/input/fsh/plandefinition/HIVB9DT.fsh @@ -18,162 +18,68 @@ Usage: #definition * type = #citation * citation = "Consolidated Guidelines on HIV Testing Services (2019)" * action[+] - * textEquivalent = "Schedule an annual follow-up test" - * condition[+] - * kind = #applicability - * expression - * language = #text/cql-identifier - * expression = "Schedule an annual follow-up test" - * type = #create - * definitionCanonical = Canonical(HIVB9DTScheduleFollowUp) - * dynamicValue[+] - * path = "intent" - * expression - * description = "Intent = 'plan'" - * language = #text/cql - * expression = "'plan' from \"http://hl7.org/fhir/request-intent\"" - * dynamicValue[+] - * path = "code.coding" - * expression - * description = "HIV Screening" - * language = #text/cql - * expression = "'171121004' from \"SNOMED-CT\" display 'HIV screening'" - * dynamicValue[+] - * path = "occurrenceDateTime" - * expression - * description = "At the recommended interval" - * language = #text/cql-identifier - * expression = "Schedule Date" -* action[+] - * textEquivalent = "Schedule quarterly retesting for PrEP users" - * condition[+] - * kind = #applicability - * expression - * language = #text/cql-identifier - * expression = "Schedule quarterly retesting for PrEP users" - * type = #create - * definitionCanonical = Canonical(HIVB9DTScheduleFollowUp) - * dynamicValue[+] - * path = "intent" - * expression - * description = "Intent = 'plan'" - * language = #text/cql - * expression = "'plan' from \"http://hl7.org/fhir/request-intent\"" - * dynamicValue[+] - * path = "code.coding" - * expression - * description = "HIV Screening" - * language = #text/cql - * expression = "'171121004' from \"SNOMED-CT\" display 'HIV screening'" - * dynamicValue[+] - * path = "occurrenceDateTime" - * expression - * description = "At the recommended interval" - * language = #text/cql-identifier - * expression = "Schedule Date" -* action[+] - * textEquivalent = "Follow-up test recommended" - * condition[+] - * kind = #applicability - * expression - * language = #text/cql-identifier - * expression = "Follow-up test recommended" - * type = #create - * definitionCanonical = Canonical(HIVB9DTScheduleFollowUp) - * dynamicValue[+] - * path = "intent" - * expression - * description = "Intent = 'proposal'" - * language = #text/cql - * expression = "'proposal' from \"http://hl7.org/fhir/request-intent\"" - * dynamicValue[+] - * path = "code.coding" - * expression - * description = "HIV Screening" - * language = #text/cql - * expression = "'171121004' from \"SNOMED-CT\" display 'HIV screening'" -* action[+] - * textEquivalent = "Schedule an HIV test, syphilis test, hepatitis B test as early as possible during this pregnancy" - * condition[+] - * kind = #applicability - * expression - * language = #text/cql-identifier - * expression = "Schedule an HIV test, syphilis test, hepatitis B test as early as possible during this pregnancy" - * type = #create + * textEquivalent = "Determine retest recommendation" * action[+] - * textEquivalent = "Schedule an HIV test as early as possible" - * type = #create - * definitionCanonical = Canonical(HIVB9DTScheduleFollowUp) - * dynamicValue[+] - * path = "intent" - * expression - * description = "Intent = 'proposal'" - * language = #text/cql - * expression = "'proposal' from \"http://hl7.org/fhir/request-intent\"" - * dynamicValue[+] - * path = "code.coding" + * textEquivalent = "Schedule an annual follow-up test" + * condition[+] + * kind = #applicability * expression - * description = "HIV test" - * language = #text/cql - * expression = "'171121004' from \"SNOMED-CT\" display 'HIV test'" - * action[+] - * textEquivalent = "Schedule a Syphilis test as early as possible" + * language = #text/cql-identifier + * expression = "Schedule an annual follow-up test" * type = #create * definitionCanonical = Canonical(HIVB9DTScheduleFollowUp) * dynamicValue[+] * path = "intent" * expression - * description = "Intent = 'proposal'" + * description = "Intent = 'plan'" * language = #text/cql - * expression = "'proposal' from \"http://hl7.org/fhir/request-intent\"" + * expression = "'plan' from \"http://hl7.org/fhir/request-intent\"" * dynamicValue[+] * path = "code.coding" * expression - * description = "Syphilis test" - * language = #text/cql - * expression = "'40675008' from \"SNOMED-CT\" display 'Syphilis test'" - * action[+] - * textEquivalent = "Schedule a Heptatitis test as early as possible" - * type = #create - * definitionCanonical = Canonical(HIVB9DTScheduleFollowUp) - * dynamicValue[+] - * path = "intent" - * expression - * description = "Intent = 'proposal'" + * description = "HIV Screening" * language = #text/cql - * expression = "'proposal' from \"http://hl7.org/fhir/request-intent\"" + * expression = "'171121004' from \"SNOMED-CT\" display 'HIV screening'" * dynamicValue[+] - * path = "code.coding" + * path = "occurrenceDateTime" * expression - * description = "Heptatitis B test" - * language = #text/cql - * expression = "'313476009' from \"SNOMED-CT\" display 'Heptatitis B test'" -* action[+] - * textEquivalent = "Schedule a follow-up tests for pregnant persons" - * condition[+] - * kind = #applicability - * expression - * language = #text/cql-identifier - * expression = "Schedule a 'Follow-up test recommended date' at first ANC contact date" - * type = #create + * description = "At the recommended interval" + * language = #text/cql-identifier + * expression = "Schedule Date" * action[+] - * textEquivalent = "Schedule a follow-up test recommended date at first ANC contact date" + * textEquivalent = "Schedule quarterly retesting for PrEP users" + * condition[+] + * kind = #applicability + * expression + * language = #text/cql-identifier + * expression = "Schedule quarterly retesting for PrEP users" * type = #create * definitionCanonical = Canonical(HIVB9DTScheduleFollowUp) * dynamicValue[+] * path = "intent" * expression - * description = "Intent = 'proposal'" + * description = "Intent = 'plan'" * language = #text/cql - * expression = "'proposal' from \"http://hl7.org/fhir/request-intent\"" + * expression = "'plan' from \"http://hl7.org/fhir/request-intent\"" * dynamicValue[+] * path = "code.coding" * expression * description = "HIV Screening" * language = #text/cql * expression = "'171121004' from \"SNOMED-CT\" display 'HIV screening'" + * dynamicValue[+] + * path = "occurrenceDateTime" + * expression + * description = "At the recommended interval" + * language = #text/cql-identifier + * expression = "Schedule Date" * action[+] - * textEquivalent = "Schedule a follow-up test recommended date during a third trimester visit" + * textEquivalent = "Follow-up test recommended" + * condition[+] + * kind = #applicability + * expression + * language = #text/cql-identifier + * expression = "Follow-up test recommended" * type = #create * definitionCanonical = Canonical(HIVB9DTScheduleFollowUp) * dynamicValue[+] @@ -189,18 +95,114 @@ Usage: #definition * language = #text/cql * expression = "'171121004' from \"SNOMED-CT\" display 'HIV screening'" * action[+] - * textEquivalent = "Schedule a follow-up test recommended date either two-weeks, 6 months or 9 months post delivery" - * type = #create - * definitionCanonical = Canonical(HIVB9DTScheduleFollowUp) - * dynamicValue[+] - * path = "intent" + * textEquivalent = "Schedule an HIV test, syphilis test, hepatitis B test as early as possible during this pregnancy" + * condition[+] + * kind = #applicability * expression - * description = "Intent = 'proposal'" - * language = #text/cql - * expression = "'proposal' from \"http://hl7.org/fhir/request-intent\"" - * dynamicValue[+] - * path = "code.coding" + * language = #text/cql-identifier + * expression = "Schedule an HIV test, syphilis test, hepatitis B test as early as possible during this pregnancy" + * type = #create + * action[+] + * textEquivalent = "Schedule an HIV test as early as possible" + * type = #create + * definitionCanonical = Canonical(HIVB9DTScheduleFollowUp) + * dynamicValue[+] + * path = "intent" + * expression + * description = "Intent = 'proposal'" + * language = #text/cql + * expression = "'proposal' from \"http://hl7.org/fhir/request-intent\"" + * dynamicValue[+] + * path = "code.coding" + * expression + * description = "HIV test" + * language = #text/cql + * expression = "'171121004' from \"SNOMED-CT\" display 'HIV test'" + * action[+] + * textEquivalent = "Schedule a Syphilis test as early as possible" + * type = #create + * definitionCanonical = Canonical(HIVB9DTScheduleFollowUp) + * dynamicValue[+] + * path = "intent" + * expression + * description = "Intent = 'proposal'" + * language = #text/cql + * expression = "'proposal' from \"http://hl7.org/fhir/request-intent\"" + * dynamicValue[+] + * path = "code.coding" + * expression + * description = "Syphilis test" + * language = #text/cql + * expression = "'40675008' from \"SNOMED-CT\" display 'Syphilis test'" + * action[+] + * textEquivalent = "Schedule a Heptatitis test as early as possible" + * type = #create + * definitionCanonical = Canonical(HIVB9DTScheduleFollowUp) + * dynamicValue[+] + * path = "intent" + * expression + * description = "Intent = 'proposal'" + * language = #text/cql + * expression = "'proposal' from \"http://hl7.org/fhir/request-intent\"" + * dynamicValue[+] + * path = "code.coding" + * expression + * description = "Heptatitis B test" + * language = #text/cql + * expression = "'313476009' from \"SNOMED-CT\" display 'Heptatitis B test'" + * action[+] + * textEquivalent = "Schedule a follow-up tests for pregnant persons" + * condition[+] + * kind = #applicability * expression - * description = "HIV Screening" - * language = #text/cql - * expression = "'171121004' from \"SNOMED-CT\" display 'HIV screening'" + * language = #text/cql-identifier + * expression = "Schedule a 'Follow-up test recommended date' at first ANC contact date" + * type = #create + * action[+] + * textEquivalent = "Schedule a follow-up test recommended date at first ANC contact date" + * type = #create + * definitionCanonical = Canonical(HIVB9DTScheduleFollowUp) + * dynamicValue[+] + * path = "intent" + * expression + * description = "Intent = 'proposal'" + * language = #text/cql + * expression = "'proposal' from \"http://hl7.org/fhir/request-intent\"" + * dynamicValue[+] + * path = "code.coding" + * expression + * description = "HIV Screening" + * language = #text/cql + * expression = "'171121004' from \"SNOMED-CT\" display 'HIV screening'" + * action[+] + * textEquivalent = "Schedule a follow-up test recommended date during a third trimester visit" + * type = #create + * definitionCanonical = Canonical(HIVB9DTScheduleFollowUp) + * dynamicValue[+] + * path = "intent" + * expression + * description = "Intent = 'proposal'" + * language = #text/cql + * expression = "'proposal' from \"http://hl7.org/fhir/request-intent\"" + * dynamicValue[+] + * path = "code.coding" + * expression + * description = "HIV Screening" + * language = #text/cql + * expression = "'171121004' from \"SNOMED-CT\" display 'HIV screening'" + * action[+] + * textEquivalent = "Schedule a follow-up test recommended date either two-weeks, 6 months or 9 months post delivery" + * type = #create + * definitionCanonical = Canonical(HIVB9DTScheduleFollowUp) + * dynamicValue[+] + * path = "intent" + * expression + * description = "Intent = 'proposal'" + * language = #text/cql + * expression = "'proposal' from \"http://hl7.org/fhir/request-intent\"" + * dynamicValue[+] + * path = "code.coding" + * expression + * description = "HIV Screening" + * language = #text/cql + * expression = "'171121004' from \"SNOMED-CT\" display 'HIV screening'"