Title: IMMZD2DTPneumococcalEncounterElements Id: IMMZD2DTPneumococcalEncounterElements Version: 0.2.0 Url: IMMZD2DTPneumococcalEncounterElements Status: draft Experimental: true Type: system: http://terminology.hl7.org/CodeSystem/library-type code: logic-library Date: 2025-06-25 20:08:00+0000 Publisher: WHO Description: This library defines encounter-based elements for Pneumococcal used throughout the Immunization CPG Related Artifacts: Dependencies WHOConcepts WHOCommon WHOElements IMMZCommon IMMZConcepts IMMZEncounterElements IMMZD2DTPneumococcalElements Parameters: Name Type Min Max In/Out Today date 0 1 In EncounterId string 0 1 In Patient Patient 0 1 Out Pneumococcal Doses Administered to Patient Immunization 0 * Out Date of First Pneumococcal Dose date 0 1 Out Date of Latest Pneumococcal Dose date 0 1 Out Pneumococcal Primary Series Doses Administered to Patient Immunization 0 * Out Number of Pneumococcal Primary Series Doses Administered integer 0 1 Out No pneumococcal primary series doses were administered boolean 0 1 Out One pneumococcal primary series dose was administered boolean 0 1 Out Two pneumococcal primary series doses were administered boolean 0 1 Out Three pneumococcal primary series doses were administered boolean 0 1 Out Pneumococcal Booster Series Doses Administered to Patient Immunization 0 * Out Number of Pneumococcal Booster Series Doses Administered integer 0 1 Out No pneumococcal booster dose was administered boolean 0 1 Out One pneumococcal booster dose was administered boolean 0 1 Out Two pneumococcal booster doses were administered boolean 0 1 Out The client's age is less than 6 weeks boolean 0 1 Out The client's age is between 6 weeks and 5 years boolean 0 1 Out The client's age is less than or equal to 5 years boolean 0 1 Out The client's age is less than or equal to five years boolean 0 1 Out The client's age is less than 12 months boolean 0 1 Out The client's age is more than or equal to 12 months and less than 24 months boolean 0 1 Out The client's age is less than 24 months boolean 0 1 Out The client's age is more than or equal to 24 months boolean 0 1 Out The client's age is more than 5 years boolean 0 1 Out The first pneumococcal dose was administered within 24 months post birth boolean 0 1 Out The first pneumococcal dose was administered after 24 months post birth boolean 0 1 Out The first pneumococcal dose was administered within 12 months post birth boolean 0 1 Out The first pneumococcal dose was administered after 12 months post birth boolean 0 1 Out The first pneumococcal dose was administered at 12–24 months post birth boolean 0 1 Out The latest pneumococcal dose was administered within 12 months post birth boolean 0 1 Out The latest pneumococcal dose was administered after 12 months post birth boolean 0 1 Out The latest pneumococcal dose was administered less than 4 weeks ago boolean 0 1 Out The latest pneumococcal dose was administered more than 4 weeks ago boolean 0 1 Out The latest pneumococcal dose was administered less than 8 weeks ago boolean 0 1 Out The latest pneumococcal dose was administered more than 8 weeks ago boolean 0 1 Out Client is at high risk for pneumococcal infection boolean 0 1 Out Client is not at high risk for pneumococcal infection boolean 0 1 Out Client's HIV status is positive boolean 0 1 Out Client's HIV status is negative or unknown boolean 0 1 Out Client had preterm birth boolean 0 1 Out Client did not have preterm birth boolean 0 1 Out Content: text/cql /* * Library: IMMZD2DTPneumococcalEncounterElements */ library IMMZD2DTPneumococcalEncounterElements using FHIR version '4.0.1' include FHIRHelpers version '4.0.1' include WHOConcepts include WHOCommon called WC include WHOElements called WE include IMMZCommon called Common include IMMZConcepts called Concepts include IMMZEncounterElements called Encounter include IMMZD2DTPneumococcalElements called PneumococcalElements parameter Today Date default Today() parameter EncounterId String context Patient /* @internal: Pneumococcal containing Doses Administered to Patient */ define "Pneumococcal Doses Administered to Patient": Encounter."Doses Administered to Patient" I where I.vaccineCode in Concepts."Pneumococcal vaccines" /* @internal: Date and time of first Pneumococcal dose */ define "Date of First Pneumococcal Dose": date from start of "Pneumococcal Doses Administered to Patient".earliest().occurrence.toInterval() /* @internal: Date and time of last Pneumococcal dose */ define "Date of Latest Pneumococcal Dose": date from start of "Pneumococcal Doses Administered to Patient".mostRecent().occurrence.toInterval() /* @internal: Pneumococcal containing Doses Administered to Patient that are in the Primary series */ define "Pneumococcal Primary Series Doses Administered to Patient": "Pneumococcal Doses Administered to Patient".seriesPrimary() /* @internal: Number of Pneumococcal Primary Series doses */ define "Number of Pneumococcal Primary Series Doses Administered": Count("Pneumococcal Primary Series Doses Administered to Patient") /* @input: No pneumococcal primary series doses were administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "Pneumococcal vaccines" and "Type of dose" = "Primary series") = 0 @decision: 2 primary doses with a booster dose (2p+1) @decision: 3 primary doses (3p+0) */ define "No pneumococcal primary series doses were administered": "Number of Pneumococcal Primary Series Doses Administered" = 0 /* @input: One pneumococcal primary series dose was administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "Pneumococcal vaccines" and "Type of dose" = "Primary series") = 1 @decision: 2 primary doses with a booster dose (2p+1) @decision: 3 primary doses (3p+0) */ define "One pneumococcal primary series dose was administered": "Number of Pneumococcal Primary Series Doses Administered" = 1 /* @input: Two pneumococcal primary series doses were administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "Pneumococcal vaccines" and "Type of dose" = "Primary series") = 2 @decision: 2 primary doses with a booster dose (2p+1) @decision: 3 primary doses (3p+0) */ define "Two pneumococcal primary series doses were administered": "Number of Pneumococcal Primary Series Doses Administered" = 2 /* @input: Three pneumococcal primary series doses were administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "Pneumococcal vaccines" and "Type of dose" = "Primary series") = 3 @decision: 3 primary doses (3p+0) */ define "Three pneumococcal primary series doses were administered": "Number of Pneumococcal Primary Series Doses Administered" = 3 /* @internal: Pneumococcal containing Doses Administered to Patient that are in the Booster series */ define "Pneumococcal Booster Series Doses Administered to Patient": "Pneumococcal Doses Administered to Patient".seriesBooster() /* @internal: Number of Pneumococcal Booster Series doses */ define "Number of Pneumococcal Booster Series Doses Administered": Count("Pneumococcal Booster Series Doses Administered to Patient") /* @input: No pneumococcal booster dose was administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "Pneumococcal vaccines" and "Type of dose" = "Booster dose") = 0 @decision: 2 primary doses with a booster dose (2p+1) @decision: 3 primary doses (3p+0) */ define "No pneumococcal booster dose was administered": "Number of Pneumococcal Booster Series Doses Administered" = 0 /* @input: One pneumococcal booster dose was administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "Pneumococcal vaccines" and "Type of dose" = "Booster dose") = 1 @decision: 2 primary doses with a booster dose (2p+1) @decision: 3 primary doses (3p+0) */ define "One pneumococcal booster dose was administered": "Number of Pneumococcal Booster Series Doses Administered" = 1 /* @input: Two pneumococcal booster doses were administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "Pneumococcal vaccines" and "Type of dose" = "Booster dose") = 2 @decision: 2 primary doses with a booster dose (2p+1) */ define "Two pneumococcal booster doses were administered": "Number of Pneumococcal Booster Series Doses Administered" = 2 /* @input: The client's age is less than 6 weeks @pseudocode: Today's date − "Date of birth" < 6 weeks @decision: 2 primary doses with a booster dose (2p+1) @decision: 3 primary doses (3p+0) */ define "The client's age is less than 6 weeks": Encounter."Current Patient Age In Weeks" < 6 /* @input: The client's age is between 6 weeks and 5 years @pseudocode: 6 weeks ≤ Today's date − "Date of birth" ≤ 5 years @decision: 2 primary doses with a booster dose (2p+1) @decision: 3 primary doses (3p+0) */ define "The client's age is between 6 weeks and 5 years": 6 <= Encounter."Current Patient Age In Weeks" and Encounter."Current Patient Age In Years" <= 5 /* @input: The client's age is less than or equal to 5 years @pseudocode: 'Today's date − "Date of birth" ≤ 5 years @decision: 2 primary doses with a booster dose (2p+1) @decision: 3 primary doses (3p+0) */ define "The client's age is less than or equal to 5 years": Encounter."Current Patient Age In Years" <= 5 /* @input: The client's age is less than or equal to five years @pseudocode: Today's date − "Date of birth" ≤ 5 years @decision: 3 primary doses (3p+0) */ define "The client's age is less than or equal to five years": "The client's age is less than or equal to 5 years" /* @input: The client's age is less than 12 months @pseudocode: Today's date − "Date of birth" < 12 months @decision: 2 primary doses with a booster dose (2p+1) */ define "The client's age is less than 12 months": Encounter."Current Patient Age In Months" < 12 /* @input: The client's age is more than or equal to 12 months and less than 24 months @pseudocode: 12 months ≤ Today's date − "Date of birth" < 24 months @decision: 2 primary doses with a booster dose (2p+1) */ define "The client's age is more than or equal to 12 months and less than 24 months": 12 <= Encounter."Current Patient Age In Months" and Encounter."Current Patient Age In Months" < 24 /* @input: The client's age is less than 24 months @pseudocode: Today's date − "Date of birth" < 24 months @decision: 3 primary doses (3p+0) */ define "The client's age is less than 24 months": Encounter."Current Patient Age In Months" < 24 /* @input: The client's age is more than or equal to 24 months @pseudocode: Today's date − "Date of birth" ≥ 24 months @decision: 2 primary doses with a booster dose (2p+1) */ define "The client's age is more than or equal to 24 months": Encounter."Current Patient Age In Months" >= 24 /* @input: The client's age is more than 5 years @pseudocode: Today's date − "Date of birth" > 5 years @decision: 2 primary doses with a booster dose (2p+1) @decision: 3 primary doses (3p+0) */ define "The client's age is more than 5 years": Encounter."Current Patient Age In Months" > 5 /* @input: The first pneumococcal dose was administered within 24 months post birth @pseudocode: "Date and time of vaccination" (where "Vaccine type" = "Pneumococcal vaccines") − "Date of birth" < 24 months @decision: 2 primary doses with a booster dose (2p+1) */ define "The first pneumococcal dose was administered within 24 months post birth": AgeInMonthsAt("Date of First Pneumococcal Dose") < 24 /* @input: The first pneumococcal dose was administered after 24 months post birth @pseudocode: "Date and time of vaccination" (where "Vaccine type" = "Pneumococcal vaccines") − "Date of birth" ≥ 24 months @decision: 2 primary doses with a booster dose (2p+1) @decision: 3 primary doses (3p+0) */ define "The first pneumococcal dose was administered after 24 months post birth": AgeInMonthsAt("Date of First Pneumococcal Dose") >= 24 /* @input: The first pneumococcal dose was administered within 12 months post birth @pseudocode: "Date and time of vaccination" (where "Vaccine type" = "Pneumococcal vaccines" AND "Dose number" = 1) − "Date of birth" < 12 months @decision: 2 primary doses with a booster dose (2p+1) @decision: 3 primary doses (3p+0) */ define "The first pneumococcal dose was administered within 12 months post birth": AgeInMonthsAt("Date of First Pneumococcal Dose") < 12 /* @input: The first pneumococcal dose was administered after 12 months post birth @pseudocode: "Date and time of vaccination" (where "Vaccine type" = "Pneumococcal vaccines" AND "Dose number" = 1) − "Date of birth" ≥ 12 months @decision: 2 primary doses with a booster dose (2p+1) @decision: 3 primary doses (3p+0) */ define "The first pneumococcal dose was administered after 12 months post birth": AgeInMonthsAt("Date of First Pneumococcal Dose") >= 12 /* @input: The first pneumococcal dose was administered at 12–24 months post birth @pseudocode: 12 months ≤ "Date and time of vaccination" (where "Vaccine type" = "Pneumococcal vaccines") − "Date of birth" < 24 months @decision: 3 primary doses (3p+0) */ define "The first pneumococcal dose was administered at 12–24 months post birth": AgeInMonthsAt("Date of First Pneumococcal Dose") >= 12 and AgeInMonthsAt("Date of First Pneumococcal Dose") < 24 /* @input: The latest pneumococcal dose was administered within 12 months post birth @pseudocode: Latest "Date and time of vaccination" (where "Vaccine type" = "Pneumococcal vaccines") − "Date of birth" < 12 months @decision: 2 primary doses with a booster dose (2p+1) @decision: 3 primary doses (3p+0) */ define "The latest pneumococcal dose was administered within 12 months post birth": AgeInMonthsAt("Date of Latest Pneumococcal Dose") < 12 /* @input: The latest pneumococcal dose was administered after 12 months post birth @pseudocode: Latest "Date and time of vaccination" (where "Vaccine type" = "Pneumococcal vaccines") − "Date of birth" ≥ 12 months @decision: 2 primary doses with a booster dose (2p+1) @decision: 3 primary doses (3p+0) */ define "The latest pneumococcal dose was administered after 12 months post birth": AgeInMonthsAt("Date of Latest Pneumococcal Dose") >= 12 /* @input: The latest pneumococcal dose was administered less than 4 weeks ago @pseudocode: Today's date − "Date and time of vaccination" (where "Vaccine type" = "Pneumococcal vaccines") < 4 weeks @decision: 3 primary doses (3p+0) */ define "The latest pneumococcal dose was administered less than 4 weeks ago": "Date of Latest Pneumococcal Dose" is not null and duration in weeks between "Date of Latest Pneumococcal Dose" and Today < 4 /* @input: The latest pneumococcal dose was administered more than 4 weeks ago @pseudocode: Today's date − "Date and time of vaccination" (where "Vaccine type" = "Pneumococcal vaccines") ≥ 4 weeks @decision: 3 primary doses (3p+0) */ define "The latest pneumococcal dose was administered more than 4 weeks ago": not "The latest pneumococcal dose was administered less than 4 weeks ago" /* @input: The latest pneumococcal dose was administered less than 8 weeks ago @pseudocode: Today's date − "Date and time of vaccination" (where "Vaccine type" = "Pneumococcal vaccines") < 8 weeks @decision: 2 primary doses with a booster dose (2p+1) @decision: 3 primary doses (3p+0) */ define "The latest pneumococcal dose was administered less than 8 weeks ago": "Date of Latest Pneumococcal Dose" is not null and duration in weeks between "Date of Latest Pneumococcal Dose" and Today < 8 /* @input: The latest pneumococcal dose was administered more than 8 weeks ago @pseudocode: Today's date − "Date and time of vaccination" (where "Vaccine type" = "Pneumococcal vaccines") ≥ 8 weeks @decision: 2 primary doses with a booster dose (2p+1) @decision: 3 primary doses (3p+0) */ define "The latest pneumococcal dose was administered more than 8 weeks ago": not "The latest pneumococcal dose was administered less than 8 weeks ago" /* @input: Client is at high risk for pneumococcal infection @pseudocode: "At high risk for pneumococcal infection" = TRUE @decision: 2 primary doses with a booster dose (2p+1) @decision: 3 primary doses (3p+0) */ define "Client is at high risk for pneumococcal infection": Encounter."Client is at high risk for pneumococcal infection" /* @input: Client is not at high risk for pneumococcal infection @pseudocode: "At high risk for pneumococcal infection" = FALSE @decision: 2 primary doses with a booster dose (2p+1) @decision: 3 primary doses (3p+0) */ define "Client is not at high risk for pneumococcal infection": Encounter."Client is not at high risk for pneumococcal infection" /* @input: Client's HIV status is positive @pseudocode: "HIV status" = "HIV-positive" @decision: 2 primary doses with a booster dose (2p+1) @decision: 3 primary doses (3p+0) */ define "Client's HIV status is positive": Encounter."Client's HIV status is positive" /* @input: Client's HIV status is negative or unknown @pseudocode: "HIV status" ≠ "HIV-positive" @decision: 2 primary doses with a booster dose (2p+1) @decision: 3 primary doses (3p+0) */ define "Client's HIV status is negative or unknown": Encounter."Client's HIV status is negative or unknown" /* @input: Client had preterm birth @pseudocode: "Preterm birth" = TRUE @decision: 2 primary doses with a booster dose (2p+1) @decision: 3 primary doses (3p+0) */ define "Client had preterm birth": Encounter."Client was a premature infant at birth" /* @input: Client did not have preterm birth @pseudocode: "Preterm birth" ≠ TRUE @decision: 2 primary doses with a booster dose (2p+1) @decision: 3 primary doses (3p+0) */ define "Client did not have preterm birth": Encounter."Client was not a premature infant at birth" Content: application/elm+xml Encoded data (117884 characters)
This library defines encounter-based elements for Pneumococcal used throughout the Immunization CPG
Pneumococcal Doses Administered to Patient
Pneumococcal Primary Series Doses Administered to Patient
Number of Pneumococcal Primary Series Doses Administered
No pneumococcal primary series doses were administered
One pneumococcal primary series dose was administered
Two pneumococcal primary series doses were administered
Three pneumococcal primary series doses were administered
Pneumococcal Booster Series Doses Administered to Patient
Number of Pneumococcal Booster Series Doses Administered
No pneumococcal booster dose was administered
One pneumococcal booster dose was administered
Two pneumococcal booster doses were administered
The client's age is between 6 weeks and 5 years
The client's age is less than or equal to 5 years
The client's age is less than or equal to five years
The client's age is more than or equal to 12 months and less than 24 months
The client's age is more than or equal to 24 months
The first pneumococcal dose was administered within 24 months post birth
The first pneumococcal dose was administered after 24 months post birth
The first pneumococcal dose was administered within 12 months post birth
The first pneumococcal dose was administered after 12 months post birth
The first pneumococcal dose was administered at 12–24 months post birth
The latest pneumococcal dose was administered within 12 months post birth
The latest pneumococcal dose was administered after 12 months post birth
The latest pneumococcal dose was administered less than 4 weeks ago
The latest pneumococcal dose was administered more than 4 weeks ago
The latest pneumococcal dose was administered less than 8 weeks ago
The latest pneumococcal dose was administered more than 8 weeks ago
Client is at high risk for pneumococcal infection
Client is not at high risk for pneumococcal infection
Client's HIV status is negative or unknown