WHO Immunization Implementation Guide
0.2.0 - ci-build

WHO Immunization Implementation Guide, published by WHO. This guide is not an authorized publication; it is the continuous build for version 0.2.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/WorldHealthOrganization/smart-immunizations/ and changes regularly. See the Directory of published versions

Library: IMMZD2DTJEEncounterElements

Official URL: http://smart.who.int/immunizations/Library/IMMZD2DTJEEncounterElements Version: 0.2.0
Draft as of 2025-08-08 Computable Name: IMMZD2DTJEEncounterElements

This library defines encounter-based elements for JE used throughout the Immunization CPG

Title: IMMZD2DTJEEncounterElements
Id: IMMZD2DTJEEncounterElements
Version: 0.2.0
Url: IMMZD2DTJEEncounterElements
Status: draft
Type:

system: http://terminology.hl7.org/CodeSystem/library-type

code: logic-library

Date: 2025-08-08 19:12:11+0000
Publisher: WHO
Description:

This library defines encounter-based elements for JE used throughout the Immunization CPG

Related Artifacts:

Dependencies

Parameters:
NameTypeMinMaxIn/Out
Todaydate01In
EncounterIdstring01In
PatientPatient01Out
JE Doses Administered to PatientImmunization0*Out
JE Primary Series Doses Administered to PatientImmunization0*Out
Number of JE Primary Series Doses Administeredinteger01Out
Date of Latest JE Dosedate01Out
No JE primary series doses were administeredboolean01Out
One JE primary series dose was administeredboolean01Out
One JE primary series doses were administeredboolean01Out
Two JE primary series doses were administeredboolean01Out
Client's age is less than 6 monthsboolean01Out
Client's age is more than or equal to 6 monthsboolean01Out
Client's age is less than 8 monthsboolean01Out
Client's age is more than or equal to 8 monthsboolean01Out
Client's age is less than 9 monthsboolean01Out
Client's age is more than or equal to 9 monthsboolean01Out
The latest JE dose was administered less than 4 weeks agoboolean01Out
The latest JE dose was administered more than 4 weeks agoboolean01Out
No live vaccine was administered in the last 4 weeksboolean01Out
Live vaccine was administered in the last 4 weeksboolean01Out
Content: text/cql

/*
  * Library: IMMZD2DTJEEncounterElements
  */
library IMMZD2DTJEEncounterElements

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 IMMZD2DTJEElements called JEElements

parameter Today Date default Today()
parameter EncounterId String

context Patient

/*
@internal: JE containing Doses Administered to Patient
*/
define "JE Doses Administered to Patient":
  Encounter."Doses Administered to Patient" I
  where
    I.vaccineCode in Concepts."JE vaccines"

/*
@internal: JE containing Doses Administered to Patient that are in the Primary series
*/
define "JE Primary Series Doses Administered to Patient":
  "JE Doses Administered to Patient".seriesPrimary()

/*
@internal: Number of JE Primary Series doses
*/
define "Number of JE Primary Series Doses Administered":
  Count("JE Primary Series Doses Administered to Patient")

/*
@internal: Date and time of last JE dose
*/
define "Date of Latest JE Dose":
  date from start of "JE Doses Administered to Patient".mostRecent().occurrence.toInterval()

/*
@input: No JE primary series doses were administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = "JE vaccines" and "Type of dose" = "Primary series") = 0
@decision: Inactivated Vero cell-derived vaccination schedule (2-dose scheme)
JE vaccination should be integrated into national immunization schedules in all areas where JE is recognized as a public health priority
@decision: Live attenuated vaccination schedule (1-dose scheme)
JE vaccination should be integrated into national immunization schedules in all areas where JE is recognized as a public health priority
@decision: Live recombinant vaccination schedule (1-dose scheme)
JE vaccination should be integrated into national immunization schedules in all areas where JE is recognized as a public health priority
*/
define "No JE primary series doses were administered":
  "Number of JE Primary Series Doses Administered" = 0

/*
@input: One JE primary series dose was administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = "JE vaccines" and "Type of dose" = "Primary series") = 1
@decision: Inactivated Vero cell-derived vaccination schedule (2-dose scheme)
JE vaccination should be integrated into national immunization schedules in all areas where JE is recognized as a public health priority
@decision: Live attenuated vaccination schedule (1-dose scheme)
JE vaccination should be integrated into national immunization schedules in all areas where JE is recognized as a public health priority
*/
define "One JE primary series dose was administered":
  "Number of JE Primary Series Doses Administered" = 1

/*
@input: One JE primary series doses were administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = "JE vaccines" and "Type of dose" = "Primary series") = 1
@decision: Live recombinant vaccination schedule (1-dose scheme)
JE vaccination should be integrated into national immunization schedules in all areas where JE is recognized as a public health priority
*/
define "One JE primary series doses were administered":
  "One JE primary series dose was administered"

/*
@input: Two JE primary series doses were administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = "JE vaccines" and "Type of dose" = "Primary series") = 2
@decision: Inactivated Vero cell-derived vaccination schedule (2-dose scheme)
JE vaccination should be integrated into national immunization schedules in all areas where JE is recognized as a public health priority
*/
define "Two JE primary series doses were administered":
  "Number of JE Primary Series Doses Administered" = 2

/*
@input: Client's age is less than 6 months
@pseudocode: Today's date − "Date of birth" < 6 months
@decision: Inactivated Vero cell-derived vaccination schedule (2-dose scheme)
JE vaccination should be integrated into national immunization schedules in all areas where JE is recognized as a public health priority
*/
define "Client's age is less than 6 months":
  Encounter."Current Patient Age In Months" < 6

/*
@input: Client's age is more than or equal to 6 months
@pseudocode: Today's date − "Date of birth" ≥ 6 months
@decision: Inactivated Vero cell-derived vaccination schedule (2-dose scheme)
JE vaccination should be integrated into national immunization schedules in all areas where JE is recognized as a public health priority
*/
define "Client's age is more than or equal to 6 months":
  Encounter."Current Patient Age In Months" >= 6

/*
@input: Client's age is less than 8 months
@pseudocode: Today's date − "Date of birth" < 8 months
@decision: Live attenuated vaccination schedule (1-dose scheme)
JE vaccination should be integrated into national immunization schedules in all areas where JE is recognized as a public health priority
*/
define "Client's age is less than 8 months":
  Encounter."Current Patient Age In Months" < 8

/*
@input: Client's age is more than or equal to 8 months
@pseudocode: Today's date − "Date of birth" ≥ 8 months
@decision: Live attenuated vaccination schedule (1-dose scheme)
JE vaccination should be integrated into national immunization schedules in all areas where JE is recognized as a public health priority
*/
define "Client's age is more than or equal to 8 months":
  Encounter."Current Patient Age In Months" >= 8

/*
@input: Client's age is less than 9 months
@pseudocode: Today's date − "Date of birth" < 9 months
@decision: Live recombinant vaccination schedule (1-dose scheme)
JE vaccination should be integrated into national immunization schedules in all areas where JE is recognized as a public health priority
*/
define "Client's age is less than 9 months":
  Encounter."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 months
@decision: Live recombinant vaccination schedule (1-dose scheme)
JE vaccination should be integrated into national immunization schedules in all areas where JE is recognized as a public health priority
*/
define "Client's age is more than or equal to 9 months":
  Encounter."Current Patient Age In Months" >= 9

/*
@input: The latest JE dose was administered less than 4 weeks ago
@pseudocode: Today's date − "Date and time of vaccination" (where "Vaccine type" = "JE vaccines") < 4 weeks
@decision: Inactivated Vero cell-derived vaccination schedule (2-dose scheme)
JE vaccination should be integrated into national immunization schedules in all areas where JE is recognized as a public health priority
*/
define "The latest JE dose was administered less than 4 weeks ago":
  "Date of Latest JE Dose" is not null
    and duration in weeks between "Date of Latest JE Dose" and Today < 4

/*
@input: The latest JE dose was administered more than 4 weeks ago
@pseudocode: Today's date − "Date and time of vaccination" (where "Vaccine type" = "JE vaccines") ≥ 4 weeks
@decision: Inactivated Vero cell-derived vaccination schedule (2-dose scheme)
JE vaccination should be integrated into national immunization schedules in all areas where JE is recognized as a public health priority
*/
define "The latest JE dose was administered more than 4 weeks ago":
  not "The latest JE dose was administered less than 4 weeks ago"

/*
@input: No live vaccine was administered in the last 4 weeks
@pseudocode: Today's date − latest "Date and time of vaccination" (where "Vaccine type" = "JE vaccines") ≥ 4 weeks
@decision: Live attenuated vaccination schedule (1-dose scheme)
JE vaccination should be integrated into national immunization schedules in all areas where JE is recognized as a public health priority
@decision: Live recombinant vaccination schedule (1-dose scheme)
JE vaccination should be integrated into national immunization schedules in all areas where JE is recognized as a public health priority*/
define "No live vaccine was administered in the last 4 weeks":
  Encounter."No live vaccine was administered in the last 4 weeks"

/*
@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 weeks
@decision: Live attenuated vaccination schedule (1-dose scheme)
JE vaccination should be integrated into national immunization schedules in all areas where JE is recognized as a public health priority
@decision: Live recombinant vaccination schedule (1-dose scheme)
JE vaccination should be integrated into national immunization schedules in all areas where JE is recognized as a public health priority*/
define "Live vaccine was administered in the last 4 weeks":
  Encounter."Live vaccine was administered in the last 4 weeks"

Content: application/elm+xml
Encoded data (60412 characters)