Title: |
IMMZD18SHepatitisBBirthLogic |
Id: |
IMMZD18SHepatitisBBirthLogic |
Version: |
0.2.0 |
Url: |
IMMZD18SHepatitisBBirthLogic |
Status: |
draft |
Type: |
system: http://terminology.hl7.org/CodeSystem/library-type
code: logic-library
|
Date: |
2025-09-17 23:03:28+0000 |
Publisher: |
WHO |
Description: |
This library defines decision support logic for the IMMZ.D18.S.Hepatitis B.Birth dose schedule table in the Immunization CPG
|
Related Artifacts: |
Dependencies
|
Parameters: |
Name | Type | Min | Max | In/Out |
Today | date | 0 | 1 | In |
Patient | Patient | 0 | 1 | Out |
Hepatitis B birth dose was administered | boolean | 0 | 1 | Out |
Hepatitis B birth dose | boolean | 0 | 1 | Out |
Hepatitis B birth dose Due Date | date | 0 | 1 | Out |
Hepatitis B birth dose Overdue | date | 0 | 1 | Out |
Hepatitis B birth dose Create | string | 0 | 1 | Out |
Hepatitis B birth dose Expiration | Resource | 0 | 1 | Out |
Test Validation | Resource | 0 | 1 | Out |
|
Content: text/cql |
/*
* Library: IMMZD18SHepatitisBBirthLogic (IMMZ.D18.S.Hepatitis B.Birth dose schedule)
* Schedule Table: Birth dose schedule
*/
library IMMZD18SHepatitisBBirthLogic
using FHIR version '4.0.1'
include FHIRHelpers version '4.0.1'
include WHOCommon called WC
include IMMZCommon called Common
include IMMZConcepts called Concepts
include IMMZEncounterElements called IE
include IMMZD2DTHepatitisBEncounterElements called Encounter
parameter Today Date default Today()
context Patient
/*
@output: Hepatitis B birth dose
@description: Provision of hepatitis B birth dose
@trigger: Child's birth
@triggerDate: "Date of birth"
*/
define "Hepatitis B birth dose":
not "Hepatitis B birth dose was administered"
/*
@output: Hepatitis B birth dose Create
@create: All infants should receive a first dose of the hepatitis B-containing vaccine as soon as possible after birth, ideally within 24 hours
*/
define "Hepatitis B birth dose Create":
if "Hepatitis B birth dose"
then 'All infants should receive a first dose of the hepatitis B-containing vaccine as soon as possible after birth, ideally within 24 hours' + '
Due Date: ' + ToString("Hepatitis B birth dose Due Date") + '
Overdue: ' + ToString("Hepatitis B birth dose Overdue")
else ''
/*
@dynamicValue: Hepatitis B birth dose Due Date
@pseudocode: "Date of birth"
*/
define "Hepatitis B birth dose Due Date":
if "Hepatitis B birth dose" then Patient.birthDate
else null
/*
@dynamicValue: Hepatitis B birth dose Overdue
@pseudocode: "Date of birth" + 24 hours
*/
define "Hepatitis B birth dose Overdue":
if "Hepatitis B birth dose" then Patient.birthDate + 24 hours
else null
/*
@dynamicValue: Hepatitis B birth dose Expiration
@pseudocode: To be determined by Member States
*/
define "Hepatitis B birth dose Expiration":
null
/*
@complete: 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":
Encounter."Hepatitis B birth dose was administered"
/*
@test: Test expected results based on example patients
*/
define "Test Validation":
case
when Patient.id = '07.newborn' then "Hepatitis B birth dose"
when Patient.id = '07.D1' then not "Hepatitis B birth dose"
else 'No test case set'
end
|
|
Content: application/elm+xml |
Encoded data (32160 characters)
|
|