{
  "resourceType": "Library",
  "id": "IMMZD18SHib2DosesWithBoosterDoseLogic",
  "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-15e6370d-cc94-4395-b02f-c6b9ac18d50d.html): Unable to Parse HTML - node 'code' has unexpected content ' ' (last text = '/*\n * Library: IMMZD18SHib2DosesWithBoosterDoseLogic (IMMZ.D18.S.Hib.2 doses with booster dose schedule)\n * Schedule Table: 2 primary doses with a booster dose (2p+1) schedule\n */\nlibrary IMMZD18SHib2DosesWithBoosterDoseLogic\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 IMMZD2DTHibEncounterElements called Encounter\n\nparameter Today Date default Today()\n\n\ncontext Patient\n\n\n/*\n@output: Haemophilus influenzae type b (Hib) dose 1\n@description: Provision of the Hib dose 1\n@trigger: Child's birth\n@pseudo: \n@triggerDate: &quot;Date of birth&quot;\n*/\ndefine &quot;Haemophilus influenzae type b (Hib) dose 1&quot;:\n  Encounter.&quot;No Hib primary series doses were administered&quot;\n  and &quot;Haemophilus influenzae type b (Hib) dose 1 Expiration&quot; after day of Today\n\n\n/*\n@output: Haemophilus influenzae type b (Hib) dose 1 Create\n@create: Hib dose 1 should be provided if the client is older than 6 weeks\n*/\ndefine &quot;Haemophilus influenzae type b (Hib) dose 1 Create&quot;:\n  if &quot;Haemophilus influenzae type b (Hib) dose 1&quot;\n  then 'Hib dose 1 should be provided if the client is older than 6 weeks' + '\nDue Date: ' + ToString(&quot;Haemophilus influenzae type b (Hib) dose 1 Due Date&quot;) + '\nExpiration: ' + ToString(&quot;Haemophilus influenzae type b (Hib) dose 1 Expiration&quot;)\n  else ''\n\n\n/*\n@dynamicValue: Haemophilus influenzae type b (Hib) dose 1 Due Date\n@pseudocode: &quot;Date of birth&quot; + 6 weeks\n*/\ndefine &quot;Haemophilus influenzae type b (Hib) dose 1 Due Date&quot;:\n  if &quot;Haemophilus influenzae type b (Hib) dose 1&quot; then Patient.birthDate + 6 weeks\n  else null\n\n\n/*\n@dynamicValue: Haemophilus influenzae type b (Hib) dose 1 Overdue\n@pseudocode: To be determined by Member States\n*/\ndefine &quot;Haemophilus influenzae type b (Hib) dose 1 Overdue&quot;:\n  null\n\n\n/*\n@dynamicValue: Haemophilus influenzae type b (Hib) dose 1 Expiration\n@pseudocode: &quot;Date of birth&quot; + 6 years\n*/\ndefine &quot;Haemophilus influenzae type b (Hib) dose 1 Expiration&quot;:\n  Patient.birthDate + 6 years\n\n  \n/*\n@complete: First Hib dose from the primary series was administered\n@pseudocode: Count of vaccines administered (where &quot;Vaccine type&quot; = &quot;Hib-containing vaccines&quot; and &quot;Type of dose&quot;= &quot;Primary series&quot;) = 1\nThe primary series has been completed for delayed start\n&quot;Completed the primary vaccination series&quot; = TRUE (where &quot;Vaccine type&quot; = &quot;Hib-containing vaccines&quot;)\n*/\ndefine &quot;First Hib dose from the primary series was administered&quot;:\n  Encounter.&quot;One Hib primary series dose was administered&quot;\n\n\n\n/*\n@output: Hib dose 2\n@description: Provision of the Hib dose 2\n@trigger: First Hib dose from the primary series was administered to the client within 1 year of age. Client's age is less than 5 years\n@pseudo: Count of vaccines administered (where &quot;Vaccine type&quot; = &quot;Hib-containing vaccines&quot; and &quot;Type of dose&quot; = &quot;Primary series&quot;) = 1 AND &quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot;= &quot;Hib-containing vaccines&quot; and &quot;Dose number&quot; = 1) − &quot;Date of birth&quot; ' at line 295 column 260</b></p></div>"
  },
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/cqf-knowledgeCapability",
      "valueCode": "computable"
    }
  ],
  "url": "http://smart.who.int/immunizations/Library/IMMZD18SHib2DosesWithBoosterDoseLogic",
  "version": "1.0.0",
  "name": "IMMZD18SHib2DosesWithBoosterDoseLogic",
  "title": "IMMZD18SHib2DosesWithBoosterDoseLogic",
  "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.Hib.2 doses with booster dose 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/IMMZD2DTHibEncounterElements"
    }
  ],
  "parameter": [
    {
      "name": "Today",
      "use": "in",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Patient",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Patient"
    },
    {
      "name": "Haemophilus influenzae type b (Hib) dose 1 Expiration",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Haemophilus influenzae type b (Hib) dose 1",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Haemophilus influenzae type b (Hib) dose 1 Due Date",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Haemophilus influenzae type b (Hib) dose 1 Create",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "string"
    },
    {
      "name": "Haemophilus influenzae type b (Hib) dose 1 Overdue",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "First Hib dose from the primary series was administered",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Second Hib dose from the primary series was administered. The primary series has been completed",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Hib dose 2 Expiration",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Hib dose 2",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Hib dose 2 Due Date",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Hib dose 2 Create",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "string"
    },
    {
      "name": "Hib dose 2 Overdue",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "One Hib booster dose was administered. Hib immunization schedule has been completed",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Hib booster dose Expiration",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Hib booster dose",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Hib booster dose Due Date",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Hib booster dose Create",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "string"
    },
    {
      "name": "Hib booster dose Overdue",
      "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-IMMZD18SHib2DosesWithBoosterDoseLogic.cql"
    },
    {
      "contentType": "application/elm+xml",
      "url": "Library-IMMZD18SHib2DosesWithBoosterDoseLogic.elm.xml"
    }
  ]
}
