IMMZD18SHPVSingleDose
type: PlanDefinition
node role: treeRoot
id:
  v: IMMZD18SHPVSingleDose
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: IMMZD18SHPVSingleDose Url: IMMZ.D18.S.Single-dose schedule Version: 0.2.0 Title: IMMZ.D18.S.Single-dose schedule Status: draft Type: system: http://terminology.hl7.org/CodeSystem/plan-definition-type code: eca-rule Date: 2026-03-03 13:07:11+0000 Publisher: WHO Description: IMMZ.D18.S.Single-dose schedule Alternative single-dose schedule Knowledge Capability: computable Related Artifacts: References WHO recommendations for routine immunization - summary tables (January 2025) Libraries: IMMZD18SHPVSingleDoseLogic Actions: Human papillomavirus (HPV) dose 1: Provision of the HPV dose 1 Trigger event: Child's birth Trigger pseudo: Trigger date: "Date of birth" Create condition: HPV dose 1 should be provided if the client is older than 9 years of age. If: Applicability: Human papillomavirus (HPV) dose 1 (Human papillomavirus (HPV) dose 1) Then: Definition: IMMZ.D2.DT.CR Dynamic Values: status: ('active') payload.contentString: (Human papillomavirus (HPV) 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' }) HPV dose 2 (Immunocompromised or HIV-positive): Provision of the HPV dose 2 for individuals immunocompromised or infected with HIV Trigger event: First HPV dose from the primary series was administered and client's HIV status is positive or client is immunocompromised Trigger pseudo: Count of vaccines administered (where "Vaccine type" = "HPV vaccines") = 1 AND ("HIV status" = "HIV-positive" OR "Immunocompromised" = TRUE) Trigger date: "Date and time of vaccination" (where "Vaccine type" = "HPV vaccines") Create condition: Individuals known to be immunocompromised or infected with HIV should receive at least two HPV vaccine doses. If: Applicability: HPV dose 2 (Immunocompromised or HIV-positive) (HPV dose 2 (Immunocompromised or HIV-positive)) Then: Definition: IMMZ.D2.DT.CR Dynamic Values: status: ('active'…
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: 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: DE209
      display:
        v: Immunocompromised
  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: IMMZD2DTHPVEncounterElements
    extension:
      url:
        v: name
        l: name
      value: String
        v: HPV Doses Administered to Patient
    extension:
      url:
        v: statement
        l: statement
      value: String
        v: /* @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"
    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: IMMZD2DTHPVEncounterElements
    extension:
      url:
        v: name
        l: name
      value: String
        v: HPV Primary Series Doses Administered to Patient
    extension:
      url:
        v: statement
        l: statement
      value: String
        v: /* @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()
    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: IMMZD2DTHPVEncounterElements
    extension:
      url:
        v: name
        l: name
      value: String
        v: Number of HPV Primary Series Doses Administered
    extension:
      url:
        v: statement
        l: statement
      value: String
        v: /* @internal: Number of HPV Primary Series doses */ define "Number of HPV Primary Series Doses Administered": Count("HPV Primary Series Doses Administered to Patient")
    extension:
      url:
        v: displaySequence
        l: displaySequence
      value: Integer
        v: 4
    url:
      v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
      l: cqf-logicDefinition
  extension:
    extension:
      url:
        v: libraryName
        l: libraryName
      value: String

String
v: IMMZD2DTHPVEncounterElements

url:
  v: name
  l: name
value: String
  v: Two HPV primary series doses were administered

url:
  v: statement
  l: statement
value: String
  v: /* @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 @code: Two HPV primary series doses were administered-112 @decision: IMMZ.D2.DT.HPV.2 doses: 2-dose schedule @decision: IMMZ.D2.DT.HPV.Single dose: Alternative single-dose schedule */ define "Two HPV primary series doses were administered": "Number of HPV Primary Series Doses Administered" = 2

url:
  v: displaySequence
  l: displaySequence
value: Integer
  v: 5

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZD18SHPVSingleDoseLogic
extension:
  url:
    v: name
    l: name
  value: String
    v: Second HPV dose from the primary series was administered
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @complete: Second HPV dose from the primary series was administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "HPV vaccines") = 2 */ define "Second HPV dose from the primary series was administered": Encounter."Two HPV primary series doses were 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: 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: 7
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: 8
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZD2DTHPVEncounterElements
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.HPV.2 doses: 2-dose schedule @decision: IMMZ.D2.DT.HPV.Single dose: Alternative single-dose schedule */ define "Client's HIV status is positive": Encounter."Client's HIV status is positive"
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: IMMZEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Immunocompromised Observation
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @internal: Immunocompromised Observation */ define "Immunocompromised Observation": ([Observation: Concepts."Immunocompromised"] O sort by end of effective.toInterval() desc).complete()
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: IMMZEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Client is immunocompromised
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @input: Client is immunocompromised @pseudocode: "Immunocompromised" = TRUE */ define "Client is immunocompromised": exists( "Immunocompromised Observation" ) and First( "Immunocompromised Observation" ).value = true
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: IMMZD2DTHPVEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Client is immunocompromised
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @input: Client is immunocompromised @pseudocode: "Immunocompromised" = TRUE @code: Client is immunocompromised-26 @decision: IMMZ.D2.DT.HPV.2 doses: 2-dose schedule @decision: IMMZ.D2.DT.HPV.Single dose: Alternative single-dose schedule */ define "Client is immunocompromised": Encounter."Client is immunocompromised"
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: IMMZD2DTHPVEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Three HPV primary series doses were administered
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @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 @code: Three HPV primary series doses were administered-112 @decision: IMMZ.D2.DT.HPV.2 doses: 2-dose schedule @decision: IMMZ.D2.DT.HPV.Single dose: Alternative single-dose schedule */ define "Three HPV primary series doses were administered": "Number of HPV Primary Series Doses Administered" = 3
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: IMMZD18SHPVSingleDoseLogic
extension:
  url:
    v: name
    l: name
  value: String
    v: Third HPV dose from the primary series was administered
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @complete: Third HPV dose from the primary series was administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "HPV vaccines") = 3 */ define "Third HPV dose from the primary series was administered": Encounter."Three HPV primary series doses were administered"
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: IMMZD18SHPVSingleDoseLogic
extension:
  url:
    v: name
    l: name
  value: String
    v: HPV dose 3 (Immunocompromised or HIV-positive)
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @output: HPV dose 3 (Immunocompromised or HIV-positive) @description: Provision of the HPV dose 3 for individuals immunocompromised or infected with HIV @trigger: Second HPV dose from the primary series was administered and client's HIV status is positive or client is immunocompromised @pseudo: Count of vaccines administered (where "Vaccine type" = "HPV vaccines") = 2 AND ("HIV status" = "HIV-positive" OR "Immunocompromised" = TRUE) @triggerDate: Latest "Date and time of vaccination" (where "Vaccine type" = "HPV vaccines") */ define "HPV dose 3 (Immunocompromised or HIV-positive)": "Second HPV dose from the primary series was administered" and ( Encounter."Client's HIV status is positive" or Encounter."Client is immunocompromised" ) and not "Third HPV dose from the primary series was administered"
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
    v: IMMZD2DTHPVEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Date of Latest HPV Dose
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @internal: Date of Latest HPV Dose */ define "Date of Latest HPV Dose": date from start of "HPV Doses Administered to Patient".mostRecent().occurrence.toInterval()
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
    v: IMMZD18SHPVSingleDoseLogic
extension:
  url:
    v: name
    l: name
  value: String
    v: HPV dose 3 (Immunocompromised or HIV-positive) Due Date
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @dynamicValue: HPV dose 3 (Immunocompromised or HIV-positive) Due Date @pseudocode: Latest "Date and time of vaccination" (where "Vaccine type" = "HPV vaccines") + 6 months */ define "HPV dose 3 (Immunocompromised or HIV-positive) Due Date": if "HPV dose 3 (Immunocompromised or HIV-positive)" then Encounter."Date of Latest HPV Dose" + 6 months else null
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: IMMZD18SHPVSingleDoseLogic
extension:
  url:
    v: name
    l: name
  value: String
    v: HPV dose 3 (Immunocompromised or HIV-positive) Create
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @output: HPV dose 3 (Immunocompromised or HIV-positive) Create @create: Where possible, three HPV doses should be provided to individuals known to be immunocompromised or infected with HIV. */ define "HPV dose 3 (Immunocompromised or HIV-positive) Create": if "HPV dose 3 (Immunocompromised or HIV-positive)" then 'Where possible, three HPV doses should be provided to individuals known to be immunocompromised or infected with HIV.' + ' Due Date: ' + ToString("HPV dose 3 (Immunocompromised or HIV-positive) Due Date") else ''
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: IMMZD2DTHPVEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: No HPV primary series doses were administered
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @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 @code: No HPV primary series doses were administered-112 @decision: IMMZ.D2.DT.HPV.2 doses: 2-dose schedule @decision: IMMZ.D2.DT.HPV.Single dose: Alternative single-dose schedule */ define "No HPV primary series doses were administered": "Number of HPV Primary Series Doses Administered" = 0
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: IMMZD2DTHPVEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: One HPV primary series dose was administered
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @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 @code: One HPV primary series dose was administered-112 @decision: IMMZ.D2.DT.HPV.2 doses: 2-dose schedule @decision: IMMZ.D2.DT.HPV.Single dose: Alternative single-dose schedule */ define "One HPV primary series dose was administered": "Number of HPV Primary 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
    v: IMMZD18SHPVSingleDoseLogic
extension:
  url:
    v: name
    l: name
  value: String
    v: First HPV dose from the primary series was administered
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @complete: First HPV dose from the primary series was administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "HPV vaccines") = 1 */ define "First HPV dose from the primary series was administered": Encounter."One HPV primary series 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: IMMZD18SHPVSingleDoseLogic
extension:
  url:
    v: name
    l: name
  value: String
    v: Human papillomavirus (HPV) dose 1
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @output: Human papillomavirus (HPV) dose 1 @description: Provision of the HPV dose 1 @trigger: Child's birth @pseudo: @triggerDate: "Date of birth" */ define "Human papillomavirus (HPV) dose 1": Encounter."No HPV primary series doses were administered" and not "First HPV dose from the primary series was administered"
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: IMMZD18SHPVSingleDoseLogic
extension:
  url:
    v: name
    l: name
  value: String
    v: Human papillomavirus (HPV) dose 1 Due Date
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @dynamicValue: Human papillomavirus (HPV) dose 1 Due Date @pseudocode: "Date of birth" + 9 years */ define "Human papillomavirus (HPV) dose 1 Due Date": if "Human papillomavirus (HPV) dose 1" then Patient.birthDate + 9 years else null
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: IMMZD18SHPVSingleDoseLogic
extension:
  url:
    v: name
    l: name
  value: String
    v: Human papillomavirus (HPV) dose 1 Overdue
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @dynamicValue: Human papillomavirus (HPV) dose 1 Overdue @pseudocode: "Date of birth" + 20 years */ define "Human papillomavirus (HPV) dose 1 Overdue": if "Human papillomavirus (HPV) dose 1" then Patient.birthDate + 20 years else null
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: IMMZD18SHPVSingleDoseLogic
extension:
  url:
    v: name
    l: name
  value: String
    v: Human papillomavirus (HPV) dose 1 Create
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @output: Human papillomavirus (HPV) dose 1 Create @create: HPV dose 1 should be provided if the client is older than 9 years of age. */ define "Human papillomavirus (HPV) dose 1 Create": if "Human papillomavirus (HPV) dose 1" then 'HPV dose 1 should be provided if the client is older than 9 years of age.' + ' Due Date: ' + ToString("Human papillomavirus (HPV) dose 1 Due Date") + ' Overdue: ' + ToString("Human papillomavirus (HPV) dose 1 Overdue") else ''
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: IMMZD18SHPVSingleDoseLogic
extension:
  url:
    v: name
    l: name
  value: String
    v: HPV dose 2 (Immunocompromised or HIV-positive)
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @output: HPV dose 2 (Immunocompromised or HIV-positive) @description: Provision of the HPV dose 2 for individuals immunocompromised or infected with HIV @trigger: First HPV dose from the primary series was administered and client's HIV status is positive or client is immunocompromised @pseudo: Count of vaccines administered (where "Vaccine type" = "HPV vaccines") = 1 AND ("HIV status" = "HIV-positive" OR "Immunocompromised" = TRUE) @triggerDate: "Date and time of vaccination" (where "Vaccine type" = "HPV vaccines") */ define "HPV dose 2 (Immunocompromised or HIV-positive)": "First HPV dose from the primary series was administered" and ( Encounter."Client's HIV status is positive" or Encounter."Client is immunocompromised" ) and not "Second HPV dose from the primary series was administered"
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: IMMZD18SHPVSingleDoseLogic
extension:
  url:
    v: name
    l: name
  value: String
    v: HPV dose 2 (Immunocompromised or HIV-positive) Due Date
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @dynamicValue: HPV dose 2 (Immunocompromised or HIV-positive) Due Date @pseudocode: "Date and time of vaccination" (where "Vaccine type" = "HPV vaccines") + 6 months */ define "HPV dose 2 (Immunocompromised or HIV-positive) Due Date": if "HPV dose 2 (Immunocompromised or HIV-positive)" then Encounter."Date of Latest HPV Dose" + 6 months else null
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: IMMZD18SHPVSingleDoseLogic
extension:
  url:
    v: name
    l: name
  value: String
    v: HPV dose 2 (Immunocompromised or HIV-positive) Create
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @output: HPV dose 2 (Immunocompromised or HIV-positive) Create @create: Individuals known to be immunocompromised or infected with HIV should receive at least two HPV vaccine doses. */ define "HPV dose 2 (Immunocompromised or HIV-positive) Create": if "HPV dose 2 (Immunocompromised or HIV-positive)" then 'Individuals known to be immunocompromised or infected with HIV should receive at least two HPV vaccine doses.' + ' Due Date: ' + ToString("HPV dose 2 (Immunocompromised or HIV-positive) Due Date") else ''
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: 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: 29
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: 30
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: 31
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: 32
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: 33
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: 34
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: 35
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: 36
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: 37
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: 38
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: 39
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: 40
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/IMMZD2DTHPVEncounterElements
  l: IMMZD2DTHPVEncounterElements

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 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: Library WC
resource:
  v: http://smart.who.int/immunizations/Library/WHOCommon
  l: WHOCommon

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 HPV vaccines
resource:
  v: http://smart.who.int/immunizations/ValueSet/IMMZ.Z.DE7
  l: IMMZ.Z.DE7

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: HPV dose 3 (Immunocompromised or HIV-positive) Create
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: string

name:
  v: Human papillomavirus (HPV) dose 1 Create
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: string

name:
  v: HPV dose 2 (Immunocompromised or HIV-positive)
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: boolean

name:
  v: HPV dose 3 (Immunocompromised or HIV-positive)
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: boolean

name:
  v: HPV dose 2 (Immunocompromised or HIV-positive) Create
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: string

name:
  v: Human papillomavirus (HPV) 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: 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: DE209
    display:
      v: Immunocompromised

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

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: IMMZD18SHPVSingleDose

v: IMMZ.D18.S.Single-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-03T13:07:11+00:00

v: WHO

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

v: IMMZ.D18.S.Single-dose schedule Alternative single-dose schedule

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

title:
  v: Human papillomavirus (HPV) dose 1
description:
  v: Provision of the HPV dose 1 Trigger event: Child's birth Trigger pseudo: Trigger date: "Date of birth" Create condition: HPV dose 1 should be provided if the client is older than 9 years of age.
condition:
  kind:
    v: applicability
  expression:
    description:
      v: Human papillomavirus (HPV) dose 1
    language:
      v: text/cql-identifier
    expression:
      v: Human papillomavirus (HPV) 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: Human papillomavirus (HPV) 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: HPV dose 2 (Immunocompromised or HIV-positive)
description:
  v: Provision of the HPV dose 2 for individuals immunocompromised or infected with HIV Trigger event: First HPV dose from the primary series was administered and client's HIV status is positive or client is immunocompromised Trigger pseudo: Count of vaccines administered (where "Vaccine type" = "HPV vaccines") = 1 AND ("HIV status" = "HIV-positive" OR "Immunocompromised" = TRUE) Trigger date: "Date and time of vaccination" (where "Vaccine type" = "HPV vaccines") Create condition: Individuals known to be immunocompromised or infected with HIV should receive at least two HPV vaccine doses.
condition:
  kind:
    v: applicability
  expression:
    description:
      v: HPV dose 2 (Immunocompromised or HIV-positive)
    language:
      v: text/cql-identifier
    expression:
      v: HPV dose 2 (Immunocompromised or HIV-positive)
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: HPV dose 2 (Immunocompromised or HIV-positive) 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: HPV dose 3 (Immunocompromised or HIV-positive)
description:
  v: Provision of the HPV dose 3 for individuals immunocompromised or infected with HIV Trigger event: Second HPV dose from the primary series was administered and client's HIV status is positive or client is immunocompromised Trigger pseudo: Count of vaccines administered (where "Vaccine type" = "HPV vaccines") = 2 AND ("HIV status" = "HIV-positive" OR "Immunocompromised" = TRUE) Trigger date: Latest "Date and time of vaccination" (where "Vaccine type" = "HPV vaccines") Create condition: Where possible, three HPV doses should be provided to individuals known to be immunocompromised or infected with HIV.
condition:
  kind:
    v: applicability
  expression:
    description:
      v: HPV dose 3 (Immunocompromised or HIV-positive)
    language:
      v: text/cql-identifier
    expression:
      v: HPV dose 3 (Immunocompromised or HIV-positive)
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: HPV dose 3 (Immunocompromised or HIV-positive) 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' }