-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added in CQL/plandef for Yellow Fever decision tables and contraindic…
…ations. Added examples/tests for these. Added MedicationRequest to all Measles contraindication examples.
- Loading branch information
1 parent
20d4904
commit 14cf98d
Showing
45 changed files
with
1,296 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ temp | |
template | ||
bundles | ||
*.jar | ||
.DS_Store | ||
.DS_Store | ||
**/tests-*-bundle.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
/* | ||
* Library: IMMZD2DTYellowFever (IMMZ.D2.DT.YellowFever) | ||
* Rule: Determine if the client is due for a yellow fever vaccination according to the national immunization protocol | ||
* Trigger: IMMZ.D2 Determine required vaccination(s) if any | ||
*/ | ||
library IMMZD2DTYellowFever | ||
// 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 | ||
|
||
/* | ||
@dynamicValue: Due date of the dose | ||
*/ | ||
define "Due date of the dose": | ||
Now() | ||
|
||
/* | ||
@dynamicValue: Guidance | ||
*/ | ||
define "Guidance": | ||
case | ||
when "Yellow fever immunization schedule is complete" then "Yellow fever immunization schedule is complete Guidance" | ||
when "Client is due for yellow fever vaccination" then "Client is due for yellow fever vaccination Guidance" | ||
when "Client is not due for yellow fever vaccination" then "Client is not due for yellow fever vaccination Guidance" | ||
else null | ||
end | ||
|
||
/* | ||
@output: Client is not due for yellow fever vaccination | ||
@pseudocode: "Immunization recommendation status" = 'Not due' | ||
*/ | ||
define "Client is not due for yellow fever vaccination": | ||
"Client is not due for yellow fever vaccination Case 1" or "Client is not due for yellow fever vaccination Case 2" | ||
|
||
/* | ||
@output: Client is not due for yellow fever vaccination Guidance | ||
@guidance: Should not vaccinate client for yellow fever dose as client's age is less than 9 months. Check for any vaccines due, and inform the caregiver of when to come back for the next dose. | ||
@guidance: Should not vaccinate client for yellow fever dose as live vaccine was administered in the last 4 weeks. Check for any vaccines due, and inform the caregiver of when to come back for the first dose. | ||
*/ | ||
define "Client is not due for yellow fever vaccination Guidance": | ||
case | ||
when "Client is not due for yellow fever vaccination Case 1" then 'Should not vaccinate client for yellow fever dose as client\'s age is less than 9 months. Check for any vaccines due, and inform the caregiver of when to come back for the next dose.' | ||
when "Client is not due for yellow fever vaccination Case 2" then 'Should not vaccinate client for yellow fever dose as live vaccine was administered in the last 4 weeks. Check for any vaccines due, and inform the caregiver of when to come back for the first dose.' | ||
else '' | ||
end | ||
|
||
/* | ||
@output: Client is not due for yellow fever vaccination Case 1 | ||
@pseudocode: "Immunization recommendation status" = 'Not due' | ||
*/ | ||
define "Client is not due for yellow fever vaccination Case 1": | ||
input."No yellow fever primary series doses were administered" | ||
and input."Client's age is less than 9 months" | ||
|
||
/* | ||
@output: Client is not due for yellow fever vaccination Case 2 | ||
@pseudocode: "Immunization recommendation status" = 'Not due' | ||
*/ | ||
define "Client is not due for yellow fever vaccination Case 2": | ||
input."No yellow fever primary series doses were administered" | ||
and input."Client's age is more than or equal to 9 months" | ||
and input."Live vaccine was administered in the last 4 weeks" | ||
|
||
/* | ||
@output: Client is due for yellow fever vaccination | ||
@pseudocode: "Immunization recommendation status" = "Due" | ||
*/ | ||
define "Client is due for yellow fever vaccination": | ||
input."No yellow fever primary series doses were administered" | ||
and input."Client's age is more than or equal to 9 months" | ||
and input."No live vaccine was administered in the last 4 weeks" | ||
|
||
/* | ||
@output: Client is due for yellow fever vaccination Guidance | ||
@guidance: Should vaccinate client for yellow fever dose as no yellow fever dose was administered, client is within appropriate age range and no live vaccine was administered in the last 4 weeks. Check for contraindications. | ||
*/ | ||
define "Client is due for yellow fever vaccination Guidance": | ||
if "Client is due for yellow fever vaccination" then 'Should vaccinate client for yellow fever dose as no yellow fever dose was administered, client is within appropriate age range and no live vaccine was administered in the last 4 weeks. Check for contraindications.' | ||
else '' | ||
|
||
/* | ||
@output: Yellow fever immunization schedule is complete | ||
@pseudocode: "Immunization recommendation status"" = 'Complete' | ||
@pseudocode: "Completed the primary vaccination series" = TRUE (where "Vaccine type" = "Yellow fever containing vaccines") | ||
*/ | ||
define "Yellow fever immunization schedule is complete": | ||
input."One yellow fever primary series dose was administered" | ||
|
||
/* | ||
@output: Yellow fever immunization schedule is complete Guidance | ||
@guidance: Yellow fever immunization schedule is complete. One yellow fever primary series dose was administered. Check for any other vaccines due. | ||
*/ | ||
define "Yellow fever immunization schedule is complete Guidance": | ||
if "Yellow fever immunization schedule is complete" then 'Yellow fever immunization schedule is complete. One yellow fever primary series dose was administered. Check for any other vaccines due.' | ||
else '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
/* | ||
* Library: IMMZD2DTYellowFeverInput (IMMZ.D2.DT.YellowFeverInput) | ||
* Rule: Determine if the client is due for a yellow fever vaccination according to the national immunization protocol | ||
* Trigger: IMMZ.D2 Determine required vaccination(s) in any | ||
*/ | ||
library IMMZD2DTYellowFeverInput | ||
// 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 | ||
|
||
// End Skeleton CQL | ||
context Patient | ||
|
||
/* | ||
@internal: Yellow Fever containing Doses Administered to Patient | ||
*/ | ||
define "Yellow Fever Doses Administered to Patient": | ||
IMMZCom."Doses Administered to Patient" I | ||
where | ||
I.vaccineCode in IMMZc."Yellow Fever Vaccine" | ||
|
||
/* | ||
@input: No yellow fever primary series doses were administered | ||
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Yellow fever containing vaccines" and "Type of dose" = "Primary series" ) = 0 | ||
*/ | ||
define "No yellow fever primary series doses were administered": | ||
not exists("Yellow Fever Doses Administered to Patient" I where I.occurrence after Patient.birthDate + 9 months) | ||
|
||
/* | ||
@input: One yellow fever primary series dose was administered | ||
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Yellow fever containing vaccines" and "Type of dose" = "Primary series" ) = 1 | ||
*/ | ||
define "One yellow fever primary series dose was administered": | ||
Count("Yellow Fever Doses Administered to Patient" I where I.occurrence after Patient.birthDate + 9 months) >= 1 | ||
|
||
/* | ||
@input: Client's age is less than 6 months | ||
@pseudocode: Today's date - "Date of birth" < 6 'month' | ||
*/ | ||
define "Client's age is less than 6 months": | ||
IMMZCom."Current Patient Age In Months" < 6 | ||
|
||
/* | ||
@input: Client's age is between 6 to 9 months | ||
@pseudocode: 6 'month' ≤ Today's date - "Date of birth" < 9 'month' | ||
*/ | ||
define "Client's age is between 6 to 9 months": | ||
not("Client's age is less than 6 months") and "Client's age is less than 9 months" | ||
|
||
/* | ||
@input: Client's age is less than 9 months | ||
@pseudocode: Today's date - "Date of birth" < 9 'month'" | ||
*/ | ||
define "Client's age is less than 9 months": | ||
IMMZCom."Current Patient Age In Months" < 9 | ||
|
||
/* | ||
@input: Client's age is more than or equal to 9 months | ||
@pseudocode: Today's date - "Date of birth" ≥ 9 'month' | ||
*/ | ||
define "Client's age is more than or equal to 9 months": | ||
not ("Client's age is less than 9 months") | ||
|
||
/* | ||
@input: Client's age is more than or equal to 60 years | ||
@pseudocode: 'Today's date - ""Date of birth"" ≥ 60 'year' | ||
*/ | ||
define "Client's age is more than or equal to 60 years": | ||
IMMZCom."Current Patient Age In Years" >= 60 | ||
|
||
/* | ||
@input: Live vaccine was administered in the last 4 weeks | ||
@pseudocode: Today's date - latest "Date and time of vaccination" (where "Live vaccine" = TRUE) < 4 'week' | ||
*/ | ||
define "Live vaccine was administered in the last 4 weeks": | ||
IMMZCom."Date of Latest Live Attenuated Vaccine" is not null and IMMZCom."Date of Latest Live Attenuated Vaccine" + 4 weeks > Now() | ||
|
||
/* | ||
@input: No live vaccine was administered in the last 4 weeks | ||
@pseudocode: Today's date - latest "Date and time of vaccination" (where "Live vaccine" = TRUE) ≥ 4 'week' | ||
*/ | ||
define "No live vaccine was administered in the last 4 weeks": | ||
not("Live vaccine was administered in the last 4 weeks") | ||
|
||
/* | ||
@input: The client is currently pregnant | ||
@pseudocode: "Potential contraindications" = 'Currently pregnant' | ||
*/ | ||
define "The client is currently pregnant": | ||
IMMZCom."Pregnant" | ||
|
||
/* | ||
@input: The client has a history of severe allergic reactions | ||
@pseudocode: "Potential contraindications" = 'Severe allergic reactions' | ||
*/ | ||
define "The client has a history of severe allergic reactions": | ||
exists(IMMZCom."Severe Allergic Reactions Condition") | ||
|
||
/* | ||
@input: The client is severely immunocompromised | ||
@psuedocode: "Potential contraindications" = "Severely immunocompromised" | ||
*/ | ||
define "The client is severely immunocompromised": | ||
exists(IMMZCom."Severely immunocompromised Condition") | ||
|
||
/* | ||
@input: The client has a symptomatic HIV infection | ||
@pseudocode: "Potential contraindications" = 'Symptomatic HIV infection' | ||
*/ | ||
define "The client has a symptomatic HIV infection": | ||
exists(IMMZCom."Symptomatic HIV Infection Condition") | ||
|
||
/* | ||
@input: The client is lactating | ||
@psuedocode: "Potential contraindications" = "Breastfeeding" | ||
*/ | ||
define "The client is lactating": | ||
exists(IMMZCom."Breastfeeding Condition") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.