cql_qdm_patientapi 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 90dd947bbcc35e52cd872156110582674021c47e
4
- data.tar.gz: 1459f79347adb75bd22385cbe0cdd1e04f13c9bd
3
+ metadata.gz: 22f5731f75487f42ff6bba1c933877d14246d907
4
+ data.tar.gz: da61edb92afdf06618c06c51473077e13e4daa5e
5
5
  SHA512:
6
- metadata.gz: '029890ec9d29f76de20513a6748f1350c982e70df4826d735a8337134d40047c4ea7ae44efacd08b16745dce625e53786e285016b618c59098dd91dc2e1478ee'
7
- data.tar.gz: 5425b8705137d6d19aa3b4e7ecd19cdc7261ab154a4ff528257ff3b1c11e1a76ecfcacadabfc965c9d5027f21753763a4c738f4ab436d8e36c20b98a7eab41c5
6
+ metadata.gz: ad09b811319929d929f9d63248ca34c6483d29c967cf3ada905beb5058b8750ea592113ea04b7b798d8adb88a325ea8215fe909e29a5917e9998c930656ef230
7
+ data.tar.gz: 8ed424e626cf70a3ed1ecdebf31bf96339415bea40b568430253dc38a4abab1afac3340c12c6684886d7b363212376519640b63cf522e01980098d98c342da65
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cql_qdm_patientapi (1.1.3)
4
+ cql_qdm_patientapi (1.1.4)
5
5
  coffee-rails (~> 4.1)
6
6
  rails (~> 4.2)
7
7
  sprockets-rails (~> 2.3)
@@ -102,7 +102,7 @@ GEM
102
102
  rake (>= 0.8.7)
103
103
  thor (>= 0.18.1, < 2.0)
104
104
  rake (12.2.1)
105
- sprockets (3.7.1)
105
+ sprockets (3.7.2)
106
106
  concurrent-ruby (~> 1.0)
107
107
  rack (> 1, < 3)
108
108
  sprockets-rails (2.3.3)
@@ -128,4 +128,4 @@ DEPENDENCIES
128
128
  teaspoon-jasmine (= 2.3.4)
129
129
 
130
130
  BUNDLED WITH
131
- 1.16.1
131
+ 1.16.2
@@ -85,7 +85,7 @@ class CQL_QDM.DiagnosticStudyPerformed extends CQL_QDM.QDMDatatype
85
85
  else
86
86
  # No end time; high is set to infinity
87
87
  @_relevantPeriodHigh = CQL_QDM.Helpers.infinityDateTime()
88
- @_status = @entry.status
88
+ @_status = @entry.qdm_status
89
89
  @_components = @entry.components
90
90
 
91
91
 
@@ -86,8 +86,14 @@ class CQL_QDM.ImmunizationOrder extends CQL_QDM.QDMDatatype
86
86
  ###
87
87
  constructor: (@entry) ->
88
88
  super @entry
89
- @_activeDatetime = CQL_QDM.Helpers.convertDateTime(@entry.active_datetime)
90
89
  @_authorDatetime = CQL_QDM.Helpers.convertDateTime(@entry.start_time)
90
+
91
+ # if activeDatetime is provided, use it, otherwise default to authorDatetime per QDM spec
92
+ if @entry.active_datetime?
93
+ @_activeDatetime = CQL_QDM.Helpers.convertDateTime(@entry.active_datetime)
94
+ else
95
+ @_activeDatetime = @_authorDatetime
96
+
91
97
  @_dosage = @entry.dose
92
98
  @_negationRationale = @entry.negationReason
93
99
  @_reason = @entry.reason
@@ -67,7 +67,7 @@ class CQL_QDM.InterventionPerformed extends CQL_QDM.QDMDatatype
67
67
  @_relevantPeriodHigh = CQL_QDM.Helpers.infinityDateTime()
68
68
  if @entry.values? && @entry.values.length > 0
69
69
  @_result = @entry.values?[0]
70
- @_status = @entry.status
70
+ @_status = @entry.qdm_status
71
71
 
72
72
  ###
73
73
  Author date time is only present when this data type has been negated.
@@ -53,7 +53,6 @@ class CQL_QDM.LaboratoryTestOrder extends CQL_QDM.QDMDatatype
53
53
  authorDatetime: ->
54
54
  @_authorDatetime
55
55
 
56
-
57
56
  ###
58
57
  Data elements that meet criteria using this datatype should document the
59
58
  laboratory test indicated by the QDM category and its corresponding value set
@@ -80,7 +79,7 @@ class CQL_QDM.LaboratoryTestPerformed extends CQL_QDM.QDMDatatype
80
79
  if @entry.values? && @entry.values.length > 0
81
80
  @_result = @entry.values?[0]
82
81
  @_resultDatetime = CQL_QDM.Helpers.convertDateTime(@entry.result_date_time)
83
- @_status = @entry.status
82
+ @_status = @entry.qdm_status
84
83
  @_components = @entry.components
85
84
 
86
85
  ###
@@ -369,7 +369,6 @@ class CQL_QDM.MedicationOrder extends CQL_QDM.QDMDatatype
369
369
  ###
370
370
  constructor: (@entry) ->
371
371
  super @entry
372
- @_activeDatetime = CQL_QDM.Helpers.convertDateTime(@entry.active_datetime)
373
372
  @_authorDatetime = CQL_QDM.Helpers.convertDateTime(@entry.start_time)
374
373
  @_dosage = @entry.dose
375
374
  @_frequency = @entry.administrationTiming
@@ -386,12 +385,6 @@ class CQL_QDM.MedicationOrder extends CQL_QDM.QDMDatatype
386
385
  # No end time; high is set to infinity
387
386
  @_relevantPeriodHigh = CQL_QDM.Helpers.infinityDateTime()
388
387
 
389
- ###
390
- @returns {Date}
391
- ###
392
- activeDatetime: ->
393
- @_activeDatetime
394
-
395
388
  ###
396
389
  @returns {Date}
397
390
  ###
@@ -110,7 +110,7 @@ class CQL_QDM.ProcedurePerformed extends CQL_QDM.QDMDatatype
110
110
  @_relevantPeriodHigh = CQL_QDM.Helpers.infinityDateTime()
111
111
  if @entry.values? && @entry.values.length > 0
112
112
  @_result = @entry.values?[0]
113
- @_status = @entry.status
113
+ @_status = @entry.qdm_status
114
114
  @_components = @entry.components
115
115
 
116
116
  ###
@@ -1,3 +1,3 @@
1
1
  module CqlQdmPatientapi
2
- VERSION = "1.1.3"
2
+ VERSION = "1.1.4"
3
3
  end
@@ -551,7 +551,7 @@
551
551
  },{"./clinical":5,"./datetime":7,"./interval":9,"./logic":10,"./uncertainty":11}],7:[function(require,module,exports){
552
552
  // Generated by CoffeeScript 1.12.7
553
553
  (function() {
554
- var DateTime, Uncertainty, convertTimezoneOffset, cqlFormatStringToMomentFormatString, getTimezoneSeparatorFromString, isValidDateTimeStringFormat, moment, normalizeMillisecondsField, normalizeMillisecondsFieldInString;
554
+ var DateTime, Uncertainty, cqlFormatStringToMomentFormatString, getTimezoneSeparatorFromString, isValidDateTimeStringFormat, moment, normalizeMillisecondsField, normalizeMillisecondsFieldInString;
555
555
 
556
556
  Uncertainty = require('./uncertainty').Uncertainty;
557
557
 
@@ -1184,21 +1184,11 @@
1184
1184
  return momentString = momentString.replace(/f/g, 'S');
1185
1185
  };
1186
1186
 
1187
- convertTimezoneOffset = function(matches) {
1188
- var num;
1189
- num = parseInt(matches[17], 10) + (matches[19] != null ? parseInt(matches[19], 10) / 60 : 0);
1190
- if (matches[16] === '+') {
1191
- return num;
1192
- } else {
1193
- return num * -1;
1194
- }
1195
- };
1196
-
1197
1187
  getTimezoneSeparatorFromString = function(string) {
1198
1188
  var ref, ref1, timezoneSeparator;
1199
- if ((typeof msAndAfter !== "undefined" && msAndAfter !== null ? (ref = msAndAfter.match(/-/)) != null ? ref.length : void 0 : void 0) === 1) {
1189
+ if ((string != null ? (ref = string.match(/-/)) != null ? ref.length : void 0 : void 0) === 1) {
1200
1190
  return timezoneSeparator = '-';
1201
- } else if ((typeof msAndAfter !== "undefined" && msAndAfter !== null ? (ref1 = msAndAfter.match(/\+/)) != null ? ref1.length : void 0 : void 0) === 1) {
1191
+ } else if ((string != null ? (ref1 = string.match(/\+/)) != null ? ref1.length : void 0 : void 0) === 1) {
1202
1192
  return timezoneSeparator = '+';
1203
1193
  } else {
1204
1194
  return timezoneSeparator = '';
@@ -43957,7 +43947,7 @@
43957
43947
  },{}],133:[function(require,module,exports){
43958
43948
  // Generated by CoffeeScript 1.12.7
43959
43949
  (function() {
43960
- var DateTime, Uncertainty, areDateTimesOrQuantities, areNumbers, classesEqual, codesAreEquivalent, compareEveryItemInArrays, compareObjects, deepCompareKeysAndValues, equals, equivalent, getClassOfObjects, getKeysFromObject, isCode, isUncertainty;
43950
+ var DateTime, Uncertainty, areDateTimesOrQuantities, areNumbers, classesEqual, codesAreEquivalent, compareEveryItemInArrays, compareObjects, deepCompareKeysAndValues, equals, equivalent, getClassOfObjects, getKeysFromObject, isCode, isFunction, isUncertainty;
43961
43951
 
43962
43952
  DateTime = require('../datatypes/datetime').DateTime;
43963
43953
 
@@ -44108,19 +44098,30 @@
44108
44098
  };
44109
44099
 
44110
44100
  deepCompareKeysAndValues = function(a, b, comparisonFunction) {
44111
- var aKeys, bKeys;
44101
+ var aKeys, bKeys, finalComparisonResult, shouldReturnNull;
44112
44102
  aKeys = getKeysFromObject(a);
44113
44103
  bKeys = getKeysFromObject(b);
44114
- return aKeys.length === bKeys.length && aKeys.every(function(key) {
44115
- return comparisonFunction(a[key], b[key]);
44104
+ shouldReturnNull = false;
44105
+ finalComparisonResult = aKeys.length === bKeys.length && aKeys.every(function(key) {
44106
+ var comparisonResult;
44107
+ comparisonResult = comparisonFunction(a[key], b[key]);
44108
+ if (comparisonResult === null) {
44109
+ shouldReturnNull = true;
44110
+ }
44111
+ return comparisonResult;
44116
44112
  });
44113
+ if (shouldReturnNull) {
44114
+ return null;
44115
+ }
44116
+ return finalComparisonResult;
44117
44117
  };
44118
44118
 
44119
44119
  getKeysFromObject = function(object) {
44120
- var key;
44120
+ var key, objectClass;
44121
+ objectClass = {}.toString.call(object);
44121
44122
  return ((function() {
44122
44123
  var results;
44123
- if (typeof key !== 'function') {
44124
+ if (!isFunction(key)) {
44124
44125
  results = [];
44125
44126
  for (key in object) {
44126
44127
  results.push(key);
@@ -44130,6 +44131,10 @@
44130
44131
  })());
44131
44132
  };
44132
44133
 
44134
+ isFunction = function(input) {
44135
+ return input instanceof Function || {}.toString.call(input) === '[object Function]';
44136
+ };
44137
+
44133
44138
  module.exports.equals = equals = function(a, b) {
44134
44139
  var aClass, bClass, ref;
44135
44140
  if (!((a != null) && (b != null))) {
@@ -44146,8 +44151,8 @@
44146
44151
  if (typeof a.equals === 'function') {
44147
44152
  return a.equals(b);
44148
44153
  }
44149
- if (a === b) {
44150
- return true;
44154
+ if (typeof a === typeof b && typeof a === 'string' || typeof a === 'number' || typeof a === 'boolean') {
44155
+ return a === b;
44151
44156
  }
44152
44157
  ref = getClassOfObjects(a, b), aClass = ref[0], bClass = ref[1];
44153
44158
  if (aClass !== bClass) {
@@ -44167,6 +44172,8 @@
44167
44172
  return compareEveryItemInArrays(a, b, equals);
44168
44173
  case '[object Object]':
44169
44174
  return compareObjects(a, b, equals);
44175
+ case '[object Function]':
44176
+ return a === b;
44170
44177
  }
44171
44178
  return false;
44172
44179
  };
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.3
4
+ version: 1.1.4
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-31 00:00:00.000000000 Z
11
+ date: 2018-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails