cql_qdm_patientapi 1.1.4 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/app/assets/javascripts/datatypes/adverseevent.js.coffee +2 -2
  4. data/app/assets/javascripts/datatypes/allergyintolerance.js.coffee +2 -2
  5. data/app/assets/javascripts/datatypes/assessment.js.coffee +9 -7
  6. data/app/assets/javascripts/datatypes/careexperience.js.coffee +1 -0
  7. data/app/assets/javascripts/datatypes/caregoal.js.coffee +1 -1
  8. data/app/assets/javascripts/datatypes/communication.js.coffee +6 -3
  9. data/app/assets/javascripts/datatypes/datatype.js.coffee +8 -2
  10. data/app/assets/javascripts/datatypes/device.js.coffee +10 -8
  11. data/app/assets/javascripts/datatypes/diagnosis.js.coffee +2 -2
  12. data/app/assets/javascripts/datatypes/diagnosticstudy.js.coffee +11 -9
  13. data/app/assets/javascripts/datatypes/encounter.js.coffee +10 -8
  14. data/app/assets/javascripts/datatypes/familyhistory.js.coffee +2 -1
  15. data/app/assets/javascripts/datatypes/immunization.js.coffee +16 -8
  16. data/app/assets/javascripts/datatypes/intervention.js.coffee +9 -7
  17. data/app/assets/javascripts/datatypes/laboratorytest.js.coffee +11 -9
  18. data/app/assets/javascripts/datatypes/medication.js.coffee +38 -22
  19. data/app/assets/javascripts/datatypes/physicalexam.js.coffee +14 -12
  20. data/app/assets/javascripts/datatypes/procedure.js.coffee +21 -19
  21. data/app/assets/javascripts/datatypes/substance.js.coffee +27 -16
  22. data/app/assets/javascripts/datatypes/symptom.js.coffee +1 -1
  23. data/app/assets/javascripts/types/component.js.coffee +2 -1
  24. data/app/assets/javascripts/types/id.js.coffee +1 -1
  25. data/app/assets/javascripts/utils/helpers.js.coffee +9 -5
  26. data/lib/cql_qdm_patientapi/version.rb +1 -1
  27. data/vendor/assets/javascripts/cql4browsers.js +32 -0
  28. metadata +3 -3
@@ -44,6 +44,6 @@ class CQL_QDM.Symptom extends CQL_QDM.QDMDatatype
44
44
  ###
45
45
  severity: ->
46
46
  if @_severity?
47
- new cql.Code(@_severity.code, @_severity.code_system)
47
+ new cql.Code(@_severity.code, @_severity.code_system, null, @_severity.title || null)
48
48
  else
49
49
  null
@@ -12,7 +12,8 @@ class CQL_QDM.Component
12
12
  @_result = CQL_QDM.Helpers.formatResult(component.result)
13
13
  code = component?.code?.code
14
14
  code_system = component?.code?.code_system
15
- @_code = new cql.Code(code, code_system)
15
+ display = component?.result?.title
16
+ @_code = new cql.Code(code, code_system, null, display || null)
16
17
 
17
18
    exec: (ctx) ->
18
19
      @
@@ -8,4 +8,4 @@ their methods will be accessable through the CQL_QDM namespace)
8
8
  Represents the QDM.Id used in the execution engine.
9
9
  ###
10
10
  class CQL_QDM.Id
11
- constructor: (@value, @namingSystem) ->
11
+ constructor: (@value, @namingSystem = null) ->
@@ -51,17 +51,21 @@ class CQL_QDM.Helpers
51
51
  else if input.codes?
52
52
  code_system = Object.keys(input.codes)?[0]
53
53
  code = input.codes[code_system]?[0]
54
- new cql.Code(code, code_system)
54
+ display = input.description
55
+ new cql.Code(code, code_system, null, display || null)
55
56
  else if input.code?
56
57
  code_system = input.code.code_system
57
58
  code = input.code.code
58
- new cql.Code(code, code_system)
59
+ display = input.description
60
+ new cql.Code(code, code_system, null, display || null)
59
61
  # Check that the scalar portion is a number and the units are a non-zero length string.
60
62
  else if (input.scalar?.match(/^[-+]?[0-9]*\.?[0-9]+$/) != null)
61
63
  if input.units.length > 0
62
64
  new cql.Quantity({unit: input.units , value: parseFloat(input.scalar)})
63
65
  else
64
66
  parseFloat(input.scalar)
67
+ else if input.scalar?
68
+ input.scalar
65
69
  else
66
70
  null
67
71
 
@@ -73,7 +77,7 @@ class CQL_QDM.Helpers
73
77
  if relatedToInput?
74
78
  for relatedTo in relatedToInput
75
79
  if relatedTo?
76
- relatedToArray.push new CQL_QDM.Id(relatedTo.referenced_id)
80
+ relatedToArray.push new CQL_QDM.Id(relatedTo.referenced_id, null)
77
81
  relatedToArray
78
82
 
79
83
  ###
@@ -95,7 +99,7 @@ class CQL_QDM.Helpers
95
99
  if diagnosesInput?
96
100
  for diagnosis in diagnosesInput.values
97
101
  if diagnosis?
98
- diagnoses.push new cql.Code(diagnosis.code, diagnosis.code_system)
102
+ diagnoses.push new cql.Code(diagnosis.code, diagnosis.code_system, null, diagnosis.title || null)
99
103
  if principalDiagnosisInput?
100
- diagnoses.push new cql.Code(principalDiagnosisInput.code, principalDiagnosisInput.code_system)
104
+ diagnoses.push new cql.Code(principalDiagnosisInput.code, principalDiagnosisInput.code_system, null, principalDiagnosisInput.title || null)
101
105
  diagnoses
@@ -1,3 +1,3 @@
1
1
  module CqlQdmPatientapi
2
- VERSION = "1.1.4"
2
+ VERSION = "1.2.0"
3
3
  end
@@ -1251,6 +1251,19 @@
1251
1251
  }
1252
1252
  });
1253
1253
 
1254
+ Interval.prototype.copy = function() {
1255
+ var newHigh, newLow;
1256
+ newLow = this.low;
1257
+ newHigh = this.high;
1258
+ if (typeof this.low.copy === 'function') {
1259
+ newLow = this.low.copy();
1260
+ }
1261
+ if (typeof this.high.copy === 'function') {
1262
+ newHigh = this.high.copy();
1263
+ }
1264
+ return new Interval(newLow, newHigh, this.lowClosed, this.highClosed);
1265
+ };
1266
+
1254
1267
  Interval.prototype.contains = function(item, precision) {
1255
1268
  var closed;
1256
1269
  if (item instanceof Interval) {
@@ -1699,6 +1712,19 @@
1699
1712
  }
1700
1713
  }
1701
1714
 
1715
+ Uncertainty.prototype.copy = function() {
1716
+ var newHigh, newLow;
1717
+ newLow = this.low;
1718
+ newHigh = this.high;
1719
+ if (typeof this.low.copy === 'function') {
1720
+ newLow = this.low.copy();
1721
+ }
1722
+ if (typeof this.high.copy === 'function') {
1723
+ newHigh = this.high.copy();
1724
+ }
1725
+ return new Uncertainty(newLow, newHigh);
1726
+ };
1727
+
1702
1728
  Uncertainty.prototype.isPoint = function() {
1703
1729
  var gte, lte;
1704
1730
  lte = function(a, b) {
@@ -4286,6 +4312,12 @@
4286
4312
  collapsedIntervals = [];
4287
4313
  a = intervals.shift();
4288
4314
  b = intervals.shift();
4315
+ if (typeof a.copy === 'function') {
4316
+ a = a.copy();
4317
+ }
4318
+ if (typeof b.copy === 'function') {
4319
+ b = b.copy();
4320
+ }
4289
4321
  while (b) {
4290
4322
  if (typeof b.low.sameOrBefore === 'function') {
4291
4323
  if (b.low.sameOrBefore(a.high)) {
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.4
4
+ version: 1.2.0
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-06-20 00:00:00.000000000 Z
11
+ date: 2018-08-22 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.6.12
135
135
  signing_key:
136
136
  specification_version: 4
137
137
  summary: QDM CQL execution engine and HDS patient model interface