WHO Immunization Implementation Guide
0.1.0 - CI Build International flag

WHO Immunization Implementation Guide, published by World Health Organization (WHO). This guide is not an authorized publication; it is the continuous build for version 0.1.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: IMMZD2DTHepatitisBInput

Official URL: http://smart.who.int/ig/smart-immunizations/Library/IMMZD2DTHepatitisBInput Version: 0.1.0
Draft as of 2024-05-30 Computable Name: IMMZD2DTHepatitisBInput

Related Artifacts

depends-onFHIR model informationhttp://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1
depends-onLibrary FHIRHelpershttp://smart.who.int/ig/smart-immunizations/Library/FHIRHelpers|4.0.1
depends-onLibrary IMMZComIMMZCommon
depends-onLibrary IMMZcIMMZConcepts
depends-onLibrary IMMZConIMMZConfig
depends-onLibrary IMMZvlIMMZVaccineLibrary
depends-onLibrary FCFHIRCommon
depends-onCode system IMMZ.D1IMMZ.D1 CodeSystem for Data Elements
depends-onCode system IMMZ.DIMMZ.D CodeSystem for Data Elements
depends-onValue set Hepatitis B VaccineIMMZ.Z.DE6 Hepatitis B containing vaccines

Parameters

Patientout01Patient
Member States defined upper limitout01integer
Member States defined lower limitout01integer
Hepatitis B Doses Administered to Patientout0*Immunization
Hepatitis B Primary Series Doses Administered to Patientout0*Immunization
Date of latest Hepatitis B Vaccineout01dateTime
Date of first Hepatitis B Vaccineout01dateTime
Hepatitis B birth dose was administeredout01boolean
Hepatitis B birth dose was not administeredout01boolean
No hepatitis B doses were administeredout01boolean
One hepatitis B dose was administeredout01boolean
Two hepatitis B doses were administeredout01boolean
Three hepatitis B doses were administeredout01boolean
No hepatitis B primary series doses were administeredout01boolean
One hepatitis B primary series dose was administeredout01boolean
Two hepatitis B primary series doses were administeredout01boolean
Three hepatitis B primary series doses were administeredout01boolean
Client's age is less than {Member States defined upper limit}out01boolean
Client's age is more than {Member States defined upper limit}out01boolean
Client's age is less than {Member States defined lower limit}out01boolean
Client's age is more than or equal to {Member States defined lower limit}out01boolean
Client's weight at birth was below 2000gout01boolean
Client's weight at birth was over 2000gout01boolean
Client was a premature infant at birthout01boolean
Client was not a premature infant at birthout01boolean
The latest hepatitis B dose was administered less than 4 weeks agoout01boolean
The latest hepatitis B dose was administered more than 4 weeks agoout01boolean
The first hepatitis B dose was administered less than 6 months agoout01boolean
The first hepatitis B dose was administered more than 6 months agoout01boolean
The client has history of severe allergic reactionsout01boolean

Data Requirements

Type: Patient (Patient)
Type: Immunization (Immunization)
Type: Observation (Observation)
FilterValue
codeOne of these codes: IMMZ.D1 CodeSystem for Data Elements DE29: Birth Weight in Grams
Type: Observation (Observation)
FilterValue
codeOne of these codes: IMMZ.D1 CodeSystem for Data Elements DE15: Preterm Birth
Type: Condition (Condition)
FilterValue
codeOne of these codes: IMMZ.D CodeSystem for Data Elements DE167: Severe allergic reactions

Contents

text/cql

/*
 * Library: IMMZD2DTHepatitisBInput (IMMZ.D2.DT.HepatitisBInput)					
 */
library IMMZD2DTHepatitisBInput
// 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

/*
@function: compare 2 dates against the defined upper limit in the required precision
*/
define function MemberStatesPrecision( start Date, end Date):
	duration in weeks between start and end

/*
@parameter: Member States defined upper limit
*/
define "Member States defined upper limit":
  4

/*
@parameter: Member States defined lower limit
*/
define "Member States defined lower limit":
  4


/*
@internal: Hepatitis B containing Doses Administered to Patient
*/
define "Hepatitis B Doses Administered to Patient":
  IMMZCom."Doses Administered to Patient" I
  where
    I.vaccineCode in IMMZc."Hepatitis B Vaccine"

/*
@internal: Hepatitis B Primary Series Doses Administered to Patient
*/
define "Hepatitis B Primary Series Doses Administered to Patient":
	"Hepatitis B Doses Administered to Patient" I where MemberStatesPrecision( Patient.birthDate, ToDate(I.occurrence as dateTime) ) >= "Member States defined upper limit"

/*
@internal: Date of latest Hepatitis B Vaccine
*/
define "Date of latest Hepatitis B Vaccine":
	First("Hepatitis B Doses Administered to Patient").occurrence as dateTime

/*
@internal: Date of first Hepatitis B Vaccine
*/
define "Date of first Hepatitis B Vaccine":
	Last("Hepatitis B Doses Administered to Patient").occurrence as dateTime

/*
@input: Hepatitis B birth dose was not administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = 'Hepatitis B containing vaccines' and "Birth Dose" = TRUE) = 0
*/
define "Hepatitis B birth dose was not administered":
	not( "Hepatitis B birth dose was administered" )

/*
@input: Hepatitis B birth dose was administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = 'Hepatitis B containing vaccines' and "Birth Dose" = TRUE) = 1
*/
define "Hepatitis B birth dose was administered":
	exists("Hepatitis B Doses Administered to Patient" I where MemberStatesPrecision( Patient.birthDate, ToDate(I.occurrence as dateTime) ) < "Member States defined upper limit")

/*
@input: No hepatitis B doses were administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = 'Hepatitis B containing vaccines') = 0
*/
define "No hepatitis B doses were administered":
	Count("Hepatitis B Doses Administered to Patient") = 0

/*
@input: One hepatitis B dose was administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = 'Hepatitis B containing vaccines') = 1
*/
define "One hepatitis B dose was administered":
	Count("Hepatitis B Doses Administered to Patient") = 1

/*
@input: Two hepatitis B doses were administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = 'Hepatitis B containing vaccines') = 2
*/
define "Two hepatitis B doses were administered":
	Count("Hepatitis B Doses Administered to Patient") = 2

/*
@input: Three hepatitis B doses were administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = 'Hepatitis B containing vaccines') = 3
*/
define "Three hepatitis B doses were administered":
	Count("Hepatitis B Doses Administered to Patient") = 3

/*
@input: No hepatitis B primary series doses were administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = 'Hepatitis B containing vaccines' and "Type of dose" = 'Primary series') = 0
*/
define "No hepatitis B primary series doses were administered":
	Count("Hepatitis B Primary Series Doses Administered to Patient") = 0

/*
@input: One hepatitis B primary series dose was administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = 'Hepatitis B containing vaccines' and "Type of dose" = 'Primary series') = 1
*/
define "One hepatitis B primary series dose was administered":
	Count("Hepatitis B Primary Series Doses Administered to Patient") = 1

/*
@input: Two hepatitis B primary series doses were administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = 'Hepatitis B containing vaccines' and "Type of dose" = 'Primary series') = 2
*/
define "Two hepatitis B primary series doses were administered":
	Count("Hepatitis B Primary Series Doses Administered to Patient") = 2

/*
@input: Three hepatitis B primary series doses were administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = 'Hepatitis B containing vaccines' and "Type of dose" = 'Primary series') = 3
*/
define "Three hepatitis B primary series doses were administered":
	Count("Hepatitis B Primary Series Doses Administered to Patient") = 3

/*
@input: Client's age is less than {Member States defined upper limit}
@pseudocode: Today's date - "Date of birth"  < Member states defined uper limit
*/
define "Client's age is less than {Member States defined upper limit}":
	MemberStatesPrecision(Patient.birthDate, Today()) < "Member States defined upper limit"
	
/*
@input: Client's age is more than {Member States defined upper limit}
@pseudocode: Today's date - "Date of birth"  > Member states defined upper limit
*/
define "Client's age is more than {Member States defined upper limit}":
	not( "Client's age is less than {Member States defined upper limit}" )

/*
@input: Client's age is less than {Member States defined lower limit}
@pseudocode: Today's date - "Date of birth"  < Member states defined lower limit
*/
define "Client's age is less than {Member States defined lower limit}":
	MemberStatesPrecision(Patient.birthDate, Today()) < "Member States defined lower limit"
	
/*
@input: Client's age is more than or equal to {Member States defined lower limit}
@pseudocode: Today's date - "Date of birth"  >= Member states defined lower limit
*/
define "Client's age is more than or equal to {Member States defined lower limit}":
	not( "Client's age is less than {Member States defined lower limit}" )

/*
@input: Client's weight at birth was over 2000g
@pseudocode: "Birth weight in grams"  ≥ 2000
*/
define "Client's weight at birth was over 2000g":
	not("Client's weight at birth was below 2000g")
/*
@input: Client's weight at birth was below 2000g
@pseudocode: "Birth weight in grams" < 2000
*/
define "Client's weight at birth was below 2000g":
	IMMZCom."Patient birth weight in grams" < 2000
/*
@input: Client was not a premature infant at birth
@pseudocode: "Preterm birth" ≠  TRUE
*/
define "Client was not a premature infant at birth":
	not("Client was a premature infant at birth")

/*
@input: Client was a premature infant at birth
@pseudocode: "Preterm birth" =  TRUE
*/
define "Client was a premature infant at birth":
	IMMZCom."Preterm Birth"

/*
@input: The latest hepatitis B dose was administered less than 4 weeks ago
@pseudocode: Today's date - latest "Date and time of vaccination" (where "Vaccine type" = 'Hepatitis B containing vaccines') < 4 'week'
*/
define "The latest hepatitis B dose was administered less than 4 weeks ago":
	"Date of latest Hepatitis B Vaccine" is not null and duration in weeks between "Date of latest Hepatitis B Vaccine" and Now() < 4 

/*
@input: The latest hepatitis B dose was administered more than 4 weeks ago
@pseudocode: Today's date - latest "Date and time of vaccination" (where "Vaccine type" = 'Hepatitis B containing vaccines') ≥ 4 'week'
*/
define "The latest hepatitis B dose was administered more than 4 weeks ago":
	"Date of latest Hepatitis B Vaccine" is not null and duration in weeks between "Date of latest Hepatitis B Vaccine" and Now() >= 4 

/*
@input: The first hepatitis B dose was administered less than 6 months ago
@pseudocode: Today's date - "Date and time of vaccination" (where "Vaccine type" = 'Hepatitis B containing vaccines' and "Dose number" = 1) < 6 'month'
*/
define "The first hepatitis B dose was administered less than 6 months ago":
	"Date of first Hepatitis B Vaccine" is not null and duration in months between "Date of first Hepatitis B Vaccine" and Now() < 6 

/*
@input: The first hepatitis B dose was administered more than 6 months ago
@pseudocode: Today's date - "Date and time of vaccination" (where "Vaccine type" = 'Hepatitis B containing vaccines' and "Dose number" = 1) ≥ 6 'month'
*/
define "The first hepatitis B dose was administered more than 6 months ago":
	"Date of first Hepatitis B Vaccine" is not null and duration in months between "Date of first Hepatitis B Vaccine" and Now() >= 6

/*
@input: The client has history of severe allergic reactions
@pseudocode: "Potential contraindications" = 'Severe allergic reactions'
*/
define "The client has history of severe allergic reactions":
		exists(IMMZCom."Severe Allergic Reactions Condition")

Content not shown - (application/elm+xml, size = 64Kb )

Content not shown - (application/elm+json, size = 111Kb )