Id: IMMZD2DTHepatitisBDelayedStart Url: IMMZ.D2.DT.Hepatitis B.Delayed start Version: 0.2.0 Title: IMMZ.D2.DT.Hepatitis B.Delayed start Status: draft Type: system: http://terminology.hl7.org/CodeSystem/plan-definition-type code: eca-rule Date: 2026-03-29 17:23:09+0000 Publisher: WHO Description: IMMZ.D2.DT.Hepatitis B.Delayed start 3-dose schedule (no birth dose + 3 doses), delayed start Knowledge Capability: computable Related Artifacts: References WHO recommendations for routine immunization - summary tables (January 2025) Libraries: IMMZD2DTHepatitisBDelayedStartLogic Actions: Determine if the client is due for a hepatitis B vaccination according to the national immunization schedule: Determine if the client is due for a hepatitis B vaccination according to the national immunization schedule 3-dose schedule (no birth dose + 3 doses), delayed start If: Applicability: Client is due for hepatitis B vaccination (Client is due for hepatitis B vaccination) Then: Definition: IMMZD2DTMR Dynamic Values: status: ('draft') intent: ('proposal') medication: (Concept { codes: { Code { system: 'http://smart.who.int/immunizations/CodeSystem/IMMZ.Z', code: 'DE6', display: 'Hepatitis B-containing vaccines' } }, display: 'Hepatitis B-containing vaccines' }) Determine if the client is due for a hepatitis B vaccination according to the national immunization schedule: Determine if the client is due for a hepatitis B vaccination according to the national immunization schedule 3-dose schedule (no birth dose + 3 doses), delayed start If: Applicability: Client is due for a hepatitis B vaccination (Client is due for a hepatitis B vaccination) Then: Definition: IMMZD2DTMR Dynamic Values: status: ('draft') intent: ('proposal') medication: (Concept { codes: { Code { system: 'http://smart.who.int/immunizations/CodeSystem/IMMZ.Z', code: 'DE6', display: 'Hepatitis B-containing vaccines' } }, display: 'Hepatitis B-containing vaccines' }) Check for Guidance for the patient regarding IMMZ.D2.DT.Hepatitis B.Delayed start.: Show Guidance for the patient regarding IMMZ.D2.DT.Hepatitis B.Delayed start. 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
Hepatitis B Doses Administered to Patient
/* @internal: Hepatitis B containing Doses Administered to Patient */ define "Hepatitis B Doses Administered to Patient": Elements."Doses Administered to Patient" I where I.vaccineCode in Concepts."Hepatitis B-containing vaccines"
/* @internal: Hepatitis B containing Doses Administered to Patient */ define "Hepatitis B Doses Administered to Patient": HepatitisBElements."Hepatitis B Doses Administered to Patient".onOrBefore(Today)
Number of Hepatitis B Doses Administered
/* @internal: Number of Hepatitis B Doses Administered */ define "Number of Hepatitis B Doses Administered": Count("Hepatitis B Doses Administered to Patient")
/* @input: No hepatitis B doses were administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "Hepatitis B-containing vaccines") = 0 @code: No hepatitis B doses were administered-93 @decision: IMMZ.D2.DT.Hepatitis B.Delayed start: 3-dose schedule (no birth dose + 3 doses), delayed start */ define "No hepatitis B doses were administered": "Number of Hepatitis B Doses Administered" = 0
/** * @dataElement Patient age in days */ define "Current Patient Age In Days": AgeInDaysAt(Today)
Client's age is more than {Member States defined lower limit}
/* @input: Client's age is more than {Member States defined lower limit} @pseudocode: Today's date − "Date of birth" > Member States defined lower limit @code: Client's age is more than {Member States defined lower limit}-66 @decision: IMMZ.D2.DT.Hepatitis B.Delayed start: 3-dose schedule (no birth dose + 3 doses), delayed start */ define "Client's age is more than {Member States defined lower limit}": Encounter."Current Patient Age In Days" >= HepBBirthDoseAgeLimitDays
Client is due for hepatitis B vaccination
/* @output: Client is due for hepatitis B vaccination @pseudocode: "Immunization recommendation status" = "Due" */ define "Client is due for hepatitis B vaccination": Encounter."No hepatitis B doses were administered" and Encounter."Client's age is more than {Member States defined lower limit}"
Client is due for hepatitis B vaccination Guidance
/* @output: Client is due for hepatitis B vaccination Guidance @guidance: Should vaccinate client with first hepatitis B dose as hepatitis B birth dose was not administered. The first hepatitis B dose should be administered as soon as possible. Check for contraindications. */ define "Client is due for hepatitis B vaccination Guidance": 'Should vaccinate client with first hepatitis B dose as hepatitis B birth dose was not administered. The first hepatitis B dose should be administered as soon as possible. Check for contraindications.'
/* @input: One hepatitis B dose was administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "Hepatitis B-containing vaccines") = 1 @code: One hepatitis B dose was administered-93 @decision: IMMZ.D2.DT.Hepatitis B.Delayed start: 3-dose schedule (no birth dose + 3 doses), delayed start */ define "One hepatitis B dose was administered": "Number of Hepatitis B Doses Administered" = 1
/* @internal: Date of Latest Hepatitis B Dose */ define "Date of Latest Hepatitis B Dose": date from start of "Hepatitis B Doses Administered to Patient".mostRecent().occurrence.toInterval()
The latest hepatitis B dose was administered less than 4 weeks ago
/* @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 weeks @code: The latest hepatitis B dose was administered less than 4 weeks ago-121 @decision: IMMZ.D2.DT.Hepatitis B.3 doses: 3-dose schedule (birth dose + 2 primary series doses), on-time start @decision: IMMZ.D2.DT.Hepatitis B.4 doses: 4-dose schedule (birth dose + 3 primary series doses), on-time start @decision: IMMZ.D2.DT.Hepatitis B.Delayed start: 3-dose schedule (no birth dose + 3 doses), delayed start */ define "The latest hepatitis B dose was administered less than 4 weeks ago": "Date of Latest Hepatitis B Dose" is not null and duration in weeks between "Date of Latest Hepatitis B Dose" and Today < 4
Client is not due for a hepatitis B vaccination Case 1
/* @output: Client is not due for a hepatitis B vaccination Case 1 @pseudocode: "Immunization recommendation status" = "Not due" */ define "Client is not due for a hepatitis B vaccination Case 1": Encounter."One hepatitis B dose was administered" and Encounter."The latest hepatitis B dose was administered less than 4 weeks ago"
/* @input: Two hepatitis B doses were administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "Hepatitis B-containing vaccines") = 2 @code: Two hepatitis B doses were administered-93 @decision: IMMZ.D2.DT.Hepatitis B.Delayed start: 3-dose schedule (no birth dose + 3 doses), delayed start */ define "Two hepatitis B doses were administered": "Number of Hepatitis B Doses Administered" = 2
Client is not due for a hepatitis B vaccination Case 2
/* @output: Client is not due for a hepatitis B vaccination Case 2 @pseudocode: "Immunization recommendation status" = "Not due" */ define "Client is not due for a hepatitis B vaccination Case 2": Encounter."Two hepatitis B doses were administered" and Encounter."The latest hepatitis B dose was administered less than 4 weeks ago"
The latest hepatitis B dose was administered more than 4 weeks ago
/* @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 weeks @code: The latest hepatitis B dose was administered more than 4 weeks ago-121 @decision: IMMZ.D2.DT.Hepatitis B.3 doses: 3-dose schedule (birth dose + 2 primary series doses), on-time start @decision: IMMZ.D2.DT.Hepatitis B.4 doses: 4-dose schedule (birth dose + 3 primary series doses), on-time start @decision: IMMZ.D2.DT.Hepatitis B.Delayed start: 3-dose schedule (no birth dose + 3 doses), delayed start */ define "The latest hepatitis B dose was administered more than 4 weeks ago": not("The latest hepatitis B dose was administered less than 4 weeks ago")
/* @internal: Date of First Hepatitis B Dose */ define "Date of First Hepatitis B Dose": date from start of "Hepatitis B Doses Administered to Patient".earliest().occurrence.toInterval()
The first hepatitis B dose was administered less than 6 months ago
/* @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 months @code: The first hepatitis B dose was administered less than 6 months ago-137 @decision: IMMZ.D2.DT.Hepatitis B.Delayed start: 3-dose schedule (no birth dose + 3 doses), delayed start */ define "The first hepatitis B dose was administered less than 6 months ago": "Date of First Hepatitis B Dose" is not null and duration in months between "Date of First Hepatitis B Dose" and Today < 6
Client is not due for a hepatitis B vaccination Case 3
/* @output: Client is not due for a hepatitis B vaccination Case 3 @pseudocode: "Immunization recommendation status" = "Not due" */ define "Client is not due for a hepatitis B vaccination Case 3": Encounter."Two hepatitis B doses were administered" and Encounter."The latest hepatitis B dose was administered more than 4 weeks ago" and Encounter."The first hepatitis B dose was administered less than 6 months ago"
Client is not due for a hepatitis B vaccination
/* @output: Client is not due for a hepatitis B vaccination @pseudocode: "Immunization recommendation status" = "Not due" */ define "Client is not due for a hepatitis B vaccination": "Client is not due for a hepatitis B vaccination Case 1" or "Client is not due for a hepatitis B vaccination Case 2" or "Client is not due for a hepatitis B vaccination Case 3"
Client is not due for a hepatitis B vaccination Guidance
/* @output: Client is not due for a hepatitis B vaccination Guidance @guidance = Should not vaccinate client with second hepatitis B dose as the latest hepatitis B 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 next dose. @guidance = Should not vaccinate client with second hepatitis B dose as the latest hepatitis B dose was administered less than 4 weeks ago. Two hepatitis B doses have been administered to the client. Check for any other vaccines due, and inform the caregiver of when to come back for the next dose. @guidance = Should not vaccinate client with third hepatitis B dose as the first hepatitis B dose was administered less than 6 months ago. Check for any other vaccines due, and inform the caregiver of when to come back for the next dose. */ define "Client is not due for a hepatitis B vaccination Guidance": case when "Client is not due for a hepatitis B vaccination Case 1" then 'Should not vaccinate client with second hepatitis B dose as the latest hepatitis B 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 next dose.' when "Client is not due for a hepatitis B vaccination Case 2" then 'Should not vaccinate client with second hepatitis B dose as the latest hepatitis B dose was administered less than 4 weeks ago. Two hepatitis B doses have been administered to the client. Check for any other vaccines due, and inform the caregiver of when to come back for the next dose.' when "Client is not due for a hepatitis B vaccination Case 3" then 'Should not vaccinate client with third hepatitis B dose as the first hepatitis B dose was administered less than 6 months ago. Check for any other vaccines due, and inform the caregiver of when to come back for the next dose.' else '' end
Client is due for a hepatitis B vaccination Case 1
/* @output: Client is due for a hepatitis B vaccination Case 1 @pseudocode: "Immunization recommendation status" = "Due" */ define "Client is due for a hepatitis B vaccination Case 1": Encounter."One hepatitis B dose was administered" and Encounter."The latest hepatitis B dose was administered more than 4 weeks ago"
The first hepatitis B dose was administered more than 6 months ago
/* @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 months @code: The first hepatitis B dose was administered more than 6 months ago-137 @decision: IMMZ.D2.DT.Hepatitis B.Delayed start: 3-dose schedule (no birth dose + 3 doses), delayed start */ define "The first hepatitis B dose was administered more than 6 months ago": not("The first hepatitis B dose was administered less than 6 months ago")
Client is due for a hepatitis B vaccination Case 2
/* @output: Client is due for a hepatitis B vaccination Case 2 @pseudocode: "Immunization recommendation status" = "Due" */ define "Client is due for a hepatitis B vaccination Case 2": Encounter."Two hepatitis B doses were administered" and Encounter."The latest hepatitis B dose was administered more than 4 weeks ago" and Encounter."The first hepatitis B dose was administered more than 6 months ago"
Client is due for a hepatitis B vaccination
/* @output: Client is due for a hepatitis B vaccination @pseudocode: "Immunization recommendation status" = "Due" */ define "Client is due for a hepatitis B vaccination": "Client is due for a hepatitis B vaccination Case 1" or "Client is due for a hepatitis B vaccination Case 2"
Client is due for a hepatitis B vaccination Guidance
/* @output: Client is due for a hepatitis B vaccination Guidance @guidance = Should vaccinate client with second hepatitis B dose as the latest hepatitis B dose was administered less than 4 weeks ago. Check for contraindications. @guidance = Should vaccinate client with third hepatitis B dose as the first hepatitis B dose was administered more than 6 months ago and the latest hepatitis B dose was administered more than 4 weeks ago. Check for contraindications. */ define "Client is due for a hepatitis B vaccination Guidance": case when "Client is due for a hepatitis B vaccination Case 1" then 'Should vaccinate client with second hepatitis B dose as the latest hepatitis B dose was administered less than 4 weeks ago. Check for contraindications.' when "Client is due for a hepatitis B vaccination Case 2" then 'Should vaccinate client with third hepatitis B dose as the first hepatitis B dose was administered more than 6 months ago and the latest hepatitis B dose was administered more than 4 weeks ago. Check for contraindications.' else '' end
Three hepatitis B doses were administered
/* @input: Three hepatitis B doses were administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "Hepatitis B-containing vaccines") = 3 @code: Three hepatitis B doses were administered-93 @decision: IMMZ.D2.DT.Hepatitis B.Delayed start: 3-dose schedule (no birth dose + 3 doses), delayed start */ define "Three hepatitis B doses were administered": "Number of Hepatitis B Doses Administered" = 3
Hepatitis B immunization schedule is complete
/* @output: Hepatitis B immunization schedule is complete @pseudocode: '"Immunization recommendation status" = "Complete" "Completed the primary vaccination series" = TRUE (where "Vaccine type" = "Hepatitis B-containing vaccines") */ define "Hepatitis B immunization schedule is complete": Encounter."Three hepatitis B doses were administered"
Hepatitis B immunization schedule is complete Guidance
/* @output: Hepatitis B immunization schedule is complete Guidance @guidance: Hepatitis B immunization schedule is complete. Three hepatitis B primary series doses were administered. Check for any other vaccines due. */ define "Hepatitis B immunization schedule is complete Guidance": 'Hepatitis B immunization schedule is complete. Three hepatitis B primary series doses were administered. Check for any other vaccines due.'
/* @dynamicValue: Guidance */ define "Guidance": case when "Client is due for hepatitis B vaccination" then "Client is due for hepatitis B vaccination Guidance" when "Client is not due for a hepatitis B vaccination" then "Client is not due for a hepatitis B vaccination Guidance" when "Client is due for a hepatitis B vaccination" then "Client is due for a hepatitis B vaccination Guidance" when "Hepatitis B immunization schedule is complete" then "Hepatitis B 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
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 }
define fluent function mostRecent(immunizations List<Immunization>): Last( immunizations I sort by start of occurrence.toInterval() )
define fluent function earliest(immunizations List<Immunization>): First( immunizations I sort by start of occurrence.toInterval() )
Value set Hepatitis B-containing vaccines
IMMZ.D2.DT.Hepatitis B.Delayed start 3-dose schedule (no birth dose + 3 doses), delayed start
WHO recommendations for routine immunization - summary tables (January 2025)
If delayed or interrupted scheduling of vaccination for children, adolescents and adults, 3 doses are recommended, with the second dose administered at least 1 month after the first, and the third dose 6 months after the first dose. If the vaccination schedule is interrupted, it is not necessary to restart the vaccine series.
Determine if the client is due for a hepatitis B vaccination according to the national immunization schedule
Determine if the client is due for a hepatitis B vaccination according to the national immunization schedule 3-dose schedule (no birth dose + 3 doses), delayed start
Concept { codes: { Code { system: 'http://smart.who.int/immunizations/CodeSystem/IMMZ.Z', code: 'DE6', display: 'Hepatitis B-containing vaccines' } }, display: 'Hepatitis B-containing vaccines' }
Check for Guidance for the patient regarding IMMZ.D2.DT.Hepatitis B.Delayed start.
Show Guidance for the patient regarding IMMZ.D2.DT.Hepatitis B.Delayed start.
Code { system: 'http://terminology.hl7.org/CodeSystem/communication-category', code: 'alert' }
Code { system: 'http://hl7.org/fhir/request-priority', code: 'routine' }