{
  "resourceType": "Library",
  "id": "IMMZD18SPneumococcal2DosesWithBoosterDoseLogic",
  "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-f134822c-0717-421d-ba49-08c29fc81346.html): Unable to Parse HTML - node 'code' has unexpected content ' ' (last text = '/*\n * Library: IMMZD18SPneumococcal2DosesWithBoosterDoseLogic (IMMZ.D18.S.Pneumococcal.2 doses with booster dose schedule)\n * Schedule Table: 2 primary doses with a booster dose (2p+1) schedule\n */\nlibrary IMMZD18SPneumococcal2DosesWithBoosterDoseLogic\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 IMMZD2DTPneumococcalEncounterElements called Encounter\n\nparameter Today Date default Today()\n\n\ncontext Patient\n\n\n/*\n@output: Pneumococcal dose 1\n@description: Provision of the pneumococcal dose 1\n@trigger: Child's birth\n@pseudo: \n@triggerDate: &quot;Date of birth&quot;\n*/\ndefine &quot;Pneumococcal dose 1&quot;:\n  Encounter.&quot;The client's age is less than or equal to 5 years&quot;\n  and Encounter.&quot;No pneumococcal primary series doses were administered&quot;\n\n\n/*\n@output: Pneumococcal dose 1 Create\n@create: Pneumococcal dose 1 should be provided if the client is older than 6 weeks\n*/\ndefine &quot;Pneumococcal dose 1 Create&quot;:\n  if &quot;Pneumococcal dose 1&quot;\n  then 'Pneumococcal dose 1 should be provided if the client is older than 6 weeks' + '\nDue Date: ' + ToString(&quot;Pneumococcal dose 1 Due Date&quot;)\n  else ''\n\n\n/*\n@dynamicValue: Pneumococcal dose 1 Due Date\n@pseudocode: &quot;Date of birth&quot; + 6 weeks\n*/\ndefine &quot;Pneumococcal dose 1 Due Date&quot;:\n  if &quot;Pneumococcal dose 1&quot; then Patient.birthDate + 6 weeks\n  else null\n\n\n/*\n@dynamicValue: Pneumococcal dose 1 Overdue\n@pseudocode: To be determined by Member States; however, there is no recommended overdue date. WHO does not currently have recommendations on the use of pneumococcal vaccine in individuals aged over 5 years.\n*/\ndefine &quot;Pneumococcal dose 1 Overdue&quot;:\n  null\n\n\n/*\n@dynamicValue: Pneumococcal dose 1 Expiration\n@pseudocode: To be determined by Member States; however, there is no recommended expiration date. WHO does not currently have recommendations on the use of pneumococcal vaccine in individuals aged over 5 years.\n*/\ndefine &quot;Pneumococcal dose 1 Expiration&quot;:\n  null\n\n  \n/*\n@complete: First pneumococcal dose from the primary series was administered\n@pseudocode: Count of vaccines administered (where &quot;Vaccine type&quot; = &quot;Pneumococcal vaccines&quot; and &quot;Type of dose&quot; = &quot;Primary series&quot;) = 1\n*/\ndefine &quot;First pneumococcal dose from the primary series was administered&quot;:\n  Encounter.&quot;One pneumococcal primary series dose was administered&quot;\n\n\n\n/*\n@output: Pneumococcal dose 2\n@description: Provision of the pneumococcal dose 2\n@trigger: First pneumococcal dose from the primary series was administered to the client, who is less than or equal to 5 years of age, either within 24 months of birth or if client is at high risk for pneumococcal infection\n@pseudo: Today's date − &quot;Date of birth&quot; ≤ 5 years AND Count of vaccines administered (where &quot;Vaccine type&quot; = &quot;Pneumococcal 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;Pneumococcal vaccines&quot;) − &quot;Date of birth&quot; ' at line 304 column 281</b></p></div>"
  },
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/cqf-knowledgeCapability",
      "valueCode": "computable"
    }
  ],
  "url": "http://smart.who.int/immunizations/Library/IMMZD18SPneumococcal2DosesWithBoosterDoseLogic",
  "version": "1.0.0",
  "name": "IMMZD18SPneumococcal2DosesWithBoosterDoseLogic",
  "title": "IMMZD18SPneumococcal2DosesWithBoosterDoseLogic",
  "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.Pneumococcal.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/IMMZD2DTPneumococcalEncounterElements"
    }
  ],
  "parameter": [
    {
      "name": "Today",
      "use": "in",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Patient",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Patient"
    },
    {
      "name": "Pneumococcal dose 1",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Pneumococcal dose 1 Due Date",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Pneumococcal dose 1 Create",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "string"
    },
    {
      "name": "Pneumococcal dose 1 Overdue",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "Pneumococcal dose 1 Expiration",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "First pneumococcal dose from the primary series was administered",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Second pneumococcal dose from the primary series was administered. The primary series has been completed.",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Pneumococcal dose 2",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Pneumococcal dose 2 Due Date",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Pneumococcal dose 2 Create",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "string"
    },
    {
      "name": "Pneumococcal dose 2 Overdue",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "Pneumococcal dose 2 Expiration",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "Pneumococcal booster dose was administered",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Pneumococcal booster dose",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Pneumococcal booster dose Due Date",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Pneumococcal booster dose Overdue",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Pneumococcal booster dose Create",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "string"
    },
    {
      "name": "Pneumococcal booster dose Expiration",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "Second pneumococcal booster dose was administered",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Pneumococcal second booster dose Expiration",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Pneumococcal second booster dose",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Pneumococcal second booster dose Due Date",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Pneumococcal second booster dose Overdue",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Pneumococcal second booster dose Create",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "string"
    },
    {
      "name": "Test Validation",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    }
  ],
  "content": [
    {
      "contentType": "text/cql",
      "url": "Library-IMMZD18SPneumococcal2DosesWithBoosterDoseLogic.cql"
    },
    {
      "contentType": "application/elm+xml",
      "url": "Library-IMMZD18SPneumococcal2DosesWithBoosterDoseLogic.elm.xml"
    }
  ]
}
