http://smart.who.int/immunizations/PlanDefinition/IMMZD18SPneumococcal2DosesWithBoosterDose
type: PlanDefinition
node role: treeRoot
meta:
  profile:
    v: http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-recommendationdefinition
    l: cpg-recommendationdefinition
  profile:
    v: http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareableplandefinition
    l: crmi-shareableplandefinition
  profile:
    v: http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishableplandefinition
    l: crmi-publishableplandefinition
text:
  status:
    v: extensions
  div:
    v: Id: IMMZD18SPneumococcal2DosesWithBoosterDose Url: IMMZ.D18.S.Pneumococcal.2 doses with booster dose schedule Version: 0.2.0 Title: IMMZ.D18.S.Pneumococcal.2 doses with booster dose schedule 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.D18.S.Pneumococcal.2 doses with booster dose schedule 2 primary doses with a booster dose (2p+1) schedule Knowledge Capability: computable Related Artifacts: References WHO recommendations for routine immunization - summary tables (January 2025) Libraries: IMMZD18SPneumococcal2DosesWithBoosterDoseLogic Actions: Pneumococcal dose 1: Provision of the pneumococcal dose 1 Trigger event: Child's birth Trigger pseudo: Trigger date: "Date of birth" Create condition: Pneumococcal dose 1 should be provided if the client is older than 6 weeks If: Applicability: Pneumococcal dose 1 (Pneumococcal dose 1) Then: Definition: IMMZ.D2.DT.CR Dynamic Values: status: ('active') payload.contentString: (Pneumococcal dose 1 Create) category.coding: (Code { system: 'http://terminology.hl7.org/CodeSystem/communication-category', code: 'alert' }) priority: (Code { system: 'http://hl7.org/fhir/request-priority', code: 'routine' }) Pneumococcal dose 2: Provision of the pneumococcal dose 2 Trigger event: First pneumococcal dose from the primary series was administered to the client, who is less than or equal to 5 years of age, either within 24 months of birth or if client is at high risk for pneumococcal infection Trigger pseudo: Today's date − "Date of birth" ≤ 5 years AND Count of vaccines administered (where "Vaccine type" = "Pneumococcal vaccines" and "Type of dose" = "Primary series") = 1 AND ("Date and time of vaccination" (where "Vaccine type" = "Pneumococcal vaccines") − "Date of birth" < 24 months OR "At high risk for pneumococcal infection" = TRUE Trigger date: Date and time of vaccination" (where "Vaccine type" = "Pneumococcal vaccin…
contained: Library
  id:
    v: effective-data-requirements
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode
      l: cqf-directReferenceCode
    value: Coding
      system:
        v: http://smart.who.int/immunizations/CodeSystem/IMMZ.D
        l: IMMZ.D
      code:
        v: DE251
      display:
        v: At high risk for pneumococcal infection
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode
      l: cqf-directReferenceCode
    value: Coding
      system:
        v: http://smart.who.int/immunizations/CodeSystem/IMMZ.D
        l: IMMZ.D
      code:
        v: DE204
      display:
        v: HIV status
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode
      l: cqf-directReferenceCode
    value: Coding
      system:
        v: http://smart.who.int/immunizations/CodeSystem/IMMZ.D
        l: IMMZ.D
      code:
        v: DE205
      display:
        v: HIV-positive
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode
      l: cqf-directReferenceCode
    value: Coding
      system:
        v: http://smart.who.int/immunizations/CodeSystem/IMMZ.D
        l: IMMZ.D
      code:
        v: DE208
      display:
        v: Preterm birth
  extension:
    extension:
      url:
        v: libraryName
        l: libraryName
      value: String
        v: IMMZElements
    extension:
      url:
        v: name
        l: name
      value: String
        v: Doses Administered to Patient
    extension:
      url:
        v: statement
        l: statement
      value: String
        v: /** * @dataElement All Doses Administered to Patient */ define "Doses Administered to Patient": [Immunization] I where I.status = 'completed' and I.isSubpotent is not true
    extension:
      url:
        v: displaySequence
        l: displaySequence
      value: Integer
        v: 0
    url:
      v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
      l: cqf-logicDefinition
  extension:
    extension:
      url:
        v: libraryName
        l: libraryName
      value: String
        v: IMMZEncounterElements
    extension:
      url:
        v: name
        l: name
      value: String
        v: Doses Administered to Patient
    extension:
      url:
        v: statement
        l: statement
      value: String
        v: /** * @dataElement All Doses Administered to Patient */ define "Doses Administered to Patient": Elements."Doses Administered to Patient" I where I.occurrence.toInterval() same day or before Today
    extension:
      url:
        v: displaySequence
        l: displaySequence
      value: Integer
        v: 1
    url:
      v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
      l: cqf-logicDefinition
  extension:
    extension:
      url:
        v: libraryName
        l: libraryName
      value: String
        v: IMMZD2DTPneumococcalEncounterElements
    extension:
      url:
        v: name
        l: name
      value: String
        v: Pneumococcal Doses Administered to Patient
    extension:
      url:
        v: statement
        l: statement
      value: String
        v: /* @internal: Pneumococcal containing Doses Administered to Patient */ define "Pneumococcal Doses Administered to Patient": Encounter."Doses Administered to Patient" I where I.vaccineCode in Concepts."Pneumococcal vaccines"
    extension:
      url:
        v: displaySequence
        l: displaySequence
      value: Integer
        v: 2
    url:
      v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
      l: cqf-logicDefinition
  extension:
    extension:
      url:
        v: libraryName
        l: libraryName
      value: String
        v: IMMZD2DTPneumococcalEncounterElements
    extension:
      url:
        v: name
        l: name
      value: String
        v: Pneumococcal Primary Series Doses Administered to Patient
    extension:
      url:
        v: statement
        l: statement
      value: String
        v: /* @internal: Pneumococcal containing Doses Administered to Patient that are in the Primary series */ define "Pneumococcal Primary Series Doses Administered to Patient": "Pneumococcal Doses Administered to Patient".seriesPrimary()
    extension:
      url:
        v: displaySequence
        l: displaySequence
      value: Integer
        v: 3
    url:
      v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
      l: cqf-logicDefinition
  extension:
    extension:
      url:
        v: libraryName
        l: libraryName
      value: String
        v: IMMZD2DTPneumococcalEncounterElements
    extension:
      url:
        v: name
        l: name
      value: String
        v: Number of Pneumococcal Primary Series Doses Administered
    extension:
      url:
        v: statement
        l: statement
      value: String
        v: /* @internal: Number of Pneumococcal Primary Series doses */ define "Number of Pneumococcal Primary Series Doses Administered": Count("Pneumococcal Primary Series Doses Administered to Patient")
    extension:
      url:
        v: displaySequence
        l: displaySequence
      value: Integer

Integer
v: 4

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZD2DTPneumococcalEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: One pneumococcal primary series dose was administered
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @input: One pneumococcal primary series dose was administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "Pneumococcal vaccines" and "Type of dose" = "Primary series") = 1 @code: One pneumococcal primary series dose was administered-121 @decision: IMMZ.D2.DT.Pneumococcal.2 doses with booster dose: 2 primary doses with a booster dose (2p+1) @decision: IMMZ.D2.DT.Pneumococcal.3 doses: 3 primary doses (3p+0) */ define "One pneumococcal primary series dose was administered": "Number of Pneumococcal Primary Series Doses Administered" = 1
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 5
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
extension:
  url:
    v: name
    l: name
  value: String
    v: First pneumococcal dose from the primary series was administered
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @complete: First pneumococcal dose from the primary series was administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "Pneumococcal vaccines" and "Type of dose" = "Primary series") = 1 */ define "First pneumococcal dose from the primary series was administered": Encounter."One pneumococcal primary series dose was administered"
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 6
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Current Patient Age In Years
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /** * @dataElement Patient age in years */ define "Current Patient Age In Years": AgeInYearsAt(Today)
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 7
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZD2DTPneumococcalEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: The client's age is less than or equal to 5 years
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @input: The client's age is less than or equal to 5 years @pseudocode: 'Today's date − "Date of birth" ≤ 5 years @code: The client's age is less than or equal to 5 years-41 @decision: IMMZ.D2.DT.Pneumococcal.2 doses with booster dose: 2 primary doses with a booster dose (2p+1) */ define "The client's age is less than or equal to 5 years": Encounter."Current Patient Age In Years" <= 5
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 8
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZD2DTPneumococcalEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Date of First Pneumococcal Dose
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @internal: Date of First Pneumococcal Dose */ define "Date of First Pneumococcal Dose": date from start of "Pneumococcal Doses Administered to Patient".earliest().occurrence.toInterval()
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 9
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZD2DTPneumococcalEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: The first pneumococcal dose was administered within 24 months post birth
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @input: The first pneumococcal dose was administered within 24 months post birth @pseudocode: "Date and time of vaccination" (where "Vaccine type" = "Pneumococcal vaccines") − "Date of birth" < 24 months @code: The first pneumococcal dose was administered within 24 months post birth-109 @decision: IMMZ.D2.DT.Pneumococcal.2 doses with booster dose: 2 primary doses with a booster dose (2p+1) */ define "The first pneumococcal dose was administered within 24 months post birth": AgeInMonthsAt("Date of First Pneumococcal Dose") < 24
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 10
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZElements
extension:
  url:
    v: name
    l: name
  value: String
    v: At high risk for pneumococcal infection Observation
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @internal: At high risk for pneumococcal infection Observation */ define "At high risk for pneumococcal infection Observation": ([Observation: Concepts."At high risk for pneumococcal infection"]).complete()
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 11
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: At high risk for pneumococcal infection Observation
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @internal: At high risk for pneumococcal infection Observation */ define "At high risk for pneumococcal infection Observation": Elements."At high risk for pneumococcal infection Observation".encounterOrOnBefore(EncounterId, Today)
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 12
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Client is at high risk for pneumococcal infection
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @input: Client is at high risk for pneumococcal infection @pseudocode: "At high risk for pneumococcal infection" = TRUE */ define "Client is at high risk for pneumococcal infection": exists( "At high risk for pneumococcal infection Observation" O where O.value = true )
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 13
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZD2DTPneumococcalEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Client is at high risk for pneumococcal infection
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @input: Client is at high risk for pneumococcal infection @pseudocode: "At high risk for pneumococcal infection" = TRUE @code: Client is at high risk for pneumococcal infection-48 @decision: IMMZ.D2.DT.Pneumococcal.2 doses with booster dose: 2 primary doses with a booster dose (2p+1) @decision: IMMZ.D2.DT.Pneumococcal.3 doses: 3 primary doses (3p+0) */ define "Client is at high risk for pneumococcal infection": Encounter."Client is at high risk for pneumococcal infection"
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 14
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZD2DTPneumococcalEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Two pneumococcal primary series doses were administered
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @input: Two pneumococcal primary series doses were administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "Pneumococcal vaccines" and "Type of dose" = "Primary series") = 2 @code: Two pneumococcal primary series doses were administered-121 @decision: IMMZ.D2.DT.Pneumococcal.2 doses with booster dose: 2 primary doses with a booster dose (2p+1) @decision: IMMZ.D2.DT.Pneumococcal.3 doses: 3 primary doses (3p+0) */ define "Two pneumococcal primary series doses were administered": "Number of Pneumococcal Primary Series Doses Administered" = 2
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 15
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
extension:
  url:
    v: name
    l: name
  value: String
    v: Second pneumococcal dose from the primary series was administered. The primary series has been completed.
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @complete: Second pneumococcal dose from the primary series was administered. The primary series has been completed. @pseudocode: "Completed the primary vaccination series" = TRUE (where "Vaccine type" = "Pneumococcal vaccines")" */ define "Second pneumococcal dose from the primary series was administered. The primary series has been completed.": Encounter."Two pneumococcal primary series doses were administered"
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 16
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
extension:
  url:
    v: name
    l: name
  value: String
    v: Pneumococcal dose 2
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @output: Pneumococcal dose 2 @description: Provision of the pneumococcal dose 2 @trigger: First pneumococcal dose from the primary series was administered to the client, who is less than or equal to 5 years of age, either within 24 months of birth or if client is at high risk for pneumococcal infection @pseudo: Today's date − "Date of birth" ≤ 5 years AND Count of vaccines administered (where "Vaccine type" = "Pneumococcal vaccines" and "Type of dose" = "Primary series") = 1 AND ("Date and time of vaccination" (where "Vaccine type" = "Pneumococcal vaccines") − "Date of birth" < 24 months OR "At high risk for pneumococcal infection" = TRUE @triggerDate: Date and time of vaccination" (where "Vaccine type" = "Pneumococcal vaccines") */ define "Pneumococcal dose 2": "First pneumococcal dose from the primary series was administered" and Encounter."The client's age is less than or equal to 5 years" and ( Encounter."The first pneumococcal dose was administered within 24 months post birth" or Encounter."Client is at high risk for pneumococcal infection" ) and not "Second pneumococcal dose from the primary series was administered. The primary series has been completed."
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 17
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZD2DTPneumococcalEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Pneumococcal Booster Series Doses Administered to Patient
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @internal: Pneumococcal Booster Series Doses Administered to Patient */ define "Pneumococcal Booster Series Doses Administered to Patient": "Pneumococcal Doses Administered to Patient".seriesBooster()
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 18
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZD2DTPneumococcalEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Number of Pneumococcal Booster Series Doses Administered
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @internal: Number of Pneumococcal Booster Series Doses Administered */ define "Number of Pneumococcal Booster Series Doses Administered": Count("Pneumococcal Booster Series Doses Administered to Patient")
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 19
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZD2DTPneumococcalEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: One pneumococcal booster dose was administered
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @input: One pneumococcal booster dose was administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "Pneumococcal vaccines" and "Type of dose" = "Booster dose") = 1 @code: One pneumococcal booster dose was administered-119 @decision: IMMZ.D2.DT.Pneumococcal.2 doses with booster dose: 2 primary doses with a booster dose (2p+1) @decision: IMMZ.D2.DT.Pneumococcal.3 doses: 3 primary doses (3p+0) */ define "One pneumococcal booster dose was administered": "Number of Pneumococcal Booster Series Doses Administered" = 1
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 20
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
extension:
  url:
    v: name
    l: name
  value: String
    v: Pneumococcal booster dose was administered
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @complete: Pneumococcal booster dose was administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "Pneumococcal vaccines" and "Type of dose" = "Booster dose") = 1 */ define "Pneumococcal booster dose was administered": Encounter."One pneumococcal booster dose was administered"
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 21
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZD2DTPneumococcalEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Date of Latest Pneumococcal Dose
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @internal: Date of Latest Pneumococcal Dose */ define "Date of Latest Pneumococcal Dose": date from start of "Pneumococcal Doses Administered to Patient".mostRecent().occurrence.toInterval()
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 22
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZD2DTPneumococcalEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: The latest pneumococcal dose was administered within 12 months post birth
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @input: The latest pneumococcal dose was administered within 12 months post birth @pseudocode: Latest "Date and time of vaccination" (where "Vaccine type" = "Pneumococcal vaccines") − "Date of birth" < 12 months @code: The latest pneumococcal dose was administered within 12 months post birth-116 @decision: IMMZ.D2.DT.Pneumococcal.2 doses with booster dose: 2 primary doses with a booster dose (2p+1) @decision: IMMZ.D2.DT.Pneumococcal.3 doses: 3 primary doses (3p+0) */ define "The latest pneumococcal dose was administered within 12 months post birth": AgeInMonthsAt("Date of Latest Pneumococcal Dose") < 12
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 23
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Current Patient Age In Months
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /** * @dataElement Patient age in months */ define "Current Patient Age In Months": AgeInMonthsAt(Today)
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 24
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZD2DTPneumococcalEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: The client's age is less than 24 months
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @input: The client's age is less than 24 months @pseudocode: Today's date − "Date of birth" < 24 months @code: The client's age is less than 24 months-42 @decision: IMMZ.D2.DT.Pneumococcal.3 doses: 3 primary doses (3p+0) */ define "The client's age is less than 24 months": Encounter."Current Patient Age In Months" < 24
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 25
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZElements
extension:
  url:
    v: name
    l: name
  value: String
    v: HIV status Observation
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @internal: HIV Status Observation */ define "HIV status Observation": ([Observation: Concepts."HIV status"]).complete()
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 26
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Client's HIV status is positive
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @input: Client's HIV status is positive @pseudocode: "HIV status" = "HIV-positive" */ define "Client's HIV status is positive": exists( (Elements."HIV status Observation".encounterOrOnBefore(EncounterId, Today)) O where O.value ~ Concepts."HIV-positive" )
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 27
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZD2DTPneumococcalEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Client's HIV status is positive
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @input: Client's HIV status is positive @pseudocode: "HIV status" = "HIV-positive" @code: Client's HIV status is positive-29 @decision: IMMZ.D2.DT.Pneumococcal.2 doses with booster dose: 2 primary doses with a booster dose (2p+1) @decision: IMMZ.D2.DT.Pneumococcal.3 doses: 3 primary doses (3p+0) */ define "Client's HIV status is positive": Encounter."Client's HIV status is positive"
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 28
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Preterm birth Observation
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @internal: Preterm birth Observation */ define "Preterm birth Observation": ([Observation: Concepts."Preterm birth"]).complete()
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 29
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Preterm birth Observation
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @internal: Preterm birth Observation */ define "Preterm birth Observation": Elements."Preterm birth Observation".encounterOrOnBefore(EncounterId, Today)
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 30
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Client was a premature infant at birth
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @input: Client was a premature infant at birth @pseudocode: "Preterm birth" = TRUE */ define "Client was a premature infant at birth": exists( "Preterm birth Observation" O where O.value = true )
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 31
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZD2DTPneumococcalEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Client had preterm birth
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @input: Client had preterm birth @pseudocode: "Preterm birth" = TRUE @code: Client had preterm birth-22 @decision: IMMZ.D2.DT.Pneumococcal.2 doses with booster dose: 2 primary doses with a booster dose (2p+1) @decision: IMMZ.D2.DT.Pneumococcal.3 doses: 3 primary doses (3p+0) */ define "Client had preterm birth": Encounter."Client was a premature infant at birth"
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 32
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZD2DTPneumococcalEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Two pneumococcal booster doses were administered
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @input: Two pneumococcal booster doses were administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "Pneumococcal vaccines" and "Type of dose" = "Booster dose") = 2 @code: Two pneumococcal booster doses were administered-119 @decision: IMMZ.D2.DT.Pneumococcal.2 doses with booster dose: 2 primary doses with a booster dose (2p+1) */ define "Two pneumococcal booster doses were administered": "Number of Pneumococcal Booster Series Doses Administered" = 2
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 33
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
extension:
  url:
    v: name
    l: name
  value: String
    v: Second pneumococcal booster dose was administered
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @complete: Second pneumococcal booster dose was administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "Pneumococcal vaccines" and "Type of dose" = "Booster dose") = 2 */ define "Second pneumococcal booster dose was administered": Encounter."Two pneumococcal booster doses were administered"
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 34
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
extension:
  url:
    v: name
    l: name
  value: String
    v: Pneumococcal second booster dose Expiration
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @dynamicValue: Pneumococcal second booster dose Expiration @pseudocode: "Date of birth" + 24 months */ define "Pneumococcal second booster dose Expiration": Patient.birthDate + 24 months
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 35
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
extension:
  url:
    v: name
    l: name
  value: String
    v: Pneumococcal second booster dose
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @output: Pneumococcal second booster dose @description: Provision of another booster dose for HIV-positive infants and preterm neonates @trigger: The primary series has been completed and one booster dose was administered to the client, who is more than 12 months of age. The latest pneumococcal dose was administered within 12 months post birth. Client is either HIV positive or had a preterm birth @pseudo: 'Today's date − "Date of birth" > 12 months AND "Completed the primary vaccination series" = TRUE (where "Vaccine type" = "Pneumococcal vaccines") AND Count of vaccines administered (where "Vaccine type" = "Pneumococcal vaccines" and "Type of dose" = "Booster dose") = 1 AND Latest "Date and time of vaccination" (where "Vaccine type" = "Pneumococcal vaccines") − "Date of birth" < 12 months AND ("HIV status" = "HIV-positive" OR "Preterm birth" = TRUE) @triggerDate: "Date of birth" */ define "Pneumococcal second booster dose": "Pneumococcal booster dose was administered" and Encounter."The latest pneumococcal dose was administered within 12 months post birth" and Encounter."The client's age is less than 24 months" and ( Encounter."Client's HIV status is positive" or Encounter."Client had preterm birth" ) and not "Second pneumococcal booster dose was administered" and "Pneumococcal second booster dose Expiration" after day of Today
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 36
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
extension:
  url:
    v: name
    l: name
  value: String
    v: Pneumococcal dose 2 Due Date
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @dynamicValue: Pneumococcal dose 2 Due Date @pseudocode: "Date and time of vaccination" (where "Vaccine type" = "Pneumococcal vaccines") + 8 weeks */ define "Pneumococcal dose 2 Due Date": if "Pneumococcal dose 2" then Encounter."Date of Latest Pneumococcal Dose" + 8 weeks else null
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 37
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
extension:
  url:
    v: name
    l: name
  value: String
    v: Pneumococcal dose 2 Create
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @output: Pneumococcal dose 2 Create @create: Pneumococcal dose 2 should be provided if the client was given the previous dose more than 8 weeks ago */ define "Pneumococcal dose 2 Create": if "Pneumococcal dose 2" then 'Pneumococcal dose 2 should be provided if the client was given the previous dose more than 8 weeks ago' + ' Due Date: ' + ToString("Pneumococcal dose 2 Due Date") else ''
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 38
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
extension:
  url:
    v: name
    l: name
  value: String
    v: Pneumococcal second booster dose Due Date
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @dynamicValue: Pneumococcal second booster dose Due Date @pseudocode: "Date of birth" + 12 months */ define "Pneumococcal second booster dose Due Date": if "Pneumococcal second booster dose" then Patient.birthDate + 12 months else null
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 39
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
extension:
  url:
    v: name
    l: name
  value: String
    v: Pneumococcal second booster dose Overdue
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @dynamicValue: Pneumococcal second booster dose Overdue @pseudocode: "Date of birth" + 24 months */ define "Pneumococcal second booster dose Overdue": if "Pneumococcal second booster dose" then Patient.birthDate + 24 months else null
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 40
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
extension:
  url:
    v: name
    l: name
  value: String
    v: Pneumococcal second booster dose Create
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @output: Pneumococcal second booster dose Create @create: HIV-positive infants and preterm neonates who have received their 3 primary vaccine doses before 12 months of age may benefit from a booster dose in the second year of life */ define "Pneumococcal second booster dose Create": if "Pneumococcal second booster dose" then 'HIV-positive infants and preterm neonates who have received their 3 primary vaccine doses before 12 months of age may benefit from a booster dose in the second year of life' + ' Due Date: ' + ToString("Pneumococcal second booster dose Due Date") + ' Overdue: ' + ToString("Pneumococcal second booster dose Overdue") + ' Expiration: ' + ToString("Pneumococcal second booster dose Expiration") else ''
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 41
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZD2DTPneumococcalEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: The first pneumococcal dose was administered within 12 months post birth
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @input: The first pneumococcal dose was administered within 12 months post birth @pseudocode: "Date and time of vaccination" (where "Vaccine type" = "Pneumococcal vaccines" AND "Dose number" = 1) − "Date of birth" < 12 months @code: The first pneumococcal dose was administered within 12 months post birth-131 @decision: IMMZ.D2.DT.Pneumococcal.2 doses with booster dose: 2 primary doses with a booster dose (2p+1) @decision: IMMZ.D2.DT.Pneumococcal.3 doses: 3 primary doses (3p+0) */ define "The first pneumococcal dose was administered within 12 months post birth": AgeInMonthsAt("Date of First Pneumococcal Dose") < 12
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 42
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
extension:
  url:
    v: name
    l: name
  value: String
    v: Pneumococcal booster dose
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @output: Pneumococcal booster dose @description: Provision of the pneumococcal booster dose @trigger: Second pneumococcal dose from the primary series was administered and first pneumococcal dose was administered within 12 months post birth @pseudo: Child's birth AND Count of vaccines administered (where "Vaccine type" = "Pneumococcal vaccines" and "Type of dose" = "Primary series") = 2 AND ("Date and time of vaccination" (where "Vaccine type" = "Pneumococcal vaccines" AND "Dose number" = 1) − "Date of birth" < 12 months @triggerDate: "Date of birth" */ define "Pneumococcal booster dose": "Second pneumococcal dose from the primary series was administered. The primary series has been completed." and Encounter."The first pneumococcal dose was administered within 12 months post birth" and not "Pneumococcal booster dose was administered"
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 43
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
extension:
  url:
    v: name
    l: name
  value: String
    v: Pneumococcal booster dose Due Date
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @dynamicValue: Pneumococcal booster dose Due Date @pseudocode: "Date of birth" + 9 months */ define "Pneumococcal booster dose Due Date": if "Pneumococcal booster dose" then Patient.birthDate + 9 months else null
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 44
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
extension:
  url:
    v: name
    l: name
  value: String
    v: Pneumococcal booster dose Overdue
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @dynamicValue: Pneumococcal booster dose Overdue @pseudocode: "Date of birth" + 18 months */ define "Pneumococcal booster dose Overdue": if "Pneumococcal booster dose" then Patient.birthDate + 18 months else null
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 45
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
extension:
  url:
    v: name
    l: name
  value: String
    v: Pneumococcal booster dose Create
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @output: Pneumococcal booster dose Create @create: Pneumococcal booster dose should be provided if the client has received the 2 previous doses */ define "Pneumococcal booster dose Create": if "Pneumococcal booster dose" then 'Pneumococcal booster dose should be provided if the client has received the 2 previous doses' + ' Due Date: ' + ToString("Pneumococcal booster dose Due Date") + ' Overdue: ' + ToString("Pneumococcal booster dose Overdue") else ''
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 46
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZD2DTPneumococcalEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: No pneumococcal primary series doses were administered
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @input: No pneumococcal primary series doses were administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "Pneumococcal vaccines" and "Type of dose" = "Primary series") = 0 @code: No pneumococcal primary series doses were administered-121 @decision: IMMZ.D2.DT.Pneumococcal.2 doses with booster dose: 2 primary doses with a booster dose (2p+1) @decision: IMMZ.D2.DT.Pneumococcal.3 doses: 3 primary doses (3p+0) */ define "No pneumococcal primary series doses were administered": "Number of Pneumococcal Primary Series Doses Administered" = 0
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 47
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
extension:
  url:
    v: name
    l: name
  value: String
    v: Pneumococcal dose 1
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @output: Pneumococcal dose 1 @description: Provision of the pneumococcal dose 1 @trigger: Child's birth @pseudo: @triggerDate: "Date of birth" */ define "Pneumococcal dose 1": Encounter."The client's age is less than or equal to 5 years" and Encounter."No pneumococcal primary series doses were administered"
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 48
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
extension:
  url:
    v: name
    l: name
  value: String
    v: Pneumococcal dose 1 Due Date
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @dynamicValue: Pneumococcal dose 1 Due Date @pseudocode: "Date of birth" + 6 weeks */ define "Pneumococcal dose 1 Due Date": if "Pneumococcal dose 1" then Patient.birthDate + 6 weeks else null
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 49
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
extension:
  url:
    v: name
    l: name
  value: String
    v: Pneumococcal dose 1 Create
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @output: Pneumococcal dose 1 Create @create: Pneumococcal dose 1 should be provided if the client is older than 6 weeks */ define "Pneumococcal dose 1 Create": if "Pneumococcal dose 1" then 'Pneumococcal dose 1 should be provided if the client is older than 6 weeks' + ' Due Date: ' + ToString("Pneumococcal dose 1 Due Date") else ''
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 50
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZCommon
extension:
  url:
    v: name
    l: name
  value: String
    v: seriesPrimary
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /** * @description: Gets the doses from the primary series */ define fluent function seriesPrimary(immunizations List<Immunization>): immunizations I where exists( I.protocolApplied pa where pa.series = 'Primary series' )
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 51
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: FHIRHelpers
extension:
  url:
    v: name
    l: name
  value: String
    v: ToString
extension:
  url:
    v: statement
    l: statement
  value: String
    v: define function ToString(value string): value.value
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 52
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: FHIRHelpers
extension:
  url:
    v: name
    l: name
  value: String
    v: ToString
extension:
  url:
    v: statement
    l: statement
  value: String
    v: define function ToString(value ImmunizationStatus): value.value
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 53
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: FHIRHelpers
extension:
  url:
    v: name
    l: name
  value: String
    v: ToBoolean
extension:
  url:
    v: statement
    l: statement
  value: String
    v: define function ToBoolean(value boolean): value.value
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 54
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: FHIRHelpers
extension:
  url:
    v: name
    l: name
  value: String
    v: ToConcept
extension:
  url:
    v: statement
    l: statement
  value: String
    v: 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 }
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 55
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: FHIRHelpers
extension:
  url:
    v: name
    l: name
  value: String
    v: ToCode
extension:
  url:
    v: statement
    l: statement
  value: String
    v: 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 }
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 56
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: WHOCommon
extension:
  url:
    v: name
    l: name
  value: String
    v: earliest
extension:
  url:
    v: statement
    l: statement
  value: String
    v: define fluent function earliest(immunizations List<Immunization>): First( immunizations I sort by start of occurrence.toInterval() )
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 57
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZCommon
extension:
  url:
    v: name
    l: name
  value: String
    v: encounterOrOnBefore
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /** * @description: Gets observation from an encounter or on or before a date */ define fluent function encounterOrOnBefore(observations List<Observation>, EncounterId String, beforeDate Date): observations O where (O.encounter.references(EncounterId) or O.effective.toInterval() starts same day or before beforeDate)
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 58
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: WHOCommon
extension:
  url:
    v: name
    l: name
  value: String
    v: references
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @description: Returns true if the given reference is to the given resourceId @comment: Returns true if the `resourceId` parameter exactly equals the tail of the given reference. NOTE: This function assumes resources from the same source server. */ define fluent function references(reference FHIR.Reference, resourceId String): resourceId = Last(Split(reference.reference, '/'))
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 59
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: WHOCommon
extension:
  url:
    v: name
    l: name
  value: String
    v: complete
extension:
  url:
    v: statement
    l: statement
  value: String
    v: define fluent function complete(observations List<Observation>): observations O where O.status in { 'final', 'amended', 'corrected' }
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 60
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: FHIRHelpers
extension:
  url:
    v: name
    l: name
  value: String
    v: ToString
extension:
  url:
    v: statement
    l: statement
  value: String
    v: define function ToString(value ObservationStatus): value.value
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 61
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZCommon
extension:
  url:
    v: name
    l: name
  value: String
    v: seriesBooster
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /** * @description: Gets the doses from the Booster series */ define fluent function seriesBooster(immunizations List<Immunization>): immunizations I where exists( I.protocolApplied pa where pa.series = 'Booster dose' )
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 62
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: WHOCommon
extension:
  url:
    v: name
    l: name
  value: String
    v: mostRecent
extension:
  url:
    v: statement
    l: statement
  value: String
    v: define fluent function mostRecent(immunizations List<Immunization>): Last( immunizations I sort by start of occurrence.toInterval() )
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 63
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: FHIRHelpers
extension:
  url:
    v: name
    l: name
  value: String
    v: ToDate
extension:
  url:
    v: statement
    l: statement
  value: String
    v: define function ToDate(value date): value.value
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 64
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

v: EffectiveDataRequirements

v: active

coding:
  system:
    v: http://terminology.hl7.org/CodeSystem/library-type
    l: library-type
  code:
    v: module-definition

type:
  v: depends-on
display:
  v: FHIR model information
resource:
  v: http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1
  l: http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo

type:
  v: depends-on
display:
  v: Library Encounter
resource:
  v: http://smart.who.int/immunizations/Library/IMMZD2DTPneumococcalEncounterElements
  l: IMMZD2DTPneumococcalEncounterElements

type:
  v: depends-on
display:
  v: Library Common
resource:
  v: http://smart.who.int/immunizations/Library/IMMZCommon
  l: IMMZCommon

type:
  v: depends-on
display:
  v: Library FHIRHelpers
resource:
  v: http://fhir.org/guides/cqf/common/Library/FHIRHelpers|4.0.1
  l: http://fhir.org/guides/cqf/common/Library/FHIRHelpers

type:
  v: depends-on
display:
  v: Library Encounter
resource:
  v: http://smart.who.int/immunizations/Library/IMMZEncounterElements
  l: IMMZEncounterElements

type:
  v: depends-on
display:
  v: Library Elements
resource:
  v: http://smart.who.int/immunizations/Library/IMMZElements
  l: IMMZElements

type:
  v: depends-on
display:
  v: Library WC
resource:
  v: http://smart.who.int/immunizations/Library/WHOCommon
  l: WHOCommon

type:
  v: depends-on
display:
  v: Library FHIRHelpers
resource:
  v: http://fhir.org/guides/cqf/common/Library/FHIRHelpers|4.0.1
  l: http://fhir.org/guides/cqf/common/Library/FHIRHelpers

type:
  v: depends-on
display:
  v: Library Concepts
resource:
  v: http://smart.who.int/immunizations/Library/IMMZConcepts
  l: IMMZConcepts

type:
  v: depends-on
display:
  v: Library WC
resource:
  v: http://smart.who.int/immunizations/Library/WHOCommon
  l: WHOCommon

type:
  v: depends-on
display:
  v: Library Common
resource:
  v: http://smart.who.int/immunizations/Library/IMMZCommon
  l: IMMZCommon

type:
  v: depends-on
display:
  v: Library WC
resource:
  v: http://smart.who.int/immunizations/Library/WHOCommon
  l: WHOCommon

type:
  v: depends-on
display:
  v: Library Concepts
resource:
  v: http://smart.who.int/immunizations/Library/IMMZConcepts
  l: IMMZConcepts

type:
  v: depends-on
display:
  v: Code system IMMZD
resource:
  v: http://smart.who.int/immunizations/CodeSystem/IMMZ.D
  l: IMMZ.D

type:
  v: depends-on
display:
  v: Value set Pneumococcal vaccines
resource:
  v: http://smart.who.int/immunizations/ValueSet/IMMZ.Z.DE13
  l: IMMZ.Z.DE13

name:
  v: Today
use:
  v: in
min:
  v: 0
max:
  v: 1
type:
  v: date

name:
  v: EncounterId
use:
  v: in
min:
  v: 0
max:
  v: 1
type:
  v: string

name:
  v: Pneumococcal dose 2
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: boolean

name:
  v: Pneumococcal second booster dose
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: boolean

name:
  v: Pneumococcal dose 2 Create
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: string

name:
  v: Pneumococcal second booster dose Create
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: string

name:
  v: Pneumococcal booster dose
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: boolean

name:
  v: Pneumococcal booster dose Create
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: string

name:
  v: Pneumococcal dose 1 Create
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: string

name:
  v: Pneumococcal dose 1
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: boolean

type:
  v: Immunization
profile:
  v: http://hl7.org/fhir/StructureDefinition/Immunization
  l: Immunization
must support:
  v: status
must support:
  v: isSubpotent

type:
  v: Immunization
profile:
  v: http://hl7.org/fhir/StructureDefinition/Immunization
  l: Immunization
must support:
  v: status
must support:
  v: isSubpotent
must support:
  v: occurrence

type:
  v: Immunization
profile:
  v: http://hl7.org/fhir/StructureDefinition/Immunization
  l: Immunization
must support:
  v: status
must support:
  v: isSubpotent
must support:
  v: occurrence
must support:
  v: vaccineCode

type:
  v: Patient
profile:
  v: http://hl7.org/fhir/StructureDefinition/Patient
  l: Patient

type:
  v: Patient
profile:
  v: http://hl7.org/fhir/StructureDefinition/Patient
  l: Patient

type:
  v: Observation
profile:
  v: http://hl7.org/fhir/StructureDefinition/Observation
  l: Observation
must support:
  v: code
code filter:
  path:
    v: code
  code:
    system:
      v: http://smart.who.int/immunizations/CodeSystem/IMMZ.D
      l: IMMZ.D
    code:
      v: DE251
    display:
      v: At high risk for pneumococcal infection

type:
  v: Observation
profile:
  v: http://hl7.org/fhir/StructureDefinition/Observation
  l: Observation
must support:
  v: code
code filter:
  path:
    v: code
  code:
    system:
      v: http://smart.who.int/immunizations/CodeSystem/IMMZ.D
      l: IMMZ.D
    code:
      v: DE204
    display:
      v: HIV status

type:
  v: Observation
profile:
  v: http://hl7.org/fhir/StructureDefinition/Observation
  l: Observation
must support:
  v: code
code filter:
  path:
    v: code
  code:
    system:
      v: http://smart.who.int/immunizations/CodeSystem/IMMZ.D
      l: IMMZ.D
    code:
      v: DE208
    display:
      v: Preterm birth

type:
  v: Patient
profile:
  v: http://hl7.org/fhir/StructureDefinition/Patient
  l: Patient

type:
  v: Immunization
profile:
  v: http://hl7.org/fhir/StructureDefinition/Immunization
  l: Immunization
must support:
  v: status
must support:
  v: isSubpotent
must support:
  v: occurrence
must support:
  v: vaccineCode

type:
  v: Immunization
profile:
  v: http://hl7.org/fhir/StructureDefinition/Immunization
  l: Immunization
must support:
  v: status
must support:
  v: isSubpotent
must support:
  v: occurrence
must support:
  v: vaccineCode

type:
  v: Observation
profile:
  v: http://hl7.org/fhir/StructureDefinition/Observation
  l: Observation
must support:
  v: code
code filter:
  path:
    v: code
  code:
    system:
      v: http://smart.who.int/immunizations/CodeSystem/IMMZ.D
      l: IMMZ.D
    code:
      v: DE251
    display:
      v: At high risk for pneumococcal infection

type:
  v: Immunization
profile:
  v: http://hl7.org/fhir/StructureDefinition/Immunization
  l: Immunization
must support:
  v: status
must support:
  v: isSubpotent
must support:
  v: occurrence
must support:
  v: vaccineCode

type:
  v: Immunization
profile:
  v: http://hl7.org/fhir/StructureDefinition/Immunization
  l: Immunization
must support:
  v: status
must support:
  v: isSubpotent
must support:
  v: occurrence
must support:
  v: vaccineCode

type:
  v: Observation
profile:
  v: http://hl7.org/fhir/StructureDefinition/Observation
  l: Observation
must support:
  v: code
code filter:
  path:
    v: code
  code:
    system:
      v: http://smart.who.int/immunizations/CodeSystem/IMMZ.D
      l: IMMZ.D
    code:
      v: DE208
    display:
      v: Preterm birth

url:
  v: http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability
  l: cpg-knowledgeCapability
value: Code
  v: computable

url:
  v: http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-effectiveDataRequirements
  l: crmi-effectiveDataRequirements
value: Canonical
  v: #effective-data-requirements
  l: effective-data-requirements

v: 0.2.0

v: IMMZ.D18.S.Pneumococcal.2 doses with booster dose schedule

coding:
  system:
    v: http://terminology.hl7.org/CodeSystem/plan-definition-type
    l: plan-definition-type
  code:
    v: eca-rule

v: draft

v: false

v: 2026-03-29T17:23:09+00:00

v: WHO

name:
  v: WHO
telecom:
  system:
    v: url
  value:
    v: http://who.int

v: IMMZ.D18.S.Pneumococcal.2 doses with booster dose schedule 2 primary doses with a booster dose (2p+1) schedule

type:
  v: citation
citation:
  v: WHO recommendations for routine immunization - summary tables (January 2025)

title:
  v: Pneumococcal dose 1
description:
  v: Provision of the pneumococcal dose 1 Trigger event: Child's birth Trigger pseudo: Trigger date: "Date of birth" Create condition: Pneumococcal dose 1 should be provided if the client is older than 6 weeks
condition:
  kind:
    v: applicability
  expression:
    description:
      v: Pneumococcal dose 1
    language:
      v: text/cql-identifier
    expression:
      v: Pneumococcal dose 1
definition: Canonical
  v: http://smart.who.int/immunizations/ActivityDefinition/IMMZD2DTCR
  l: IMMZD2DTCR
dynamic value:
  path:
    v: status
  expression:
    language:
      v: text/cql-expression
    expression:
      v: 'active'
dynamic value:
  path:
    v: payload.contentString
  expression:
    language:
      v: text/cql-identifier
    expression:
      v: Pneumococcal dose 1 Create
dynamic value:
  path:
    v: category.coding
  expression:
    description:
      v: Category of communication
    language:
      v: text/cql-expression
    expression:
      v: Code { system: 'http://terminology.hl7.org/CodeSystem/communication-category', code: 'alert' }
dynamic value:
  path:
    v: priority
  expression:
    description:
      v: Alert priority
    language:
      v: text/cql-expression
    expression:
      v: Code { system: 'http://hl7.org/fhir/request-priority', code: 'routine' }

title:
  v: Pneumococcal dose 2
description:
  v: Provision of the pneumococcal dose 2 Trigger event: First pneumococcal dose from the primary series was administered to the client, who is less than or equal to 5 years of age, either within 24 months of birth or if client is at high risk for pneumococcal infection Trigger pseudo: Today's date − "Date of birth" ≤ 5 years AND Count of vaccines administered (where "Vaccine type" = "Pneumococcal vaccines" and "Type of dose" = "Primary series") = 1 AND ("Date and time of vaccination" (where "Vaccine type" = "Pneumococcal vaccines") − "Date of birth" < 24 months OR "At high risk for pneumococcal infection" = TRUE Trigger date: Date and time of vaccination" (where "Vaccine type" = "Pneumococcal vaccines") Create condition: Pneumococcal dose 2 should be provided if the client was given the previous dose more than 8 weeks ago
condition:
  kind:
    v: applicability
  expression:
    description:
      v: Pneumococcal dose 2
    language:
      v: text/cql-identifier
    expression:
      v: Pneumococcal dose 2
definition: Canonical
  v: http://smart.who.int/immunizations/ActivityDefinition/IMMZD2DTCR
  l: IMMZD2DTCR
dynamic value:
  path:
    v: status
  expression:
    language:
      v: text/cql-expression
    expression:
      v: 'active'
dynamic value:
  path:
    v: payload.contentString
  expression:
    language:
      v: text/cql-identifier
    expression:
      v: Pneumococcal dose 2 Create
dynamic value:
  path:
    v: category.coding
  expression:
    description:
      v: Category of communication
    language:
      v: text/cql-expression
    expression:
      v: Code { system: 'http://terminology.hl7.org/CodeSystem/communication-category', code: 'alert' }
dynamic value:
  path:
    v: priority
  expression:
    description:
      v: Alert priority
    language:
      v: text/cql-expression
    expression:
      v: Code { system: 'http://hl7.org/fhir/request-priority', code: 'routine' }

title:
  v: Pneumococcal booster dose
description:
  v: Provision of the pneumococcal booster dose Trigger event: Second pneumococcal dose from the primary series was administered and first pneumococcal dose was administered within 12 months post birth Trigger pseudo: Child's birth AND Count of vaccines administered (where "Vaccine type" = "Pneumococcal vaccines" and "Type of dose" = "Primary series") = 2 AND ("Date and time of vaccination" (where "Vaccine type" = "Pneumococcal vaccines" AND "Dose number" = 1) − "Date of birth" < 12 months Trigger date: "Date of birth" Create condition: Pneumococcal booster dose should be provided if the client has received the 2 previous doses
condition:
  kind:
    v: applicability
  expression:
    description:
      v: Pneumococcal booster dose
    language:
      v: text/cql-identifier
    expression:
      v: Pneumococcal booster dose
definition: Canonical
  v: http://smart.who.int/immunizations/ActivityDefinition/IMMZD2DTCR
  l: IMMZD2DTCR
dynamic value:
  path:
    v: status
  expression:
    language:
      v: text/cql-expression
    expression:
      v: 'active'
dynamic value:
  path:
    v: payload.contentString
  expression:
    language:
      v: text/cql-identifier
    expression:
      v: Pneumococcal booster dose Create
dynamic value:
  path:
    v: category.coding
  expression:
    description:
      v: Category of communication
    language:
      v: text/cql-expression
    expression:
      v: Code { system: 'http://terminology.hl7.org/CodeSystem/communication-category', code: 'alert' }
dynamic value:
  path:
    v: priority
  expression:
    description:
      v: Alert priority
    language:
      v: text/cql-expression
    expression:
      v: Code { system: 'http://hl7.org/fhir/request-priority', code: 'routine' }

title:
  v: Pneumococcal second booster dose
description:
  v: Provision of another booster dose for HIV-positive infants and preterm neonates Trigger event: The primary series has been completed and one booster dose was administered to the client, who is more than 12 months of age. The latest pneumococcal dose was administered within 12 months post birth. Client is either HIV positive or had a preterm birth Trigger pseudo: 'Today's date − "Date of birth" > 12 months AND "Completed the primary vaccination series" = TRUE (where "Vaccine type" = "Pneumococcal vaccines") AND Count of vaccines administered (where "Vaccine type" = "Pneumococcal vaccines" and "Type of dose" = "Booster dose") = 1 AND Latest "Date and time of vaccination" (where "Vaccine type" = "Pneumococcal vaccines") − "Date of birth" < 12 months AND ("HIV status" = "HIV-positive" OR "Preterm birth" = TRUE) Trigger date: "Date of birth" Create condition: HIV-positive infants and preterm neonates who have received their 3 primary vaccine doses before 12 months of age may benefit from a booster dose in the second year of life
condition:
  kind:
    v: applicability
  expression:
    description:
      v: Pneumococcal second booster dose
    language:
      v: text/cql-identifier
    expression:
      v: Pneumococcal second booster dose
definition: Canonical
  v: http://smart.who.int/immunizations/ActivityDefinition/IMMZD2DTCR
  l: IMMZD2DTCR
dynamic value:
  path:
    v: status
  expression:
    language:
      v: text/cql-expression
    expression:
      v: 'active'
dynamic value:
  path:
    v: payload.contentString
  expression:
    language:
      v: text/cql-identifier
    expression:
      v: Pneumococcal second booster dose Create
dynamic value:
  path:
    v: category.coding
  expression:
    description:
      v: Category of communication
    language:
      v: text/cql-expression
    expression:
      v: Code { system: 'http://terminology.hl7.org/CodeSystem/communication-category', code: 'alert' }
dynamic value:
  path:
    v: priority
  expression:
    description:
      v: Alert priority
    language:
      v: text/cql-expression
    expression:
      v: Code { system: 'http://hl7.org/fhir/request-priority', code: 'routine' }