Skip to content

Commit 81b47fc

Browse files
authored
Update CQL URLs to link to CQL R2 (2.0) (#375)
1 parent 779b541 commit 81b47fc

5 files changed

Lines changed: 32 additions & 34 deletions

File tree

OVERVIEW.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ In order for the CQL execution framework to determine if a code is in a valueset
9595

9696
### MessageListener
9797

98-
The CQL specification defines a [Message](https://cql.hl7.org/09-b-cqlreference.html#message) operator that "provides a run-time mechanism for returning messages, warnings, traces, and errors to the calling environment." To support this, the CQL execution framework supports a "MessageListener" API. A MessageListener class must contain an `onMessage` function which will be called by the CQL execution framework if the `condition` passed to the `Message` operator is `true`:
98+
The CQL specification defines a [Message](https://cql.hl7.org/R2/09-b-cqlreference.html#message) operator that "provides a run-time mechanism for returning messages, warnings, traces, and errors to the calling environment." To support this, the CQL execution framework supports a "MessageListener" API. A MessageListener class must contain an `onMessage` function which will be called by the CQL execution framework if the `condition` passed to the `Message` operator is `true`:
9999
```typescript
100100
onMessage(source: any, code: string, severity: string, message: string) {
101101
// do something with the message

src/datatypes/interval.ts

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ import {
2323
import { MIN_FLOAT_VALUE } from '../util/limits';
2424
import { Quantity } from './quantity';
2525

26-
// TODO: Replace all build.fhir.org URL references with stable references once CQL 2.0 is pulished
27-
2826
export class Interval {
2927
constructor(
3028
public low: any,
@@ -78,7 +76,7 @@ export class Interval {
7876
return new Interval(newLow, newHigh, this.lowClosed, this.highClosed, this.pointType);
7977
}
8078

81-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#contains
79+
// https://cql.hl7.org/R2/09-b-cqlreference.html#contains
8280
contains(item: any, precision?: any) {
8381
if (item != null && item.isInterval) {
8482
throw new Error('Argument to contains must be a point');
@@ -93,7 +91,7 @@ export class Interval {
9391
);
9492
}
9593

96-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#properly-includes
94+
// https://cql.hl7.org/R2/09-b-cqlreference.html#properly-includes
9795
properContains(item: any, precision?: any) {
9896
// From contains: "If the second argument is null, the result is null."
9997
if (item == null) {
@@ -110,7 +108,7 @@ export class Interval {
110108
);
111109
}
112110

113-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#properly-includes
111+
// https://cql.hl7.org/R2/09-b-cqlreference.html#properly-includes
114112
properlyIncludes(other: any, precision?: any) {
115113
// "For the interval-interval overload, if either argument is null, the result is null."
116114
if (other == null) {
@@ -130,7 +128,7 @@ export class Interval {
130128
);
131129
}
132130

133-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#includes
131+
// https://cql.hl7.org/R2/09-b-cqlreference.html#includes
134132
includes(other: any, precision?: any) {
135133
// "For the interval-interval overload, if either argument is null, the result is null."
136134
if (other == null) {
@@ -151,7 +149,7 @@ export class Interval {
151149
);
152150
}
153151

154-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#included-in
152+
// https://cql.hl7.org/R2/09-b-cqlreference.html#included-in
155153
includedIn(other: any, precision?: any) {
156154
// "For the interval-interval overload, if either argument is null, the result is null."
157155
if (other == null) {
@@ -170,7 +168,7 @@ export class Interval {
170168
);
171169
}
172170

173-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#overlaps
171+
// https://cql.hl7.org/R2/09-b-cqlreference.html#overlaps
174172
overlaps(other: any, precision?: any) {
175173
// "If either argument is null, the result is null."
176174
if (other == null) {
@@ -187,7 +185,7 @@ export class Interval {
187185
);
188186
}
189187

190-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#overlaps
188+
// https://cql.hl7.org/R2/09-b-cqlreference.html#overlaps
191189
overlapsAfter(other: any, precision?: any) {
192190
// "If either argument is null, the result is null."
193191
if (other == null) {
@@ -201,7 +199,7 @@ export class Interval {
201199
);
202200
}
203201

204-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#overlaps
202+
// https://cql.hl7.org/R2/09-b-cqlreference.html#overlaps
205203
overlapsBefore(other: any, precision?: any) {
206204
// "If either argument is null, the result is null."
207205
if (other == null) {
@@ -215,7 +213,7 @@ export class Interval {
215213
);
216214
}
217215

218-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#union
216+
// https://cql.hl7.org/R2/09-b-cqlreference.html#union
219217
union(other: any) {
220218
// "If either argument is null, the result is null."
221219
if (other == null) {
@@ -253,7 +251,7 @@ export class Interval {
253251
);
254252
}
255253

256-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#intersect
254+
// https://cql.hl7.org/R2/09-b-cqlreference.html#intersect
257255
intersect(other: any) {
258256
// "If either argument is null, the result is null."
259257
if (other == null) {
@@ -292,7 +290,7 @@ export class Interval {
292290
);
293291
}
294292

295-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#except
293+
// https://cql.hl7.org/R2/09-b-cqlreference.html#except
296294
except(other: any) {
297295
// "If either argument is null, the result is null."
298296
if (other === null) {
@@ -339,7 +337,7 @@ export class Interval {
339337
return null;
340338
}
341339

342-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#same-as-2
340+
// https://cql.hl7.org/R2/09-b-cqlreference.html#same-as-2
343341
sameAs(other: any, precision?: any) {
344342
// "If either or both arguments are null, the result is null."
345343
if (other === null) {
@@ -373,7 +371,7 @@ export class Interval {
373371
}
374372
}
375373

376-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#same-or-after-2
374+
// https://cql.hl7.org/R2/09-b-cqlreference.html#same-or-after-2
377375
sameOrBefore(other: any, precision?: any) {
378376
// "If either or both arguments are null, the result is null."
379377
if (other === null) {
@@ -401,7 +399,7 @@ export class Interval {
401399
return cmp.lessThanOrEquals(left.end(), right.start(), precision);
402400
}
403401

404-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#same-or-after-2
402+
// https://cql.hl7.org/R2/09-b-cqlreference.html#same-or-after-2
405403
sameOrAfter(other: any, precision?: any) {
406404
// "If either or both arguments are null, the result is null."
407405
if (other === null) {
@@ -429,7 +427,7 @@ export class Interval {
429427
return cmp.greaterThanOrEquals(left.start(), right.end(), precision);
430428
}
431429

432-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#equal-1
430+
// https://cql.hl7.org/R2/09-b-cqlreference.html#equal-1
433431
equals(other: any) {
434432
// "If either argument is null, the result is null."
435433
if (other == null) {
@@ -449,7 +447,7 @@ export class Interval {
449447
);
450448
}
451449

452-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#after-1
450+
// https://cql.hl7.org/R2/09-b-cqlreference.html#after-1
453451
after(other: any, precision?: any) {
454452
// "If either argument is null, the result is null."
455453
if (other == null) {
@@ -467,7 +465,7 @@ export class Interval {
467465
return cmp.greaterThan(this.start(), other.end(), precision);
468466
}
469467

470-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#before-1
468+
// https://cql.hl7.org/R2/09-b-cqlreference.html#before-1
471469
before(other: any, precision?: any) {
472470
// "If either argument is null, the result is null."
473471
if (other == null) {
@@ -485,7 +483,7 @@ export class Interval {
485483
return cmp.lessThan(this.end(), other.start(), precision);
486484
}
487485

488-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#meets
486+
// https://cql.hl7.org/R2/09-b-cqlreference.html#meets
489487
meets(other: any, precision?: any) {
490488
// "If either argument is null, the result is null."
491489
if (other == null) {
@@ -503,7 +501,7 @@ export class Interval {
503501
);
504502
}
505503

506-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#meets
504+
// https://cql.hl7.org/R2/09-b-cqlreference.html#meets
507505
meetsAfter(other: any, precision?: any) {
508506
// "If either argument is null, the result is null."
509507
if (other == null) {
@@ -528,7 +526,7 @@ export class Interval {
528526
}
529527
}
530528

531-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#meets
529+
// https://cql.hl7.org/R2/09-b-cqlreference.html#meets
532530
meetsBefore(other: any, precision?: any) {
533531
// "If either argument is null, the result is null."
534532
if (other == null) {
@@ -556,7 +554,7 @@ export class Interval {
556554
}
557555
}
558556

559-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#start
557+
// https://cql.hl7.org/R2/09-b-cqlreference.html#start
560558
start() {
561559
// "If the low boundary of the interval is closed and null, this operator returns the minimum
562560
// value for the point type of the interval."
@@ -581,7 +579,7 @@ export class Interval {
581579
return this.lowClosed ? this.low : successor(this.low, this.pointType);
582580
}
583581

584-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#end
582+
// https://cql.hl7.org/R2/09-b-cqlreference.html#end
585583
end() {
586584
// "If the high boundary of the interval is closed and null, this operator returns the maximum
587585
// value for the point type of the interval."
@@ -606,7 +604,7 @@ export class Interval {
606604
return this.highClosed ? this.high : predecessor(this.high, this.pointType);
607605
}
608606

609-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#starts
607+
// https://cql.hl7.org/R2/09-b-cqlreference.html#starts
610608
starts(other: any, precision?: any) {
611609
// "If either argument is null, the result is null."
612610
if (other == null) {
@@ -634,7 +632,7 @@ export class Interval {
634632
}
635633
}
636634

637-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#ends
635+
// https://cql.hl7.org/R2/09-b-cqlreference.html#ends
638636
ends(other: any, precision?: any) {
639637
// "If either argument is null, the result is null."
640638
if (other == null) {
@@ -662,7 +660,7 @@ export class Interval {
662660
}
663661
}
664662

665-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#width
663+
// https://cql.hl7.org/R2/09-b-cqlreference.html#width
666664
width() {
667665
// "Note that because CQL defines duration and difference operations for date and time valued
668666
// intervals, width is not defined for intervals of these types."
@@ -680,7 +678,7 @@ export class Interval {
680678
return limitDecimalPrecision(subtract(end, start, this.pointType));
681679
}
682680

683-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#size
681+
// https://cql.hl7.org/R2/09-b-cqlreference.html#size
684682
size() {
685683
// "Note that because CQL defines duration and difference operations for date and time valued
686684
// intervals, size is not defined for intervals of these types."
@@ -700,7 +698,7 @@ export class Interval {
700698
);
701699
}
702700

703-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#size
701+
// https://cql.hl7.org/R2/09-b-cqlreference.html#size
704702
getPointSize() {
705703
// "... point-size is determined by successor of minimum T - minimum T"
706704
let minValue = minValueForType(this.pointType, getQuantityInstanceForMinMax(this));
@@ -726,7 +724,7 @@ export class Interval {
726724
throw new Error('Point type of interval cannot be determined.');
727725
}
728726

729-
// https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#point-from
727+
// https://cql.hl7.org/R2/09-b-cqlreference.html#point-from
730728
pointFrom() {
731729
// "The point from operator extracts the single point from a unit interval."
732730
const start = this.start();

src/elm/clinical.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ export class CalculateAge extends Expression {
298298
// From the spec: "Note that for AgeInYears and AgeInMonths, the birthDate is specified as a
299299
// Date and Today() is used to obtain the current date; whereas with the other precisions,
300300
// birthDate is specified as a DateTime, and Now() is used to obtain the current DateTime."
301-
// See: https://cql.hl7.org/09-b-cqlreference.html#age
301+
// See: https://cql.hl7.org/R2/09-b-cqlreference.html#age
302302
let asOf: dt.Date | dt.DateTime;
303303
if (
304304
this.precision.toLowerCase() === dt.DateTime.Unit.YEAR ||

src/elm/query.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ export class Query extends Expression {
247247
});
248248

249249
// Iterate over the cartesian product of the sources.
250-
// See: https://cql.hl7.org/03-developersguide.html#multi-source-queries
250+
// See: https://cql.hl7.org/R2/03-developersguide.html#multi-source-queries
251251
const cartesian = cartesianProductOf(sourceResults);
252252
let returnedValues: any[] = [];
253253
for (const combo of cartesian) {

src/types/type-specifiers.interfaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
ELM_CHOICE_TYPE_SPECIFIER
77
} from '../util/elmTypes';
88

9-
// Types derived from http://cql.hl7.org/04-logicalspecification.html#typespecifier
9+
// Types derived from http://cql.hl7.org/R2/04-logicalspecification.html#typespecifier
1010

1111
/*
1212
* Utility type for any possible TypeSpecifier

0 commit comments

Comments
 (0)