{
  "resourceType": "Library",
  "id": "IMMZD18SCholeraWCVaccinesLogic",
  "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-36d06f34-6e45-48d7-830f-123c6295f838.html): Unable to Parse HTML - node 'code' has unexpected content ' ' (last text = '/*\n * Library: IMMZD18SCholeraWCVaccinesLogic (IMMZ.D18.S.Cholera.WC vaccines schedule)\n * Schedule Table: Whole-cell (WC) vaccines (Shanchol, Euvchol and mORCVAX), 2-dose schedule\n */\nlibrary IMMZD18SCholeraWCVaccinesLogic\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 IMMZD2DTCholeraEncounterElements called Encounter\n\nparameter Today Date default Today()\n\n\ncontext Patient\n\n\n/*\n@output: Cholera dose 1\n@description: Provision of the cholera dose 1\n@trigger: Child's birth and no cholera doses have been administered\n@pseudo: Child's birth AND Count of vaccines administered (where &quot;Vaccine type&quot; = &quot;Cholera vaccines&quot; and &quot;Type of dose&quot; = &quot;Primary series&quot;) = 0\n@triggerDate: &quot;Date of birth&quot;\nOR\nLatest &quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot; = &quot;Cholera vaccines&quot;)\n*/\ndefine &quot;Cholera dose 1&quot;:\n  Encounter.&quot;No cholera primary series dose was administered&quot;\n  and not &quot;First cholera dose was administered&quot;\n\n\n/*\n@output: Cholera dose 1 Create\n@create: WC vaccines: 2 doses should be given 14 days apart to individuals aged ≥ 1 year.\nRevaccination is recommended where there is continued risk of Vibrio cholerae infection. For WC vaccines, revaccination is recommended after 3 years.\n*/\ndefine &quot;Cholera dose 1 Create&quot;:\n  if &quot;Cholera dose 1&quot;\n  then 'WC vaccines: 2 doses should be given 14 days apart to individuals aged ≥ 1 year.\nRevaccination is recommended where there is continued risk of Vibrio cholerae infection. For WC vaccines, revaccination is recommended after 3 years.' + '\nDue Date: ' + ToString(&quot;Cholera dose 1 Due Date&quot;)\n  else ''\n\n\n/*\n@dynamicValue: Cholera dose 1 Due Date\n@pseudocode: &quot;Date of birth&quot; + 1 year\n*/\ndefine &quot;Cholera dose 1 Due Date&quot;:\n  if &quot;Cholera dose 1&quot; then Patient.birthDate + 1 year\n  else null\n\n\n/*\n@dynamicValue: Cholera dose 1 Overdue\n@pseudocode: To be determined by Member States; however, there is no recommended overdue date.\n*/\ndefine &quot;Cholera dose 1 Overdue&quot;:\n  null\n\n\n/*\n@dynamicValue: Cholera dose 1 Expiration\n@pseudocode: To be determined by Member States; however, there is no recommended expiration date and individuals are always eligible to be vaccinated.\n*/\ndefine &quot;Cholera dose 1 Expiration&quot;:\n  null\n\n  \n/*\n@complete: First cholera dose was administered\n@pseudocode: 'Latest &quot;Dose number&quot; (where &quot;Vaccine type&quot; = &quot;Cholera vaccines&quot; and &quot;Type of dose&quot; = &quot;Primary series&quot;) = 1\n*/\ndefine &quot;First cholera dose was administered&quot;:\n  Encounter.&quot;One cholera primary series dose was administered&quot;\n\n\n\n/*\n@output: Cholera dose 2\n@description: Provision of the cholera dose 2\n@trigger: First cholera dose administered\n@pseudo: Latest &quot;Dose number&quot; (where &quot;Vaccine type&quot; = &quot;Cholera vaccines&quot;and &quot;Type of dose&quot; = &quot;Primary series&quot;) = 1\n@triggerDate: Latest &quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot; = &quot;Cholera vaccines&quot;)\n*/\ndefine &quot;Cholera dose 2&quot;:\n  &quot;First cholera dose was administered&quot;\n  and not &quot;The primary series has been completed&quot;\n\n\n/*\n@output: Cholera dose 2 Create\n@create: WC vaccines: 2 doses should be given 14 days apart to individuals aged ≥ 1 year.\n*/\ndefine &quot;Cholera dose 2 Create&quot;:\n  if &quot;Cholera dose 2&quot;\n  then 'WC vaccines: 2 doses should be given 14 days apart to individuals aged ≥ 1 year.' + '\nDue Date: ' + ToString(&quot;Cholera dose 2 Due Date&quot;)\n  else ''\n\n\n/*\n@dynamicValue: Cholera dose 2 Due Date\n@pseudocode: Latest &quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot; = &quot;Cholera vaccines&quot;) + 2 weeks\n*/\ndefine &quot;Cholera dose 2 Due Date&quot;:\n  if &quot;Cholera dose 2&quot; then Encounter.&quot;Date of Latest Cholera Dose&quot; + 2 weeks\n  else null\n\n\n/*\n@dynamicValue: Cholera dose 2 Overdue\n@pseudocode: To be determined by Member States; however, there is no recommended overdue date and individuals are always eligible to be vaccinated.\n*/\ndefine &quot;Cholera dose 2 Overdue&quot;:\n  null\n\n\n/*\n@dynamicValue: Cholera dose 2 Expiration\n@pseudocode: To be determined by Member States; however, there is no recommended expiration date and individuals are always eligible to be vaccinated.\n*/\ndefine &quot;Cholera dose 2 Expiration&quot;:\n  null\n\n  \n/*\n@complete: The primary series has been completed\n@pseudocode: &quot;Completed the primary vaccination series&quot; (where &quot;Vaccine type&quot; = &quot;Cholera vaccines&quot;) = TRUE\n*/\ndefine &quot;The primary series has been completed&quot;:\n  Encounter.&quot;Two cholera primary series doses were administered&quot;\n\n\n\n/*\n@output: Cholera booster dose 1\n@description: Provision of the cholera booster dose 1\n@trigger: Primary series for cholera has been completed and latest cholera dose was administered more than 3 years ago\n@pseudo: &quot;Completed the primary vaccination series&quot; (where &quot;Vaccine type&quot; = &quot;Cholera vaccines&quot;) = TRUE AND Today's date − latest &quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot; = &quot;Cholera vaccines&quot;) ≥ 3 years\n@triggerDate: Latest &quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot; = &quot;Cholera vaccines&quot;)\n*/\ndefine &quot;Cholera booster dose 1&quot;:\n  &quot;The primary series has been completed&quot;\n  and not &quot;First cholera booster dose was administered&quot;\n\n\n/*\n@output: Cholera booster dose 1 Create\n@create: For WC vaccines, revaccination is recommended after 3 years.\n*/\ndefine &quot;Cholera booster dose 1 Create&quot;:\n  if &quot;Cholera booster dose 1&quot;\n  then 'For WC vaccines, revaccination is recommended after 3 years.' + '\nDue Date: ' + ToString(&quot;Cholera booster dose 1 Due Date&quot;)\n  else ''\n\n\n/*\n@dynamicValue: Cholera booster dose 1 Due Date\n@pseudocode: Latest &quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot; = &quot;Cholera vaccines&quot;) + 2 weeks\n*/\ndefine &quot;Cholera booster dose 1 Due Date&quot;:\n  if &quot;Cholera booster dose 1&quot; then Encounter.&quot;Date of Latest Cholera Dose&quot; + 3 years\n  else null\n\n\n/*\n@dynamicValue: Cholera booster dose 1 Overdue\n@pseudocode: To be determined by Member States; however, there is no recommended overdue date and individuals are always eligible to be vaccinated.\n*/\ndefine &quot;Cholera booster dose 1 Overdue&quot;:\n  null\n\n\n/*\n@dynamicValue: Cholera booster dose 1 Expiration\n@pseudocode: To be determined by Member States; however, there is no recommended expiration date and individuals are always eligible to be vaccinated.\n*/\ndefine &quot;Cholera booster dose 1 Expiration&quot;:\n  null\n\n  \n/*\n@complete: First cholera booster dose was administered\n@pseudocode: 'Latest &quot;Dose number&quot; (where &quot;Vaccine type&quot; = &quot;Cholera vaccines&quot; and &quot;Type of dose&quot; = &quot;Booster dose&quot;) = 1\n*/\ndefine &quot;First cholera booster dose was administered&quot;:\n  Encounter.&quot;At least one booster series dose was administered&quot;\n  and Encounter.&quot;Dose number of the latest dose is one&quot;\n\n\n\n/*\n@output: Cholera booster dose 2\n@description: Provision of the cholera booster dose 1\n@trigger: First cholera booster dose administered\n@pseudo: Latest &quot;Dose number&quot; (where &quot;Vaccine type&quot; = &quot;Cholera vaccines&quot;and &quot;Type of dose&quot; = &quot;Booster dose&quot;) = 1\n@triggerDate: Latest &quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot; = &quot;Cholera vaccines&quot;)\n*/\ndefine &quot;Cholera booster dose 2&quot;:\n  &quot;First cholera booster dose was administered&quot;\n  and not &quot;Revaccination with booster series has been completed in the last 3 years&quot;\n\n\n/*\n@output: Cholera booster dose 2 Create\n@create: For WC vaccines, revaccination is recommended after 3 years.\n*/\ndefine &quot;Cholera booster dose 2 Create&quot;:\n  if &quot;Cholera booster dose 2&quot;\n  then 'For WC vaccines, revaccination is recommended after 3 years.' + '\nDue Date: ' + ToString(&quot;Cholera booster dose 2 Due Date&quot;)\n  else ''\n\n\n/*\n@dynamicValue: Cholera booster dose 2 Due Date\n@pseudocode: Latest &quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot; = &quot;Cholera vaccines&quot;) + 3 years\n*/\ndefine &quot;Cholera booster dose 2 Due Date&quot;:\n  if &quot;Cholera booster dose 2&quot; then Encounter.&quot;Date of Latest Cholera Dose&quot; + 2 weeks\n  else null\n\n\n/*\n@dynamicValue: Cholera booster dose 2 Overdue\n@pseudocode: To be determined by Member States; however, there is no recommended overdue date and individuals are always eligible to be vaccinated.\n*/\ndefine &quot;Cholera booster dose 2 Overdue&quot;:\n  null\n\n\n/*\n@dynamicValue: Cholera booster dose 2 Expiration\n@pseudocode: To be determined by Member States; however, there is no recommended expiration date and individuals are always eligible to be vaccinated.\n*/\ndefine &quot;Cholera booster dose 2 Expiration&quot;:\n  null\n\n  \n/*\n@complete: Revaccination with booster series has been completed in the last 3 years\n@pseudocode: &quot;Completed the booster series&quot; (where &quot;Vaccine type&quot; = &quot;Cholera vaccines&quot;) = TRUE AND Today's date − latest &quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot; = &quot;Cholera vaccine&quot;) ' at line 469 column 197</b></p></div>"
  },
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/cqf-knowledgeCapability",
      "valueCode": "computable"
    }
  ],
  "url": "http://smart.who.int/immunizations/Library/IMMZD18SCholeraWCVaccinesLogic",
  "version": "1.0.0",
  "name": "IMMZD18SCholeraWCVaccinesLogic",
  "title": "IMMZD18SCholeraWCVaccinesLogic",
  "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.Cholera.WC vaccines 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/IMMZD2DTCholeraEncounterElements"
    }
  ],
  "parameter": [
    {
      "name": "Today",
      "use": "in",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Patient",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Patient"
    },
    {
      "name": "First cholera dose was administered",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Cholera dose 1",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Cholera dose 1 Due Date",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Cholera dose 1 Create",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "string"
    },
    {
      "name": "Cholera dose 1 Overdue",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "Cholera dose 1 Expiration",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "The primary series has been completed",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Cholera dose 2",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Cholera dose 2 Due Date",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Cholera dose 2 Create",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "string"
    },
    {
      "name": "Cholera dose 2 Overdue",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "Cholera dose 2 Expiration",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "First cholera booster dose was administered",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Cholera booster dose 1",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Cholera booster dose 1 Due Date",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Cholera booster dose 1 Create",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "string"
    },
    {
      "name": "Cholera booster dose 1 Overdue",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "Cholera booster dose 1 Expiration",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "Revaccination with booster series has been completed in the last 3 years",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Cholera booster dose 2",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Cholera booster dose 2 Due Date",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Cholera booster dose 2 Create",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "string"
    },
    {
      "name": "Cholera booster dose 2 Overdue",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "Cholera booster dose 2 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-IMMZD18SCholeraWCVaccinesLogic.cql"
    },
    {
      "contentType": "application/elm+xml",
      "url": "Library-IMMZD18SCholeraWCVaccinesLogic.elm.xml"
    }
  ]
}
