{
  "resourceType": "Library",
  "id": "IMMZD18STBEEnceVirLogic",
  "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-8e59a79c-8ae9-40e2-8bbb-df03efbb1202.html): Unable to Parse HTML - node 'code' has unexpected content ' ' (last text = '/*\n * Library: IMMZD18STBEEnceVirLogic (IMMZ.D18.S.TBE.EnceVir schedule)\n * Schedule Table: EnceVir, 3-dose schedule\n */\nlibrary IMMZD18STBEEnceVirLogic\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 IMMZD2DTTBEEncounterElements called Encounter\n\nparameter Today Date default Today()\n\n\ncontext Patient\n\n\n/*\n@output: Tick-borne encephalitis (TBE) EnceVir dose 1\n@description: Provision of the TBE EnceVir dose 1\n@trigger: Child's birth\n@pseudo: \n@triggerDate: &quot;Date of birth&quot;\n*/\ndefine &quot;Tick-borne encephalitis (TBE) EnceVir dose 1&quot;:\n  Encounter.&quot;No TBE primary series doses were administered&quot;\n  and not &quot;First TBE dose from the primary series was administered&quot;\n\n\n/*\n@output: Tick-borne encephalitis (TBE) EnceVir dose 1 Create\n@create: The TBE-Moscow vaccine is not licensed for use in children aged under 3 years.\n*/\ndefine &quot;Tick-borne encephalitis (TBE) EnceVir dose 1 Create&quot;:\n  if &quot;Tick-borne encephalitis (TBE) EnceVir dose 1&quot;\n  then 'The TBE-Moscow vaccine is not licensed for use in children aged under 3 years.' + '\nDue Date: ' + ToString(&quot;Tick-borne encephalitis (TBE) EnceVir dose 1 Due Date&quot;)\n  else ''\n\n\n/*\n@dynamicValue: Tick-borne encephalitis (TBE) EnceVir dose 1 Due Date\n@pseudocode: &quot;Date of birth&quot; + 3 years\n*/\ndefine &quot;Tick-borne encephalitis (TBE) EnceVir dose 1 Due Date&quot;:\n  if &quot;Tick-borne encephalitis (TBE) EnceVir dose 1&quot; then Patient.birthDate + 3 years\n  else null\n\n\n/*\n@dynamicValue: Tick-borne encephalitis (TBE) EnceVir 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;Tick-borne encephalitis (TBE) EnceVir dose 1 Overdue&quot;:\n  null\n\n\n/*\n@dynamicValue: Tick-borne encephalitis (TBE) EnceVir 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;Tick-borne encephalitis (TBE) EnceVir dose 1 Expiration&quot;:\n  null\n\n  \n/*\n@complete: First TBE dose from the primary series was administered\n@pseudocode: Count of vaccines administered (where &quot;Vaccine type&quot; = &quot;TBE vaccines&quot; and &quot;Type of dose&quot; = &quot;Primary series&quot;) = 1\n*/\ndefine &quot;First TBE dose from the primary series was administered&quot;:\n  Encounter.&quot;One TBE primary series dose was administered&quot;\n\n\n\n/*\n@output: TBE EnceVir Dose 2\n@description: Provision of the TBE EnceVir dose 2\n@trigger: First TBE dose from the primary series was administered\n@pseudo: Count of vaccines administered (where &quot;Vaccine type&quot; = &quot;TBE vaccines&quot; and &quot;Type of dose&quot; = &quot;Primary series&quot;) = 1\n@triggerDate: &quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot; = &quot;TBE vaccines&quot;)\n*/\ndefine &quot;TBE EnceVir Dose 2&quot;:\n  &quot;First TBE dose from the primary series was administered&quot;\n  and not &quot;Second TBE dose from the primary series was administered&quot;\n\n\n/*\n@output: TBE EnceVir Dose 2 Create\n@create: The manufacturer of EnceVir recommends 2 doses given at an interval of 5–7 months.\n*/\ndefine &quot;TBE EnceVir Dose 2 Create&quot;:\n  if &quot;TBE EnceVir Dose 2&quot;\n  then 'The manufacturer of EnceVir recommends 2 doses given at an interval of 5–7 months.' + '\nDue Date: ' + ToString(&quot;TBE EnceVir Dose 2 Due Date&quot;) + '\nOverdue: ' + ToString(&quot;TBE EnceVir Dose 2 Overdue&quot;)\n  else ''\n\n\n/*\n@dynamicValue: TBE EnceVir Dose 2 Due Date\n@pseudocode: &quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot; = &quot;TBE vaccines&quot;) + 5 months\n*/\ndefine &quot;TBE EnceVir Dose 2 Due Date&quot;:\n  if &quot;TBE EnceVir Dose 2&quot; then Encounter.&quot;Date of Latest TBE Dose&quot; + 5 months\n  else null\n\n\n/*\n@dynamicValue: TBE EnceVir Dose 2 Overdue\n@pseudocode: &quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot; = &quot;TBE vaccines&quot;) + 7 months\n*/\ndefine &quot;TBE EnceVir Dose 2 Overdue&quot;:\n  if &quot;TBE EnceVir Dose 2&quot; then Encounter.&quot;Date of Latest TBE Dose&quot; + 7 months\n  else null\n\n\n/*\n@dynamicValue: TBE EnceVir 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;TBE EnceVir Dose 2 Expiration&quot;:\n  null\n\n  \n/*\n@complete: Second TBE dose from the primary series was administered\n@pseudocode: Count of vaccines administered (where &quot;Vaccine type&quot; = &quot;TBE vaccines&quot; and &quot;Type of dose&quot; = &quot;Primary series&quot;) = 2\n*/\ndefine &quot;Second TBE dose from the primary series was administered&quot;:\n  Encounter.&quot;Two TBE primary series doses were administered&quot;\n\n\n\n/*\n@output: TBE EnceVir dose 3\n@description: Provision of the TBE EnceVir dose 3\n@trigger: Second TBE dose from the primary series was administered\n@pseudo: Count of vaccines administered (where &quot;Vaccine type&quot; = &quot;TBE vaccines&quot; and &quot;Type of dose&quot; = &quot;Primary series&quot;) = 2\n@triggerDate: Latest &quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot; = &quot;TBE vaccines&quot;)\n*/\ndefine &quot;TBE EnceVir dose 3&quot;:\n  &quot;Second TBE dose from the primary series was administered&quot;\n  and not &quot;Third TBE dose from the primary series was administered. The primary series has been completed&quot;\n\n\n/*\n@output: TBE EnceVir dose 3 Create\n@create: The recommended interval is 12 months between the second and third doses.\n*/\ndefine &quot;TBE EnceVir dose 3 Create&quot;:\n  if &quot;TBE EnceVir dose 3&quot;\n  then 'The recommended interval is 12 months between the second and third doses.' + '\nDue Date: ' + ToString(&quot;TBE EnceVir dose 3 Due Date&quot;)\n  else ''\n\n\n/*\n@dynamicValue: TBE EnceVir dose 3 Due Date\n@pseudocode: Latest &quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot; = &quot;TBE vaccines&quot;) + 12 months\n*/\ndefine &quot;TBE EnceVir dose 3 Due Date&quot;:\n  if &quot;TBE EnceVir dose 3&quot; then Encounter.&quot;Date of Latest TBE Dose&quot; + 12 months\n  else null\n\n\n/*\n@dynamicValue: TBE EnceVir dose 3 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;TBE EnceVir dose 3 Overdue&quot;:\n  null\n\n\n/*\n@dynamicValue: TBE EnceVir dose 3 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;TBE EnceVir dose 3 Expiration&quot;:\n  null\n\n  \n/*\n@complete: Third TBE dose from the primary series was administered. The primary series has been completed\n@pseudocode: &quot;Completed the primary vaccination series&quot; = TRUE (where &quot;Vaccine type&quot; = &quot;TBE vaccines&quot;)\n*/\ndefine &quot;Third TBE dose from the primary series was administered. The primary series has been completed&quot;:\n  Encounter.&quot;Three TBE primary series doses were administered&quot;\n\n\n\n/*\n@output: TBE EnceVir booster dose\n@description: Provision of the TBE EnceVir booster dose\n@trigger: The primary series has been completed\n@pseudo: &quot;Completed the primary vaccination series&quot; = TRUE (where &quot;Vaccine type&quot; = &quot;TBE vaccines&quot;)\n@triggerDate: Latest &quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot; = &quot;TBE vaccines&quot;)\n*/\ndefine &quot;TBE EnceVir booster dose&quot;:\n  &quot;Third TBE dose from the primary series was administered. The primary series has been completed&quot;\n\n\n/*\n@output: TBE EnceVir booster dose Create\n@create: TBE booster dose should be provided every 3 years to the client if the country recognizes TBE as a priority and the client has completed the primary series.\n*/\ndefine &quot;TBE EnceVir booster dose Create&quot;:\n  if &quot;TBE EnceVir booster dose&quot;\n  then 'TBE booster dose should be provided every 3 years to the client if the country recognizes TBE as a priority and the client has completed the primary series.' + '\nDue Date: ' + ToString(&quot;TBE EnceVir booster dose Due Date&quot;)\n  else ''\n\n\n/*\n@dynamicValue: TBE EnceVir booster dose Due Date\n@pseudocode: Latest &quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot; = &quot;TBE vaccines&quot;) + 3 years\n*/\ndefine &quot;TBE EnceVir booster dose Due Date&quot;:\n  if &quot;TBE EnceVir booster dose&quot; then Encounter.&quot;Date of Latest TBE Dose&quot; + 3 years\n  else null\n\n\n/*\n@dynamicValue: TBE EnceVir booster dose 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;TBE EnceVir booster dose Overdue&quot;:\n  null\n\n\n/*\n@dynamicValue: TBE EnceVir booster dose 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;TBE EnceVir booster dose Expiration&quot;:\n  null\n\n  \n/*\n@complete: TBE booster dose was administered less than 3 years ago\n@pseudocode: Count of vaccines administered (where &quot;Vaccine type&quot; = &quot;TBE vaccines&quot; and &quot;Type of dose&quot; = &quot;Booster dose&quot;) ≥ 1 AND Today's date - Latest &quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot; = &quot;TBE vaccines&quot;) ' at line 465 column 223</b></p></div>"
  },
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/cqf-knowledgeCapability",
      "valueCode": "computable"
    }
  ],
  "url": "http://smart.who.int/immunizations/Library/IMMZD18STBEEnceVirLogic",
  "version": "1.0.0",
  "name": "IMMZD18STBEEnceVirLogic",
  "title": "IMMZD18STBEEnceVirLogic",
  "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.TBE.EnceVir 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/IMMZD2DTTBEEncounterElements"
    }
  ],
  "parameter": [
    {
      "name": "Today",
      "use": "in",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Patient",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Patient"
    },
    {
      "name": "First TBE dose from the primary series was administered",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Tick-borne encephalitis (TBE) EnceVir dose 1",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Tick-borne encephalitis (TBE) EnceVir dose 1 Due Date",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Tick-borne encephalitis (TBE) EnceVir dose 1 Create",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "string"
    },
    {
      "name": "Tick-borne encephalitis (TBE) EnceVir dose 1 Overdue",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "Tick-borne encephalitis (TBE) EnceVir dose 1 Expiration",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "Second TBE dose from the primary series was administered",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "TBE EnceVir Dose 2",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "TBE EnceVir Dose 2 Due Date",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "TBE EnceVir Dose 2 Overdue",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "TBE EnceVir Dose 2 Create",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "string"
    },
    {
      "name": "TBE EnceVir Dose 2 Expiration",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "Third TBE dose from the primary series was administered. The primary series has been completed",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "TBE EnceVir dose 3",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "TBE EnceVir dose 3 Due Date",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "TBE EnceVir dose 3 Create",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "string"
    },
    {
      "name": "TBE EnceVir dose 3 Overdue",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "TBE EnceVir dose 3 Expiration",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "TBE EnceVir booster dose",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "TBE EnceVir booster dose Due Date",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "TBE EnceVir booster dose Create",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "string"
    },
    {
      "name": "TBE EnceVir booster dose Overdue",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "TBE EnceVir booster dose Expiration",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "TBE booster dose was administered less than 3 years ago",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Test Validation",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    }
  ],
  "content": [
    {
      "contentType": "text/cql",
      "url": "Library-IMMZD18STBEEnceVirLogic.cql"
    },
    {
      "contentType": "application/elm+xml",
      "url": "Library-IMMZD18STBEEnceVirLogic.elm.xml"
    }
  ]
}
