Title: |
IMMZD2DTHPVEncounterElements |
Id: |
IMMZD2DTHPVEncounterElements |
Version: |
0.2.0 |
Url: |
IMMZD2DTHPVEncounterElements |
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 encounter-based elements for HPV used throughout the Immunization CPG
|
Related Artifacts: |
Dependencies
|
Parameters: |
Name | Type | Min | Max | In/Out |
Today | date | 0 | 1 | In |
EncounterId | string | 0 | 1 | In |
Patient | Patient | 0 | 1 | Out |
HPV Doses Administered to Patient | Immunization | 0 | * | Out |
HPV Primary Series Doses Administered to Patient | Immunization | 0 | * | Out |
Number of HPV Primary Series Doses Administered | integer | 0 | 1 | Out |
Date of Latest HPV Dose | date | 0 | 1 | Out |
No HPV primary series doses were administered | boolean | 0 | 1 | Out |
One HPV primary series dose was administered | boolean | 0 | 1 | Out |
Two HPV primary series doses were administered | boolean | 0 | 1 | Out |
Three HPV primary series doses were administered | boolean | 0 | 1 | Out |
Client's age is less than 9 years | boolean | 0 | 1 | Out |
Client's age is between 9 and 14 years | boolean | 0 | 1 | Out |
Client's age more than or equal to 15 years | boolean | 0 | 1 | Out |
Client's age is between 9 and 20 years | boolean | 0 | 1 | Out |
Client's age is more than 20 years | boolean | 0 | 1 | Out |
Client's biological sex is female | boolean | 0 | 1 | Out |
Client's biological sex is not female | boolean | 0 | 1 | Out |
The latest HPV dose was administered less than 6 months ago | boolean | 0 | 1 | Out |
The latest HPV dose was administered more than 6 months ago | boolean | 0 | 1 | Out |
Client is immunocompromised | boolean | 0 | 1 | Out |
Client is not immunocompromised | boolean | 0 | 1 | Out |
Client's HIV status is positive | boolean | 0 | 1 | Out |
Client's HIV status is negative or unknown | boolean | 0 | 1 | Out |
|
Content: text/cql |
/*
* Library: IMMZD2DTHPVEncounterElements
*/
library IMMZD2DTHPVEncounterElements
using FHIR version '4.0.1'
include FHIRHelpers version '4.0.1'
include WHOConcepts
include WHOCommon called WC
include WHOElements called WE
include IMMZCommon called Common
include IMMZConcepts called Concepts
include IMMZEncounterElements called Encounter
include IMMZD2DTHPVElements called HPVElements
parameter Today Date default Today()
parameter EncounterId String
context Patient
/*
@internal: HPV containing Doses Administered to Patient
*/
define "HPV Doses Administered to Patient":
Encounter."Doses Administered to Patient" I
where
I.vaccineCode in Concepts."HPV vaccines"
/*
@internal: HPV containing Doses Administered to Patient that are in the Primary series
*/
define "HPV Primary Series Doses Administered to Patient":
"HPV Doses Administered to Patient".seriesPrimary()
/*
@internal: Number of HPV Primary Series doses
*/
define "Number of HPV Primary Series Doses Administered":
Count("HPV Primary Series Doses Administered to Patient")
/*
@internal: Date and time of last HPV dose
*/
define "Date of Latest HPV Dose":
date from start of "HPV Doses Administered to Patient".mostRecent().occurrence.toInterval()
/*
@input: No HPV primary series doses were administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = "HPV vaccines" and "Type of dose" = "Primary series") = 0
@decision: 2-dose schedule
@decision: Alternative single-dose schedule
*/
define "No HPV primary series doses were administered":
"Number of HPV Primary Series Doses Administered" = 0
/*
@input: One HPV primary series dose was administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = "HPV vaccines" and "Type of dose" = "Primary series") = 1
@decision: 2-dose schedule
@decision: Alternative single-dose schedule
*/
define "One HPV primary series dose was administered":
"Number of HPV Primary Series Doses Administered" = 1
/*
@input: Two HPV primary series doses were administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = "HPV vaccines" and "Type of dose" = "Primary series") = 2
@decision: 2-dose schedule
@decision: Alternative single-dose schedule
*/
define "Two HPV primary series doses were administered":
"Number of HPV Primary Series Doses Administered" = 2
/*
@input: Three HPV primary series doses were administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = "HPV vaccines" and "Type of dose" = "Primary series") = 3
@decision: 2-dose schedule
@decision: Alternative single-dose schedule
*/
define "Three HPV primary series doses were administered":
"Number of HPV Primary Series Doses Administered" = 3
/*
@input: Client's age is less than 9 years
@pseudocode: Today's date − "Date of birth" < 9 years
@decision: 2-dose schedule
@decision: Alternative single-dose schedule
*/
define "Client's age is less than 9 years":
Encounter."Current Patient Age In Years" < 9
/*
@input: Client's age is between 9 and 14 years
@pseudocode: 9 years ≤ Today's date − "Date of birth" ≤ 14 years
@decision: 2-dose schedule
*/
define "Client's age is between 9 and 14 years":
9 <= Encounter."Current Patient Age In Years"
and Encounter."Current Patient Age In Years" <= 14
/*
@input: Client's age more than or equal to 15 years
@pseudocode: Today's date − "Date of birth" ≥ 15 years
@decision: 2-dose schedule
*/
define "Client's age more than or equal to 15 years":
Encounter."Current Patient Age In Years" >= 15
/*
@input: Client's age is between 9 and 20 years
@pseudocode: 9 years ≤ Today's date − "Date of birth" ≤ 20 years
@decision: Alternative single-dose schedule
*/
define "Client's age is between 9 and 20 years":
9 <= Encounter."Current Patient Age In Years"
and Encounter."Current Patient Age In Years" <= 20
/*
@input: Client's age is more than 20 years
@pseudocode: Today's date − "Date of birth" > 20 years
@decision: Alternative single-dose schedule
*/
define "Client's age is more than 20 years":
Encounter."Current Patient Age In Years" > 20
/*
@input: Client's biological sex is female
@pseudocode: "Sex" = "Female"
@decision: 2-dose schedule
*/
define "Client's biological sex is female":
Patient.gender = 'female'
/*
@input: Client's biological sex is not female
@pseudocode: "Sex" ≠ "Female"
@decision: 2-dose schedule
*/
define "Client's biological sex is not female":
not "Client's biological sex is female"
/*
@input: The latest HPV dose was administered less than 6 months ago
@pseudocode: Today's date − latest "Date and time of vaccination" (where "Vaccine type" = "HPV vaccines") < 6 months
@decision: 2-dose schedule
@decision: Alternative single-dose schedule
*/
define "The latest HPV dose was administered less than 6 months ago":
"Date of Latest HPV Dose" is not null
and duration in months between "Date of Latest HPV Dose" and Today < 6
/*
@input: The latest HPV dose was administered more than 6 months ago
@pseudocode: Today's date − latest "Date and time of vaccination" (where "Vaccine type" = "HPV vaccines") ≥ 6 months
@decision: 2-dose schedule
@decision: Alternative single-dose schedule
*/
define "The latest HPV dose was administered more than 6 months ago":
not "The latest HPV dose was administered less than 6 months ago"
/*
@input: Client is immunocompromised
@pseudocode: "Immunocompromised" = TRUE
@decision: 2-dose schedule
@decision: Alternative single-dose schedule
*/
define "Client is immunocompromised":
Encounter."Client is immunocompromised"
/*
@input: Client is not immunocompromised
@pseudocode: "Immunocompromised" ≠ TRUE
@decision: 2-dose schedule
@decision: Alternative single-dose schedule
*/
define "Client is not immunocompromised":
Encounter."Client is not immunocompromised"
/*
@input: Client's HIV status is positive
@pseudocode: "HIV status" = "HIV-positive"
@decision: 2-dose schedule
@decision: Alternative single-dose schedule
*/
define "Client's HIV status is positive":
Encounter."Client's HIV status is positive"
/*
@input: Client's HIV status is negative or unknown
@pseudocode: "HIV status" ≠ "HIV-positive"
@decision: 2-dose schedule
@decision: Alternative single-dose schedule
*/
define "Client's HIV status is negative or unknown":
Encounter."Client's HIV status is negative or unknown"
|
|
Content: application/elm+xml |
Encoded data (60956 characters)
|
|