Id: IMMZD2DTBCG Url: IMMZ.D2.DT.BCG Version: 0.2.0 Title: IMMZ.D2.DT.BCG Status: draft Type: system: http://terminology.hl7.org/CodeSystem/plan-definition-type code: eca-rule Date: 2026-03-03 13:07:11+0000 Publisher: WHO Description: IMMZ.D2.DT.BCG IMMZ.D2.DT.BCG Knowledge Capability: computable Related Artifacts: References WHO recommendations for routine immunization - summary tables (January 2025) Libraries: IMMZD2DTBCGLogic Actions: Determine if the client is due for BCG.: Determine if the client is due for BCG vaccine according to the national immunization protocol. If: Applicability: Client is due for BCG vaccination (Client is due for BCG vaccination) Then: Definition: IMMZD2DTMR Dynamic Values: status: ('draft') intent: ('proposal') medication: (Concept { codes: { Code { system: 'http://smart.who.int/immunizations/CodeSystem/IMMZ.Z', code: 'DE1', display: 'BCG vaccines' } }, display: 'BCG vaccines' }) Check for Guidance for the patient regarding IMMZ.D2.DT.BCG.: Show Guidance for the patient regarding IMMZ.D2.DT.BCG. If: Applicability: Has Guidance (Has Guidance) Then: Definition: IMMZ.D2.DT.CR Dynamic Values: status: ('active') payload.contentString: (Guidance) category.coding: (Code { system: 'http://terminology.hl7.org/CodeSystem/communication-category', code: 'alert' }) priority: (Code { system: 'http://hl7.org/fhir/request-priority', code: 'routine' })
/** * @dataElement All Doses Administered to Patient */ define "Doses Administered to Patient": [Immunization] I where I.status = 'completed' and I.isSubpotent is not true
/* @internal: BCG containing Doses Administered to Patient */ define "BCG Doses Administered to Patient": Elements."Doses Administered to Patient" I where I.vaccineCode in Concepts."BCG vaccines"
BCG Primary Series Doses Administered to Patient
/* @internal: BCG containing Doses Administered to Patient that are in the Primary series */ define "BCG Primary Series Doses Administered to Patient": "BCG Doses Administered to Patient".seriesPrimary()
/* @internal: BCG containing Doses Administered to Patient that are in the Primary series */ define "BCG Primary Series Doses Administered to Patient": BCGElements."BCG Primary Series Doses Administered to Patient".onOrBefore(Today)
Number of BCG Primary Series Doses Administered
/* @internal: Number of BCG Primary Series doses */ define "Number of BCG Primary Series Doses Administered": Count("BCG Primary Series Doses Administered to Patient")
No BCG primary series dose was administered
/* @input: No BCG primary series dose was administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "BCG vaccines" and "Type of dose" = "Primary series") = 0 @code: No BCG primary series dose was administered-112 @decision: IMMZ.D2.DT.BCG */ define "No BCG primary series dose was administered": "Number of BCG Primary Series Doses Administered" = 0
/** * @dataElement Patient age in days */ define "Current Patient Age In Days": AgeInDaysAt(Today)
Client's age is less than or equal to 28 days
/* @input: Client's age is less than or equal to 28 days @pseudocode: Today's date − "Date of birth" ≤ 28 days @code: Client's age is less than or equal to 28 days-40 @decision: IMMZ.D2.DT.BCG */ define "Client's age is less than or equal to 28 days": Encounter."Current Patient Age In Days" <= 28
/* @internal: HIV Status Observation */ define "HIV status Observation": ([Observation: Concepts."HIV status"]).complete()
/* @input: Client's HIV status is positive @pseudocode: "HIV status" = "HIV-positive" */ define "Client's HIV status is positive": exists( (Elements."HIV status Observation".encounterOrOnBefore(EncounterId, Today)) O where O.value ~ Concepts."HIV-positive" )
Client's HIV status is negative or unknown
/* @input: Client's HIV status is negative or unknown @pseudocode: "HIV status" ≠ "HIV-positive" */ define "Client's HIV status is negative or unknown": not "Client's HIV status is positive"
/* @input: Client's HIV status is negative or unknown @pseudocode: "HIV status" ≠ "HIV-positive" @code: Client's HIV status is negative or unknown-29 @decision: IMMZ.D2.DT.BCG */ define "Client's HIV status is negative or unknown": Encounter."Client's HIV status is negative or unknown"
/* @dataElement: Live attenuated vaccines */ define "Live Attenuated Vaccines": "Doses Administered to Patient" I where I.vaccineCode in Concepts."Live Attenuated"
/* @dataElement Live attenuated vaccines */ define "Live Attenuated Vaccines": Elements."Live Attenuated Vaccines" I where I.occurrence.toInterval() same day or before Today
/* @input: No live vaccine was administered @pseudocode: Today's date − latest "Date and time of vaccination" (where "Live vaccine" = TRUE) IS NULL */ define "No live vaccine was administered": not exists("Live Attenuated Vaccines")
/* @input: No live vaccine was administered @pseudocode: Today's date − latest "Date and time of vaccination" (where "Live vaccine" = TRUE) IS NULL @code: No live vaccine was administered-90 @decision: IMMZ.D2.DT.BCG */ define "No live vaccine was administered": Encounter."No live vaccine was administered"
Client is due for BCG vaccination Case 1
/* @output: Client is due for BCG vaccination Case 1 @pseudocode: "Immunization recommendation status" = "Due" */ define "Client is due for BCG vaccination Case 1": Encounter."No BCG primary series dose was administered" and Encounter."Client's age is less than or equal to 28 days" and Encounter."Client's HIV status is negative or unknown" and Encounter."No live vaccine was administered"
/* @input: Client's HIV status is positive @pseudocode: "HIV status" = "HIV-positive" @code: Client's HIV status is positive-29 @decision: IMMZ.D2.DT.BCG */ define "Client's HIV status is positive": Encounter."Client's HIV status is positive"
/* @internal: Currently on ART Observation */ define "Currently on ART Observation": ([Observation: Concepts."Currently on ART"] O sort by end of effective.toInterval() desc).complete()
/* @internal: Currently on ART Observation */ define "Currently on ART Observation": Elements."Currently on ART Observation".encounterOrOnBefore(EncounterId, Today).mostRecent()
Client is currently receiving antiretroviral therapy
/* @input: Client is currently receiving antiretroviral therapy @pseudocode: "Currently on ART" = TRUE */ define "Client is currently receiving antiretroviral therapy": "Currently on ART Observation" is not null and "Currently on ART Observation".value = true
/* @input: Client is currently receiving antiretroviral therapy @pseudocode: "Currently on ART" = TRUE @code: Client is currently receiving antiretroviral therapy-25 @decision: IMMZ.D2.DT.BCG */ define "Client is currently receiving antiretroviral therapy": Encounter."Client is currently receiving antiretroviral therapy"
/* @internal: Immunologically stable Observation */ define "Immunologically stable Observation": ([Observation: Concepts."Immunologically stable"] O sort by end of effective.toInterval() desc).complete()
/* @internal: Immunologically stable Observation */ define "Immunologically stable Observation": Elements."Immunologically stable Observation".encounterOrOnBefore(EncounterId, Today)
/* @input: Client is immunologically stable @pseudocode: "Immunologically stable" = TRUE */ define "Client is immunologically stable": exists("Immunologically stable Observation") and First("Immunologically stable Observation").value = true
/* @input: Client is immunologically stable @pseudocode: "Immunologically stable" = TRUE @code: Client is immunologically stable-31 @decision: IMMZ.D2.DT.BCG */ define "Client is immunologically stable": Encounter."Client is immunologically stable"
Client is due for BCG vaccination Case 2
/* @output: Client is due for BCG vaccination Case 2 @pseudocode: "Immunization recommendation status" = "Due" */ define "Client is due for BCG vaccination Case 2": Encounter."No BCG primary series dose was administered" and Encounter."Client's age is less than or equal to 28 days" and Encounter."Client's HIV status is positive" and Encounter."Client is currently receiving antiretroviral therapy" and Encounter."Client is immunologically stable" and Encounter."No live vaccine was administered"
/** * @dataElement Patient age in years */ define "Current Patient Age In Years": AgeInYearsAt(Today)
Client's age is between 28 days and 5 years
/* @input: Client's age is between 28 days and 5 years @pseudocode: 28 days < Today's date − "Date of birth" < 5 years @code: Client's age is between 28 days and 5 years-50 @decision: IMMZ.D2.DT.BCG */ define "Client's age is between 28 days and 5 years": 28 < Encounter."Current Patient Age In Days" and Encounter."Current Patient Age In Years" < 5
/* @internal: TB infection test result Observation */ define "TB infection test result Observation": ([Observation: Concepts."TB infection test result"] O sort by end of effective.toInterval() desc).complete()
/* @internal: Immunologically stable Observation */ define "TB infection test result Observation": Elements."TB infection test result Observation".encounterOrOnBefore(EncounterId, Today)
Client's TB infection test result is negative
/* @input: Client's TB infection test result is negative @pseudocode: "TB infection test result" = "Negative" */ define "Client's TB infection test result is negative": exists("TB infection test result Observation") and First( "TB infection test result Observation" ).value ~ Concepts."TB-Negative"
/* @input: Client's TB infection test result is negative @pseudocode: "TB infection test result" = "Negative" @code: Client's TB infection test result is negative-39 @decision: IMMZ.D2.DT.BCG */ define "Client's TB infection test result is negative": Encounter."Client's TB infection test result is negative"
/* @dataElement Date and time of last live attenuated vaccine */ define "Date of Latest Live Attenuated Vaccine": date from start of "Live Attenuated Vaccines".mostRecent().occurrence.toInterval()
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 */ define "Live vaccine was administered in the last 4 weeks": "Date of Latest Live Attenuated Vaccine" is not null and duration in weeks between "Date of Latest Live Attenuated Vaccine" and Today < 4
No live vaccine was administered in the last 4 weeks
/* @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 weeks */ define "No live vaccine was administered in the last 4 weeks": not("Live vaccine was administered in the last 4 weeks")
No live vaccine was administered in the last four weeks
/* @input: No live vaccine was administered in the last four weeks @pseudocode: Today's date − latest "Date and time of vaccination" (where "Live vaccine" = TRUE) ≥ 4 weeks @code: No live vaccine was administered in the last four weeks-92 @decision: IMMZ.D2.DT.BCG */ define "No live vaccine was administered in the last four weeks": Encounter."No live vaccine was administered in the last 4 weeks"
Client is due for BCG vaccination Case 3
/* @output: Client is due for BCG vaccination Case 3 @pseudocode: "Immunization recommendation status" = "Due" */ define "Client is due for BCG vaccination Case 3": Encounter."No BCG primary series dose was administered" and Encounter."Client's age is between 28 days and 5 years" and Encounter."Client's HIV status is negative or unknown" and Encounter."Client's TB infection test result is negative" and Encounter."No live vaccine was administered in the last four weeks"
/* @internal: Clinically well Observation */ define "Clinically well Observation": ([Observation: Concepts."Clinically well"] O sort by end of effective.toInterval() desc).complete()
/* @internal: Clinically well Observation */ define "Clinically well Observation": Elements."Clinically well Observation".encounterOrOnBefore(EncounterId, Today)
/* @input: Client is clinically well @pseudocode: "Clinically well" = TRUE */ define "Client is clinically well": exists("Clinically well Observation") and First( "Clinically well Observation" ).value = true
/* @input: Client is clinically well @pseudocode: "Clinically well" = TRUE @code: Client is clinically well-24 @decision: IMMZ.D2.DT.BCG */ define "Client is clinically well": Encounter."Client is clinically well"
Client is due for BCG vaccination Case 4
/* @output: Client is due for BCG vaccination Case 4 @pseudocode: "Immunization recommendation status" = "Due" */ define "Client is due for BCG vaccination Case 4": Encounter."No BCG primary series dose was administered" and Encounter."Client's age is between 28 days and 5 years" and Encounter."Client's HIV status is positive" and Encounter."Client is currently receiving antiretroviral therapy" and Encounter."Client is immunologically stable" and Encounter."No live vaccine was administered in the last four weeks" and Encounter."Client is clinically well"
/* @input: Client's age is more than 5 years @pseudocode: Today's date − "Date of birth" ≥ 5 years @code: Client's age is more than 5 years-40 @decision: IMMZ.D2.DT.BCG */ define "Client's age is more than 5 years": Encounter."Current Patient Age In Years" >= 5
Client is due for BCG vaccination Case 5
/* @output: Client is due for BCG vaccination Case 5 @pseudocode: "Immunization recommendation status" = "Due" */ define "Client is due for BCG vaccination Case 5": Encounter."No BCG primary series dose was administered" and Encounter."Client's age is more than 5 years" and Encounter."Client's HIV status is negative or unknown" and Encounter."Client's TB infection test result is negative" and Encounter."No live vaccine was administered in the last four weeks"
Client is due for BCG vaccination Case 6
/* @output: Client is due for BCG vaccination Case 6 @pseudocode: "Immunization recommendation status" = "Due" */ define "Client is due for BCG vaccination Case 6": Encounter."No BCG primary series dose was administered" and Encounter."Client's age is more than 5 years" and Encounter."Client's HIV status is positive" and Encounter."Client is currently receiving antiretroviral therapy" and Encounter."Client is immunologically stable" and Encounter."No live vaccine was administered in the last four weeks" and Encounter."Client is clinically well"
/* @output: Client is due for BCG vaccination @pseudocode: "Immunization recommendation status" = "Due" */ define "Client is due for BCG vaccination": "Client is due for BCG vaccination Case 1" or "Client is due for BCG vaccination Case 2" or "Client is due for BCG vaccination Case 3" or "Client is due for BCG vaccination Case 4" or "Client is due for BCG vaccination Case 5" or "Client is due for BCG vaccination Case 6"
Client is due for BCG vaccination Guidance
/* @output: Client is due for BCG vaccination Guidance @guidance = Should vaccinate client with first BCG dose as no BCG dose was administered, client is within age range, HIV status is not positive and no live vaccine was administered. Check for contraindications. @guidance = Should vaccinate client with first BCG dose as no BCG dose was administered, client is immunologically stable and no live vaccine was administered. Check for contraindications. @guidance = Should vaccinate client with first BCG dose as no BCG dose was administered, client's TB test result is negative and no live vaccine was administered in the past 4 weeks. Check for contraindications. @guidance = Should vaccinate client with first BCG dose as no BCG dose was administered, client is receiving ART, clinically well and immunologically stable. No live vaccine was administered in the last 4 weeks. Check for contraindications. @guidance = Should vaccinate client with first BCG dose as no BCG dose was administered, client's TB test result is negative and no live vaccine was administered in the past 4 weeks. Check for contraindications. @guidance = Should vaccinate client with first BCG dose as no BCG dose was administered, client is receiving ART, clinically well and immunologically stable. No live vaccine was administered in the past 4 weeks. Check for contraindications */ define "Client is due for BCG vaccination Guidance": case when "Client is due for BCG vaccination Case 1" then 'Should vaccinate client with first BCG dose as no BCG dose was administered, client is within age range, HIV status is not positive and no live vaccine was administered. Check for contraindications.' when "Client is due for BCG vaccination Case 2" then 'Should vaccinate client with first BCG dose as no BCG dose was administered, client is immunologically stable and no live vaccine was administered. Check for contraindications.' when "Client is due for BCG vaccination Case 3" then 'Should vaccinate client with first BCG dose as no BCG dose was administered, client\'s TB test result is negative and no live vaccine was administered in the past 4 weeks. Check for contraindications.' when "Client is due for BCG vaccination Case 4" then 'Should vaccinate client with first BCG dose as no BCG dose was administered, client is receiving ART, clinically well and immunologically stable. No live vaccine was administered in the last 4 weeks. Check for contraindications.' when "Client is due for BCG vaccination Case 5" then 'Should vaccinate client with first BCG dose as no BCG dose was administered, client\'s TB test result is negative and no live vaccine was administered in the past 4 weeks. Check for contraindications.' when "Client is due for BCG vaccination Case 6" then 'Should vaccinate client with first BCG dose as no BCG dose was administered, client is receiving ART, clinically well and immunologically stable. No live vaccine was administered in the past 4 weeks. Check for contraindications' else '' end
Live vaccine was administered in the last four weeks
/* @input: Live vaccine was administered in the last four weeks @pseudocode: Today's date − latest "Date and time of vaccination" (where "Live vaccine" = TRUE) < 4 weeks @code: Live vaccine was administered in the last four weeks-92 @decision: IMMZ.D2.DT.BCG */ define "Live vaccine was administered in the last four weeks": Encounter."Live vaccine was administered in the last 4 weeks"
Client is not due for BCG vaccination Case 1
/* @output: Client is not due for BCG vaccination Case 1 @pseudocode: "Immunization recommendation status" = "Not due" */ define "Client is not due for BCG vaccination Case 1": Encounter."No BCG primary series dose was administered" and Encounter."Client's age is less than or equal to 28 days" and Encounter."Client's HIV status is negative or unknown" and Encounter."Live vaccine was administered in the last four weeks"
Client is not due for BCG vaccination Case 2
/* @output: Client is not due for BCG vaccination Case 2 @pseudocode: "Immunization recommendation status" = "Not due" */ define "Client is not due for BCG vaccination Case 2": Encounter."No BCG primary series dose was administered" and Encounter."Client's age is less than or equal to 28 days" and Encounter."Client's HIV status is positive" and Encounter."Client is currently receiving antiretroviral therapy" and Encounter."Client is immunologically stable" and Encounter."Live vaccine was administered in the last four weeks"
/* @input: Client is not immunologically stable @pseudocode: "Immunologically stable" = FALSE */ define "Client is not immunologically stable": exists("Immunologically stable Observation") and First("Immunologically stable Observation").value = false
/* @input: Client is not immunologically stable @pseudocode: "Immunologically stable" = FALSE @code: Client is not immunologically stable-32 @decision: IMMZ.D2.DT.BCG */ define "Client is not immunologically stable": Encounter."Client is not immunologically stable"
Client is not due for BCG vaccination Case 3
/* @output: Client is not due for BCG vaccination Case 3 @pseudocode: "Immunization recommendation status" = "Not due" */ define "Client is not due for BCG vaccination Case 3": Encounter."No BCG primary series dose was administered" and Encounter."Client's age is less than or equal to 28 days" and Encounter."Client's HIV status is positive" and Encounter."Client is currently receiving antiretroviral therapy" and Encounter."Client is not immunologically stable"
Client is currently not receiving antiretroviral therapy
/* @input: Client is currently not receiving antiretroviral therapy @pseudocode: "Currently on ART" = FALSE */ define "Client is currently not receiving antiretroviral therapy": "Currently on ART Observation" is null or "Currently on ART Observation".value = false
/* @input: Client is currently not receiving antiretroviral therapy @pseudocode: "Currently on ART" = FALSE @code: Client is currently not receiving antiretroviral therapy-26 @decision: IMMZ.D2.DT.BCG */ define "Client is currently not receiving antiretroviral therapy": Encounter."Client is currently not receiving antiretroviral therapy"
Client is not due for BCG vaccination Case 4
/* @output: Client is not due for BCG vaccination Case 4 @pseudocode: "Immunization recommendation status" = "Not due" */ define "Client is not due for BCG vaccination Case 4": Encounter."No BCG primary series dose was administered" and Encounter."Client's age is less than or equal to 28 days" and Encounter."Client's HIV status is positive" and Encounter."Client is currently not receiving antiretroviral therapy"
Client is not due for BCG vaccination Case 5
/* @output: Client is not due for BCG vaccination Case 5 @pseudocode: "Immunization recommendation status" = "Not due" */ define "Client is not due for BCG vaccination Case 5": Encounter."No BCG primary series dose was administered" and Encounter."Client's age is between 28 days and 5 years" and Encounter."Client's HIV status is negative or unknown" and Encounter."Client's TB infection test result is negative" and Encounter."Live vaccine was administered in the last four weeks"
Client's TB infection test result is positive
/* @input: Client's TB infection test result is positive @pseudocode: "TB infection test result" = "Positive" */ define "Client's TB infection test result is positive": exists("TB infection test result Observation") and First( "TB infection test result Observation" ).value ~ Concepts."TB-Positive"
/* @input: Client's TB infection test result is positive @pseudocode: "TB infection test result" = "Positive" @code: Client's TB infection test result is positive-39 @decision: IMMZ.D2.DT.BCG */ define "Client's TB infection test result is positive": Encounter."Client's TB infection test result is positive"
Client is not due for BCG vaccination Case 6
/* @output: Client is not due for BCG vaccination Case 6 @pseudocode: "Immunization recommendation status" = "Not due" */ define "Client is not due for BCG vaccination Case 6": Encounter."No BCG primary series dose was administered" and Encounter."Client's age is between 28 days and 5 years" and Encounter."Client's HIV status is negative or unknown" and Encounter."Client's TB infection test result is positive"
Client is not due for BCG vaccination Case 7
/* @output: Client is not due for BCG vaccination Case 7 @pseudocode: "Immunization recommendation status" = "Not due" */ define "Client is not due for BCG vaccination Case 7": Encounter."No BCG primary series dose was administered" and Encounter."Client's age is between 28 days and 5 years" and Encounter."Client's HIV status is positive" and Encounter."Client is currently receiving antiretroviral therapy" and Encounter."Client is not immunologically stable"
/* @input: Client is not clinically well @pseudocode: "Clinically well" = FALSE */ define "Client is not clinically well": exists("Clinically well Observation") and First( "Clinically well Observation" ).value = false
/* @input: Client is not clinically well @pseudocode: "Clinically well" = FALSE @code: Client is not clinically well-25 @decision: IMMZ.D2.DT.BCG */ define "Client is not clinically well": Encounter."Client is not clinically well"
Client is not due for BCG vaccination Case 8
/* @output: Client is not due for BCG vaccination Case 8 @pseudocode: "Immunization recommendation status" = "Not due" */ define "Client is not due for BCG vaccination Case 8": Encounter."No BCG primary series dose was administered" and Encounter."Client's age is between 28 days and 5 years" and Encounter."Client's HIV status is positive" and Encounter."Client is currently receiving antiretroviral therapy" and Encounter."Client is not clinically well"
Client is not due for BCG vaccination Case 9
/* @output: Client is not due for BCG vaccination Case 9 @pseudocode: "Immunization recommendation status" = "Not due" */ define "Client is not due for BCG vaccination Case 9": Encounter."No BCG primary series dose was administered" and Encounter."Client's age is between 28 days and 5 years" and Encounter."Client's HIV status is positive" and Encounter."Client is currently receiving antiretroviral therapy" and Encounter."Client is immunologically stable" and Encounter."Live vaccine was administered in the last four weeks" and Encounter."Client is clinically well"
Client is not due for BCG vaccination Case 10
/* @output: Client is not due for BCG vaccination Case 10 @pseudocode: "Immunization recommendation status" = "Not due" */ define "Client is not due for BCG vaccination Case 10": Encounter."No BCG primary series dose was administered" and Encounter."Client's age is between 28 days and 5 years" and Encounter."Client's HIV status is positive" and Encounter."Client is currently not receiving antiretroviral therapy"
Client is not due for BCG vaccination Case 11
/* @output: Client is not due for BCG vaccination Case 11 @pseudocode: "Immunization recommendation status" = "Not due" */ define "Client is not due for BCG vaccination Case 11": Encounter."No BCG primary series dose was administered" and Encounter."Client's age is more than 5 years" and Encounter."Client's HIV status is negative or unknown" and Encounter."Client's TB infection test result is negative" and Encounter."Live vaccine was administered in the last four weeks"
Client is not due for BCG vaccination Case 12
/* @output: Client is not due for BCG vaccination Case 12 @pseudocode: "Immunization recommendation status" = "Not due" */ define "Client is not due for BCG vaccination Case 12": Encounter."No BCG primary series dose was administered" and Encounter."Client's age is more than 5 years" and Encounter."Client's HIV status is negative or unknown" and Encounter."Client's TB infection test result is positive"
Client is not due for BCG vaccination Case 13
/* @output: Client is not due for BCG vaccination Case 13 @pseudocode: "Immunization recommendation status" = "Not due" */ define "Client is not due for BCG vaccination Case 13": Encounter."No BCG primary series dose was administered" and Encounter."Client's age is more than 5 years" and Encounter."Client's HIV status is positive" and Encounter."Client is currently receiving antiretroviral therapy" and Encounter."Client is not immunologically stable"
Client is not due for BCG vaccination Case 14
/* @output: Client is not due for BCG vaccination Case 14 @pseudocode: "Immunization recommendation status" = "Not due" */ define "Client is not due for BCG vaccination Case 14": Encounter."No BCG primary series dose was administered" and Encounter."Client's age is more than 5 years" and Encounter."Client's HIV status is positive" and Encounter."Client is currently receiving antiretroviral therapy" and Encounter."Client is not clinically well"
Client is not due for BCG vaccination Case 15
/* @output: Client is not due for BCG vaccination Case 15 @pseudocode: "Immunization recommendation status" = "Not due" */ define "Client is not due for BCG vaccination Case 15": Encounter."No BCG primary series dose was administered" and Encounter."Client's age is more than 5 years" and Encounter."Client's HIV status is positive" and Encounter."Client is currently receiving antiretroviral therapy" and Encounter."Client is immunologically stable" and Encounter."Live vaccine was administered in the last four weeks" and Encounter."Client is clinically well"
Client is not due for BCG vaccination Case 16
/* @output: Client is not due for BCG vaccination Case 16 @pseudocode: "Immunization recommendation status" = "Not due" */ define "Client is not due for BCG vaccination Case 16": Encounter."No BCG primary series dose was administered" and Encounter."Client's age is more than 5 years" and Encounter."Client's HIV status is positive" and Encounter."Client is currently not receiving antiretroviral therapy"
/* @output: Client is not due for BCG vaccination @pseudocode: "Immunization recommendation status" = "Not due" */ define "Client is not due for BCG vaccination": "Client is not due for BCG vaccination Case 1" or "Client is not due for BCG vaccination Case 2" or "Client is not due for BCG vaccination Case 3" or "Client is not due for BCG vaccination Case 4" or "Client is not due for BCG vaccination Case 5" or "Client is not due for BCG vaccination Case 6" or "Client is not due for BCG vaccination Case 7" or "Client is not due for BCG vaccination Case 8" or "Client is not due for BCG vaccination Case 9" or "Client is not due for BCG vaccination Case 10" or "Client is not due for BCG vaccination Case 11" or "Client is not due for BCG vaccination Case 12" or "Client is not due for BCG vaccination Case 13" or "Client is not due for BCG vaccination Case 14" or "Client is not due for BCG vaccination Case 15" or "Client is not due for BCG vaccination Case 16"
Client is not due for BCG vaccination Guidance
/* @output: Client is not due for BCG vaccination Guidance @guidance = Should not vaccinate client with first BCG 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 BCG dose. @guidance = Should not vaccinate client with first BCG 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 BCG dose. @guidance = Should not vaccinate client with first BCG dose as client is not immunologically stable. Check for any vaccines due and inform the caregiver of when to come back for the first BCG dose. @guidance = Should not vaccinate client with first BCG dose as ART has not been started. Check for any vaccines due and inform the caregiver of when to come back for the first BCG dose. @guidance = Should not vaccinate client with first BCG dose as live vaccine was administered in the past 4 weeks. Check for any vaccines due and inform the caregiver of when to come back for the first dose. @guidance = Should not vaccinate client with first BCG dose as client's TB infection test result is positive. Consider evaluating for TB disease or for TB preventive treatment (TPT) eligibility (once TB disease is ruled out). @guidance = Should not vaccinate client with first BCG dose as client is not immunologically stable. Check for any vaccines due, and inform the caregiver of when to come back for the first BCG dose. @guidance = Should not vaccinate client with first BCG dose as client is not clinically well. Check for any vaccines due, and inform the caregiver of when to come back for the first BCG dose. @guidance = Should not vaccinate client with first BCG dose as live vaccine was administered in the past 4 weeks. Check for any vaccines due and inform the caregiver of when to come back for the first BCG dose. @guidance = Should not vaccinate client with first BCG dose as client is not currently receiving ART. Check for any vaccines due and inform the caregiver of when to come back for the first BCG dose. @guidance = Should not vaccinate client with first BCG 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 BCG dose. @guidance = Should not vaccinate client with first BCG dose as client's TB infection test result is positive. Consider evaluating for TB disease or for TB preventive treatment (TPT) eligibility (once TB disease is ruled out). @guidance = Should not vaccinate client with first BCG dose as client is not immnologically stable. Check for any vaccines due, and inform the caregiver of when to come back for the first BCG dose. @guidance = Should not vaccinate client with first BCG dose as client is not clinically well. Check for any vaccines due and inform the caregiver of when to come back for the first BCG dose. @guidance = Should not vaccinate client with first BCG dose as live vaccine was administered in the past 4 weeks. Check for any vaccines due, and inform the caregiver of when to come back for the first BCG dose. @guidance = Should not vaccinate client with first BCG dose as client is not currently receiving ART. Check for any vaccines due and inform the caregiver of when to come back for the first BCG dose. */ define "Client is not due for BCG vaccination Guidance": case when "Client is not due for BCG vaccination Case 1" then 'Should not vaccinate client with first BCG 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 BCG dose.' when "Client is not due for BCG vaccination Case 2" then 'Should not vaccinate client with first BCG 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 BCG dose.' when "Client is not due for BCG vaccination Case 3" then 'Should not vaccinate client with first BCG dose as client is not immunologically stable. Check for any vaccines due and inform the caregiver of when to come back for the first BCG dose.' when "Client is not due for BCG vaccination Case 4" then 'Should not vaccinate client with first BCG dose as ART has not been started. Check for any vaccines due and inform the caregiver of when to come back for the first BCG dose.' when "Client is not due for BCG vaccination Case 5" then 'Should not vaccinate client with first BCG dose as live vaccine was administered in the past 4 weeks. Check for any vaccines due and inform the caregiver of when to come back for the first dose.' when "Client is not due for BCG vaccination Case 6" then 'Should not vaccinate client with first BCG dose as client\'s TB infection test result is positive. Consider evaluating for TB disease or for TB preventive treatment (TPT) eligibility (once TB disease is ruled out).' when "Client is not due for BCG vaccination Case 7" then 'Should not vaccinate client with first BCG dose as client is not immunologically stable. Check for any vaccines due, and inform the caregiver of when to come back for the first BCG dose.' when "Client is not due for BCG vaccination Case 8" then 'Should not vaccinate client with first BCG dose as client is not clinically well. Check for any vaccines due, and inform the caregiver of when to come back for the first BCG dose.' when "Client is not due for BCG vaccination Case 9" then 'Should not vaccinate client with first BCG dose as live vaccine was administered in the past 4 weeks. Check for any vaccines due and inform the caregiver of when to come back for the first BCG dose.' when "Client is not due for BCG vaccination Case 10" then 'Should not vaccinate client with first BCG dose as client is not currently receiving ART. Check for any vaccines due and inform the caregiver of when to come back for the first BCG dose.' when "Client is not due for BCG vaccination Case 11" then 'Should not vaccinate client with first BCG 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 BCG dose.' when "Client is not due for BCG vaccination Case 12" then 'Should not vaccinate client with first BCG dose as client\'s TB infection test result is positive. Consider evaluating for TB disease or for TB preventive treatment (TPT) eligibility (once TB disease is ruled out).' when "Client is not due for BCG vaccination Case 13" then 'Should not vaccinate client with first BCG dose as client is not immnologically stable. Check for any vaccines due, and inform the caregiver of when to come back for the first BCG dose.' when "Client is not due for BCG vaccination Case 14" then 'Should not vaccinate client with first BCG dose as client is not clinically well. Check for any vaccines due and inform the caregiver of when to come back for the first BCG dose.' when "Client is not due for BCG vaccination Case 15" then 'Should not vaccinate client with first BCG dose as live vaccine was administered in the past 4 weeks. Check for any vaccines due, and inform the caregiver of when to come back for the first BCG dose.' when "Client is not due for BCG vaccination Case 16" then 'Should not vaccinate client with first BCG dose as client is not currently receiving ART. Check for any vaccines due and inform the caregiver of when to come back for the first BCG dose.' else '' end
Client's TB infection test result is unknown (test not done or no result yet)
/* @input: Client's TB infection test result is unknown (test not done or no result yet) @pseudocode: "TB infection test result" IS NULL */ define "Client's TB infection test result is unknown (test not done or no result yet)": not exists( "TB infection test result Observation" ) or ( not ("Client's TB infection test result is negative") and not ("Client's TB infection test result is positive") )
/* @input: Client's TB infection test result is unknown (test not done or no result yet) @pseudocode: "TB infection test result" IS NULL @code: Client's TB infection test result is unknown (test not done or no result yet)-34 @decision: IMMZ.D2.DT.BCG */ define "Client's TB infection test result is unknown (test not done or no result yet)": Encounter."Client's TB infection test result is unknown (test not done or no result yet)"
Clinical judgement is required. Create clinical note. Case 1
/* @output: Clinical judgement is required. Create clinical note. Case 1 @pseudocode: "Immunization recommendation status" = "Further evaluation needed" */ define "Clinical judgement is required. Create clinical note. Case 1": Encounter."No BCG primary series dose was administered" and Encounter."Client's age is between 28 days and 5 years" and Encounter."Client's HIV status is negative or unknown" and Encounter."Client's TB infection test result is unknown (test not done or no result yet)"
Clinical judgement is required. Create clinical note. Case 2
/* @output: Clinical judgement is required. Create clinical note. Case 2 @pseudocode: '"Immunization recommendation status" = "Further evaluation needed" */ define "Clinical judgement is required. Create clinical note. Case 2": Encounter."No BCG primary series dose was administered" and Encounter."Client's age is more than 5 years" and Encounter."Client's HIV status is negative or unknown" and Encounter."Client's TB infection test result is unknown (test not done or no result yet)"
Clinical judgement is required. Create clinical note.
/* @output: Clinical judgement is required. Create clinical note. @pseudocode: "Immunization recommendation status" = "Further evaluation needed" */ define "Clinical judgement is required. Create clinical note.": "Clinical judgement is required. Create clinical note. Case 1" or "Clinical judgement is required. Create clinical note. Case 2"
Clinical judgement is required. Create clinical note. Guidance
/* @output: Clinical judgement is required. Create clinical note. Guidance @guidance = Recommend the client to perform TB infection testing. Re-evaluate client once the test result is available. @guidance = Recommend the client to perform TB infection testing. Re-evaluate client once the test result is available. */ define "Clinical judgement is required. Create clinical note. Guidance": case when "Clinical judgement is required. Create clinical note. Case 1" then 'Recommend the client to perform TB infection testing. Re-evaluate client once the test result is available.' when "Clinical judgement is required. Create clinical note. Case 2" then 'Recommend the client to perform TB infection testing. Re-evaluate client once the test result is available.' else '' end
One BCG primary series dose was administered
/* @input: One BCG primary series dose was administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "BCG vaccines" and "Type of dose" = "Primary series") = 1 @code: One BCG primary series dose was administered-112 @decision: IMMZ.D2.DT.BCG */ define "One BCG primary series dose was administered": "Number of BCG Primary Series Doses Administered" = 1
/* @output: BCG immunization schedule is complete @pseudocode: '"Immunization recommendation status" = "Complete" "Completed the primary vaccination series" = TRUE (where "Vaccine type" = "BCG vaccines") */ define "BCG immunization schedule is complete": Encounter."One BCG primary series dose was administered"
BCG immunization schedule is complete Guidance
/* @output: BCG immunization schedule is complete Guidance @guidance: BCG immunization schedule is complete. One BCG primary series dose was administered. Check for any vaccines due. */ define "BCG immunization schedule is complete Guidance": 'BCG immunization schedule is complete. One BCG primary series dose was administered. Check for any vaccines due.'
/* @dynamicValue: Guidance */ define "Guidance": case when "Client is due for BCG vaccination" then "Client is due for BCG vaccination Guidance" when "Client is not due for BCG vaccination" then "Client is not due for BCG vaccination Guidance" when "Clinical judgement is required. Create clinical note." then "Clinical judgement is required. Create clinical note. Guidance" when "BCG immunization schedule is complete" then "BCG immunization schedule is complete Guidance" else '' end
define "Has Guidance": "Guidance" is not null and "Guidance" != ''
/** * @description: Gets immunizations on or before a date */ define fluent function onOrBefore(immunizations List<Immunization>, beforeDate Date): immunizations I where I.occurrence.toInterval() same day or before beforeDate
/** * @description: Gets the doses from the primary series */ define fluent function seriesPrimary(immunizations List<Immunization>): immunizations I where exists( I.protocolApplied pa where pa.series = 'Primary series' )
define function ToString(value string): value.value
define function ToString(value ImmunizationStatus): value.value
define function ToBoolean(value boolean): value.value
define function ToConcept(concept FHIR.CodeableConcept): if concept is null then null else System.Concept { codes: concept.coding C return ToCode(C), display: concept.text.value }
define function ToCode(coding FHIR.Coding): if coding is null then null else System.Code { code: coding.code.value, system: coding.system.value, version: coding.version.value, display: coding.display.value }
/** * @description: Gets observation from an encounter or on or before a date */ define fluent function encounterOrOnBefore(observations List<Observation>, EncounterId String, beforeDate Date): observations O where (O.encounter.references(EncounterId) or O.effective.toInterval() starts same day or before beforeDate)
/* @description: Returns true if the given reference is to the given resourceId @comment: Returns true if the `resourceId` parameter exactly equals the tail of the given reference. NOTE: This function assumes resources from the same source server. */ define fluent function references(reference FHIR.Reference, resourceId String): resourceId = Last(Split(reference.reference, '/'))
define fluent function complete(observations List<Observation>): observations O where O.status in { 'final', 'amended', 'corrected' }
define function ToString(value ObservationStatus): value.value
define fluent function mostRecent(observations List<Observation>): Last( observations O sort by issued )
define fluent function mostRecent(immunizations List<Immunization>): Last( immunizations I sort by start of occurrence.toInterval() )
WHO recommendations for routine immunization - summary tables (January 2025)
Neonates born to women of unknown HIV status should be vaccinated as the benefits of BCG vaccination outweigh the risks. Neonates of unknown HIV status born to HIV-infected women should be vaccinated if they have no clinical evidence suggestive of HIV infection.
Determine if the client is due for BCG vaccine according to the national immunization protocol.
Concept { codes: { Code { system: 'http://smart.who.int/immunizations/CodeSystem/IMMZ.Z', code: 'DE1', display: 'BCG vaccines' } }, display: 'BCG vaccines' }
Check for Guidance for the patient regarding IMMZ.D2.DT.BCG.
Show Guidance for the patient regarding IMMZ.D2.DT.BCG.
Code { system: 'http://terminology.hl7.org/CodeSystem/communication-category', code: 'alert' }
Code { system: 'http://hl7.org/fhir/request-priority', code: 'routine' }