cql 0.7.0
cql: ^0.7.0 copied to clipboard
Model-independent CQL (Clinical Quality Language) translator and execution engine. FHIR-free — data access via ModelResolver; bindings are fhir_r4/r5/r6_cql.
Changelog #
0.7.0 #
-
Dates no calendar holds are refused everywhere.
CqlDate/CqlDateTimechecked year, month, day, time fields and their nesting withasserts, which a compiled app skips: on a device Feb 30 2024 constructed. The checks are nowCqlDateTimeBase.checkFields, run on every construction path, throwing aFormatExceptionnaming the field. The string parser also reads the whole string or refuses it ('2024-13-01'used to read as the year 2024), raisesFormatExceptionrather thanArgumentErrorfor text that is not a date-time, and accepts CQL's@2016T/@2012-01Tliteral forms.CqlLongenforces the 64-bit range its message always claimed. -
Every
catch (_)in the engine names what it absorbs, with the CQL sentence it implements (62 sites).ToDate,ToDateTime,ToTime,ToLong,ToInteger(Long out of range),ToRatio,ToQuantityandToStringanswer null for input they cannot convert instead of throwing;ConvertsTo*andCanConvert*are exactlyTo* != null; quantity comparisons and interval operators answer null for units that do not compare (previouslyafter/before/same or beforecould throw aUcumExceptionout of the engine);predecessor/successorat the calendar's edge are null. A library'sresolveCodeRef/resolveValueSetRef/resolveCodeSystemRefreturn null for an unknown name instead of throwing. A defect (anError) inside any of these now surfaces instead of becoming false or null. -
The annotation types (
Annotation,ErrorAnnotation,CqlToElmError,CqlToElmInfo,Locator,Tag,Narrative,ErrorSeverity,ErrorType,CqlToElmBase) are exported from the public barrel.libraryFromCqlhas always recorded translation errors onCqlLibrary.annotationinstead of throwing; without the types a caller could not tell a library that translated from one that did not. -
CqlDateTimeBase.valueDateTimeis the instant the value denotes. A value withZor an explicit offset is returned in UTC, asDateTime.parsedoes:2013-01-14T10:00:00+02:00is 08:00Z. It used to build a localDateTimefrom the wall-clock components and discard the offset, so that value read 10:00 in whatever zone the machine ran in. A value with no offset is still returned in the local zone.DurationBetweenandDifferenceBetweenhad compensated for the old behaviour by re-applying the offset themselves; they no longer do, so their answers are unchanged (the spec's own cross-offset cases,hours between @2017-03-12T01:00:00-07:00 and @2017-03-12T03:00:00-06:00 = 1, are now engine tests).
0.6.3 #
BundleDataProviderexported from the public barrel (retrieve data directly from a Bundle without a custom provider)
0.6.2 #
- Widen meta constraint to ^1.16.0 (was ^1.19.0, which conflicted with the meta version pinned by current Flutter SDKs, making cql unresolvable alongside Flutter packages)
0.6.1 #
- Fix: fractional timezone offsets (+05:30, +05:45, -03:30) were truncated to whole hours when rendering CqlDateTime value strings (same defect class as fhir_r4 0.6.1); regression test added
0.6.0 #
Versioned 0.6.0 (not 0.1.0) to ship on the same release train as the fhir_r4/r5/r6 family — the fhir-fli packages version in lockstep (ucum excepted, which is independent).
Initial release of the standalone, model-independent CQL engine and
CQL-to-ELM translator, extracted from fhir_r4_cql (which is now a thin
R4B binding over this package, alongside fhir_r5_cql and fhir_r6_cql).
- Architecture: FHIR-free. Concrete data access enters through the
ModelResolver/RetrieveProviderboundary interfaces, implemented by the per-version binding packages. A port of the reference cqframework (Java) engine and translator; 595 tests including the CQL conformance suites. - CQL System primitives are deliberately wrapped (
CqlLongis BigInt-backed — Dartintis a JS double on the web;CqlDecimalpreserves source scale forequivalent). The reference implementations went native because their native types fit; Dart's don't. - Package layout: implementation under
lib/src/with a curatedpackage:cql/cql.dartbarrel (engine, translator API, ELM model, System primitives, boundary interfaces, exceptions). The ANTLR-generated lexer/parser is internal. - Data: ships the modelinfo data served by
StandardModelInfoProvider(FHIR 1.0.2–4.0.1, QDM 4.1.2–5.6, QUICK, QICore, US Core, System/Test) — regenerable via the checked-intool/regenerate_modelinfo.dart. The ~23MB of generated QDM/QUICK model classes (never imported) and the experimental modelinfo variants were removed; superseded generator scripts deleted in favor of the tool/ pipeline. - Known limitation: library/valueset file loading uses
dart:ioin a few exported files, so web support is pending their move behind provider seams.