cql_qdm_patientapi 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7165133cf3ab4dae98bf3eab64cccc6089511bf6
4
- data.tar.gz: a7cbfc4c6c410ebb76e5c130dad3a45fe1b8a4b4
3
+ metadata.gz: 9d90e0a82b8504ddfea9c98fcfe611dbb10d0844
4
+ data.tar.gz: 85e593400fcf1bdca7517af28db957767975b121
5
5
  SHA512:
6
- metadata.gz: 976d559eaa8d4826df046fd72a5458b071cfbd8c868c005e6baea02d3b2e07997ad1542b5e9a02a9401ed8c013d8fabd76a5635c682ee6b9414d676a289fab45
7
- data.tar.gz: 6bb7d9a35ca76bb041d86b8cf7058482b249d2cb2d5ec316e35c2cb502bbe320283d8619585a24ec493ff7062e4790742c4bda29d78e794abc85dadb1725aaae
6
+ metadata.gz: 68b65eb813a96473005f003ece85a472bfd58516179e6f3d5d8fd7a2260761e65c31e4d32301bc717ad48c2be4e6d444f4cf2cbf45bd88bc5bf79b5669d47527
7
+ data.tar.gz: dfd69d85f7a52b462438b68c06329350d218db88562ad23f4716be95d62d367aaa0a0d37c442037ca98a8e3b32799e3d51381f42efa42b7fbb0aafaa153b87d2
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cql_qdm_patientapi (1.1.0)
4
+ cql_qdm_patientapi (1.1.1)
5
5
  coffee-rails (~> 4.1)
6
6
  rails (~> 4.2)
7
7
  sprockets-rails (~> 2.3)
@@ -32,7 +32,7 @@ class CQL_QDM.Helpers
32
32
  @returns cql.DateTime
33
33
  ###
34
34
  @infinityDateTime: ->
35
- cql.DateTime.parse('9999-12-31T23:59:59.999+0000')
35
+ cql.DateTime.parse('9999-12-31T23:59:59.999+00:00')
36
36
 
37
37
  ###
38
38
  For DateTime values makes sure value meets the CQL standard.
@@ -1,3 +1,3 @@
1
1
  module CqlQdmPatientapi
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -439,6 +439,14 @@
439
439
  this.display = display;
440
440
  }
441
441
 
442
+ Object.defineProperties(Concept.prototype, {
443
+ isConcept: {
444
+ get: function() {
445
+ return true;
446
+ }
447
+ }
448
+ });
449
+
442
450
  Concept.prototype.hasMatch = function(code) {
443
451
  return codesInList(toCodeList(code), this.codes);
444
452
  };
@@ -565,7 +573,7 @@
565
573
 
566
574
  DateTime.parse = function(string) {
567
575
  var arg, args, match, num, regex;
568
- match = regex = /(\d{4})(-(\d{2}))?(-(\d{2}))?(T((\d{2})(\:(\d{2})(\:(\d{2})(\.(\d+))?)?)?)?(([+-])(\d{2})(\:?(\d{2}))?)?)?/.exec(string);
576
+ match = regex = /(\d{4})(-(\d{2}))?(-(\d{2}))?(T((\d{2})(\:(\d{2})(\:(\d{2})(\.(\d+))?)?)?)?(Z|(([+-])(\d{2})(\:?(\d{2}))?))?)?/.exec(string);
569
577
  if ((match != null ? match[0] : void 0) === string) {
570
578
  args = [match[1], match[3], match[5], match[8], match[10], match[12], match[14]];
571
579
  if (args[6] != null) {
@@ -580,9 +588,11 @@
580
588
  }
581
589
  return results;
582
590
  })();
583
- if (match[17] != null) {
584
- num = parseInt(match[17], 10) + (match[19] != null ? parseInt(match[19], 10) / 60 : 0);
585
- args.push(match[16] === '+' ? num : num * -1);
591
+ if (match[18] != null) {
592
+ num = parseInt(match[18], 10) + (match[20] != null ? parseInt(match[20], 10) / 60 : 0);
593
+ args.push(match[17] === '+' ? num : num * -1);
594
+ } else if (match[15] === 'Z') {
595
+ args.push(0);
586
596
  }
587
597
  return (function(func, args, ctor) {
588
598
  ctor.prototype = func.prototype;
@@ -620,6 +630,14 @@
620
630
  }
621
631
  }
622
632
 
633
+ Object.defineProperties(DateTime.prototype, {
634
+ isDateTime: {
635
+ get: function() {
636
+ return true;
637
+ }
638
+ }
639
+ });
640
+
623
641
  DateTime.prototype.copy = function() {
624
642
  return new DateTime(this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond, this.timezoneOffset);
625
643
  };
@@ -1045,7 +1063,7 @@
1045
1063
  if (this.second != null) {
1046
1064
  str += ':' + this._pad(this.second);
1047
1065
  if (this.millisecond != null) {
1048
- str += '.' + this._pad(this.millisecond);
1066
+ str += '.' + String("00" + this.millisecond).slice(-3);
1049
1067
  }
1050
1068
  }
1051
1069
  }
@@ -1058,7 +1076,7 @@
1058
1076
  offsetHours = Math.floor(Math.abs(this.timezoneOffset));
1059
1077
  str += this._pad(offsetHours);
1060
1078
  offsetMin = (Math.abs(this.timezoneOffset) - offsetHours) * 60;
1061
- str += this._pad(offsetMin);
1079
+ str += ':' + this._pad(offsetMin);
1062
1080
  }
1063
1081
  return str;
1064
1082
  };
@@ -1144,6 +1162,14 @@
1144
1162
  this.highClosed = highClosed != null ? highClosed : true;
1145
1163
  }
1146
1164
 
1165
+ Object.defineProperties(Interval.prototype, {
1166
+ isInterval: {
1167
+ get: function() {
1168
+ return true;
1169
+ }
1170
+ }
1171
+ });
1172
+
1147
1173
  Interval.prototype.contains = function(item, precision) {
1148
1174
  var closed;
1149
1175
  if (item instanceof Interval) {
@@ -1449,9 +1475,9 @@
1449
1475
  };
1450
1476
 
1451
1477
  Interval.prototype.toClosed = function() {
1452
- var high, low, point, ref1, ref2;
1478
+ var high, low, point, ref1;
1453
1479
  point = (ref1 = this.low) != null ? ref1 : this.high;
1454
- if (typeof point === 'number' || point instanceof DateTime || (point != null ? (ref2 = point.constructor) != null ? ref2.name : void 0 : void 0) === 'Quantity') {
1480
+ if (typeof point === 'number' || point instanceof DateTime || (point != null ? point.isQuantity : void 0)) {
1455
1481
  low = (function() {
1456
1482
  switch (false) {
1457
1483
  case !(this.lowClosed && (this.low == null)):
@@ -1692,10 +1718,10 @@
1692
1718
  return arr;
1693
1719
  }
1694
1720
  allQs = arr.every(function(x) {
1695
- return x.constructor.name === "Quantity";
1721
+ return x.isQuantity;
1696
1722
  });
1697
1723
  someQs = arr.some(function(x) {
1698
- return x.constructor.name === "Quantity";
1724
+ return x.isQuantity;
1699
1725
  });
1700
1726
  if (allQs) {
1701
1727
  unit = arr[0].unit;
@@ -2074,7 +2100,7 @@
2074
2100
  return null;
2075
2101
  } else {
2076
2102
  return args != null ? args.reduce(function(x, y) {
2077
- if (x.constructor.name === 'Quantity' || x.constructor.name === 'DateTime') {
2103
+ if (x.isQuantity || x.isDateTime) {
2078
2104
  return Quantity.doAddition(x, y);
2079
2105
  } else {
2080
2106
  return x + y;
@@ -2103,7 +2129,7 @@
2103
2129
  return null;
2104
2130
  } else {
2105
2131
  return args.reduce(function(x, y) {
2106
- if (x.constructor.name === 'Quantity' || x.constructor.name === 'DateTime') {
2132
+ if (x.isQuantity || x.isDateTime) {
2107
2133
  return Quantity.doSubtraction(x, y);
2108
2134
  } else {
2109
2135
  return x - y;
@@ -2132,7 +2158,7 @@
2132
2158
  return null;
2133
2159
  } else {
2134
2160
  return args != null ? args.reduce(function(x, y) {
2135
- if (x.constructor.name === 'Quantity' || y.constructor.name === 'Quantity') {
2161
+ if (x.isQuantity || y.isQuantity) {
2136
2162
  return Quantity.doMultiplication(x, y);
2137
2163
  } else {
2138
2164
  return x * y;
@@ -2161,7 +2187,7 @@
2161
2187
  return null;
2162
2188
  } else {
2163
2189
  return args != null ? args.reduce(function(x, y) {
2164
- if (x.constructor.name === 'Quantity') {
2190
+ if (x.isQuantity) {
2165
2191
  return Quantity.doDivision(x, y);
2166
2192
  } else {
2167
2193
  return x / y;
@@ -2289,7 +2315,7 @@
2289
2315
  arg = this.execArgs(ctx);
2290
2316
  if (arg == null) {
2291
2317
  return null;
2292
- } else if (arg.constructor.name === 'Quantity') {
2318
+ } else if (arg.isQuantity) {
2293
2319
  return Quantity.createQuantity(Math.abs(arg.value), arg.unit);
2294
2320
  } else {
2295
2321
  return Math.abs(arg);
@@ -2312,7 +2338,7 @@
2312
2338
  arg = this.execArgs(ctx);
2313
2339
  if (arg == null) {
2314
2340
  return null;
2315
- } else if (arg.constructor.name === 'Quantity') {
2341
+ } else if (arg.isQuantity) {
2316
2342
  return Quantity.createQuantity(arg.value * -1, arg.unit);
2317
2343
  } else {
2318
2344
  return arg * -1;
@@ -2796,6 +2822,14 @@
2796
2822
  this.display = json.display;
2797
2823
  }
2798
2824
 
2825
+ Object.defineProperties(Concept.prototype, {
2826
+ isConcept: {
2827
+ get: function() {
2828
+ return true;
2829
+ }
2830
+ }
2831
+ });
2832
+
2799
2833
  Concept.prototype.toCode = function(ctx, code) {
2800
2834
  var ref, system;
2801
2835
  system = (ref = ctx.getCodeSystem(code.system.name)) != null ? ref.id : void 0;
@@ -3137,6 +3171,14 @@
3137
3171
  DateTime.__super__.constructor.apply(this, arguments);
3138
3172
  }
3139
3173
 
3174
+ Object.defineProperties(DateTime.prototype, {
3175
+ isDateTime: {
3176
+ get: function() {
3177
+ return true;
3178
+ }
3179
+ }
3180
+ });
3181
+
3140
3182
  DateTime.prototype.exec = function(ctx) {
3141
3183
  var args, i, len, p, property, ref;
3142
3184
  ref = DateTime.PROPERTIES;
@@ -3190,6 +3232,14 @@
3190
3232
  }
3191
3233
  }
3192
3234
 
3235
+ Object.defineProperties(Time.prototype, {
3236
+ isTime: {
3237
+ get: function() {
3238
+ return true;
3239
+ }
3240
+ }
3241
+ });
3242
+
3193
3243
  Time.prototype.exec = function(ctx) {
3194
3244
  var args, p;
3195
3245
  args = (function() {
@@ -3851,6 +3901,14 @@
3851
3901
  this.high = build(json.high);
3852
3902
  }
3853
3903
 
3904
+ Object.defineProperties(Interval.prototype, {
3905
+ isInterval: {
3906
+ get: function() {
3907
+ return true;
3908
+ }
3909
+ }
3910
+ });
3911
+
3854
3912
  Interval.prototype.exec = function(ctx) {
3855
3913
  return new dtivl.Interval(this.low.execute(ctx), this.high.execute(ctx), this.lowClosed, this.highClosed);
3856
3914
  };
@@ -4334,6 +4392,14 @@
4334
4392
  this.elements = (ref2 = build(json.element)) != null ? ref2 : [];
4335
4393
  }
4336
4394
 
4395
+ Object.defineProperties(List.prototype, {
4396
+ isList: {
4397
+ get: function() {
4398
+ return true;
4399
+ }
4400
+ }
4401
+ });
4402
+
4337
4403
  List.prototype.exec = function(ctx) {
4338
4404
  var item, j, len, ref2, results;
4339
4405
  ref2 = this.elements;
@@ -4688,6 +4754,14 @@
4688
4754
  this.value = this.value === 'true';
4689
4755
  }
4690
4756
 
4757
+ Object.defineProperties(BooleanLiteral.prototype, {
4758
+ isBooleanLiteral: {
4759
+ get: function() {
4760
+ return true;
4761
+ }
4762
+ }
4763
+ });
4764
+
4691
4765
  BooleanLiteral.prototype.exec = function(ctx) {
4692
4766
  return this.value;
4693
4767
  };
@@ -4704,6 +4778,14 @@
4704
4778
  this.value = parseInt(this.value, 10);
4705
4779
  }
4706
4780
 
4781
+ Object.defineProperties(IntegerLiteral.prototype, {
4782
+ isIntegerLiteral: {
4783
+ get: function() {
4784
+ return true;
4785
+ }
4786
+ }
4787
+ });
4788
+
4707
4789
  IntegerLiteral.prototype.exec = function(ctx) {
4708
4790
  return this.value;
4709
4791
  };
@@ -4720,6 +4802,14 @@
4720
4802
  this.value = parseFloat(this.value);
4721
4803
  }
4722
4804
 
4805
+ Object.defineProperties(DecimalLiteral.prototype, {
4806
+ isDecimalLiteral: {
4807
+ get: function() {
4808
+ return true;
4809
+ }
4810
+ }
4811
+ });
4812
+
4723
4813
  DecimalLiteral.prototype.exec = function(ctx) {
4724
4814
  return this.value;
4725
4815
  };
@@ -4735,6 +4825,14 @@
4735
4825
  StringLiteral.__super__.constructor.apply(this, arguments);
4736
4826
  }
4737
4827
 
4828
+ Object.defineProperties(StringLiteral.prototype, {
4829
+ isStringLiteral: {
4830
+ get: function() {
4831
+ return true;
4832
+ }
4833
+ }
4834
+ });
4835
+
4738
4836
  StringLiteral.prototype.exec = function(ctx) {
4739
4837
  return this.value.replace(/\\'/g, "'").replace(/\\"/g, "\"");
4740
4838
  };
@@ -5509,6 +5607,14 @@
5509
5607
  }
5510
5608
  }
5511
5609
 
5610
+ Object.defineProperties(Quantity.prototype, {
5611
+ isQuantity: {
5612
+ get: function() {
5613
+ return true;
5614
+ }
5615
+ }
5616
+ });
5617
+
5512
5618
  Quantity.prototype.clone = function() {
5513
5619
  return new Quantity({
5514
5620
  value: this.value,
@@ -6392,7 +6498,7 @@
6392
6498
  },{"./builder":14,"./expression":20}],35:[function(require,module,exports){
6393
6499
  // Generated by CoffeeScript 1.12.7
6394
6500
  (function() {
6395
- var Combine, Concatenate, Expression, Lower, PositionOf, Split, Substring, Upper, build,
6501
+ var Combine, Concatenate, EndsWith, Expression, Lower, PositionOf, Split, StartsWith, Substring, Upper, build,
6396
6502
  extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
6397
6503
  hasProp = {}.hasOwnProperty;
6398
6504
 
@@ -6569,6 +6675,52 @@
6569
6675
 
6570
6676
  })(Expression);
6571
6677
 
6678
+ module.exports.StartsWith = StartsWith = (function(superClass) {
6679
+ extend(StartsWith, superClass);
6680
+
6681
+ function StartsWith(json) {
6682
+ StartsWith.__super__.constructor.apply(this, arguments);
6683
+ }
6684
+
6685
+ StartsWith.prototype.exec = function(ctx) {
6686
+ var args;
6687
+ args = this.execArgs(ctx);
6688
+ if (args.some(function(x) {
6689
+ return x == null;
6690
+ })) {
6691
+ return null;
6692
+ } else {
6693
+ return args[0].slice(0, args[1].length) === args[1];
6694
+ }
6695
+ };
6696
+
6697
+ return StartsWith;
6698
+
6699
+ })(Expression);
6700
+
6701
+ module.exports.EndsWith = EndsWith = (function(superClass) {
6702
+ extend(EndsWith, superClass);
6703
+
6704
+ function EndsWith(json) {
6705
+ EndsWith.__super__.constructor.apply(this, arguments);
6706
+ }
6707
+
6708
+ EndsWith.prototype.exec = function(ctx) {
6709
+ var args;
6710
+ args = this.execArgs(ctx);
6711
+ if (args.some(function(x) {
6712
+ return x == null;
6713
+ })) {
6714
+ return null;
6715
+ } else {
6716
+ return args[1] === '' || args[0].slice(-args[1].length) === args[1];
6717
+ }
6718
+ };
6719
+
6720
+ return EndsWith;
6721
+
6722
+ })(Expression);
6723
+
6572
6724
  }).call(this);
6573
6725
 
6574
6726
 
@@ -6644,6 +6796,14 @@
6644
6796
  })();
6645
6797
  }
6646
6798
 
6799
+ Object.defineProperties(Tuple.prototype, {
6800
+ isTuple: {
6801
+ get: function() {
6802
+ return true;
6803
+ }
6804
+ }
6805
+ });
6806
+
6647
6807
  Tuple.prototype.exec = function(ctx) {
6648
6808
  var el, i, len, ref1, ref2, val;
6649
6809
  val = {};
@@ -43315,7 +43475,11 @@
43315
43475
 
43316
43476
  Context.prototype.supportLibraryLocalIds = function(lib, localIdResults) {
43317
43477
  var ref, results, supportLib, supportLibName;
43318
- localIdResults[lib.library.source.library.identifier.id] = lib.localId_context;
43478
+ if (localIdResults[lib.library.source.library.identifier.id] != null) {
43479
+ this.mergeLibraryLocalIdResults(localIdResults, lib.library.source.library.identifier.id, lib.localId_context);
43480
+ } else {
43481
+ localIdResults[lib.library.source.library.identifier.id] = lib.localId_context;
43482
+ }
43319
43483
  ref = lib.library_context;
43320
43484
  results = [];
43321
43485
  for (supportLibName in ref) {
@@ -43325,6 +43489,21 @@
43325
43489
  return results;
43326
43490
  };
43327
43491
 
43492
+ Context.prototype.mergeLibraryLocalIdResults = function(localIdResults, libraryId, libraryResults) {
43493
+ var existingResult, localId, localIdResult, results;
43494
+ results = [];
43495
+ for (localId in libraryResults) {
43496
+ localIdResult = libraryResults[localId];
43497
+ existingResult = localIdResults[libraryId][localId];
43498
+ if (existingResult === false || existingResult === null || existingResult === void 0 || existingResult.length === 0) {
43499
+ results.push(localIdResults[libraryId][localId] = localIdResult);
43500
+ } else {
43501
+ results.push(void 0);
43502
+ }
43503
+ }
43504
+ return results;
43505
+ };
43506
+
43328
43507
  Context.prototype.checkParameters = function(params) {
43329
43508
  var pDef, pName, pVal;
43330
43509
  for (pName in params) {
@@ -43376,12 +43555,10 @@
43376
43555
  };
43377
43556
 
43378
43557
  Context.prototype.matchesIntervalTypeSpecifier = function(val, spec) {
43379
- var ref;
43380
- return ((ref = val.constructor) != null ? ref.name : void 0) === "Interval" && ((val.low == null) || this.matchesTypeSpecifier(val.low, spec.pointType)) && ((val.high == null) || this.matchesTypeSpecifier(val.high, spec.pointType));
43558
+ return val.isInterval && ((val.low == null) || this.matchesTypeSpecifier(val.low, spec.pointType)) && ((val.high == null) || this.matchesTypeSpecifier(val.high, spec.pointType));
43381
43559
  };
43382
43560
 
43383
43561
  Context.prototype.matchesNamedTypeSpecifier = function(val, spec) {
43384
- var ref, ref1, ref2, ref3;
43385
43562
  switch (spec.name) {
43386
43563
  case "{urn:hl7-org:elm-types:r1}Boolean":
43387
43564
  return typeof val === "boolean";
@@ -43392,42 +43569,41 @@
43392
43569
  case "{urn:hl7-org:elm-types:r1}String":
43393
43570
  return typeof val === "string";
43394
43571
  case "{urn:hl7-org:elm-types:r1}Concept":
43395
- return (val != null ? (ref = val.constructor) != null ? ref.name : void 0 : void 0) === 'Concept';
43572
+ return val != null ? val.isConcept : void 0;
43396
43573
  case "{urn:hl7-org:elm-types:r1}DateTime":
43397
- return (val != null ? (ref1 = val.constructor) != null ? ref1.name : void 0 : void 0) === 'DateTime';
43574
+ return val != null ? val.isDateTime : void 0;
43398
43575
  case "{urn:hl7-org:elm-types:r1}Quantity":
43399
- return (val != null ? (ref2 = val.constructor) != null ? ref2.name : void 0 : void 0) === 'Quantity';
43576
+ return val != null ? val.isQuantity : void 0;
43400
43577
  case "{urn:hl7-org:elm-types:r1}Time":
43401
- return (val != null ? (ref3 = val.constructor) != null ? ref3.name : void 0 : void 0) === 'DateTime' && val.isTime();
43578
+ return (val != null ? val.isDateTime : void 0) && val.isTime();
43402
43579
  default:
43403
43580
  return true;
43404
43581
  }
43405
43582
  };
43406
43583
 
43407
43584
  Context.prototype.matchesInstanceType = function(val, inst) {
43408
- var ref, ref1, ref2, ref3, ref4;
43409
- switch ((ref = inst.constructor) != null ? ref.name : void 0) {
43410
- case "BooleanLiteral":
43585
+ switch (false) {
43586
+ case !inst.isBooleanLiteral:
43411
43587
  return typeof val === "boolean";
43412
- case "DecimalLiteral":
43588
+ case !inst.isDecimalLiteral:
43413
43589
  return typeof val === "number";
43414
- case "IntegerLiteral":
43590
+ case !inst.isIntegerLiteral:
43415
43591
  return typeof val === "number" && Math.floor(val) === val;
43416
- case "StringLiteral":
43592
+ case !inst.isStringLiteral:
43417
43593
  return typeof val === "string";
43418
- case "Concept":
43419
- return (val != null ? (ref1 = val.constructor) != null ? ref1.name : void 0 : void 0) === "Concept";
43420
- case "DateTime":
43421
- return (val != null ? (ref2 = val.constructor) != null ? ref2.name : void 0 : void 0) === "DateTime";
43422
- case "Quantity":
43423
- return (val != null ? (ref3 = val.constructor) != null ? ref3.name : void 0 : void 0) === "Quantity";
43424
- case "Time":
43425
- return (val != null ? (ref4 = val.constructor) != null ? ref4.name : void 0 : void 0) === "DateTime" && val.isTime();
43426
- case "List":
43594
+ case !inst.isConcept:
43595
+ return val != null ? val.isConcept : void 0;
43596
+ case !inst.isDateTime:
43597
+ return val != null ? val.isDateTime : void 0;
43598
+ case !inst.isQuantity:
43599
+ return val != null ? val.isQuantity : void 0;
43600
+ case !inst.isTime:
43601
+ return (val != null ? val.isDateTime : void 0) && val.isTime();
43602
+ case !inst.isList:
43427
43603
  return this.matchesListInstanceType(val, inst);
43428
- case "Tuple":
43604
+ case !inst.isTuple:
43429
43605
  return this.matchesTupleInstanceType(val, inst);
43430
- case "Interval":
43606
+ case !inst.isInterval:
43431
43607
  return this.matchesIntervalInstanceType(val, inst);
43432
43608
  default:
43433
43609
  return true;
@@ -43451,9 +43627,9 @@
43451
43627
  };
43452
43628
 
43453
43629
  Context.prototype.matchesIntervalInstanceType = function(val, ivl) {
43454
- var pointType, ref, ref1;
43630
+ var pointType, ref;
43455
43631
  pointType = (ref = ivl.low) != null ? ref : ivl.high;
43456
- return ((ref1 = val.constructor) != null ? ref1.name : void 0) === "Interval" && ((val.low == null) || this.matchesInstanceType(val.low, pointType)) && ((val.high == null) || this.matchesInstanceType(val.high, pointType));
43632
+ return val.isInterval && ((val.low == null) || this.matchesInstanceType(val.low, pointType)) && ((val.high == null) || this.matchesInstanceType(val.high, pointType));
43457
43633
  };
43458
43634
 
43459
43635
  return Context;
@@ -43677,8 +43853,9 @@
43677
43853
  }
43678
43854
 
43679
43855
  Results.prototype.recordPatientResult = function(patient_ctx, resultName, result) {
43680
- var base, patientId;
43681
- patientId = patient_ctx.patient.id();
43856
+ var base, p, patientId;
43857
+ p = patient_ctx.patient;
43858
+ patientId = typeof p.getId === 'function' ? p.getId() : p.id();
43682
43859
  if ((base = this.patientResults)[patientId] == null) {
43683
43860
  base[patientId] = {};
43684
43861
  }
@@ -43712,8 +43889,7 @@
43712
43889
  };
43713
43890
 
43714
43891
  areDateTimesOrQuantities = function(a, b) {
43715
- var ref, ref1;
43716
- return (a instanceof DateTime && b instanceof DateTime) || ((a != null ? (ref = a.constructor) != null ? ref.name : void 0 : void 0) === 'Quantity' && (b != null ? (ref1 = b.constructor) != null ? ref1.name : void 0 : void 0) === 'Quantity');
43892
+ return (a instanceof DateTime && b instanceof DateTime) || ((a != null ? a.isQuantity : void 0) && (b != null ? b.isQuantity : void 0));
43717
43893
  };
43718
43894
 
43719
43895
  isUncertainty = function(x) {
@@ -43876,11 +44052,11 @@
43876
44052
  };
43877
44053
 
43878
44054
  module.exports.equals = equals = function(a, b) {
43879
- var aClass, bClass, ref, ref1;
44055
+ var aClass, bClass, ref;
43880
44056
  if (!((a != null) && (b != null))) {
43881
44057
  return null;
43882
44058
  }
43883
- if ((a != null ? (ref = a.constructor) != null ? ref.name : void 0 : void 0) === 'Quantity') {
44059
+ if (a != null ? a.isQuantity : void 0) {
43884
44060
  return a.equals(b);
43885
44061
  }
43886
44062
  if (a instanceof Uncertainty) {
@@ -43894,7 +44070,7 @@
43894
44070
  if (a === b) {
43895
44071
  return true;
43896
44072
  }
43897
- ref1 = getClassOfObjects(a, b), aClass = ref1[0], bClass = ref1[1];
44073
+ ref = getClassOfObjects(a, b), aClass = ref[0], bClass = ref[1];
43898
44074
  if (aClass !== bClass) {
43899
44075
  return false;
43900
44076
  }
@@ -43906,7 +44082,7 @@
43906
44082
  return a[p] === b[p];
43907
44083
  });
43908
44084
  case '[object Array]':
43909
- if (a.includes(null) || a.includes(void 0) || b.includes(null) || b.includes(void 0)) {
44085
+ if (a.indexOf(null) >= 0 || a.indexOf(void 0) >= 0 || b.indexOf(null) >= 0 || b.indexOf(void 0) >= 0) {
43910
44086
  return null;
43911
44087
  }
43912
44088
  return compareEveryItemInArrays(a, b, equals);
@@ -43963,7 +44139,7 @@
43963
44139
  })(Exception);
43964
44140
 
43965
44141
  module.exports.successor = successor = function(val) {
43966
- var e, high, ref, succ;
44142
+ var e, high, succ;
43967
44143
  if (typeof val === "number") {
43968
44144
  if (parseInt(val) === val) {
43969
44145
  if (val === MAX_INT_VALUE) {
@@ -43990,7 +44166,7 @@
43990
44166
  }
43991
44167
  })();
43992
44168
  return new Uncertainty(successor(val.low), high);
43993
- } else if ((val != null ? (ref = val.constructor) != null ? ref.name : void 0 : void 0) === 'Quantity') {
44169
+ } else if (val != null ? val.isQuantity : void 0) {
43994
44170
  succ = val.clone();
43995
44171
  succ.value = successor(val.value);
43996
44172
  return succ;
@@ -44000,7 +44176,7 @@
44000
44176
  };
44001
44177
 
44002
44178
  module.exports.predecessor = predecessor = function(val) {
44003
- var e, low, pred, ref;
44179
+ var e, low, pred;
44004
44180
  if (typeof val === "number") {
44005
44181
  if (parseInt(val) === val) {
44006
44182
  if (val === MIN_INT_VALUE) {
@@ -44027,7 +44203,7 @@
44027
44203
  }
44028
44204
  })();
44029
44205
  return new Uncertainty(low, predecessor(val.high));
44030
- } else if ((val != null ? (ref = val.constructor) != null ? ref.name : void 0 : void 0) === 'Quantity') {
44206
+ } else if (val != null ? val.isQuantity : void 0) {
44031
44207
  pred = val.clone();
44032
44208
  pred.value = predecessor(val.value);
44033
44209
  return pred;
@@ -44037,7 +44213,7 @@
44037
44213
  };
44038
44214
 
44039
44215
  module.exports.maxValueForInstance = function(val) {
44040
- var ref, val2;
44216
+ var val2;
44041
44217
  if (typeof val === "number") {
44042
44218
  if (parseInt(val) === val) {
44043
44219
  return MAX_INT_VALUE;
@@ -44046,7 +44222,7 @@
44046
44222
  }
44047
44223
  } else if (val instanceof DateTime) {
44048
44224
  return MAX_DATE_VALUE;
44049
- } else if ((val != null ? (ref = val.constructor) != null ? ref.name : void 0 : void 0) === 'Quantity') {
44225
+ } else if (val != null ? val.isQuantity : void 0) {
44050
44226
  val2 = val.clone();
44051
44227
  val2.value = maxValueForInstance(val2.value);
44052
44228
  return val2;
@@ -44056,7 +44232,7 @@
44056
44232
  };
44057
44233
 
44058
44234
  module.exports.minValueForInstance = function(val) {
44059
- var ref, val2;
44235
+ var val2;
44060
44236
  if (typeof val === "number") {
44061
44237
  if (parseInt(val) === val) {
44062
44238
  return MIN_INT_VALUE;
@@ -44065,7 +44241,7 @@
44065
44241
  }
44066
44242
  } else if (val instanceof DateTime) {
44067
44243
  return MIN_DATE_VALUE;
44068
- } else if ((val != null ? (ref = val.constructor) != null ? ref.name : void 0 : void 0) === 'Quantity') {
44244
+ } else if (val != null ? val.isQuantity : void 0) {
44069
44245
  val2 = val.clone();
44070
44246
  val2.value = minValueForInstance(val2.value);
44071
44247
  return val2;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cql_qdm_patientapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - The MITRE Corporation
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-03 00:00:00.000000000 Z
11
+ date: 2018-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  version: '0'
132
132
  requirements: []
133
133
  rubyforge_project:
134
- rubygems_version: 2.6.14
134
+ rubygems_version: 2.5.2.1
135
135
  signing_key:
136
136
  specification_version: 4
137
137
  summary: QDM CQL execution engine and HDS patient model interface