{
  "resourceType": "Library",
  "id": "IMMZD2DTHepatitisBElements",
  "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-7d1e12f7-8acb-4e76-8f9d-6362a12721a1.html): Unable to Parse HTML - node 'code' has unexpected content ' ' (last text = '\n/*\n  * Library: IMMZD2DTHepatitisBElements\n  */\nlibrary IMMZD2DTHepatitisBElements\n\nusing FHIR version '4.0.1'\ninclude FHIRHelpers version '4.0.1'\n\ninclude WHOConcepts\ninclude WHOCommon called WC\ninclude WHOElements called WE\n\ninclude IMMZCommon called Common\ninclude IMMZConcepts called Concepts\ninclude IMMZElements called Elements\n\nparameter HepBBirthDoseAgeLimitDays Integer default 1\nparameter HepBLowerLimitWeeks Integer default 4\n\ncontext Patient\n\n/*\n@internal: Hepatitis B containing Doses Administered to Patient\n*/\ndefine &quot;Hepatitis B Doses Administered to Patient&quot;:\n  Elements.&quot;Doses Administered to Patient&quot; I\n  where\n    I.vaccineCode in Concepts.&quot;Hepatitis B-containing vaccines&quot;\n\n/*\n@internal: Hepatitis B containing Doses Administered to Patient that are in the Primary series\n*/\ndefine &quot;Hepatitis B Primary Series Doses Administered to Patient&quot;:\n  &quot;Hepatitis B Doses Administered to Patient&quot;.seriesPrimary()\n\n/*\n@internal: Number of Hepatitis B Primary Series doses\n*/\ndefine &quot;Number of Hepatitis B Primary Series Doses Administered&quot;:\n  Count(&quot;Hepatitis B Primary Series Doses Administered to Patient&quot;)\n\n/*\n@input: Hepatitis B birth dose was not administered\n@pseudocode: Count of vaccines administered (where &quot;Vaccine type&quot; = &quot;Hepatitis B-containing vaccines&quot; and &quot;Birth dose&quot; = TRUE) = 0\n@code: Hepatitis B birth dose was not administered-117\n@decision: IMMZ.D2.DT.Hepatitis B.Birth dose: Birth dose administration\n*/\ndefine &quot;Hepatitis B birth dose was not administered&quot;:\n  &quot;Number of Hepatitis B Dose 0 Doses Administered&quot; = 0\n\n/*\n@input: Client's age is less than {Member States defined upper limit}\n@pseudocode: Today's date − &quot;Date of birth&quot; ' at line 291 column 46</b></p></div>"
  },
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/cqf-knowledgeCapability",
      "valueCode": "computable"
    }
  ],
  "url": "http://smart.who.int/immunizations/Library/IMMZD2DTHepatitisBElements",
  "version": "1.0.0",
  "name": "IMMZD2DTHepatitisBElements",
  "title": "IMMZD2DTHepatitisBElements",
  "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 context-independent elements for Hepatitis B used throughout the Immunization CPG",
  "relatedArtifact": [
    {
      "type": "depends-on",
      "display": "Library WHOConcepts",
      "resource": "http://smart.who.int/immunizations/Library/WHOConcepts"
    },
    {
      "type": "depends-on",
      "display": "Library WC",
      "resource": "http://smart.who.int/immunizations/Library/WHOCommon"
    },
    {
      "type": "depends-on",
      "display": "Library WE",
      "resource": "http://smart.who.int/immunizations/Library/WHOElements"
    },
    {
      "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 Elements",
      "resource": "http://smart.who.int/immunizations/Library/IMMZElements"
    }
  ],
  "parameter": [
    {
      "name": "HepBBirthDoseAgeLimitDays",
      "use": "in",
      "min": 0,
      "max": "1",
      "type": "integer"
    },
    {
      "name": "HepBLowerLimitWeeks",
      "use": "in",
      "min": 0,
      "max": "1",
      "type": "integer"
    },
    {
      "name": "Patient",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Patient"
    },
    {
      "name": "Hepatitis B Doses Administered to Patient",
      "use": "out",
      "min": 0,
      "max": "*",
      "type": "Immunization"
    },
    {
      "name": "Hepatitis B Primary Series Doses Administered to Patient",
      "use": "out",
      "min": 0,
      "max": "*",
      "type": "Immunization"
    },
    {
      "name": "Number of Hepatitis B Primary Series Doses Administered",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "integer"
    },
    {
      "name": "Hepatitis B Dose 0 Doses Administered to Patient",
      "use": "out",
      "min": 0,
      "max": "*",
      "type": "Immunization"
    },
    {
      "name": "Number of Hepatitis B Dose 0 Doses Administered",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "integer"
    },
    {
      "name": "Hepatitis B birth dose was not administered",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Client's age is less than {Member States defined upper limit}",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Client's age is more than {Member States defined upper limit}",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Hepatitis B birth dose was administered",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "No hepatitis B primary series doses were administered",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Client's age is less than {Member States defined lower limit}",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Client's age is more than or equal to {Member States defined lower limit}",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "One hepatitis B primary series dose was administered",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Date of Latest Hepatitis B Dose",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "The latest hepatitis B dose was administered less than 4 weeks ago",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "The latest hepatitis B dose was administered more than 4 weeks ago",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Two hepatitis B primary series doses were administered",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Client's weight at birth was over 2000 g",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Client was not a premature infant at birth",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Client's weight at birth was below 2000 g",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Client was a premature infant at birth",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Three hepatitis B primary series doses were administered",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "One hepatitis B primary series doses were administered",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Number of Hepatitis B Doses Administered",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "integer"
    },
    {
      "name": "No hepatitis B doses were administered",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Client's age is more than {Member States defined lower limit}",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "One hepatitis B dose was administered",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Two hepatitis B doses were administered",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Date of First Hepatitis B Dose",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "The first hepatitis B dose was administered less than 6 months ago",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "The first hepatitis B dose was administered more than 6 months ago",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Three hepatitis B doses were administered",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    }
  ],
  "content": [
    {
      "contentType": "text/cql",
      "url": "Library-IMMZD2DTHepatitisBElements.cql"
    },
    {
      "contentType": "application/elm+xml",
      "url": "Library-IMMZD2DTHepatitisBElements.elm.xml"
    }
  ]
}
