{
  "resourceType": "Library",
  "id": "IMMZD18SDTPPregnancyStartingWith3DosesLogic",
  "meta": {
    "profile": [
      "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablelibrary",
      "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablelibrary",
      "http://hl7.org/fhir/uv/cql/StructureDefinition/cql-library",
      "http://hl7.org/fhir/uv/cql/StructureDefinition/cql-module"
    ]
  },
  "text": {
    "status": "extensions",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b style=\"color: maroon\">Exception parsing generated Narrative (see /tmp/liquid-8c60c021-f1dc-4716-a92f-0d9ce32b5632.html): Unable to Parse HTML - node 'code' has unexpected content ' ' (last text = '/*\n * Library: IMMZD18SDTPPregnancyStartingWith3DosesLogic (IMMZ.D18.S.DTP.Pregnancy starting with 3 doses schedule)\n * Schedule Table: Diphtheria and tetanus vaccination schedule in pregnant women who received 3 childhood diphtheria–tetanus–pertussis (DTP) doses\n */\nlibrary IMMZD18SDTPPregnancyStartingWith3DosesLogic\n\nusing FHIR version '4.0.1'\ninclude FHIRHelpers version '4.0.1'\n\ninclude WHOCommon called WC\n\ninclude IMMZCommon called Common\ninclude IMMZConcepts called Concepts\n\ninclude IMMZEncounterElements called IE\ninclude IMMZD2DTDTPEncounterElements called Encounter\n\nparameter Today Date default Today()\n\n\ncontext Patient\n\n\n/*\n@output: Tetanus and diphtheria-containing vaccine booster dose 1 (during pregnancy)\n@description: Provision of tetanus and diphtheria booster dose 1 for pregnant women who received only 3 doses of DTP during childhood without booster doses\n@trigger: The primary DTP series has been completed and client is currently pregnant\n@pseudo: &quot;Completed the primary vaccination series&quot; = TRUE (where &quot;Vaccine type&quot; = &quot;DTP-containing vaccines&quot;) AND &quot;Currently pregnant&quot; = TRUE\n@triggerDate: &quot;Contact date&quot; WHEN &quot;ANC contact number&quot; = 1\n*/\ndefine &quot;Tetanus and diphtheria-containing vaccine booster dose 1 (during pregnancy)&quot;:\n  Encounter.&quot;Three DTP primary series doses were administered&quot;\n  and Encounter.&quot;Client is currently pregnant&quot;\n  and not(&quot;First tetanus and diphtheria booster dose was administered&quot;)\n\n\n/*\n@output: Tetanus and diphtheria-containing vaccine booster dose 1 (during pregnancy) Create\n@create: Pregnant women who have received only 3 doses of tetanus-containing vaccines during childhood without booster doses should receive 2 doses of tetanus-containing vaccines at the earliest opportunity during pregnancy with a minimal interval of 4 weeks between doses and the second dose at least 2 weeks before giving birth.\n*/\ndefine &quot;Tetanus and diphtheria-containing vaccine booster dose 1 (during pregnancy) Create&quot;:\n  if &quot;Tetanus and diphtheria-containing vaccine booster dose 1 (during pregnancy)&quot;\n  then 'Pregnant women who have received only 3 doses of tetanus-containing vaccines during childhood without booster doses should receive 2 doses of tetanus-containing vaccines at the earliest opportunity during pregnancy with a minimal interval of 4 weeks between doses and the second dose at least 2 weeks before giving birth.' + '\nDue Date: ' + ToString(&quot;Tetanus and diphtheria-containing vaccine booster dose 1 (during pregnancy) Due Date&quot;) + '\nOverdue: ' + ToString(&quot;Tetanus and diphtheria-containing vaccine booster dose 1 (during pregnancy) Overdue&quot;) + '\nExpiration: ' + &quot;Tetanus and diphtheria-containing vaccine booster dose 1 (during pregnancy) Expiration&quot;\n  else ''\n\n\n/*\n@dynamicValue: Tetanus and diphtheria-containing vaccine booster dose 1 (during pregnancy) Due Date\n@pseudocode: &quot;Contact date&quot; WHEN &quot;ANC contact number&quot; = 1\n*/\ndefine &quot;Tetanus and diphtheria-containing vaccine booster dose 1 (during pregnancy) Due Date&quot;:\n  if &quot;Tetanus and diphtheria-containing vaccine booster dose 1 (during pregnancy)&quot; then Today\n  else null\n\n\n/*\n@dynamicValue: Tetanus and diphtheria-containing vaccine booster dose 1 (during pregnancy) Overdue\n@pseudocode: Every subsequent contact until 38 weeks\n*/\ndefine &quot;Tetanus and diphtheria-containing vaccine booster dose 1 (during pregnancy) Overdue&quot;:\n  if &quot;Tetanus and diphtheria-containing vaccine booster dose 1 (during pregnancy)&quot; then Today\n  else null\n\n\n/*\n@dynamicValue: Tetanus and diphtheria-containing vaccine booster dose 1 (during pregnancy) Expiration\n@pseudocode: Two weeks before birth for the pregnancy; however, individuals remain eligible to be vaccinated.\n&quot;Gestational age&quot; ' at line 278 column 20</b></p></div>"
  },
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/cqf-knowledgeCapability",
      "valueCode": "computable"
    }
  ],
  "url": "http://smart.who.int/immunizations/Library/IMMZD18SDTPPregnancyStartingWith3DosesLogic",
  "version": "1.0.0",
  "name": "IMMZD18SDTPPregnancyStartingWith3DosesLogic",
  "title": "IMMZD18SDTPPregnancyStartingWith3DosesLogic",
  "status": "draft",
  "experimental": false,
  "type": {
    "coding": [
      {
        "system": "http://terminology.hl7.org/CodeSystem/library-type",
        "code": "logic-library"
      }
    ]
  },
  "date": "2026-10-02T09:24:37+00:00",
  "publisher": "WHO",
  "contact": [
    {
      "name": "WHO",
      "telecom": [
        {
          "system": "url",
          "value": "http://who.int"
        }
      ]
    }
  ],
  "description": "This library defines decision support logic for the IMMZ.D18.S.DTP.Pregnancy starting with 3 doses schedule table in the Immunization CPG",
  "relatedArtifact": [
    {
      "type": "depends-on",
      "display": "Library WC",
      "resource": "http://smart.who.int/immunizations/Library/WHOCommon"
    },
    {
      "type": "depends-on",
      "display": "Library Common",
      "resource": "http://smart.who.int/immunizations/Library/IMMZCommon"
    },
    {
      "type": "depends-on",
      "display": "Library Concepts",
      "resource": "http://smart.who.int/immunizations/Library/IMMZConcepts"
    },
    {
      "type": "depends-on",
      "display": "Library IE",
      "resource": "http://smart.who.int/immunizations/Library/IMMZEncounterElements"
    },
    {
      "type": "depends-on",
      "display": "Library Encounter",
      "resource": "http://smart.who.int/immunizations/Library/IMMZD2DTDTPEncounterElements"
    }
  ],
  "parameter": [
    {
      "name": "Today",
      "use": "in",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Patient",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Patient"
    },
    {
      "name": "First tetanus and diphtheria booster dose was administered",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Tetanus and diphtheria-containing vaccine booster dose 1 (during pregnancy)",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Tetanus and diphtheria-containing vaccine booster dose 1 (during pregnancy) Due Date",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Tetanus and diphtheria-containing vaccine booster dose 1 (during pregnancy) Overdue",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Tetanus and diphtheria-containing vaccine booster dose 1 (during pregnancy) Expiration",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "string"
    },
    {
      "name": "Tetanus and diphtheria-containing vaccine booster dose 1 (during pregnancy) Create",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "string"
    },
    {
      "name": "Second tetanus and diphtheria booster dose was administered",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Tetanus and diphtheria-containing vaccine booster dose 2 (during pregnancy)",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Tetanus and diphtheria-containing vaccine booster dose 2 (during pregnancy) Due Date",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Tetanus and diphtheria-containing vaccine booster dose 2 (during pregnancy) Overdue",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Tetanus and diphtheria-containing vaccine booster dose 2 (during pregnancy) Expiration",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "string"
    },
    {
      "name": "Tetanus and diphtheria-containing vaccine booster dose 2 (during pregnancy) Create",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "string"
    },
    {
      "name": "Third tetanus and diphtheria-containing booster dose was administered. Tetanus and diphtheria immunization schedule has been completed",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Tetanus and diphtheria-containing vaccine booster dose 3",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Tetanus and diphtheria-containing vaccine booster dose 3 Due Date",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Tetanus and diphtheria-containing vaccine booster dose 3 Create",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "string"
    },
    {
      "name": "Tetanus and diphtheria-containing vaccine booster dose 3 Overdue",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "Tetanus and diphtheria-containing vaccine booster dose 3 Expiration",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "Test Validation",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    }
  ],
  "content": [
    {
      "contentType": "text/cql",
      "url": "Library-IMMZD18SDTPPregnancyStartingWith3DosesLogic.cql"
    },
    {
      "contentType": "application/elm+xml",
      "url": "Library-IMMZD18SDTPPregnancyStartingWith3DosesLogic.elm.xml"
    }
  ]
}
