FHIRHelpers
type: Library
node role: treeRoot
id:
  v: FHIRHelpers
text:
  status:
    v: extensions
  div:
    v: Id: FHIRHelpers Url: FHIR Helpers Version: 0.1.0 Name: FHIRHelpers Title: FHIR Helpers Status: draft Type: system: http://terminology.hl7.org/CodeSystem/library-type code: logic-library Date: 2026-02-27 18:11:00+0000 Publisher: HL7 International - [Some] Work Group Jurisdiction: US Content: text/cql /*#xD; @author: Bryn Rhodes#xD; @description: This library defines functions to convert between FHIR#xD; data types and CQL system-defined types, as well as functions to support#xD; FHIRPath implementation. For more information, the FHIRHelpers wiki page:#xD; https://github.com/cqframework/clinical_quality_language/wiki/FHIRHelpers#xD; @allowFluent: true#xD; #xD; @update: Refresh based on AU 2022 content; version 4.0.012 for use in the ecqm-content-qicore-2022 repository#xD; @update: Added ToValueSet function; version 4.0.013 for use in the ecqm-content-qicore-2022 repository#xD; */#xD; library FHIRHelpers version '4.0.013'#xD; #xD; using FHIR version '4.0.1'#xD; #xD; define function ToInterval(period FHIR.Period):#xD; if period is null then#xD; null#xD; else#xD; if period.&quot;start&quot; is null then#xD; Interval(period.&quot;start&quot;.value, period.&quot;end&quot;.value]#xD; else#xD; Interval[period.&quot;start&quot;.value, period.&quot;end&quot;.value]#xD; #xD; define function ToCalendarUnit(unit System.String):#xD; case unit#xD; when 'ms' then 'millisecond'#xD; when 's' then 'second'#xD; when 'min' then 'minute'#xD; when 'h' then 'hour'#xD; when 'd' then 'day'#xD; when 'wk' then 'week'#xD; when 'mo' then 'month'#xD; when 'a' then 'year'#xD; else unit#xD; end#xD; #xD; define function ToQuantity(quantity FHIR.Quantity):#xD; case#xD; when quantity is null then null#xD; when quantity.value is null then null#xD; when quantity.comparator is not null then#xD; Message(null, true, 'FHIRHelpers.ToQuantity.ComparatorQuantityNotSupported', 'Error', 'FHIR Quantity value has a comparator and cannot be converted to a System.Quantity value.')#xD; when quantity.system is null or …
extension:
  url:
    v: http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-softwaresystem
    l: cqfm-softwaresystem
  value: Reference
    l: cqf-tooling
    reference:
      v: Device/cqf-tooling
url:
  v: http://cms.gov/fhir/mct/Library/FHIRHelpers
  l: FHIRHelpers
version:
  v: 0.1.0
name:
  v: FHIRHelpers
title:
  v: FHIR Helpers
status:
  v: draft
type:
  coding:
    system:
      v: http://terminology.hl7.org/CodeSystem/library-type
      l: library-type
    code:
      v: logic-library
date:
  v: 2026-02-27T18:11:00+00:00
publisher:
  v: HL7 International - [Some] Work Group
contact:
  telecom:
    system:
      v: url
    value:
      v: http://hl7.org/Special/committees/[something]
jurisdiction:
  coding:
    system:
      v: urn:iso:std:iso:3166
      l: 3166
    code:
      v: US
content:
  content type:
    v: text/cql