{
  "resourceType": "Library",
  "id": "IMMZD18STBETBEMoscowLogic",
  "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-b0e1bfd1-f625-4742-a27e-ebaa01ad111d.html): Unable to Parse HTML - node 'code' has unexpected content ' ' (last text = '/*\n * Library: IMMZD18STBETBEMoscowLogic (IMMZ.D18.S.TBE.TBE-Moscow schedule)\n * Schedule Table: TBE-Moscow, 3-dose schedule\n */\nlibrary IMMZD18STBETBEMoscowLogic\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)-Moscow dose 1\n@description: Provision of the TBE-Moscow dose 1\n@trigger: Child's birth\n@pseudo: \n@triggerDate: &quot;Date of birth&quot;\n*/\ndefine &quot;Tick-borne encephalitis (TBE)-Moscow 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)-Moscow 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)-Moscow dose 1 Create&quot;:\n  if &quot;Tick-borne encephalitis (TBE)-Moscow 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)-Moscow dose 1 Due Date&quot;)\n  else ''\n\n\n/*\n@dynamicValue: Tick-borne encephalitis (TBE)-Moscow dose 1 Due Date\n@pseudocode: &quot;Date of birth&quot; + 3 years\n*/\ndefine &quot;Tick-borne encephalitis (TBE)-Moscow dose 1 Due Date&quot;:\n  if &quot;Tick-borne encephalitis (TBE)-Moscow dose 1&quot; then Patient.birthDate + 3 years\n  else null\n\n\n/*\n@dynamicValue: Tick-borne encephalitis (TBE)-Moscow 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)-Moscow dose 1 Overdue&quot;:\n  null\n\n\n/*\n@dynamicValue: Tick-borne encephalitis (TBE)-Moscow 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)-Moscow 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-Moscow dose 2\n@description: Provision of the TBE-Moscow 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-Moscow 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-Moscow dose 2 Create\n@create: The manufacturer of TBE-Moscow recommends a standard primary immunization schedule of 2 doses given at an interval of 1–7 months.\n*/\ndefine &quot;TBE-Moscow dose 2 Create&quot;:\n  if &quot;TBE-Moscow dose 2&quot;\n  then 'The manufacturer of TBE-Moscow recommends a standard primary immunization schedule of 2 doses given at an interval of 1–7 months.' + '\nDue Date: ' + ToString(&quot;TBE-Moscow dose 2 Due Date&quot;) + '\nOverdue: ' + ToString(&quot;TBE-Moscow dose 2 Overdue&quot;)\n  else ''\n\n\n/*\n@dynamicValue: TBE-Moscow dose 2 Due Date\n@pseudocode: &quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot; = &quot;TBE vaccines&quot;) + 1 month\n*/\ndefine &quot;TBE-Moscow dose 2 Due Date&quot;:\n  if &quot;TBE-Moscow dose 2&quot; then Encounter.&quot;Date of Latest TBE Dose&quot; + 1 month\n  else null\n\n\n/*\n@dynamicValue: TBE-Moscow 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-Moscow dose 2 Overdue&quot;:\n  if &quot;TBE-Moscow dose 2&quot; then Encounter.&quot;Date of Latest TBE Dose&quot; + 7 months\n  else null\n\n\n/*\n@dynamicValue: TBE-Moscow 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-Moscow 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-Moscow dose 3\n@description: Provision of the TBE-Moscow 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-Moscow 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-Moscow dose 3 Create\n@create: The recommended interval is 12 months between the second and third doses.\n*/\ndefine &quot;TBE-Moscow dose 3 Create&quot;:\n  if &quot;TBE-Moscow dose 3&quot;\n  then 'The recommended interval is 12 months between the second and third doses.' + '\nDue Date: ' + ToString(&quot;TBE-Moscow dose 3 Due Date&quot;)\n  else ''\n\n\n/*\n@dynamicValue: TBE-Moscow 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-Moscow dose 3 Due Date&quot;:\n  if &quot;TBE-Moscow dose 3&quot; then Encounter.&quot;Date of Latest TBE Dose&quot; + 12 months\n  else null\n\n\n/*\n@dynamicValue: TBE-Moscow 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-Moscow dose 3 Overdue&quot;:\n  null\n\n\n/*\n@dynamicValue: TBE-Moscow 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-Moscow 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-Moscow booster dose(s)\n@description: Provision of the TBE-Moscow booster dose (s)\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-Moscow booster dose(s)&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-Moscow booster dose(s) 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-Moscow booster dose(s) Create&quot;:\n  if &quot;TBE-Moscow booster dose(s)&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-Moscow booster dose(s) Due Date&quot;)\n  else ''\n\n\n/*\n@dynamicValue: TBE-Moscow booster dose(s) 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-Moscow booster dose(s) Due Date&quot;:\n  if &quot;TBE-Moscow booster dose(s)&quot; then Encounter.&quot;Date of Latest TBE Dose&quot; + 3 years\n  else null\n\n\n/*\n@dynamicValue: TBE-Moscow booster dose(s) 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-Moscow booster dose(s) Overdue&quot;:\n  null\n\n\n/*\n@dynamicValue: TBE-Moscow booster dose(s) 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-Moscow booster dose(s) 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/IMMZD18STBETBEMoscowLogic",
  "version": "1.0.0",
  "name": "IMMZD18STBETBEMoscowLogic",
  "title": "IMMZD18STBETBEMoscowLogic",
  "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.TBE-Moscow 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)-Moscow dose 1",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "Tick-borne encephalitis (TBE)-Moscow dose 1 Due Date",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "Tick-borne encephalitis (TBE)-Moscow dose 1 Create",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "string"
    },
    {
      "name": "Tick-borne encephalitis (TBE)-Moscow dose 1 Overdue",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "Tick-borne encephalitis (TBE)-Moscow 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-Moscow dose 2",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "TBE-Moscow dose 2 Due Date",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "TBE-Moscow dose 2 Overdue",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "TBE-Moscow dose 2 Create",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "string"
    },
    {
      "name": "TBE-Moscow 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-Moscow dose 3",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "TBE-Moscow dose 3 Due Date",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "TBE-Moscow dose 3 Create",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "string"
    },
    {
      "name": "TBE-Moscow dose 3 Overdue",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "TBE-Moscow dose 3 Expiration",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "TBE-Moscow booster dose(s)",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "boolean"
    },
    {
      "name": "TBE-Moscow booster dose(s) Due Date",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "date"
    },
    {
      "name": "TBE-Moscow booster dose(s) Create",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "string"
    },
    {
      "name": "TBE-Moscow booster dose(s) Overdue",
      "use": "out",
      "min": 0,
      "max": "1",
      "type": "Resource"
    },
    {
      "name": "TBE-Moscow booster dose(s) 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-IMMZD18STBETBEMoscowLogic.cql"
    },
    {
      "contentType": "application/elm+xml",
      "url": "Library-IMMZD18STBETBEMoscowLogic.elm.xml"
    }
  ]
}
