WHO Immunization Implementation Guide
0.2.0 - ci-build

WHO Immunization Implementation Guide, published by WHO. This guide is not an authorized publication; it is the continuous build for version 0.2.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: IMMZD5DTPneumococcalCILogic

Official URL: http://smart.who.int/immunizations/Library/IMMZD5DTPneumococcalCILogic Version: 0.2.0
Draft as of 2025-08-08 Computable Name: IMMZD5DTPneumococcalCILogic

This library defines decision support logic for the IMMZ.D5.DT.Pneumococcal contraindications decision table in the Immunization CPG

Title: IMMZD5DTPneumococcalCILogic
Id: IMMZD5DTPneumococcalCILogic
Version: 0.2.0
Url: IMMZD5DTPneumococcalCILogic
Status: draft
Type:

system: http://terminology.hl7.org/CodeSystem/library-type

code: logic-library

Date: 2025-08-08 19:12:11+0000
Publisher: WHO
Description:

This library defines decision support logic for the IMMZ.D5.DT.Pneumococcal contraindications decision table in the Immunization CPG

Related Artifacts:

Dependencies

Parameters:
NameTypeMinMaxIn/Out
Todaydate01In
PatientPatient01Out
Pneumococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical noteboolean01Out
Pneumococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Guidancestring01Out
Pneumococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note.boolean01Out
Pneumococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note. Guidancestring01Out
Guidancestring01Out
Has Guidanceboolean01Out
Test ValidationResource01Out
Content: text/cql

/*
 * Library: IMMZD5DTPneumococcalCILogic (IMMZ.D5.DT.Pneumococcal contraindications)
 * Rule: Check for contraindications before administering the vaccine(s) due	
 * Decision Table: Potential Contraindications
 * Trigger: IMMZ.D5 Determine vaccine(s) to be administered based on contraindications
 */
library IMMZD5DTPneumococcalCILogic

using FHIR version '4.0.1'
include FHIRHelpers version '4.0.1'

include IMMZD5DTPneumococcalEncounterElements called Encounter

parameter Today Date default Today()

context Patient


/*
@dynamicValue: Guidance
*/
define "Guidance":
  case
    when "Pneumococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note" then "Pneumococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Guidance"
    when "Pneumococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note." then "Pneumococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note. Guidance"
    else ''
  end

define "Has Guidance":
  "Guidance" is not null and "Guidance" != ''

/*
@output: Pneumococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note
@pseudocode: "Immunization recommendation status" = "Further evaluation needed"
*/
define "Pneumococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note":
  Encounter."The client has a history of anaphylactic reactions"

/*
@output: Pneumococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Guidance
@guidance: Do not vaccinate client with pneumococcal if client has a history of anaphylactic reaction to any component of the vaccine.
*/
define "Pneumococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Guidance":
  'Do not vaccinate client with pneumococcal if client has a history of anaphylactic reaction to any component of the vaccine.'

/*
@output: Pneumococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note.
@pseudocode: "Immunization recommendation status" = "Further evaluation needed"
*/
define "Pneumococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note.":
  Encounter."The client has a history of severe allergic reactions"

/*
@output: Pneumococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note. Guidance
@guidance: Do not vaccinate client with pneumococcal if client has a history of severe allergic reactions to any component of the vaccine.
*/
define "Pneumococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note. Guidance":
  'Do not vaccinate client with pneumococcal if client has a history of severe allergic reactions to any component of the vaccine.'


/*
@test: Test expected results based on example patients
*/
define "Test Validation":
  case
    when Patient.id = '61.1' then "Pneumococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note" and "Guidance" = 'Do not vaccinate client with pneumococcal if client has a history of anaphylactic reaction to any component of the vaccine.'
    when Patient.id = '62.1' then "Pneumococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note." and "Guidance" = 'Do not vaccinate client with pneumococcal if client has a history of severe allergic reactions to any component of the vaccine.'
    else 'No test case set'
  end
Content: application/elm+xml
Encoded data (32292 characters)