Skip to content

Commit

Permalink
Added in plandef for yellow fever contraindication. Updated plan defs…
Browse files Browse the repository at this point in the history
… and activity defs to use rulesets to simplify adding new antigens.
  • Loading branch information
lukeaduncan committed Jan 26, 2024
1 parent 4804ce0 commit d70e1e5
Show file tree
Hide file tree
Showing 27 changed files with 427 additions and 783 deletions.
57 changes: 57 additions & 0 deletions input/cql/IMMZD18SYellowFever.cql
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* Library: IMMZD18SYellowFever (IMMZ.D18.S.YellowFever)
* Trigger: IMMZ.D18 Determine required vaccination(s) Schedule if any
*/
library IMMZD18SYellowFever
// Start Skeleton CQL
using FHIR version '4.0.1'
include FHIRHelpers version '4.0.1'
include IMMZCommon called IMMZCom
include IMMZConcepts called IMMZc
include IMMZConfig called IMMZCon
include IMMZVaccineLibrary called IMMZvl
include FHIRCommon called FC
include IMMZD2DTYellowFeverInput called input

// End Skeleton CQL
context Patient


/*
@output: Yellow fever dose 1
@trigger: Child's birth
*/
define "Yellow fever dose 1":
input."No yellow fever primary series doses were administered"

/*
@output: Measles dose dose 1 Create
@create: The client is due for measles dose 1 if the client is at least 9 months
*/
define "Yellow fever dose dose 1 Create":
if "Yellow fever dose 1" then 'The client is due for yellow fever dose 1 if the client is at least 9 months and living in a yellow fever endemic area. Due Date is '
+ ToString("Yellow fever dose 1 Due Date") + '. Overdue on ' + ToString("Yellow fever dose 1 Overdue")
else ''

/*
@dynamicValue: Yellow fever dose 1 Due Date
@pseudocode: "Date of birth" + 9 'month'
*/
define "Yellow fever dose 1 Due Date":
if "Yellow fever dose 1" then Patient.birthDate + 9 months
else null

/*
@dynamicValue: Yellow fever dose 1 Overdue
@pseudocode: To be determined by Member States however there is no recommended overdue date and individuals are always eligible to be vaccinated
*/
define "Yellow fever dose 1 Overdue":
if "Yellow fever dose 1" then Patient.birthDate + 12 months
else null

/*
@dynamicValue: Yellow fever dose 1 Expiration
@pseudocode: To be determined by Member States however there is no recommended expiration date and individuals are always eligible to be vaccinated
*/
define "Yellow fever dose 1 Expiration":
null
18 changes: 18 additions & 0 deletions input/fsh/activitydefinitions/IMMZADrulesets.fsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
RuleSet: MedicationRequestActivityDefinition( antigen, version, date, doNotPerform, product )
* extension[+]
* url = "http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability"
* valueCode = #computable
* version = "{version}"
* name = "IMMZ{antigen}MedicationRequest"
* status = #draft
* experimental = false
* date = {date}
* publisher = "World Health Organization (WHO)"
* contact[+]
* telecom[+]
* system = #url
* value = "https://who.int"
* kind = #MedicationRequest
* intent = #proposal
* doNotPerform = {doNotPerform}
* productCodeableConcept = {product}
18 changes: 1 addition & 17 deletions input/fsh/activitydefinitions/IMMZD2DTMeaslesMR.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,4 @@ Title: "IMMZ.D2.DT.Measles.MR"
Description: "Provide immunization"
Usage: #definition

* extension[+]
* url = "http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability"
* valueCode = #computable
* version = "0.1.0"
* name = "IMMZD2DTMeaslesMedicationRequest"
* status = #draft
* experimental = false
* date = 2023-10-03
* publisher = "World Health Organization (WHO)"
* contact[+]
* telecom[+]
* system = #url
* value = "https://who.int"
* kind = #MedicationRequest
* intent = #proposal
* doNotPerform = false
* productCodeableConcept = $ICD11#XM61M7 "Measles vaccines"
* insert MedicationRequestActivityDefinition( D2DTMeasles, 0.1.0, 2023-10-23, false, $ICD11#XM28X5 "Measles vaccines")
7 changes: 7 additions & 0 deletions input/fsh/activitydefinitions/IMMZD2DTYellowFeverMR.fsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Instance: IMMZD2DTYellowFeverMR
InstanceOf: http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-immunizationactivity
Title: "IMMZ.D2.DT.YellowFever.MR"
Description: "Provide immunization"
Usage: #definition

* insert MedicationRequestActivityDefinition( D2DTYellowFever, 0.1.0, 2023-10-23, false, $ICD11#XM0N24 "Yellow fever vaccine")
18 changes: 1 addition & 17 deletions input/fsh/activitydefinitions/IMMZD5DTMeaslesMR.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,4 @@ Title: "IMMZ.D5.DT.Measles.MR"
Description: "Immunization Contraindication"
Usage: #definition

* extension[+]
* url = "http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability"
* valueCode = #computable
* version = "0.1.0"
* name = "IMMZD5DTMeaslesContraindicationMRUpdate"
* status = #draft
* experimental = false
* date = 2023-10-03
* publisher = "World Health Organization (WHO)"
* contact[+]
* telecom[+]
* system = #url
* value = "https://who.int"
* kind = #MedicationRequest
* intent = #proposal
* doNotPerform = true
* productCodeableConcept = $ICD11#XM28X5 "Measles vaccines"
* insert MedicationRequestActivityDefinition( D5DTMeasles, 0.1.0, 2023-10-23, true, $ICD11#XM28X5 "Measles vaccines")
7 changes: 7 additions & 0 deletions input/fsh/activitydefinitions/IMMZD5DTYellowFeverMR.fsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Instance: IMMZD5DTYellowFeverMR
InstanceOf: http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-immunizationactivity
Title: "IMMZ.D5.DT.YellowFever.MR"
Description: "Immunization Contraindication"
Usage: #definition

* insert MedicationRequestActivityDefinition( D5DTYellowFever, 0.1.0, 2023-10-23, true, $ICD11#XM0N24 "Yellow fever vaccine")
55 changes: 3 additions & 52 deletions input/fsh/plandefinitions/IMMZD18SMeaslesDose0HighTx.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -7,57 +7,8 @@ Countries with ongoing transmission in which the risk of measles mortality remai
"""
Usage: #definition

* library = "http://smart.who.int/ig/smart-immunizations/Library/IMMZD18SMeaslesDose0HighTx"
* extension[+]
* url = "http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability"
* valueCode = #computable
* version = "0.1.0"
* name = "IMMZD18SMeaslesDose0HighTx"
* status = #draft
* experimental = false
* publisher = "World Health Organization (WHO)"
* action[+]
* title = "Provision of the measles MCV0 dose (dose zero)."
* description = """
* insert PlanDefMain( IMMZD18SMeaslesDose0HighTx, 0.1.0 )
* insert PlanDefCommunicationRequestAction([[Provision of the measles MCV0 dose (dose zero).]], [["""
Provision of the measles MCV0 dose (dose zero).
Countries with ongoing transmission in which the risk of measles mortality remains high.
"""
* condition[+]
* kind = #applicability
* expression
* description = "Measles MCV0 dose"
* language = #text/cql-identifier
* expression = "Measles MCV0 dose"
* definitionCanonical = Canonical(IMMZD2DTCR)
* dynamicValue[+]
* path = "status"
* expression
* language = #text-cql
* expression = "'active'"
* dynamicValue[+]
* path = "payload.contentAttachment.title"
* expression
* language = #text/cql-identifier
* expression = "Measles MCV0 dose Create"
* dynamicValue[+]
* path = "payload.contentAttachment.language"
* expression
* language = #text/cql
* expression = "'en-US'"
* dynamicValue[+]
* path = "payload.contentAttachment.contentType"
* expression
* language = #text/cql
* expression = "'text/plain'"
* dynamicValue[+]
* path = "category.coding"
* expression
* description = "Category of communication"
* language = #text/cql
* expression = "Code { system: 'http://terminology.hl7.org/CodeSystem/communication-category', code: 'alert' }"
* dynamicValue[+]
* path = "priority"
* expression
* description = "Alert priority"
* language = #text/cql
* expression = "Code { system: 'http://hl7.org/fhir/request-priority', code: 'routine' }"
"""]], Measles MCV0 dose, Measles MCV0 dose Create)
55 changes: 3 additions & 52 deletions input/fsh/plandefinitions/IMMZD18SMeaslesDose0LowTx.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -7,57 +7,8 @@ Countries with ongoing transmission in which the risk of measles mortality remai
"""
Usage: #definition

* library = "http://smart.who.int/ig/smart-immunizations/Library/IMMZD18SMeaslesDose0LowTx"
* extension[+]
* url = "http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability"
* valueCode = #computable
* version = "0.1.0"
* name = "IMMZD18SMeaslesDose0LowTx"
* status = #draft
* experimental = false
* publisher = "World Health Organization (WHO)"
* action[+]
* title = "Provision of the measles MCV0 dose (dose zero)."
* description = """
* insert PlanDefMain( IMMZD18SMeaslesDose0LowTx, 0.1.0 )
* insert PlanDefCommunicationRequestAction([[Provision of the measles MCV0 dose (dose zero).]], [["""
Provision of the measles MCV0 dose (dose zero).
Countries with ongoing transmission in which the risk of measles mortality remains low.
"""
* condition[+]
* kind = #applicability
* expression
* description = "Measles MCV0 dose"
* language = #text/cql-identifier
* expression = "Measles MCV0 dose"
* definitionCanonical = Canonical(IMMZD2DTCR)
* dynamicValue[+]
* path = "status"
* expression
* language = #text-cql
* expression = "'active'"
* dynamicValue[+]
* path = "payload.contentAttachment.title"
* expression
* language = #text/cql-identifier
* expression = "Measles MCV0 dose Create"
* dynamicValue[+]
* path = "payload.contentAttachment.language"
* expression
* language = #text/cql
* expression = "'en-US'"
* dynamicValue[+]
* path = "payload.contentAttachment.contentType"
* expression
* language = #text/cql
* expression = "'text/plain'"
* dynamicValue[+]
* path = "category.coding"
* expression
* description = "Category of communication"
* language = #text/cql
* expression = "Code { system: 'http://terminology.hl7.org/CodeSystem/communication-category', code: 'alert' }"
* dynamicValue[+]
* path = "priority"
* expression
* description = "Alert priority"
* language = #text/cql
* expression = "Code { system: 'http://hl7.org/fhir/request-priority', code: 'routine' }"
"""]], Measles MCV0 dose, Measles MCV0 dose Create)
100 changes: 5 additions & 95 deletions input/fsh/plandefinitions/IMMZD18SMeaslesHighTx.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -7,102 +7,12 @@ Countries with ongoing transmission in which the risk of measles mortality remai
"""
Usage: #definition

* library = "http://smart.who.int/ig/smart-immunizations/Library/IMMZD18SMeaslesHighTx"
* extension[+]
* url = "http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability"
* valueCode = #computable
* version = "0.1.0"
* name = "IMMZD18SMeaslesHighTx"
* status = #draft
* experimental = false
* publisher = "World Health Organization (WHO)"
* action[+]
* title = "Provision of first measles dose from the primary schedule."
* description = """
* insert PlanDefMain( IMMZD18SMeaslesHighTx, 0.1.0 )
* insert PlanDefCommunicationRequestAction([[Provision of first measles dose from the primary schedule.]], [["""
Provision of first measles dose from the primary schedule.
Countries with ongoing transmission in which the risk of measles mortality remains high.
"""
* condition[+]
* kind = #applicability
* expression
* description = "Measles dose 1"
* language = #text/cql-identifier
* expression = "Measles dose 1"
* definitionCanonical = Canonical(IMMZD2DTCR)
* dynamicValue[+]
* path = "status"
* expression
* language = #text-cql
* expression = "'active'"
* dynamicValue[+]
* path = "payload.contentAttachment.title"
* expression
* language = #text/cql-identifier
* expression = "Measles dose 1 Create"
* dynamicValue[+]
* path = "payload.contentAttachment.language"
* expression
* language = #text/cql
* expression = "'en-US'"
* dynamicValue[+]
* path = "payload.contentAttachment.contentType"
* expression
* language = #text/cql
* expression = "'text/plain'"
* dynamicValue[+]
* path = "category.coding"
* expression
* description = "Category of communication"
* language = #text/cql
* expression = "Code { system: 'http://terminology.hl7.org/CodeSystem/communication-category', code: 'alert' }"
* dynamicValue[+]
* path = "priority"
* expression
* description = "Alert priority"
* language = #text/cql
* expression = "Code { system: 'http://hl7.org/fhir/request-priority', code: 'routine' }"
* action[+]
* title = "Provision of second measles dose from the primary schedule."
* description = """
"""]], Measles dose 1, Measles dose 1 Create)
* insert PlanDefCommunicationRequestAction([[Provision of second measles dose from the primary schedule.]], [["""
Provision of second measles dose from the primary schedule.
Countries with ongoing transmission in which the risk of measles mortality remains high.
"""
* condition[+]
* kind = #applicability
* expression
* description = "Measles dose 2"
* language = #text/cql-identifier
* expression = "Measles dose 2"
* definitionCanonical = Canonical(IMMZD2DTCR)
* dynamicValue[+]
* path = "status"
* expression
* language = #text-cql
* expression = "'active'"
* dynamicValue[+]
* path = "payload.contentAttachment.title"
* expression
* language = #text/cql-identifier
* expression = "Measles dose 2 Create"
* dynamicValue[+]
* path = "payload.contentAttachment.language"
* expression
* language = #text/cql
* expression = "'en-US'"
* dynamicValue[+]
* path = "payload.contentAttachment.contentType"
* expression
* language = #text/cql
* expression = "'text/plain'"
* dynamicValue[+]
* path = "category.coding"
* expression
* description = "Category of communication"
* language = #text/cql
* expression = "Code { system: 'http://terminology.hl7.org/CodeSystem/communication-category', code: 'alert' }"
* dynamicValue[+]
* path = "priority"
* expression
* description = "Alert priority"
* language = #text/cql
* expression = "Code { system: 'http://hl7.org/fhir/request-priority', code: 'routine' }"
"""]], Measles dose 2, Measles dose 2 Create)
Loading

0 comments on commit d70e1e5

Please sign in to comment.