-
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 files for Mumps for CQL/plandefs for decision tables and con…
…traindications.
- Loading branch information
1 parent
c14684b
commit 38281aa
Showing
48 changed files
with
1,371 additions
and
5 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
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,161 @@ | ||
|
||
/* | ||
* Library: IMMZD2DTMumps (IMMZ.D2.DT.Mumps) | ||
* Rule: Determine if the client is due for a mumps vaccination according to the national immunization schedule | ||
* Decision Table: 2-dose schedule (countries with mumps in schedule and low transmission of measles) | ||
* Trigger: IMMZ.D2 Determine required vaccination(s) if any | ||
*/ | ||
library IMMZD2DTMumps | ||
// 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 IMMZD2DTMumpsInput called input | ||
|
||
// End Skeleton CQL | ||
context Patient | ||
|
||
define "mumps": | ||
input."Mumps Doses Administered to Patient" | ||
|
||
/* | ||
@dynamicValue: Guidance | ||
*/ | ||
define "Guidance": | ||
case | ||
when "Client is not due for mumps vaccination" then "Client is not due for mumps vaccination Guidance" | ||
when "Client is due for mumps vaccination" then "Client is due for mumps vaccination Guidance" | ||
when "Mumps immunization schedule is complete" then "Mumps immunization schedule is complete Guidance" | ||
else '' | ||
end | ||
|
||
/* | ||
@output: Client is not due for mumps vaccination Case 1 | ||
@pseudocode: "Immunization recommendation status" = 'Not due' | ||
*/ | ||
define "Client is not due for mumps vaccination Case 1": | ||
input."Client's age is less than 12 months" | ||
|
||
/* | ||
@output: Client is not due for mumps vaccination Case 2 | ||
@pseudocode: "Immunization recommendation status" = 'Not due' | ||
*/ | ||
define "Client is not due for mumps vaccination Case 2": | ||
input."No mumps primary series doses were administered" | ||
and input."Client's age is more than or equal to 12 months" | ||
and input."Live vaccine was administered in the last 4 weeks" | ||
|
||
/* | ||
@output: Client is not due for mumps vaccination Case 3 | ||
@pseudocode: "Immunization recommendation status" = 'Not due' | ||
*/ | ||
define "Client is not due for mumps vaccination Case 3": | ||
input."One mumps primary series dose was administered" | ||
and input."The latest mumps dose was administered less than 4 weeks ago" | ||
|
||
/* | ||
@output: Client is not due for mumps vaccination Case 4 | ||
@pseudocode: "Immunization recommendation status" = 'Not due' | ||
*/ | ||
define "Client is not due for mumps vaccination Case 4": | ||
input."One mumps primary series dose was administered" | ||
and input."The latest mumps dose was administered more than 4 weeks ago" | ||
and input."Live vaccine was administered in the last 4 weeks" | ||
|
||
/* | ||
@output: Client is not due for mumps vaccination | ||
@pseudocode: "Immunization recommendation status" = 'Not due' | ||
*/ | ||
define "Client is not due for mumps vaccination": | ||
"Client is not due for mumps vaccination Case 1" | ||
or "Client is not due for mumps vaccination Case 2" | ||
or "Client is not due for mumps vaccination Case 3" | ||
or "Client is not due for mumps vaccination Case 4" | ||
|
||
/* | ||
@output: Client is not due for mumps vaccination Guidance | ||
@guidance: Should not vaccinate client for first mumps dose as client's age is less than 12 months. Check for any other vaccines due, and inform the caregiver of when to come back for first dose. | ||
@guidance: Should not vaccinate client for first mumps dose as live vaccine was administered in the last 4 weeks. Check for any other vaccines due, and inform the caregiver of when to come back for first dose. | ||
@guidance: Should not vaccinate client for second mumps dose as latest mumps dose was administered less than 4 weeks ago. Check for any other vaccines due, and inform the caregiver of when to come back for the second dose. | ||
@guidance: Should not vaccinate client for second mumps dose as live vaccine was administered in the last 4 weeks. Check for any other vaccines due, and inform the caregiver of when to come back for the second dose. | ||
*/ | ||
define "Client is not due for mumps vaccination Guidance": | ||
case | ||
when "Client is not due for mumps vaccination Case 1" then 'Should not vaccinate client for first mumps dose as client\'s age is less than 12 months. Check for any other vaccines due, and inform the caregiver of when to come back for first dose.' | ||
when "Client is not due for mumps vaccination Case 2" then 'Should not vaccinate client for first mumps dose as live vaccine was administered in the last 4 weeks. Check for any other vaccines due, and inform the caregiver of when to come back for first dose.' | ||
when "Client is not due for mumps vaccination Case 3" then 'Should not vaccinate client for second mumps dose as latest mumps dose was administered less than 4 weeks ago. Check for any other vaccines due, and inform the caregiver of when to come back for the second dose.' | ||
when "Client is not due for mumps vaccination Case 4" then 'Should not vaccinate client for second mumps dose as live vaccine was administered in the last 4 weeks. Check for any other vaccines due, and inform the caregiver of when to come back for the second dose.' | ||
else '' | ||
end | ||
|
||
/* | ||
@output: Client is due for mumps vaccination Case 1 | ||
@pseudocode: "Immunization recommendation status" = 'Due' | ||
*/ | ||
define "Client is due for mumps vaccination Case 1": | ||
input."No mumps primary series doses were administered" | ||
and input."Client's age is more than or equal to 12 months" | ||
and input."No live vaccine was administered in the last 4 weeks" | ||
|
||
/* | ||
@output: Client is due for mumps vaccination Case 2 | ||
@pseudocode: "Immunization recommendation status" = 'Due' | ||
*/ | ||
define "Client is due for mumps vaccination Case 2": | ||
input."One mumps primary series dose was administered" | ||
and input."The latest mumps dose was administered more than 4 weeks ago" | ||
and input."No live vaccine was administered in the last 4 weeks" | ||
|
||
/* | ||
@output: Client is due for mumps vaccination | ||
@pseudocode: "Immunization recommendation status" = 'Due' | ||
*/ | ||
define "Client is due for mumps vaccination": | ||
"Client is due for mumps vaccination Case 1" | ||
or "Client is due for mumps vaccination Case 2" | ||
|
||
/* | ||
@output: Client is due for mumps vaccination Guidance | ||
@guidance: Should vaccinate client for first mumps dose as the client is within appropriate age range and no live vaccine was administered in the last 4 weeks. Check for contraindications. | ||
@guidance: Should vaccinate client for second mumps dose as latest mumps dose was administered more than 4 weeks ago and no live vaccine was administered in the last 4 weeks. Check for contraindications. | ||
*/ | ||
define "Client is due for mumps vaccination Guidance": | ||
case | ||
when "Client is due for mumps vaccination Case 1" then 'Should vaccinate client for first mumps dose as the client is within appropriate age range and no live vaccine was administered in the last 4 weeks. Check for contraindications. ' | ||
when "Client is due for mumps vaccination Case 2" then 'Should vaccinate client for second mumps dose as latest mumps dose was administered more than 4 weeks ago and no live vaccine was administered in the last 4 weeks. Check for contraindications.' | ||
else '' | ||
end | ||
|
||
/* | ||
@output: Mumps immunization schedule is complete | ||
@pseudocode: "Immunization recommendation status" = 'Complete' | ||
*/ | ||
define "Mumps immunization schedule is complete": | ||
input."Two mumps primary series doses were administered" | ||
|
||
/* | ||
@output: Mumps immunization schedule is complete Guidance | ||
@guidance: Mumps immunization schedule is complete. Two mumps primary series doses were administered. Check for any other vaccines due. | ||
*/ | ||
define "Mumps immunization schedule is complete Guidance": | ||
'Mumps immunization schedule is complete. Two mumps primary series doses were administered. Check for any other vaccines due.' | ||
|
||
|
||
/* | ||
@test: Test expected results based on example patients | ||
*/ | ||
define "Test Validation": | ||
case | ||
when Patient.id = '08.Alt12m' then "Client is not due for mumps vaccination Case 1" and "Guidance" = 'Should not vaccinate client for first mumps dose as client\'s age is less than 12 months. Check for any other vaccines due, and inform the caregiver of when to come back for first dose.' | ||
when Patient.id = '09.D0Agt12mLVlt4w' then "Client is not due for mumps vaccination Case 2" and "Guidance" = 'Should not vaccinate client for first mumps dose as live vaccine was administered in the last 4 weeks. Check for any other vaccines due, and inform the caregiver of when to come back for first dose.' | ||
when Patient.id = '10.D0Agt12mLVgt4w' then "Client is due for mumps vaccination Case 1" and "Guidance" = 'Should vaccinate client for first mumps dose as the client is within appropriate age range and no live vaccine was administered in the last 4 weeks. Check for contraindications. ' | ||
when Patient.id = '11.D1Mlt4w' then "Client is not due for mumps vaccination Case 3" and "Guidance" = 'Should not vaccinate client for second mumps dose as latest mumps dose was administered less than 4 weeks ago. Check for any other vaccines due, and inform the caregiver of when to come back for the second dose.' | ||
when Patient.id = '12.D1Mgt4wLVlt4w' then "Client is not due for mumps vaccination Case 4" and "Guidance" = 'Should not vaccinate client for second mumps dose as live vaccine was administered in the last 4 weeks. Check for any other vaccines due, and inform the caregiver of when to come back for the second dose.' | ||
when Patient.id = '13.D1Mgt4wLVgt4w' then "Client is due for mumps vaccination Case 2" and "Guidance" = 'Should vaccinate client for second mumps dose as latest mumps dose was administered more than 4 weeks ago and no live vaccine was administered in the last 4 weeks. Check for contraindications.' | ||
when Patient.id = '14.D2' then "Mumps immunization schedule is complete" and "Guidance" = 'Mumps immunization schedule is complete. Two mumps primary series doses were administered. Check for any other vaccines due.' | ||
else 'No test case set' | ||
end |
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,122 @@ | ||
/* | ||
* Library: IMMZD2DTMumpsInput (IMMZ.D2.DT.MumpsInput) | ||
*/ | ||
library IMMZD2DTMumpsInput | ||
// 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: Mumps containing Doses Administered to Patient | ||
*/ | ||
define "Mumps Doses Administered to Patient": | ||
IMMZCom."Doses Administered to Patient" I | ||
where | ||
I.vaccineCode in IMMZc."Mumps Vaccine" | ||
|
||
/* | ||
@internal: Date of latest Mumps Vaccine | ||
*/ | ||
define "Date of latest Mumps Vaccine": | ||
First("Mumps Doses Administered to Patient").occurrence as dateTime | ||
|
||
/* | ||
@input: No mumps primary series doses were administered | ||
@pseudocode: Count of vaccines administered (where "Vaccine type" = 'Mumps containing vaccines' and "Type of dose" = "Primary series") = 0 | ||
*/ | ||
define "No mumps primary series doses were administered": | ||
not exists("Mumps Doses Administered to Patient") | ||
|
||
/* | ||
@input: One mumps primary series dose was administered | ||
@pseudocode: Count of vaccines administered (where "Vaccine type" = 'Mumps containing vaccines' and "Type of dose" = "Primary series") = 1 | ||
*/ | ||
define "One mumps primary series dose was administered": | ||
Count("Mumps Doses Administered to Patient") = 1 | ||
|
||
/* | ||
@input: Two mumps primary series doses were administered | ||
@pseudocode: Count of vaccines administered (where "Vaccine type" = 'Mumps containing vaccines' and "Type of dose" = "Primary series") = 2 | ||
*/ | ||
define "Two mumps primary series doses were administered": | ||
Count("Mumps Doses Administered to Patient") >= 2 | ||
|
||
/* | ||
@input: Client's age is less than 12 months | ||
@pseudocode: 'Today's date - "Date of birth" < 12 'month' | ||
*/ | ||
define "Client's age is less than 12 months": | ||
IMMZCom."Current Patient Age In Months" < 12 | ||
|
||
/* | ||
@input: Client's age is more than or equal to 12 months | ||
@pseudocode: 'Today's date - "Date of birth" ≥ 12 'month' | ||
*/ | ||
define "Client's age is more than or equal to 12 months": | ||
not("Client's age is less than 12 months") | ||
|
||
/* | ||
@input: The latest mumps dose was administered less than 4 weeks ago | ||
@pseudocode: 'Today's date - "Date and time of vaccination" (where "Vaccine type" = 'Mumps containing vaccines') < 4 'week' | ||
*/ | ||
define "The latest mumps dose was administered less than 4 weeks ago": | ||
"Date of latest Mumps Vaccine" is not null and duration in weeks between "Date of latest Mumps Vaccine" and Now() < 4 | ||
|
||
/* | ||
@input: The latest mumps dose was administered more than 4 weeks ago | ||
@pseudocode: 'Today's date - "Date and time of vaccination" (where "Vaccine type" = 'Mumps containing vaccines') ≥ 4 'week' | ||
*/ | ||
define "The latest mumps dose was administered more than 4 weeks ago": | ||
Not("The latest mumps dose was administered less than 4 weeks ago") | ||
|
||
/* | ||
@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 duration in weeks between IMMZCom."Date of Latest Live Attenuated Vaccine" and Now() < 4 | ||
|
||
/* | ||
@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 allergy to vaccine components | ||
@pseudocode: '"Potential contraindications" = 'Severe allergic reactions" | ||
*/ | ||
define "The client has allergy to vaccine components": | ||
exists(IMMZCom."Severe Allergic Reactions Condition") | ||
|
||
/* | ||
@input: The client has immune deficiency | ||
@pseudocode: '"Potential contraindications" = 'Immunodeficiency syndromes' | ||
*/ | ||
define "The client has immune deficiency": | ||
exists(IMMZCom."Immunodeficiency syndromes Condition") | ||
|
||
/* | ||
@input: The client is severely immunosuppressed | ||
@pseudocode: "Potential contraindications" = "Severely immunosuppressed" | ||
*/ | ||
define "The client is severely immunosuppressed": | ||
exists(IMMZCom."Severely Immunosuppressed 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.