IMMZD2DTDTPPregnancyStartingWith4Doses
type: PlanDefinition
node role: treeRoot
id:
  v: IMMZD2DTDTPPregnancyStartingWith4Doses
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: IMMZD2DTDTPPregnancyStartingWith4Doses Url: IMMZ.D2.DT.DTP.Pregnancy starting with 4 doses Version: 0.2.0 Title: IMMZ.D2.DT.DTP.Pregnancy starting with 4 doses 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.D2.DT.DTP.Pregnancy starting with 4 doses Diphtheria and tetanus vaccination schedule in pregnant women who received 4 childhood DTP doses Knowledge Capability: computable Related Artifacts: References WHO recommendations for routine immunization - summary tables (January 2025) Libraries: IMMZD2DTDTPPregnancyStartingWith4DosesLogic Actions: Determine if the client is due for DTP.: Determine if the client is due for DTP vaccine according to the national immunization protocol. Diphtheria and tetanus vaccination schedule in pregnant women who received 4 childhood DTP doses If: Applicability: Client is due for tetanus and diphtheria booster dose (Client is due for tetanus and diphtheria booster dose) Then: Definition: IMMZD2DTMR Dynamic Values: status: ('draft') intent: ('proposal') medication: (Concept { codes: { Code { system: 'http://smart.who.int/immunizations/CodeSystem/IMMZ.Z', code: 'DE28', display: 'Tetanus and diphtheria-containing vaccines' } }, display: 'Tetanus and diphtheria-containing vaccines' }) Check for Guidance for the patient regarding IMMZ.D2.DT.DTP.Pregnancy starting with 4 doses.: Show Guidance for the patient regarding IMMZ.D2.DT.DTP.Pregnancy starting with 4 doses. If: Applicability: Has Guidance (Has Guidance) Then: Definition: IMMZ.D2.DT.CR Dynamic Values: status: ('active') payload.contentString: (Guidance) category.coding: (Code { system: 'http://terminology.hl7.org/CodeSystem/communication-category', code: 'alert' }) priority: (Code { system: 'http://hl7.org/fhir/request-priority', code: 'routine' })
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: DE161
      display:
        v: Potential contraindications
  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: DE162
      display:
        v: Currently pregnant
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode
      l: cqf-directReferenceCode
    value: Coding
      system:
        v: http://terminology.hl7.org/CodeSystem/condition-clinical
        l: condition-clinical
      code:
        v: active
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode
      l: cqf-directReferenceCode
    value: Coding
      system:
        v: http://terminology.hl7.org/CodeSystem/condition-clinical
        l: condition-clinical
      code:
        v: recurrence
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode
      l: cqf-directReferenceCode
    value: Coding
      system:
        v: http://terminology.hl7.org/CodeSystem/condition-clinical
        l: condition-clinical
      code:
        v: relapse
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode
      l: cqf-directReferenceCode
    value: Coding
      type: https://loinc.org/rdf/82810-3
      system:
        v: http://loinc.org
        l: loinc.org
      code:
        v: 82810-3
      display:
        v: Pregnancy status
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode
      l: cqf-directReferenceCode
    value: Coding
      type: LA15173-0
      system:
        v: http://loinc.org
        l: loinc.org
      code:
        v: LA15173-0
      display:
        v: Pregnant
  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: IMMZD2DTDTPElements
    extension:
      url:
        v: name
        l: name
      value: String
        v: DTP Doses Administered to Patient
    extension:
      url:
        v: statement
        l: statement
      value: String
        v: /* @internal: DTP containing Doses Administered to Patient */ define "DTP Doses Administered to Patient": Elements."Doses Administered to Patient" I where I.vaccineCode in Concepts."DTP-containing vaccines"
    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: IMMZD2DTDTPElements
    extension:
      url:
        v: name
        l: name
      value: String
        v: DTP Primary Series Doses Administered to Patient
    extension:
      url:
        v: statement
        l: statement
      value: String
        v: /* @internal: DTP containing Doses Administered to Patient that are in the Primary series */ define "DTP Primary Series Doses Administered to Patient": "DTP Doses Administered to Patient".seriesPrimary()
    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: IMMZD2DTDTPEncounterElements
    extension:
      url:
        v: name
        l: name
      value: String
        v: DTP Primary Series Doses Administered to Patient
    extension:
      url:
        v: statement
        l: statement
      value: String

String
v: /* @internal: DTP containing Doses Administered to Patient that are in the Primary series */ define "DTP Primary Series Doses Administered to Patient": DTPElements."DTP Primary Series Doses Administered to Patient".onOrBefore(Today)

url:
  v: displaySequence
  l: displaySequence
value: Integer
  v: 3

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZD2DTDTPEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Number of DTP Primary Series Doses Administered
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @internal: Number of DTP Primary Series doses */ define "Number of DTP Primary Series Doses Administered": Count("DTP 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:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: IMMZD2DTDTPEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Three DTP primary series doses were administered
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @input: Three DTP primary series doses were administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "DTP-containing vaccines" and "Type of dose" = "Primary series") = 3 @code: Three DTP primary series doses were administered-123 @decision: IMMZ.D2.DT.DTP.On-time start: DTP vaccination schedule, on-time start (at ≤ 12 months of age) @decision: IMMZ.D2.DT.DTP.Delayed or interrupted series: DTP vaccination schedule for the following groups: children ≥ 1 year of age with no previous immunization, adolescents and adults with no previous immunization (including pregnant women) and supplementary immunization activities in high-risk areas, for women of reproductive age @decision: IMMZ.D2.DT.DTP.Pregnancy: Determine whether DTP-containing vaccines are needed for pregnant women @decision: IMMZ.D2.DT.DTP.Pregnancy starting with 3 doses: Diphtheria and tetanus vaccination schedule in pregnant women who received 3 childhood DTP doses @decision: IMMZ.D2.DT.DTP.Pregnancy starting with 4 doses: Diphtheria and tetanus vaccination schedule in pregnant women who received 4 childhood DTP doses */ define "Three DTP primary series doses were administered": "Number of DTP Primary Series Doses Administered" = 3
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
    v: IMMZD2DTDTPElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Td Doses Administered to Patient
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @internal: Td Doses Administered to Patient */ define "Td Doses Administered to Patient": Elements."Doses Administered to Patient" I where I.vaccineCode in Concepts."Tetanus and diphtheria-containing vaccines"
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: IMMZD2DTDTPElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Td Booster Series Doses Administered to Patient
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @internal: Td Booster Series Doses Administered to Patient */ define "Td Booster Series Doses Administered to Patient": "Td Doses Administered to Patient".seriesBooster()
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: IMMZD2DTDTPEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Td Booster Series Doses Administered to Patient
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @internal: Td Booster Series Doses Administered to Patient */ define "Td Booster Series Doses Administered to Patient": DTPElements."Td Booster Series Doses Administered to Patient".onOrBefore(Today)
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: IMMZD2DTDTPEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Number of Td Booster Series Doses Administered
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @internal: Number of Td Booster Series Doses Administered */ define "Number of Td Booster Series Doses Administered": Count("Td Booster Series Doses Administered to Patient")
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: IMMZD2DTDTPEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: One tetanus and diphtheria booster dose was administered
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @input: One tetanus and diphtheria booster dose was administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "Tetanus and diphtheria-containing vaccines" and "Type of dose" = "Booster dose") = 1 @code: One tetanus and diphtheria booster dose was administered-140 @decision: IMMZ.D2.DT.DTP.On-time start: DTP vaccination schedule, on-time start (at ≤ 12 months of age) @decision: IMMZ.D2.DT.DTP.Delayed or interrupted series: DTP vaccination schedule for the following groups: children ≥ 1 year of age with no previous immunization, adolescents and adults with no previous immunization (including pregnant women) and supplementary immunization activities in high-risk areas, for women of reproductive age @decision: IMMZ.D2.DT.DTP.Pregnancy: Determine whether DTP-containing vaccines are needed for pregnant women @decision: IMMZ.D2.DT.DTP.Pregnancy starting with 4 doses: Diphtheria and tetanus vaccination schedule in pregnant women who received 4 childhood DTP doses */ define "One tetanus and diphtheria booster dose was administered": "Number of Td Booster Series Doses Administered" = 1
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: Potential contraindications
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @internal: Potential contraindications observations */ define "Potential contraindications": ([Observation: Concepts."Potential contraindications"]).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: IMMZElements
extension:
  url:
    v: name
    l: name
  value: String
    v: CI Currently pregnant Observation
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @internal: Observation for currently pregnant */ define "CI Currently pregnant Observation": "Potential contraindications" O where O.value ~ Concepts."CI-Currently pregnant"
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: CI Currently pregnant Observation
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @internal: Observation for currently pregnant */ define "CI Currently pregnant Observation": Elements."CI Currently pregnant Observation" O where O.encounter.references(EncounterId) or O.effective.toInterval() starts same day or after Today - 9 months
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: IMMZElements
extension:
  url:
    v: name
    l: name
  value: String
    v: CI Currently pregnant Condition
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @internal: Condition for currently pregnant */ define "CI Currently pregnant Condition": [Condition: Concepts."CI-Currently pregnant"]
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: IMMZEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: CI Currently pregnant Condition
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @internal: Condition for currently pregnant */ define "CI Currently pregnant Condition": Elements."CI Currently pregnant Condition" C where C.prevalenceInterval() includes Today
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: WHOElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Pregnancy Status Observation
extension:
  url:
    v: statement
    l: statement
  value: String
    v: define "Pregnancy Status Observation": [Observation: Concepts."Pregnancy status"] O where O.status in { 'final', 'amended', 'corrected' }
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: WHOElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Pregnant Observation
extension:
  url:
    v: statement
    l: statement
  value: String
    v: define "Pregnant Observation": "Pregnancy Status Observation" O where O.value ~ Concepts."Pregnant"
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: WHOEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Pregnant Observation
extension:
  url:
    v: statement
    l: statement
  value: String
    v: define "Pregnant Observation": Elements."Pregnant Observation" O where O.encounter.references(EncounterId) or O.effective.toInterval() starts same day or after AsOf - 9 months
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: IMMZEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: The client is pregnant
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @input: The client is pregnant @pseudocode: "Potential contraindications" = "Currently pregnant" */ define "The client is pregnant": exists "CI Currently pregnant Observation" or exists "CI Currently pregnant Condition" or exists WE."Pregnant Observation"
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: IMMZD2DTDTPEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Client is currently pregnant
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @input: Client is currently pregnant @pseudocode: "Currently pregnant" = TRUE @code: Client is currently pregnant-27 @decision: IMMZ.D2.DT.DTP.Pregnancy: Determine whether DTP-containing vaccines are needed for pregnant women @decision: IMMZ.D2.DT.DTP.Pregnancy starting with 3 doses: Diphtheria and tetanus vaccination schedule in pregnant women who received 3 childhood DTP doses @decision: IMMZ.D2.DT.DTP.Pregnancy starting with 4 doses: Diphtheria and tetanus vaccination schedule in pregnant women who received 4 childhood DTP doses */ define "Client is currently pregnant": Encounter."The client is pregnant"
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: Client is due for tetanus and diphtheria booster dose Case 1
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @output: Client is due for tetanus and diphtheria booster dose Case 1 @pseudocode: "Immunization recommendation status" = "Due" (where "Vaccine type" = "Tetanus and diphtheria-containing vaccines") */ define "Client is due for tetanus and diphtheria booster dose Case 1": Encounter."Three DTP primary series doses were administered" and Encounter."One tetanus and diphtheria booster dose was administered" and Encounter."Client is currently pregnant"
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: IMMZD2DTDTPEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Two tetanus and diphtheria booster doses were administered
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @input: Two tetanus and diphtheria booster doses were administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "Tetanus and diphtheria-containing vaccines" and "Type of dose" = "Booster dose") = 2 @code: Two tetanus and diphtheria booster doses were administered-140 @decision: IMMZ.D2.DT.DTP.On-time start: DTP vaccination schedule, on-time start (at ≤ 12 months of age) @decision: IMMZ.D2.DT.DTP.Delayed or interrupted series: DTP vaccination schedule for the following groups: children ≥ 1 year of age with no previous immunization, adolescents and adults with no previous immunization (including pregnant women) and supplementary immunization activities in high-risk areas, for women of reproductive age @decision: IMMZ.D2.DT.DTP.Pregnancy: Determine whether DTP-containing vaccines are needed for pregnant women @decision: IMMZ.D2.DT.DTP.Pregnancy starting with 3 doses: Diphtheria and tetanus vaccination schedule in pregnant women who received 3 childhood DTP doses @decision: IMMZ.D2.DT.DTP.Pregnancy starting with 4 doses: Diphtheria and tetanus vaccination schedule in pregnant women who received 4 childhood DTP doses */ define "Two tetanus and diphtheria booster doses were administered": "Number of Td Booster Series Doses Administered" = 2
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: IMMZD2DTDTPEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Td Doses Administered to Patient
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @internal: Td Doses Administered to Patient */ define "Td Doses Administered to Patient": DTPElements."Td Doses Administered to Patient".onOrBefore(Today)
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: IMMZD2DTDTPEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Date of Latest Td Dose
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @internal: Date of Latest Td Dose */ define "Date of Latest Td Dose": date from start of "Td Doses Administered to Patient".mostRecent().occurrence.toInterval()
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: IMMZD2DTDTPEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: The latest tetanus and diphtheria dose was administered less than 1 year ago
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @input: The latest tetanus and diphtheria dose was administered less than 1 year ago @pseudocode: Today's date − latest "Date and time of vaccination" (where "Vaccine type" = "Tetanus and diphtheria-containing vaccines") < 1 year @code: The latest tetanus and diphtheria dose was administered less than 1 year ago-131 @decision: IMMZ.D2.DT.DTP.Delayed or interrupted series: DTP vaccination schedule for the following groups: children ≥ 1 year of age with no previous immunization, adolescents and adults with no previous immunization (including pregnant women) and supplementary immunization activities in high-risk areas, for women of reproductive age @decision: IMMZ.D2.DT.DTP.Pregnancy starting with 3 doses: Diphtheria and tetanus vaccination schedule in pregnant women who received 3 childhood DTP doses @decision: IMMZ.D2.DT.DTP.Pregnancy starting with 4 doses: Diphtheria and tetanus vaccination schedule in pregnant women who received 4 childhood DTP doses */ define "The latest tetanus and diphtheria dose was administered less than 1 year ago": "Date of Latest Td Dose" is not null and duration in years between "Date of Latest Td Dose" and Today < 1
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: IMMZD2DTDTPEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: The latest tetanus and diphtheria dose was administered more than 1 year ago
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @input: The latest tetanus and diphtheria dose was administered more than 1 year ago @pseudocode: Today's date − latest "Date and time of vaccination" (where "Vaccine type" = "Tetanus and diphtheria-containing vaccines") ≥ 1 year @code: The latest tetanus and diphtheria dose was administered more than 1 year ago-131 @decision: IMMZ.D2.DT.DTP.Delayed or interrupted series: DTP vaccination schedule for the following groups: children ≥ 1 year of age with no previous immunization, adolescents and adults with no previous immunization (including pregnant women) and supplementary immunization activities in high-risk areas, for women of reproductive age @decision: IMMZ.D2.DT.DTP.Pregnancy starting with 3 doses: Diphtheria and tetanus vaccination schedule in pregnant women who received 3 childhood DTP doses @decision: IMMZ.D2.DT.DTP.Pregnancy starting with 4 doses: Diphtheria and tetanus vaccination schedule in pregnant women who received 4 childhood DTP doses */ define "The latest tetanus and diphtheria dose was administered more than 1 year ago": not("The latest tetanus and diphtheria dose was administered less than 1 year ago")
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
extension:
  url:
    v: name
    l: name
  value: String
    v: Client is due for tetanus and diphtheria booster dose Case 2
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @output: Client is due for tetanus and diphtheria booster dose Case 2 @pseudocode: "Immunization recommendation status" = "Due" (where "Vaccine type" = "Tetanus and diphtheria-containing vaccines") */ define "Client is due for tetanus and diphtheria booster dose Case 2": Encounter."Three DTP primary series doses were administered" and Encounter."Two tetanus and diphtheria booster doses were administered" and Encounter."The latest tetanus and diphtheria dose was administered more than 1 year ago"
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
extension:
  url:
    v: name
    l: name
  value: String
    v: Client is due for tetanus and diphtheria booster dose
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @output: Client is due for tetanus and diphtheria booster dose @pseudocode: "Immunization recommendation status" = "Due" (where "Vaccine type" = "Tetanus and diphtheria-containing vaccines") */ define "Client is due for tetanus and diphtheria booster dose": "Client is due for tetanus and diphtheria booster dose Case 1" or "Client is due for tetanus and diphtheria booster dose Case 2"
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
extension:
  url:
    v: name
    l: name
  value: String
    v: Client is due for tetanus and diphtheria booster dose Guidance
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @output: Client is due for tetanus and diphtheria booster dose Guidance @guidance = Should vaccinate client with second tetanus and diphtheria booster dose as three DTP primary series doses and one tetanus and diphtheria booster dose were administered and client is currently pregnant. Check for contraindications. @guidance = Should vaccinate client with third tetanus and diphtheria booster dose as the latest tetanus and diphtheria dose was administered more than 1 year ago. This dose should be administered at least 1 year after second booster dose or during next pregnancy. Check for contraindications. */ define "Client is due for tetanus and diphtheria booster dose Guidance": case when "Client is due for tetanus and diphtheria booster dose Case 1" then 'Should vaccinate client with second tetanus and diphtheria booster dose as three DTP primary series doses and one tetanus and diphtheria booster dose were administered and client is currently pregnant. Check for contraindications.' when "Client is due for tetanus and diphtheria booster dose Case 2" then 'Should vaccinate client with third tetanus and diphtheria booster dose as the latest tetanus and diphtheria dose was administered more than 1 year ago. This dose should be administered at least 1 year after second booster dose or during next pregnancy. Check for contraindications.' else '' end
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
extension:
  url:
    v: name
    l: name
  value: String
    v: Client is not due for tetanus and diphtheria booster dose
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @output: Client is not due for tetanus and diphtheria booster dose @pseudocode: "Immunization recommendation status" = "Not due" (where "Vaccine type" = "Tetanus and diphtheria-containing vaccines") */ define "Client is not due for tetanus and diphtheria booster dose": Encounter."Three DTP primary series doses were administered" and Encounter."Two tetanus and diphtheria booster doses were administered" and Encounter."The latest tetanus and diphtheria dose was administered less than 1 year ago"
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
extension:
  url:
    v: name
    l: name
  value: String
    v: Client is not due for tetanus and diphtheria booster dose Guidance
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @output: Client is not due for tetanus and diphtheria booster dose Guidance @guidance: Should not vaccinate client with third tetanus and diphtheria booster dose as the latest tetanus and booster dose was administered less than 1 year ago. This dose should be administered at least 1 year after second booster dose or during next pregnancy. Check for any other vaccines due and inform the caregiver of when to come back for third tetanus and diphtheria booster dose. */ define "Client is not due for tetanus and diphtheria booster dose Guidance": 'Should not vaccinate client with third tetanus and diphtheria booster dose as the latest tetanus and booster dose was administered less than 1 year ago. This dose should be administered at least 1 year after second booster dose or during next pregnancy. Check for any other vaccines due and inform the caregiver of when to come back for third tetanus and diphtheria booster dose.'
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: IMMZD2DTDTPEncounterElements
extension:
  url:
    v: name
    l: name
  value: String
    v: Three tetanus and diphtheria booster doses were administered
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @input: Three tetanus and diphtheria booster doses were administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "Tetanus and diphtheria-containing vaccines" and "Type of dose" = "Booster dose") = 3 @code: Three tetanus and diphtheria booster doses were administered-140 @decision: IMMZ.D2.DT.DTP.On-time start: DTP vaccination schedule, on-time start (at ≤ 12 months of age) @decision: IMMZ.D2.DT.DTP.Pregnancy: Determine whether DTP-containing vaccines are needed for pregnant women @decision: IMMZ.D2.DT.DTP.Pregnancy starting with 3 doses: Diphtheria and tetanus vaccination schedule in pregnant women who received 3 childhood DTP doses @decision: IMMZ.D2.DT.DTP.Pregnancy starting with 4 doses: Diphtheria and tetanus vaccination schedule in pregnant women who received 4 childhood DTP doses */ define "Three tetanus and diphtheria booster doses were administered": "Number of Td Booster Series Doses Administered" = 3
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
extension:
  url:
    v: name
    l: name
  value: String
    v: Tetanus and diphtheria immunization schedule is complete
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @output: Tetanus and diphtheria immunization schedule is complete @pseudocode: "Immunization recommendation status" = "Complete" (where "Vaccine type" = "Tetanus and diphtheria-containing vaccines") */ define "Tetanus and diphtheria immunization schedule is complete": Encounter."Three DTP primary series doses were administered" and Encounter."Three tetanus and diphtheria booster doses were administered"
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: Tetanus and diphtheria immunization schedule is complete Guidance
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @output: Tetanus and diphtheria immunization schedule is complete Guidance @guidance: Tetanus and diphtheria immunization schedule is complete. Three DTP primary series doses and three tetanus and diphtheria booster doses were administered. Check for any other vaccines due. */ define "Tetanus and diphtheria immunization schedule is complete Guidance": 'Tetanus and diphtheria immunization schedule is complete. Three DTP primary series doses and three tetanus and diphtheria booster doses were administered. Check for any other vaccines due.'
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: Guidance
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @dynamicValue: Guidance */ define "Guidance": case when "Client is due for tetanus and diphtheria booster dose" then "Client is due for tetanus and diphtheria booster dose Guidance" when "Client is not due for tetanus and diphtheria booster dose" then "Client is not due for tetanus and diphtheria booster dose Guidance" when "Tetanus and diphtheria immunization schedule is complete" then "Tetanus and diphtheria immunization schedule is complete Guidance" else '' end
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: Has Guidance
extension:
  url:
    v: statement
    l: statement
  value: String
    v: define "Has Guidance": "Guidance" is not null and "Guidance" != ''
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: IMMZCommon
extension:
  url:
    v: name
    l: name
  value: String
    v: onOrBefore
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /** * @description: Gets immunizations on or before a date */ define fluent function onOrBefore(immunizations List<Immunization>, beforeDate Date): immunizations I where I.occurrence.toInterval() same day or before beforeDate
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: 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: 38
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: 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: 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: 40
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: 41
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: 42
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: 43
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: 44
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: 45
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: 46
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: 47
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: prevalenceInterval
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @description: Returns an interval representing the normalized prevalence period of a given Condition resource. @comment: Uses the toInterval and toAbatementInterval functions to determine the widest potential interval from onset to abatement as specified in the given Condition. */ define fluent function prevalenceInterval(condition Condition): if condition.clinicalStatus ~ "active" or condition.clinicalStatus ~ "recurrence" or condition.clinicalStatus ~ "relapse" then Interval[start of condition.onset.toInterval(), end of condition.abatementInterval()] else (end of condition.abatementInterval()) abatementDate return if abatementDate is null then Interval[start of condition.onset.toInterval(), abatementDate) else Interval[start of condition.onset.toInterval(), abatementDate]
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
    v: WHOCommon
extension:
  url:
    v: name
    l: name
  value: String
    v: abatementInterval
extension:
  url:
    v: statement
    l: statement
  value: String
    v: // Was getting error on this for this particular choice set not being found /* @description: Returns an interval representing the normalized Abatement of a given Condition resource. @comment: NOTE: Due to the complexity of determining an interval from a String, this function will throw a run-time exception if used with a Condition instance that has a String as the abatement value. */ define fluent function abatementInterval(condition Condition): if condition.abatement is FHIR.dateTime then Interval[FHIRHelpers.ToDateTime(condition.abatement as FHIR.dateTime), FHIRHelpers.ToDateTime(condition.abatement as FHIR.dateTime)] else if condition.abatement is FHIR.Period then FHIRHelpers.ToInterval(condition.abatement as FHIR.Period) else if condition.abatement is FHIR.string then Message(null as Interval<DateTime>, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a String value is not supported') else if condition.abatement is FHIR.Age then Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(condition.abatement as FHIR.Age), FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(condition.abatement as FHIR.Age) + 1 year) else if condition.abatement is FHIR.Range then Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((condition.abatement as FHIR.Range).low), FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((condition.abatement as FHIR.Range).high) + 1 year) else if condition.abatement is FHIR.boolean then Interval[end of condition.onset.toInterval(), condition.recordedDate) 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
    v: FHIRHelpers
extension:
  url:
    v: name
    l: name
  value: String
    v: ToDateTime
extension:
  url:
    v: statement
    l: statement
  value: String
    v: define function ToDateTime(value dateTime): value.value
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: FHIRHelpers
extension:
  url:
    v: name
    l: name
  value: String
    v: ToInterval
extension:
  url:
    v: statement
    l: statement
  value: String
    v: define function ToInterval(period FHIR.Period): if period is null then null else if period."start" is null then Interval(period."start".value, period."end".value] else Interval[period."start".value, period."end".value]
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: 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: 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: ToQuantity
extension:
  url:
    v: statement
    l: statement
  value: String
    v: define function ToQuantity(quantity FHIR.Quantity): case when quantity is null then null when quantity.value is null then null when quantity.comparator is not null then Message(null, true, 'FHIRHelpers.ToQuantity.ComparatorQuantityNotSupported', 'Error', 'FHIR Quantity value has a comparator and cannot be converted to a System.Quantity value.') when quantity.system is null or quantity.system.value = 'http://unitsofmeasure.org' or quantity.system.value = 'http://hl7.org/fhirpath/CodeSystem/calendar-units' then System.Quantity { value: quantity.value.value, unit: ToCalendarUnit(Coalesce(quantity.code.value, quantity.unit.value, '1')) } else Message(null, true, 'FHIRHelpers.ToQuantity.InvalidFHIRQuantity', 'Error', 'Invalid FHIR Quantity code: ' & quantity.unit.value & ' (' & quantity.system.value & '|' & quantity.code.value & ')') end
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: ToCalendarUnit
extension:
  url:
    v: statement
    l: statement
  value: String
    v: define function ToCalendarUnit(unit System.String): case unit when 'ms' then 'millisecond' when 's' then 'second' when 'min' then 'minute' when 'h' then 'hour' when 'd' then 'day' when 'wk' then 'week' when 'mo' then 'month' when 'a' then 'year' else unit end
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: 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: 55
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/IMMZD2DTDTPEncounterElements
  l: IMMZD2DTDTPEncounterElements

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

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

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

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

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

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

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

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: Code system ConditionClinicalStatusCodes
resource:
  v: http://terminology.hl7.org/CodeSystem/condition-clinical
  l: condition-clinical

type:
  v: depends-on
display:
  v: Code system LOINC
resource:
  v: http://loinc.org
  l: loinc.org

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

type:
  v: depends-on
display:
  v: Value set Tetanus and diphtheria-containing vaccines
resource:
  v: http://smart.who.int/immunizations/ValueSet/IMMZ.Z.DE28
  l: IMMZ.Z.DE28

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: AsOf
use:
  v: in
min:
  v: 0
max:
  v: 1
type:
  v: date

name:
  v: Guidance
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: string

name:
  v: Client is due for tetanus and diphtheria booster dose
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: boolean

name:
  v: Has Guidance
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: 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: 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: DE161
    display:
      v: Potential contraindications

type:
  v: Observation
profile:
  v: http://hl7.org/fhir/StructureDefinition/Observation
  l: Observation
must support:
  v: code
must support:
  v: value
code filter:
  path:
    v: code
  code:
    system:
      v: http://smart.who.int/immunizations/CodeSystem/IMMZ.D
      l: IMMZ.D
    code:
      v: DE161
    display:
      v: Potential contraindications

type:
  v: Observation
profile:
  v: http://hl7.org/fhir/StructureDefinition/Observation
  l: Observation
must support:
  v: code
must support:
  v: value
must support:
  v: encounter
must support:
  v: effective
code filter:
  path:
    v: code
  code:
    system:
      v: http://smart.who.int/immunizations/CodeSystem/IMMZ.D
      l: IMMZ.D
    code:
      v: DE161
    display:
      v: Potential contraindications

type:
  v: Condition
profile:
  v: http://hl7.org/fhir/StructureDefinition/Condition
  l: Condition
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: DE162
    display:
      v: Currently pregnant

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

type:
  v: Condition
profile:
  v: http://hl7.org/fhir/StructureDefinition/Condition
  l: Condition
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: DE162
    display:
      v: Currently pregnant

type:
  v: Observation
profile:
  v: http://hl7.org/fhir/StructureDefinition/Observation
  l: Observation
must support:
  v: code
must support:
  v: status
code filter:
  path:
    v: code
  code: https://loinc.org/rdf/82810-3
    system:
      v: http://loinc.org
      l: loinc.org
    code:
      v: 82810-3
    display:
      v: Pregnancy status

type:
  v: Observation
profile:
  v: http://hl7.org/fhir/StructureDefinition/Observation
  l: Observation
must support:
  v: code
must support:
  v: status
must support:
  v: value
code filter:
  path:
    v: code
  code: https://loinc.org/rdf/82810-3
    system:
      v: http://loinc.org
      l: loinc.org
    code:
      v: 82810-3
    display:
      v: Pregnancy status

type:
  v: Observation
profile:
  v: http://hl7.org/fhir/StructureDefinition/Observation
  l: Observation
must support:
  v: code
must support:
  v: status
must support:
  v: value
must support:
  v: encounter
must support:
  v: effective
code filter:
  path:
    v: code
  code: https://loinc.org/rdf/82810-3
    system:
      v: http://loinc.org
      l: loinc.org
    code:
      v: 82810-3
    display:
      v: Pregnancy status

type:
  v: Immunization
profile:
  v: http://hl7.org/fhir/StructureDefinition/Immunization
  l: Immunization
must support:
  v: status
must support:
  v: isSubpotent
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: 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: 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: 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: 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: IMMZD2DTDTPPregnancyStartingWith4Doses

v: IMMZ.D2.DT.DTP.Pregnancy starting with 4 doses

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.D2.DT.DTP.Pregnancy starting with 4 doses Diphtheria and tetanus vaccination schedule in pregnant women who received 4 childhood DTP doses

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

extension:
  url:
    v: http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-rationale
    l: cpg-rationale
  value: Markdown
    v: Pregnant women who received 4 tetanus-containing vaccines doses during childhood or pre-adulthood need only 1 booster dose, which should be given at the first opportunity. To provide lifelong protection, a sixth dose would be needed at least 1 year after the fifth dose, or during the next pregnancy. From 7 years of age, only tetanus toxoid with reduced diphtheria toxoid (Td) combinations should be used. Age-appropriate combinations-containing pertussis vaccine with reduced diphtheria toxoid are also available. Only acellular pertussis (aP)-containing vaccines should be used for vaccination of persons aged 7 years and older.
title:
  v: Determine if the client is due for DTP.
description:
  v: Determine if the client is due for DTP vaccine according to the national immunization protocol. Diphtheria and tetanus vaccination schedule in pregnant women who received 4 childhood DTP doses
condition:
  kind:
    v: applicability
  expression:
    description:
      v: Client is due for tetanus and diphtheria booster dose
    language:
      v: text/cql-identifier
    expression:
      v: Client is due for tetanus and diphtheria booster dose
definition: Canonical
  v: http://smart.who.int/immunizations/ActivityDefinition/IMMZD2DTMR
  l: IMMZD2DTMR
dynamic value:
  path:
    v: status
  expression:
    language:
      v: text/cql-expression
    expression:
      v: 'draft'
dynamic value:
  path:
    v: intent
  expression:
    language:
      v: text/cql-expression
    expression:
      v: 'proposal'
dynamic value:
  path:
    v: medication
  expression:
    language:
      v: text/cql-expression
    expression:
      v: Concept { codes: { Code { system: 'http://smart.who.int/immunizations/CodeSystem/IMMZ.Z', code: 'DE28', display: 'Tetanus and diphtheria-containing vaccines' } }, display: 'Tetanus and diphtheria-containing vaccines' }

title:
  v: Check for Guidance for the patient regarding IMMZ.D2.DT.DTP.Pregnancy starting with 4 doses.
description:
  v: Show Guidance for the patient regarding IMMZ.D2.DT.DTP.Pregnancy starting with 4 doses.
condition:
  kind:
    v: applicability
  expression:
    description:
      v: Has Guidance
    language:
      v: text/cql-identifier
    expression:
      v: Has Guidance
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: Guidance
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' }