WHO Immunization Implementation Guide
1.0.0 - release
WHO Immunization Implementation Guide, published by WHO. This guide is not an authorized publication; it is the continuous build for version 1.0.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/tree/132/merge and changes regularly. See the Directory of published versions
| Draft as of 2026-03-31 |
{
"resourceType" : "Library",
"id" : "IMMZD2DTHepatitisBBirthDoseLogic",
"meta" : {
"profile" : [
🔗 "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablelibrary"🔗 ,
"http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablelibrary"🔗 ,
"http://hl7.org/fhir/uv/cql/StructureDefinition/cql-library"🔗 ,
"http://hl7.org/fhir/uv/cql/StructureDefinition/cql-module"
]
},
"text" : {
"status" : "extensions",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n<div>\n <table class=\"grid dict\">\n \n \n <tr>\n <th scope=\"row\"><b>Title: </b></th>\n <td style=\"padding-left: 4px;\">IMMZD2DTHepatitisBBirthDoseLogic</td>\n </tr>\n \n\n \n \n <tr>\n <th scope=\"row\"><b>Id: </b></th>\n <td style=\"padding-left: 4px;\">IMMZD2DTHepatitisBBirthDoseLogic</td>\n </tr>\n \n\n \n \n <tr>\n <th scope=\"row\"><b>Version: </b></th>\n <td style=\"padding-left: 4px;\">1.0.0</td>\n </tr>\n \n\n \n <tr>\n <th scope=\"row\"><b>Url: </b></th>\n <td style=\"padding-left: 4px;\"><a href=\"Library-IMMZD2DTHepatitisBBirthDoseLogic.html\">IMMZD2DTHepatitisBBirthDoseLogic</a></td>\n </tr>\n \n\n \n\n \n\n \n <tr>\n <th scope=\"row\"><b>Status: </b></th>\n <td style=\"padding-left: 4px;\">draft</td>\n </tr>\n \n\n \n\n \n <tr>\n <th scope=\"row\"><b>Type: </b></th>\n <td style=\"padding-left: 4px;\">\n \n \n \n <p style=\"margin-bottom: 5px;\">\n <b>system: </b> <span><a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-library-type.html\">http://terminology.hl7.org/CodeSystem/library-type</a></span>\n </p>\n \n \n <p style=\"margin-bottom: 5px;\">\n <b>code: </b> <span>logic-library</span>\n </p>\n \n \n \n \n \n </td>\n </tr>\n \n\n \n\n \n <tr>\n <th scope=\"row\"><b>Date: </b></th>\n <td style=\"padding-left: 4px;\">2026-03-31 13:54:17+0000</td>\n </tr>\n \n\n \n <tr>\n <th scope=\"row\"><b>Publisher: </b></th>\n <td style=\"padding-left: 4px;\">WHO</td>\n </tr>\n \n\n \n <tr>\n <th scope=\"row\"><b>Description: </b></th>\n <td style=\"padding-left: 4px;\"><div><p>This library defines decision support logic for the IMMZ.D2.DT.Hepatitis B.Birth dose decision table in the Immunization CPG</p>\n</div></td>\n </tr>\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n <tr>\n <th scope=\"row\"><b>Related Artifacts: </b></th>\n <td style=\"padding-left: 4px;\">\n \n \n \n <p><b>Dependencies</b></p>\n <ul>\n \n <li><a href=\"Library-IMMZD2DTHepatitisBEncounterElements.html\">IMMZD2DTHepatitisBEncounterElements</a></li>\n \n </ul>\n \n \n \n \n \n </td>\n </tr>\n \n\n \n <tr>\n <th scope=\"row\"><b>Parameters: </b></th>\n <td style=\"padding-left: 4px;\">\n <table class=\"grid-dict\">\n <tr><th><b>Name</b></th><th><b>Type</b></th><th><b>Min</b></th><th><b>Max</b></th><th><b>In/Out</b></th></tr>\n \n <tr><th>Today</th><th>date</th><th>0</th><th>1</th><th>In</th></tr>\n \n <tr><th>Patient</th><th>Patient</th><th>0</th><th>1</th><th>Out</th></tr>\n \n <tr><th>Client is due for hepatitis B monovalent vaccine</th><th>boolean</th><th>0</th><th>1</th><th>Out</th></tr>\n \n <tr><th>Client is due for hepatitis B monovalent vaccine Guidance</th><th>string</th><th>0</th><th>1</th><th>Out</th></tr>\n \n <tr><th>Client should follow delayed-start decision logic</th><th>boolean</th><th>0</th><th>1</th><th>Out</th></tr>\n \n <tr><th>Client should follow delayed-start decision logic Guidance</th><th>string</th><th>0</th><th>1</th><th>Out</th></tr>\n \n <tr><th>Client is not due for the hepatitis B birth dose</th><th>boolean</th><th>0</th><th>1</th><th>Out</th></tr>\n \n <tr><th>Client is not due for the hepatitis B birth dose Guidance</th><th>string</th><th>0</th><th>1</th><th>Out</th></tr>\n \n <tr><th>Guidance</th><th>string</th><th>0</th><th>1</th><th>Out</th></tr>\n \n <tr><th>Has Guidance</th><th>boolean</th><th>0</th><th>1</th><th>Out</th></tr>\n \n <tr><th>Test Validation</th><th>Resource</th><th>0</th><th>1</th><th>Out</th></tr>\n \n </table>\n </td>\n </tr>\n \n\n \n\n \n \n <tr>\n <td colspan=\"2\">\n <table>\n <tr><th><a id=\"cql-content\"><b>Content: </b></a> text/cql</th></tr>\n <tr><td><pre><code class=\"language-cql\">/*\n * Library: IMMZD2DTHepatitisBBirthDoseLogic (IMMZ.D2.DT.Hepatitis B.Birth dose)\n * Rule: Determine if the client is due for a hepatitis B vaccination according to the national immunization schedule\n * Decision Table: Birth dose administration\n * Trigger: IMMZ.D2 Determine required vaccination(s) if any\n */\nlibrary IMMZD2DTHepatitisBBirthDoseLogic\n\nusing FHIR version '4.0.1'\ninclude FHIRHelpers version '4.0.1'\n\ninclude IMMZD2DTHepatitisBEncounterElements called Encounter\n\nparameter Today Date default Today()\n\ncontext Patient\n\n\n/*\n@dynamicValue: Guidance\n*/\ndefine "Guidance":\n case \n when "Client is due for hepatitis B monovalent vaccine" then "Client is due for hepatitis B monovalent vaccine Guidance"\n when "Client should follow delayed-start decision logic" then "Client should follow delayed-start decision logic Guidance"\n when "Client is not due for the hepatitis B birth dose" then "Client is not due for the hepatitis B birth dose Guidance" \n else ''\n end\n \ndefine "Has Guidance":\n "Guidance" is not null and "Guidance" != ''\n\n/*\n@output: Client is due for hepatitis B monovalent vaccine\n@pseudocode: "Immunization recommendation status" = "Due" (where "Type of hepatitis B dose" = "Hepatitis B monovalent vaccine")\n*/\ndefine "Client is due for hepatitis B monovalent vaccine":\n Encounter."Hepatitis B birth dose was not administered"\n and Encounter."Client's age is less than {Member States defined upper limit}"\n\n/*\n@output: Client is due for hepatitis B monovalent vaccine Guidance\n@guidance: Should vaccinate client with hepatitis B birth dose, as a monovalent dose. Check for contraindications.\n*/\ndefine "Client is due for hepatitis B monovalent vaccine Guidance":\n 'Should vaccinate client with hepatitis B birth dose, as a monovalent dose. Check for contraindications.'\n\n/*\n@output: Client should follow delayed-start decision logic\n@pseudocode: \n*/\ndefine "Client should follow delayed-start decision logic":\n Encounter."Hepatitis B birth dose was not administered"\n and Encounter."Client's age is more than {Member States defined upper limit}"\n\n/*\n@output: Client should follow delayed-start decision logic Guidance\n@guidance: The client has a delayed start. Please follow the delayed start schedule.\n*/\ndefine "Client should follow delayed-start decision logic Guidance":\n 'The client has a delayed start. Please follow the delayed start schedule.'\n\n/*\n@output: Client is not due for the hepatitis B birth dose\n@pseudocode: "Immunization recommendation status" = "Not due"\n*/\ndefine "Client is not due for the hepatitis B birth dose":\n Encounter."Hepatitis B birth dose was administered"\n\n/*\n@output: Client is not due for the hepatitis B birth dose Guidance\n@guidance: Hepatitis B birth dose was already administered. Check hepatitis B immunization schedule.\n*/\ndefine "Client is not due for the hepatitis B birth dose Guidance":\n 'Hepatitis B birth dose was already administered. Check hepatitis B immunization schedule.'\n\n\n/*\n@test: Test expected results based on example patients\n*/\ndefine "Test Validation":\n case\n when Patient.id = 'HepatitisB08.2' then "Client is due for hepatitis B monovalent vaccine" and "Guidance" = 'Should vaccinate client with hepatitis B birth dose, as a monovalent dose. Check for contraindications.'\n when Patient.id = 'HepatitisB09.2' then "Client should follow delayed-start decision logic" and "Guidance" = 'The client has a delayed start. Please follow the delayed start schedule.'\n when Patient.id = 'HepatitisB10.1' then "Client is not due for the hepatitis B birth dose" and "Guidance" = 'Hepatitis B birth dose was already administered. Check hepatitis B immunization schedule.'\n else 'No test case set'\n end\n</code></pre></td></tr>\n </table>\n </td>\n </tr>\n \n \n \n </table>\n</div>\n</div>"
},
"extension" : [
{
"url" : "http://hl7.org/fhir/StructureDefinition/cqf-knowledgeCapability",
"valueCode" : "computable"
}
],
"url" : "http://smart.who.int/immunizations/Library/IMMZD2DTHepatitisBBirthDoseLogic",
"version" : "1.0.0",
"name" : "IMMZD2DTHepatitisBBirthDoseLogic",
"title" : "IMMZD2DTHepatitisBBirthDoseLogic",
"status" : "draft",
"experimental" : false,
"type" : {
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/library-type",
"code" : "logic-library"
}
]
},
"date" : "2026-03-31T13:54:17+00:00",
"publisher" : "WHO",
"contact" : [
{
"name" : "WHO",
"telecom" : [
{
"system" : "url",
"value" : "http://who.int"
}
]
}
],
"description" : "This library defines decision support logic for the IMMZ.D2.DT.Hepatitis B.Birth dose decision table in the Immunization CPG",
"relatedArtifact" : [
{
"type" : "depends-on",
"display" : "Library Encounter",
"resource" : "http://smart.who.int/immunizations/Library/IMMZD2DTHepatitisBEncounterElements"
}
],
"parameter" : [
{
"name" : "Today",
"use" : "in",
"min" : 0,
"max" : "1",
"type" : "date"
},
{
"name" : "Patient",
"use" : "out",
"min" : 0,
"max" : "1",
"type" : "Patient"
},
{
"name" : "Client is due for hepatitis B monovalent vaccine",
"use" : "out",
"min" : 0,
"max" : "1",
"type" : "boolean"
},
{
"name" : "Client is due for hepatitis B monovalent vaccine Guidance",
"use" : "out",
"min" : 0,
"max" : "1",
"type" : "string"
},
{
"name" : "Client should follow delayed-start decision logic",
"use" : "out",
"min" : 0,
"max" : "1",
"type" : "boolean"
},
{
"name" : "Client should follow delayed-start decision logic Guidance",
"use" : "out",
"min" : 0,
"max" : "1",
"type" : "string"
},
{
"name" : "Client is not due for the hepatitis B birth dose",
"use" : "out",
"min" : 0,
"max" : "1",
"type" : "boolean"
},
{
"name" : "Client is not due for the hepatitis B birth dose Guidance",
"use" : "out",
"min" : 0,
"max" : "1",
"type" : "string"
},
{
"name" : "Guidance",
"use" : "out",
"min" : 0,
"max" : "1",
"type" : "string"
},
{
"name" : "Has Guidance",
"use" : "out",
"min" : 0,
"max" : "1",
"type" : "boolean"
},
{
"name" : "Test Validation",
"use" : "out",
"min" : 0,
"max" : "1",
"type" : "Resource"
}
],
"content" : [
{
"contentType" : "text/cql",
"data" : "LyoKICogTGlicmFyeTogSU1NWkQyRFRIZXBhdGl0aXNCQmlydGhEb3NlTG9naWMgKElNTVouRDIuRFQuSGVwYXRpdGlzIEIuQmlydGggZG9zZSkKICogUnVsZTogRGV0ZXJtaW5lIGlmIHRoZSBjbGllbnQgaXMgZHVlIGZvciBhIGhlcGF0aXRpcyBCIHZhY2NpbmF0aW9uIGFjY29yZGluZyB0byB0aGUgbmF0aW9uYWwgaW1tdW5pemF0aW9uIHNjaGVkdWxlCiAqIERlY2lzaW9uIFRhYmxlOiBCaXJ0aCBkb3NlIGFkbWluaXN0cmF0aW9uCiAqIFRyaWdnZXI6IElNTVouRDIgRGV0ZXJtaW5lIHJlcXVpcmVkIHZhY2NpbmF0aW9uKHMpIGlmIGFueQogKi8KbGlicmFyeSBJTU1aRDJEVEhlcGF0aXRpc0JCaXJ0aERvc2VMb2dpYwoKdXNpbmcgRkhJUiB2ZXJzaW9uICc0LjAuMScKaW5jbHVkZSBGSElSSGVscGVycyB2ZXJzaW9uICc0LjAuMScKCmluY2x1ZGUgSU1NWkQyRFRIZXBhdGl0aXNCRW5jb3VudGVyRWxlbWVudHMgY2FsbGVkIEVuY291bnRlcgoKcGFyYW1ldGVyIFRvZGF5IERhdGUgZGVmYXVsdCBUb2RheSgpCgpjb250ZXh0IFBhdGllbnQKCgovKgpAZHluYW1pY1ZhbHVlOiBHdWlkYW5jZQoqLwpkZWZpbmUgIkd1aWRhbmNlIjoKICBjYXNlIAogICAgd2hlbiAiQ2xpZW50IGlzIGR1ZSBmb3IgaGVwYXRpdGlzIEIgbW9ub3ZhbGVudCB2YWNjaW5lIiB0aGVuICJDbGllbnQgaXMgZHVlIGZvciBoZXBhdGl0aXMgQ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