OMTKData2020
type: Library
node role: treeRoot
id:
  v: OMTKData2020
text:
  status:
    v: extensions
  div:
    v: Id: OMTKData2020 Url: Library - OMTK Data (2020) Version: 2022.1.0 Name: OMTKData2020 Title: Library - OMTK Data (2020) Status: active Experimental: false Type: system: http://terminology.hl7.org/CodeSystem/library-type code: logic-library Date: 2026-04-27 16:35:01+0000 Publisher: CDC / Security Risk Solutions, Inc. (SRS) Copyright: Centers for Disease Control and Prevention (CDC) Parameters: Name Type Min Max In/Out Months integer 0 * Out Days28 integer 0 * Out Days29 integer 0 * Out Days30 integer 0 * Out Days31 integer 0 * Out DrugIngredients Resource 0 * Out Content: text/cql library OMTKData2020 version '2022.1.0' define Months: { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 } define Days28: { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28 } define Days29: { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 } define Days30: { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 } define Days31: { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 } /* Returns true if the given year is a leap year, false otherwise */ define function IsLeapYear(y Integer): (y mod 4 = 0 and y mod 100 != 0) or y mod 400 = 0 /* Returns a list of the days in the given month in the given year List<DateTime> */ define function DaysInMonth(y Integer, m Integer): ( case when m in { 1, 3, 5, 7, 8, 10, 12 } then Days31 when m = 2 then if IsLeapYear(y) then Days29 else Days28 else Days30 end ) D return DateTime(y, m, D) /* Returns a list of the days in the given year List<DateTime> */ define function DaysInYear(y Integer): flatten ( Months M return DaysInMonth(y, M) ) define function DaysInPeriod(period Interval<DateTime>): case when start of period is null or end of period is null then null when start of period same year as end of period then case when month from start …
contained: Parameters
  id:
    v: options
  parameter:
    name:
      v: translatorVersion
    value: String
      v: 3.25.0
  parameter:
    name:
      v: option
    value: String
      v: EnableAnnotations
  parameter:
    name:
      v: option
    value: String
      v: EnableLocators
  parameter:
    name:
      v: option
    value: String
      v: DisableListDemotion
  parameter:
    name:
      v: option
    value: String
      v: DisableListPromotion
  parameter:
    name:
      v: format
    value: String
      v: JSON
  parameter:
    name:
      v: format
    value: String
      v: XML
  parameter:
    name:
      v: analyzeDataRequirements
    value: Boolean
      v: false
  parameter:
    name:
      v: collapseDataRequirements
    value: Boolean
      v: true
  parameter:
    name:
      v: compatibilityLevel
    value: String
      v: 1.5
  parameter:
    name:
      v: enableCqlOnly
    value: Boolean
      v: false
  parameter:
    name:
      v: errorLevel
    value: String
      v: Info
  parameter:
    name:
      v: signatureLevel
    value: String
      v: Overloads
  parameter:
    name:
      v: validateUnits
    value: Boolean
      v: true
  parameter:
    name:
      v: verifyOnly
    value: Boolean
      v: false
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/cqf-cqlOptions
    l: cqf-cqlOptions
  value: Reference
    l: options
    reference:
      v: #options
extension:
  url:
    v: http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-softwaresystem
    l: crmi-softwaresystem
  value: Reference
    l: cqf-tooling
    reference:
      v: Device/cqf-tooling
url:
  v: http://fhir.org/guides/cdc/opioid-cds/Library/OMTKData2020
  l: OMTKData2020
version:
  v: 2022.1.0
name:
  v: OMTKData2020
title:
  v: Library - OMTK Data (2020)
status:
  v: active
experimental:
  v: false
type:
  coding:
    system:
      v: http://terminology.hl7.org/CodeSystem/library-type
      l: library-type
    code:
      v: logic-library
date:
  v: 2026-04-27T16:35:01+00:00
publisher:
  v: CDC / Security Risk Solutions, Inc. (SRS)
contact:
  telecom:
    system:
      v: url
    value:
      v: https://www.securityrisksolutions.com
copyright:
  v: Centers for Disease Control and Prevention (CDC)
parameter:
  name:
    v: Months
  use:
    v: out
  min:
    v: 0
  max:
    v: *
  type:
    v: integer
parameter:
  name:
    v: Days28
  use:
    v: out
  min:
    v: 0
  max:
    v: *
  type:
    v: integer
parameter:
  name:
    v: Days29
  use:
    v: out
  min:
    v: 0
  max:
    v: *
  type:
    v: integer
parameter:
  name:
    v: Days30
  use:
    v: out
  min:
    v: 0
  max:
    v: *
  type:
    v: integer
parameter:
  name:
    v: Days31
  use:
    v: out
  min:
    v: 0
  max:
    v: *
  type:
    v: integer
parameter:
  name:
    v: DrugIngredients
  use:
    v: out
  min:
    v: 0
  max:
    v: *
  type:
    v: Resource

content type:
  v: text/cql

content type:
  v: application/elm+xml

content type:
  v: application/elm+json