cqm-models 1.0.3 → 1.1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (188) hide show
  1. checksums.yaml +5 -5
  2. data/.eslintrc.json +10 -2
  3. data/.github/PULL_REQUEST_TEMPLATE.md +0 -4
  4. data/.rubocop.yml +3 -0
  5. data/.travis.yml +31 -1
  6. data/README.md +59 -2
  7. data/app/assets/javascripts/AdverseEvent.js +16 -7
  8. data/app/assets/javascripts/AllDataElements.js +6 -6
  9. data/app/assets/javascripts/AllergyIntolerance.js +16 -7
  10. data/app/assets/javascripts/AssessmentOrder.js +15 -6
  11. data/app/assets/javascripts/AssessmentPerformed.js +16 -7
  12. data/app/assets/javascripts/AssessmentRecommended.js +16 -7
  13. data/app/assets/javascripts/CareGoal.js +16 -7
  14. data/app/assets/javascripts/CommunicationPerformed.js +15 -6
  15. data/app/assets/javascripts/DeviceApplied.js +16 -7
  16. data/app/assets/javascripts/DeviceOrder.js +16 -7
  17. data/app/assets/javascripts/DeviceRecommended.js +16 -7
  18. data/app/assets/javascripts/Diagnosis.js +16 -7
  19. data/app/assets/javascripts/DiagnosticStudyOrder.js +16 -7
  20. data/app/assets/javascripts/DiagnosticStudyPerformed.js +16 -7
  21. data/app/assets/javascripts/DiagnosticStudyRecommended.js +16 -7
  22. data/app/assets/javascripts/EncounterOrder.js +16 -7
  23. data/app/assets/javascripts/EncounterPerformed.js +16 -7
  24. data/app/assets/javascripts/EncounterRecommended.js +16 -7
  25. data/app/assets/javascripts/FamilyHistory.js +16 -7
  26. data/app/assets/javascripts/Id.js +7 -3
  27. data/app/assets/javascripts/ImmunizationAdministered.js +16 -7
  28. data/app/assets/javascripts/ImmunizationOrder.js +16 -7
  29. data/app/assets/javascripts/IndividualResult.js +7 -2
  30. data/app/assets/javascripts/InterventionOrder.js +16 -7
  31. data/app/assets/javascripts/InterventionPerformed.js +16 -7
  32. data/app/assets/javascripts/InterventionRecommended.js +16 -7
  33. data/app/assets/javascripts/LaboratoryTestOrder.js +16 -7
  34. data/app/assets/javascripts/LaboratoryTestPerformed.js +16 -7
  35. data/app/assets/javascripts/LaboratoryTestRecommended.js +16 -7
  36. data/app/assets/javascripts/MedicationActive.js +16 -7
  37. data/app/assets/javascripts/MedicationAdministered.js +16 -7
  38. data/app/assets/javascripts/MedicationDischarge.js +16 -7
  39. data/app/assets/javascripts/MedicationDispensed.js +16 -7
  40. data/app/assets/javascripts/MedicationOrder.js +16 -7
  41. data/app/assets/javascripts/Participation.js +15 -6
  42. data/app/assets/javascripts/PatientCareExperience.js +16 -7
  43. data/app/assets/javascripts/PatientCharacteristic.js +16 -7
  44. data/app/assets/javascripts/PatientCharacteristicBirthdate.js +16 -7
  45. data/app/assets/javascripts/PatientCharacteristicClinicalTrialParticipant.js +16 -7
  46. data/app/assets/javascripts/PatientCharacteristicEthnicity.js +16 -7
  47. data/app/assets/javascripts/PatientCharacteristicExpired.js +16 -7
  48. data/app/assets/javascripts/PatientCharacteristicPayer.js +16 -7
  49. data/app/assets/javascripts/PatientCharacteristicRace.js +16 -7
  50. data/app/assets/javascripts/PatientCharacteristicSex.js +16 -7
  51. data/app/assets/javascripts/PhysicalExamOrder.js +16 -7
  52. data/app/assets/javascripts/PhysicalExamPerformed.js +16 -7
  53. data/app/assets/javascripts/PhysicalExamRecommended.js +16 -7
  54. data/app/assets/javascripts/ProcedureOrder.js +16 -7
  55. data/app/assets/javascripts/ProcedurePerformed.js +16 -7
  56. data/app/assets/javascripts/ProcedureRecommended.js +16 -7
  57. data/app/assets/javascripts/ProviderCareExperience.js +16 -7
  58. data/app/assets/javascripts/ProviderCharacteristic.js +16 -7
  59. data/app/assets/javascripts/QDMPatient.js +262 -0
  60. data/app/assets/javascripts/Result.js +7 -2
  61. data/app/assets/javascripts/ResultComponent.js +14 -6
  62. data/app/assets/javascripts/SubstanceAdministered.js +16 -7
  63. data/app/assets/javascripts/SubstanceOrder.js +16 -7
  64. data/app/assets/javascripts/SubstanceRecommended.js +16 -7
  65. data/app/assets/javascripts/Symptom.js +16 -7
  66. data/app/assets/javascripts/attributes/Component.js +30 -0
  67. data/app/assets/javascripts/attributes/FacilityLocation.js +30 -0
  68. data/app/assets/javascripts/basetypes/Any.js +1 -1
  69. data/app/assets/javascripts/basetypes/Code.js +1 -1
  70. data/app/assets/javascripts/basetypes/DataElement.js +2 -1
  71. data/app/assets/javascripts/basetypes/DateTime.js +5 -1
  72. data/app/assets/javascripts/basetypes/Interval.js +1 -1
  73. data/app/assets/javascripts/basetypes/Quantity.js +1 -1
  74. data/app/assets/javascripts/basetypes/Ratio.js +1 -1
  75. data/app/assets/javascripts/browser.js +3 -0
  76. data/app/assets/javascripts/cqm/AllCQMModels.js +24 -0
  77. data/app/assets/javascripts/cqm/CQLLibrary.js +32 -0
  78. data/app/assets/javascripts/cqm/CQLStatementDependency.js +28 -0
  79. data/app/assets/javascripts/cqm/Concept.js +17 -0
  80. data/app/assets/javascripts/cqm/Measure.js +108 -0
  81. data/app/assets/javascripts/{MeasurePackage.js → cqm/MeasurePackage.js} +9 -3
  82. data/app/assets/javascripts/cqm/Patient.js +38 -0
  83. data/app/assets/javascripts/cqm/PopulationSet.js +88 -0
  84. data/app/assets/javascripts/cqm/Provider.js +44 -0
  85. data/app/assets/javascripts/cqm/ValueSet.js +26 -0
  86. data/app/assets/javascripts/index.js +18 -8
  87. data/app/models/{qdm/tacoma → cqm}/concept.rb +4 -4
  88. data/app/models/cqm/cql_library.rb +22 -0
  89. data/app/models/cqm/cql_statement_dependency.rb +24 -0
  90. data/app/models/cqm/measure.rb +105 -0
  91. data/app/models/{qdm/tacoma → cqm}/measure_package.rb +2 -2
  92. data/app/models/cqm/patient.rb +20 -0
  93. data/app/models/cqm/population_set.rb +86 -0
  94. data/app/models/cqm/provider.rb +110 -0
  95. data/app/models/cqm/valueset.rb +15 -0
  96. data/app/models/hqmfOid_to_datatype_map.json +55 -0
  97. data/app/models/model_finder.rb +12 -0
  98. data/app/models/models.rb +18 -6
  99. data/app/models/qdm/adverse_event.rb +3 -2
  100. data/app/models/qdm/allergy_intolerance.rb +2 -1
  101. data/app/models/qdm/assessment_order.rb +1 -0
  102. data/app/models/qdm/assessment_performed.rb +2 -1
  103. data/app/models/qdm/assessment_recommended.rb +2 -1
  104. data/app/models/qdm/attributes/attribute.rb +63 -0
  105. data/app/models/qdm/{component.rb → attributes/component.rb} +1 -1
  106. data/app/models/qdm/{facility_location.rb → attributes/facility_location.rb} +1 -1
  107. data/app/models/qdm/basetypes/data_element.rb +21 -6
  108. data/app/models/qdm/basetypes/interval.rb +2 -1
  109. data/app/models/qdm/care_goal.rb +2 -1
  110. data/app/models/qdm/communication_performed.rb +1 -0
  111. data/app/models/qdm/device_applied.rb +2 -1
  112. data/app/models/qdm/device_order.rb +2 -1
  113. data/app/models/qdm/device_recommended.rb +2 -1
  114. data/app/models/qdm/diagnosis.rb +2 -1
  115. data/app/models/qdm/diagnostic_study_order.rb +2 -1
  116. data/app/models/qdm/diagnostic_study_performed.rb +3 -2
  117. data/app/models/qdm/diagnostic_study_recommended.rb +2 -1
  118. data/app/models/qdm/encounter_order.rb +3 -2
  119. data/app/models/qdm/encounter_performed.rb +2 -1
  120. data/app/models/qdm/encounter_recommended.rb +3 -2
  121. data/app/models/qdm/family_history.rb +2 -1
  122. data/app/models/qdm/immunization_administered.rb +2 -1
  123. data/app/models/qdm/immunization_order.rb +2 -1
  124. data/app/models/qdm/intervention_order.rb +2 -1
  125. data/app/models/qdm/intervention_performed.rb +2 -1
  126. data/app/models/qdm/intervention_recommended.rb +2 -1
  127. data/app/models/qdm/laboratory_test_order.rb +2 -1
  128. data/app/models/qdm/laboratory_test_performed.rb +2 -1
  129. data/app/models/qdm/laboratory_test_recommended.rb +2 -1
  130. data/app/models/qdm/medication_active.rb +2 -1
  131. data/app/models/qdm/medication_administered.rb +2 -1
  132. data/app/models/qdm/medication_discharge.rb +2 -1
  133. data/app/models/qdm/medication_dispensed.rb +4 -3
  134. data/app/models/qdm/medication_order.rb +3 -2
  135. data/app/models/qdm/participation.rb +1 -0
  136. data/app/models/qdm/patient.rb +7 -4
  137. data/app/models/qdm/patient_care_experience.rb +2 -1
  138. data/app/models/qdm/patient_characteristic.rb +2 -1
  139. data/app/models/qdm/patient_characteristic_birthdate.rb +2 -1
  140. data/app/models/qdm/patient_characteristic_clinical_trial_participant.rb +2 -1
  141. data/app/models/qdm/patient_characteristic_ethnicity.rb +2 -1
  142. data/app/models/qdm/patient_characteristic_expired.rb +2 -1
  143. data/app/models/qdm/patient_characteristic_payer.rb +2 -1
  144. data/app/models/qdm/patient_characteristic_race.rb +2 -1
  145. data/app/models/qdm/patient_characteristic_sex.rb +2 -1
  146. data/app/models/qdm/physical_exam_order.rb +2 -1
  147. data/app/models/qdm/physical_exam_performed.rb +2 -1
  148. data/app/models/qdm/physical_exam_recommended.rb +2 -1
  149. data/app/models/qdm/procedure_order.rb +2 -1
  150. data/app/models/qdm/procedure_performed.rb +2 -1
  151. data/app/models/qdm/procedure_recommended.rb +2 -1
  152. data/app/models/qdm/provider_care_experience.rb +2 -1
  153. data/app/models/qdm/provider_characteristic.rb +2 -1
  154. data/app/models/qdm/substance_administered.rb +2 -1
  155. data/app/models/qdm/substance_order.rb +2 -1
  156. data/app/models/qdm/substance_recommended.rb +2 -1
  157. data/app/models/qdm/symptom.rb +2 -1
  158. data/bin/build_cql_execution.sh +8 -0
  159. data/bin/validate_browser.sh +17 -0
  160. data/bin/validate_generator.sh +12 -0
  161. data/cqm-models.gemspec +5 -2
  162. data/data/oids_qdm_5.4.json +321 -0
  163. data/data/{oids.json → oids_unversioned.json} +0 -0
  164. data/dist/browser.js +102937 -0
  165. data/dist/index.js +36637 -36540
  166. data/lib/generate_models.rb +89 -93
  167. data/lib/generate_patients.rb +125 -0
  168. data/lib/generate_types.rb +64 -0
  169. data/lib/generators/custom_mongo/model.rb.tt +20 -0
  170. data/lib/generators/custom_mongo/model_generator.rb +34 -0
  171. data/notice.md +9 -0
  172. data/package.json +12 -6
  173. data/templates/id_template.js.erb +8 -3
  174. data/templates/index_template.js.erb +18 -8
  175. data/templates/models_template.rb.erb +20 -4
  176. data/templates/mongoose_template.js.erb +23 -15
  177. data/templates/patient_extension.rb.erb +7 -4
  178. data/templates/patient_template.js.erb +88 -87
  179. data/yarn.lock +552 -347
  180. metadata +86 -19
  181. data/app/assets/javascripts/Component.js +0 -26
  182. data/app/assets/javascripts/Concept.js +0 -14
  183. data/app/assets/javascripts/FacilityLocation.js +0 -26
  184. data/app/assets/javascripts/Measure.js +0 -78
  185. data/app/assets/javascripts/Patient.js +0 -262
  186. data/app/assets/javascripts/ValueSet.js +0 -30
  187. data/app/models/qdm/tacoma/measure.rb +0 -174
  188. data/app/models/qdm/tacoma/valueset.rb +0 -68
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cqm-models
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - aholmes@mitre.org
@@ -10,8 +10,22 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2019-05-16 00:00:00.000000000 Z
13
+ date: 2019-05-22 00:00:00.000000000 Z
14
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: bundle-audit
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - ">="
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: '0'
15
29
  - !ruby/object:Gem::Dependency
16
30
  name: bundler
17
31
  requirement: !ruby/object:Gem::Requirement
@@ -40,6 +54,20 @@ dependencies:
40
54
  - - "~>"
41
55
  - !ruby/object:Gem::Version
42
56
  version: 10.0.0
57
+ - !ruby/object:Gem::Dependency
58
+ name: codecov
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ type: :development
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
43
71
  - !ruby/object:Gem::Dependency
44
72
  name: mongoid
45
73
  requirement: !ruby/object:Gem::Requirement
@@ -60,14 +88,14 @@ dependencies:
60
88
  requirements:
61
89
  - - "~>"
62
90
  - !ruby/object:Gem::Version
63
- version: '5.1'
91
+ version: '5.2'
64
92
  type: :development
65
93
  prerelease: false
66
94
  version_requirements: !ruby/object:Gem::Requirement
67
95
  requirements:
68
96
  - - "~>"
69
97
  - !ruby/object:Gem::Version
70
- version: '5.1'
98
+ version: '5.2'
71
99
  - !ruby/object:Gem::Dependency
72
100
  name: rake
73
101
  requirement: !ruby/object:Gem::Requirement
@@ -110,6 +138,20 @@ dependencies:
110
138
  - - "~>"
111
139
  - !ruby/object:Gem::Version
112
140
  version: 0.54.0
141
+ - !ruby/object:Gem::Dependency
142
+ name: simplecov
143
+ requirement: !ruby/object:Gem::Requirement
144
+ requirements:
145
+ - - ">="
146
+ - !ruby/object:Gem::Version
147
+ version: '0'
148
+ type: :development
149
+ prerelease: false
150
+ version_requirements: !ruby/object:Gem::Requirement
151
+ requirements:
152
+ - - ">="
153
+ - !ruby/object:Gem::Version
154
+ version: '0'
113
155
  description: This library contains auto generated Mongo (Mongoid) models that correspond
114
156
  to the QDM (Quality Data Model) specification.
115
157
  email:
@@ -136,8 +178,6 @@ files:
136
178
  - app/assets/javascripts/AssessmentRecommended.js
137
179
  - app/assets/javascripts/CareGoal.js
138
180
  - app/assets/javascripts/CommunicationPerformed.js
139
- - app/assets/javascripts/Component.js
140
- - app/assets/javascripts/Concept.js
141
181
  - app/assets/javascripts/DeviceApplied.js
142
182
  - app/assets/javascripts/DeviceOrder.js
143
183
  - app/assets/javascripts/DeviceRecommended.js
@@ -148,7 +188,6 @@ files:
148
188
  - app/assets/javascripts/EncounterOrder.js
149
189
  - app/assets/javascripts/EncounterPerformed.js
150
190
  - app/assets/javascripts/EncounterRecommended.js
151
- - app/assets/javascripts/FacilityLocation.js
152
191
  - app/assets/javascripts/FamilyHistory.js
153
192
  - app/assets/javascripts/Id.js
154
193
  - app/assets/javascripts/ImmunizationAdministered.js
@@ -160,15 +199,12 @@ files:
160
199
  - app/assets/javascripts/LaboratoryTestOrder.js
161
200
  - app/assets/javascripts/LaboratoryTestPerformed.js
162
201
  - app/assets/javascripts/LaboratoryTestRecommended.js
163
- - app/assets/javascripts/Measure.js
164
- - app/assets/javascripts/MeasurePackage.js
165
202
  - app/assets/javascripts/MedicationActive.js
166
203
  - app/assets/javascripts/MedicationAdministered.js
167
204
  - app/assets/javascripts/MedicationDischarge.js
168
205
  - app/assets/javascripts/MedicationDispensed.js
169
206
  - app/assets/javascripts/MedicationOrder.js
170
207
  - app/assets/javascripts/Participation.js
171
- - app/assets/javascripts/Patient.js
172
208
  - app/assets/javascripts/PatientCareExperience.js
173
209
  - app/assets/javascripts/PatientCharacteristic.js
174
210
  - app/assets/javascripts/PatientCharacteristicBirthdate.js
@@ -186,13 +222,15 @@ files:
186
222
  - app/assets/javascripts/ProcedureRecommended.js
187
223
  - app/assets/javascripts/ProviderCareExperience.js
188
224
  - app/assets/javascripts/ProviderCharacteristic.js
225
+ - app/assets/javascripts/QDMPatient.js
189
226
  - app/assets/javascripts/Result.js
190
227
  - app/assets/javascripts/ResultComponent.js
191
228
  - app/assets/javascripts/SubstanceAdministered.js
192
229
  - app/assets/javascripts/SubstanceOrder.js
193
230
  - app/assets/javascripts/SubstanceRecommended.js
194
231
  - app/assets/javascripts/Symptom.js
195
- - app/assets/javascripts/ValueSet.js
232
+ - app/assets/javascripts/attributes/Component.js
233
+ - app/assets/javascripts/attributes/FacilityLocation.js
196
234
  - app/assets/javascripts/basetypes/Any.js
197
235
  - app/assets/javascripts/basetypes/Code.js
198
236
  - app/assets/javascripts/basetypes/DataElement.js
@@ -200,13 +238,38 @@ files:
200
238
  - app/assets/javascripts/basetypes/Interval.js
201
239
  - app/assets/javascripts/basetypes/Quantity.js
202
240
  - app/assets/javascripts/basetypes/Ratio.js
241
+ - app/assets/javascripts/browser.js
242
+ - app/assets/javascripts/cqm/AllCQMModels.js
243
+ - app/assets/javascripts/cqm/CQLLibrary.js
244
+ - app/assets/javascripts/cqm/CQLStatementDependency.js
245
+ - app/assets/javascripts/cqm/Concept.js
246
+ - app/assets/javascripts/cqm/Measure.js
247
+ - app/assets/javascripts/cqm/MeasurePackage.js
248
+ - app/assets/javascripts/cqm/Patient.js
249
+ - app/assets/javascripts/cqm/PopulationSet.js
250
+ - app/assets/javascripts/cqm/Provider.js
251
+ - app/assets/javascripts/cqm/ValueSet.js
203
252
  - app/assets/javascripts/index.js
253
+ - app/models/cqm/concept.rb
254
+ - app/models/cqm/cql_library.rb
255
+ - app/models/cqm/cql_statement_dependency.rb
256
+ - app/models/cqm/measure.rb
257
+ - app/models/cqm/measure_package.rb
258
+ - app/models/cqm/patient.rb
259
+ - app/models/cqm/population_set.rb
260
+ - app/models/cqm/provider.rb
261
+ - app/models/cqm/valueset.rb
262
+ - app/models/hqmfOid_to_datatype_map.json
263
+ - app/models/model_finder.rb
204
264
  - app/models/models.rb
205
265
  - app/models/qdm/adverse_event.rb
206
266
  - app/models/qdm/allergy_intolerance.rb
207
267
  - app/models/qdm/assessment_order.rb
208
268
  - app/models/qdm/assessment_performed.rb
209
269
  - app/models/qdm/assessment_recommended.rb
270
+ - app/models/qdm/attributes/attribute.rb
271
+ - app/models/qdm/attributes/component.rb
272
+ - app/models/qdm/attributes/facility_location.rb
210
273
  - app/models/qdm/basetypes/code.rb
211
274
  - app/models/qdm/basetypes/data_element.rb
212
275
  - app/models/qdm/basetypes/interval.rb
@@ -214,7 +277,6 @@ files:
214
277
  - app/models/qdm/basetypes/ratio.rb
215
278
  - app/models/qdm/care_goal.rb
216
279
  - app/models/qdm/communication_performed.rb
217
- - app/models/qdm/component.rb
218
280
  - app/models/qdm/device_applied.rb
219
281
  - app/models/qdm/device_order.rb
220
282
  - app/models/qdm/device_recommended.rb
@@ -225,7 +287,6 @@ files:
225
287
  - app/models/qdm/encounter_order.rb
226
288
  - app/models/qdm/encounter_performed.rb
227
289
  - app/models/qdm/encounter_recommended.rb
228
- - app/models/qdm/facility_location.rb
229
290
  - app/models/qdm/family_history.rb
230
291
  - app/models/qdm/id.rb
231
292
  - app/models/qdm/immunization_administered.rb
@@ -265,20 +326,25 @@ files:
265
326
  - app/models/qdm/substance_order.rb
266
327
  - app/models/qdm/substance_recommended.rb
267
328
  - app/models/qdm/symptom.rb
268
- - app/models/qdm/tacoma/concept.rb
269
329
  - app/models/qdm/tacoma/individual_result.rb
270
- - app/models/qdm/tacoma/measure.rb
271
- - app/models/qdm/tacoma/measure_package.rb
272
- - app/models/qdm/tacoma/valueset.rb
330
+ - bin/build_cql_execution.sh
273
331
  - bin/console
274
332
  - bin/setup
333
+ - bin/validate_browser.sh
275
334
  - bin/validate_dist.sh
335
+ - bin/validate_generator.sh
276
336
  - config/mongoid.yml
277
337
  - cqm-models.gemspec
278
- - data/oids.json
338
+ - data/oids_qdm_5.4.json
339
+ - data/oids_unversioned.json
340
+ - dist/browser.js
279
341
  - dist/index.js
280
342
  - lib/cqm/models.rb
281
343
  - lib/generate_models.rb
344
+ - lib/generate_patients.rb
345
+ - lib/generate_types.rb
346
+ - lib/generators/custom_mongo/model.rb.tt
347
+ - lib/generators/custom_mongo/model_generator.rb
282
348
  - modelinfo/qdm-modelinfo-4.2.xml
283
349
  - modelinfo/qdm-modelinfo-4.3.xml
284
350
  - modelinfo/qdm-modelinfo-5.0.1.xml
@@ -286,6 +352,7 @@ files:
286
352
  - modelinfo/qdm-modelinfo-5.0.xml
287
353
  - modelinfo/qdm-modelinfo-5.3.xml
288
354
  - modelinfo/qdm-modelinfo-5.4.xml
355
+ - notice.md
289
356
  - package.json
290
357
  - templates/all_data_elements_template.js.erb
291
358
  - templates/id_template.js.erb
@@ -316,7 +383,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
316
383
  version: '0'
317
384
  requirements: []
318
385
  rubyforge_project:
319
- rubygems_version: 2.6.14
386
+ rubygems_version: 2.7.7
320
387
  signing_key:
321
388
  specification_version: 4
322
389
  summary: Mongo models that correspond to the QDM specification.
@@ -1,26 +0,0 @@
1
- const mongoose = require('mongoose');
2
- const { DataElementSchema } = require('./basetypes/DataElement');
3
- const Code = require('./basetypes/Code');
4
- const Interval = require('./basetypes/Interval');
5
- const Quantity = require('./basetypes/Quantity');
6
- const DateTime = require('./basetypes/DateTime');
7
-
8
- const { FacilityLocationSchema } = require('./FacilityLocation');
9
- const { IdSchema } = require('./Id');
10
- const Any = require('./basetypes/Any');
11
-
12
- const [Number, String] = [
13
- mongoose.Schema.Types.Number,
14
- mongoose.Schema.Types.String,
15
- ];
16
-
17
- const ComponentSchema = new mongoose.Schema({
18
- code: Code,
19
- result: Any,
20
- qdmVersion: { type: String, default: '5.4' },
21
- _type: { type: String, default: 'Component' },
22
-
23
- });
24
-
25
- module.exports.ComponentSchema = ComponentSchema;
26
- module.exports.Component = mongoose.model('Component', ComponentSchema);
@@ -1,14 +0,0 @@
1
- const mongoose = require('mongoose');
2
-
3
- const mString = mongoose.Schema.Types.String;
4
-
5
- const ConceptSchema = mongoose.Schema({
6
- code: mString,
7
- code_system: mString,
8
- code_system_name: mString,
9
- code_system_version: mString,
10
- display_name: mString,
11
- });
12
-
13
- module.exports.ConceptSchema = ConceptSchema;
14
- module.exports.Concept = mongoose.model('concept', ConceptSchema);
@@ -1,26 +0,0 @@
1
- const mongoose = require('mongoose');
2
- const { DataElementSchema } = require('./basetypes/DataElement');
3
- const Code = require('./basetypes/Code');
4
- const Interval = require('./basetypes/Interval');
5
- const Quantity = require('./basetypes/Quantity');
6
- const DateTime = require('./basetypes/DateTime');
7
- const { ComponentSchema } = require('./Component');
8
-
9
- const { IdSchema } = require('./Id');
10
- const Any = require('./basetypes/Any');
11
-
12
- const [Number, String] = [
13
- mongoose.Schema.Types.Number,
14
- mongoose.Schema.Types.String,
15
- ];
16
-
17
- const FacilityLocationSchema = new mongoose.Schema({
18
- code: Code,
19
- locationPeriod: Interval,
20
- qdmVersion: { type: String, default: '5.4' },
21
- _type: { type: String, default: 'FacilityLocation' },
22
-
23
- });
24
-
25
- module.exports.FacilityLocationSchema = FacilityLocationSchema;
26
- module.exports.FacilityLocation = mongoose.model('FacilityLocation', FacilityLocationSchema);
@@ -1,78 +0,0 @@
1
- const mongoose = require('mongoose');
2
- const Code = require('./basetypes/Code');
3
- const Interval = require('./basetypes/Interval');
4
- const Quantity = require('./basetypes/Quantity');
5
-
6
- const [Number, String, Boolean, Mixed, ObjectId, Date] = [
7
- mongoose.Schema.Types.Number,
8
- mongoose.Schema.Types.String,
9
- mongoose.Schema.Types.Boolean,
10
- mongoose.Schema.Types.Mixed,
11
- mongoose.Schema.Types.ObjectId,
12
- mongoose.Schema.Types.Date,
13
- ];
14
-
15
- const MeasureSchema = mongoose.Schema(
16
- {
17
- // ID/other measure information
18
- id: String,
19
- measure_id: String,
20
- hqmf_id: String,
21
- hqmf_set_id: String,
22
- hqmf_version_number: Number,
23
- cms_id: String,
24
- title: String,
25
- description: String,
26
- type: String,
27
- category: { type: String, default: 'Uncategorized' },
28
-
29
- // Measure type variables
30
- episode_of_care: Boolean,
31
- continuous_constiable: Boolean,
32
- episode_ids: [],
33
-
34
- // Publishing data (used by Bonnie)
35
- published: Boolean,
36
- publish_date: Date,
37
- version: Number,
38
-
39
- // ELM/CQL Measure-logic related data
40
- elm_annotations: Mixed,
41
- cql: [String],
42
- elm: [Mixed],
43
- main_cql_library: String,
44
- cql_statement_dependencies: Mixed,
45
-
46
- // HQMF/Tacoma-specific Measure-logic related data
47
- population_criteria: Mixed,
48
- data_criteria: Mixed,
49
- source_data_criteria: Mixed,
50
- measure_period: Interval,
51
- measure_attributes: [],
52
- populations: [Mixed],
53
- populations_cql_map: Mixed,
54
- observations: [Mixed],
55
- // TODO: Depending on how we restructure the Measure/Population object, may be deleted in the future
56
- population_ids: Mixed,
57
-
58
- value_sets: [{ type: ObjectId, ref: 'ValueSet' }],
59
-
60
- complexity: Mixed, // Bonnie-specific?
61
-
62
- // Relations to other model classes
63
- user: { type: ObjectId, ref: 'User', index: true }, // Bonnie-specific
64
- bundle: { type: ObjectId, ref: 'Bundle' }, // Cypress-specific, but used in Bonnie-bundler as well
65
- package: { type: ObjectId, ref: 'MeasurePackage' }, // Bonnie specific
66
- },
67
- // Options
68
- {
69
- timestamps: { createdAt: 'created_at', updatedAt: 'updated_at' }, // These are the Mongoid conventions for timestamps
70
- }
71
- );
72
-
73
- MeasureSchema.virtual('ALL_POPULATION_CODES').get(() => ['STRAT', 'IPP', 'DENOM', 'DENEX', 'NUMER', 'NUMEX', 'DENEXCEP', 'MSRPOPL', 'OBSERV', 'MSRPOPLEX']);
74
-
75
- MeasureSchema.virtual('cqlSkipStatements').get(() => ['SDE Ethnicity', 'SDE Payer', 'SDE Race', 'SDE Sex']);
76
-
77
- module.exports.MeasureSchema = MeasureSchema;
78
- module.exports.Measure = mongoose.model('measure', MeasureSchema);
@@ -1,262 +0,0 @@
1
- const mongoose = require('mongoose');
2
- const Code = require('./basetypes/Code');
3
- const Interval = require('./basetypes/Interval');
4
- const Quantity = require('./basetypes/Quantity');
5
- const DateTime = require('./basetypes/DateTime');
6
- const AllDataElements = require('./AllDataElements');
7
-
8
- const [Schema, Number, String, Mixed] = [
9
- mongoose.Schema,
10
- mongoose.Schema.Types.Number,
11
- mongoose.Schema.Types.String,
12
- mongoose.Schema.Types.Mixed,
13
- ];
14
-
15
- const PatientSchema = new Schema({
16
- birthDatetime: DateTime,
17
- qdmVersion: { type: String, default: '5.4' },
18
- _type: { type: String, default: 'Patient' },
19
-
20
- givenNames: [String],
21
- familyName: String,
22
- bundleId: String,
23
- // These are the "data criteria", or QDM datatype elements that exist on a
24
- // patient.
25
- dataElements: [],
26
- // This field is for application specific information only. If both Bonnie
27
- // Cypress use a common field, it should be made a field on this model,
28
- // and not put into extendedData.
29
- extendedData: {
30
- type: Mixed,
31
- default: {},
32
- },
33
- }, { id: false });
34
-
35
- // After initialization of a Patient model, initialize every individual data element
36
- // to its respective Mongoose Model
37
- PatientSchema.methods.initializeDataElements = function initializeDataElements() {
38
- let typeStripped;
39
- const dataElementsInit = [];
40
- this.dataElements.forEach((element) => {
41
- typeStripped = element._type.replace(/QDM::/, '');
42
- if (typeStripped in AllDataElements) {
43
- dataElementsInit.push(AllDataElements[typeStripped](element));
44
- } else {
45
- dataElementsInit.push(element);
46
- }
47
- });
48
- this.set({ dataElements: dataElementsInit });
49
- };
50
-
51
- PatientSchema.queue('initializeDataElements');
52
-
53
- PatientSchema.methods.id = function id() {
54
- return this._id;
55
- };
56
-
57
- // Returns an array of elements that exist on this patient, that
58
- // match the given HQMF data criteria OID.
59
- PatientSchema.methods.getByHqmfOid = function getByHqmfOid(hqmfOid) {
60
- return this.dataElements.filter(element => element.hqmfOid === hqmfOid);
61
- };
62
-
63
- // Returns an array of elements that exist on this patient, that
64
- // match the given QRDA data criteria OID.
65
- PatientSchema.methods.getByQrdaOid = function getByQrdaOid(qrdaOid) {
66
- return this.dataElements.filter(element => element.qrdaOid === qrdaOid);
67
- };
68
-
69
- // Returns an array of elements that exist on this patient. Optionally
70
- // takes a category, which returns all elements of that QDM category.
71
- // Example: patient.getDataElements(category = 'encounters') will return
72
- // all Encounter QDM data types active on the patient.
73
- PatientSchema.methods.getDataElements = function getDataElements(params) {
74
- if (params.qdmCategory && params.qdmStatus) {
75
- return this.dataElements.filter(element => (element.qdmCategory === params.qdmCategory) && (element.qdmStatus === params.qdmStatus));
76
- } else if (params.category) {
77
- return this.dataElements.filter(element => element.qdmCategory === params.qdmCategory);
78
- }
79
- return this.dataElements;
80
- };
81
-
82
- // Returns an array of dataElements that exist on the patient, queried by
83
- // QDM profile
84
- // @param {string} profile - the data criteria requested by the execution engine
85
- // @param {boolean} isNegated - whether dataElements should be returned based on their negation status
86
- // @returns {DataElement[]}
87
- PatientSchema.methods.getByProfile = function getByProfile(profile, isNegated = null) {
88
- // If isNegated == true, only return data elements with a negationRationale that is not null.
89
- // If isNegated == false, only return data elements with a null negationRationale.
90
- // If isNegated == null, return all matching data elements by type, regardless of negationRationale.
91
- const results = this.dataElements.filter(element => element._type === `QDM::${profile}` && (isNegated === null || !!element.negationRationale === isNegated));
92
- return results.map((result) => {
93
- const removedMongooseItems = AllDataElements[profile](result).toObject();
94
- // toObject() will remove all mongoose functions but also remove the schema methods, so we add them back
95
- Object.entries(Object.getPrototypeOf(result).schema.methods).forEach(([method_name, method]) => {
96
- removedMongooseItems[method_name] = method;
97
- });
98
- return removedMongooseItems;
99
- });
100
- };
101
-
102
- // This method is called by the CQL execution engine on a CQLPatient when
103
- // the execution engine wants information on a record. A record could be patient
104
- // characteristic information about the patient, or it could be data criteria
105
- // that currently exist on this patient (data criteria you drag on a patient
106
- // in Bonnie patient builder).
107
- // @param {String} profile - the data criteria requested by the execution engine
108
- // @returns {Object}
109
- PatientSchema.methods.findRecords = function findRecords(profile) {
110
- let profileStripped;
111
- if (profile === 'Patient') {
112
- // Requested generic patient info
113
- const info = { birthDatetime: this.birthDatetime };
114
- return [info];
115
- } else if (/PatientCharacteristic/.test(profile)) {
116
- // Requested a patient characteristic
117
- profileStripped = profile.replace(/ *\{[^)]*\} */g, '');
118
- return this.getByProfile(profileStripped);
119
- } else if (profile != null) {
120
- // Requested something else (probably a QDM data type).
121
-
122
- // Strip model details from request. The requested profile string contains
123
- // a lot of things we do not need or care about. Example, we might see
124
- // something like:
125
- // "{urn:healthit-gov:qdm:v5_0_draft}PatientCharacteristicEthnicity"
126
- // Where we only care about: "PatientCharacteristicEthnicity".
127
- profileStripped = profile.replace(/ *\{[^)]*\} */g, '');
128
-
129
- // Check and handle negation status
130
- if (/Positive/.test(profileStripped)) {
131
- profileStripped = profileStripped.replace(/Positive/, '');
132
- // Since the data criteria is 'Positive', it is not negated.
133
- return this.getByProfile(profileStripped, false);
134
- } else if (/Negative/.test(profileStripped)) {
135
- profileStripped = profileStripped.replace(/Negative/, '');
136
- // Since the data criteria is 'Negative', it is negated.
137
- return this.getByProfile(profileStripped, true);
138
- }
139
- // No negation status, proceed normally
140
- return this.getByProfile(profileStripped);
141
- }
142
- return [];
143
- };
144
-
145
- PatientSchema.methods.adverse_events = function adverse_events() {
146
- return this.getDataElements({ category: 'adverse_event' });
147
- };
148
-
149
- PatientSchema.methods.allergies = function allergies() {
150
- return this.getDataElements({ category: 'allergy' });
151
- };
152
-
153
- PatientSchema.methods.assessments = function assessments() {
154
- return this.getDataElements({ category: 'assessment' });
155
- };
156
-
157
- PatientSchema.methods.care_experiences = function care_experiences() {
158
- return this.getDataElements({ category: 'care_experience' });
159
- };
160
-
161
- PatientSchema.methods.care_goals = function care_goals() {
162
- return this.getDataElements({ category: 'care_goal' });
163
- };
164
-
165
- PatientSchema.methods.communications = function communications() {
166
- return this.getDataElements({ category: 'communication' });
167
- };
168
-
169
- PatientSchema.methods.conditions = function conditions() {
170
- return this.getDataElements({ category: 'condition' });
171
- };
172
-
173
- PatientSchema.methods.devices = function devices() {
174
- return this.getDataElements({ category: 'device' });
175
- };
176
-
177
- PatientSchema.methods.diagnostic_studies = function diagnostic_studies() {
178
- return this.getDataElements({ category: 'diagnostic_study' });
179
- };
180
-
181
- PatientSchema.methods.encounters = function encounters() {
182
- return this.getDataElements({ category: 'encounter' });
183
- };
184
-
185
- PatientSchema.methods.family_history = function family_history() {
186
- return this.getDataElements({ category: 'family_history' });
187
- };
188
-
189
- PatientSchema.methods.functional_statuses = function functional_statuses() {
190
- return this.getDataElements({ category: 'functional_status' });
191
- };
192
-
193
- PatientSchema.methods.immunizations = function immunizations() {
194
- return this.getDataElements({ category: 'immunization' });
195
- };
196
-
197
- PatientSchema.methods.interventions = function interventions() {
198
- return this.getDataElements({ category: 'intervention' });
199
- };
200
-
201
- PatientSchema.methods.laboratory_tests = function laboratory_tests() {
202
- return this.getDataElements({ category: 'laboratory_test' });
203
- };
204
-
205
- PatientSchema.methods.medical_equipment = function medical_equipment() {
206
- return this.getDataElements({ category: 'medical_equipment' });
207
- };
208
-
209
- PatientSchema.methods.medications = function medications() {
210
- return this.getDataElements({ category: 'medication' });
211
- };
212
-
213
- PatientSchema.methods.physical_exams = function physical_exams() {
214
- return this.getDataElements({ category: 'physical_exam' });
215
- };
216
-
217
- PatientSchema.methods.preferences = function preferences() {
218
- return this.getDataElements({ category: 'preference' });
219
- };
220
-
221
- PatientSchema.methods.provider_characteristics = function provider_characteristics() {
222
- return this.getDataElements({ category: 'provider_characteristic' });
223
- };
224
-
225
- PatientSchema.methods.procedures = function procedures() {
226
- return this.getDataElements({ category: 'procedure' });
227
- };
228
-
229
- PatientSchema.methods.results = function results() {
230
- return this.getDataElements({ category: 'result' });
231
- };
232
-
233
- PatientSchema.methods.risk_category_assessments = function risk_category_assessments() {
234
- return this.getDataElements({ category: 'risk_category_assessment' });
235
- };
236
-
237
- PatientSchema.methods.social_history = function social_history() {
238
- return this.getDataElements({ category: 'social_history' });
239
- };
240
-
241
- PatientSchema.methods.substances = function substances() {
242
- return this.getDataElements({ category: 'substance' });
243
- };
244
-
245
- PatientSchema.methods.symptoms = function symptoms() {
246
- return this.getDataElements({ category: 'symptom' });
247
- };
248
-
249
- PatientSchema.methods.system_characteristics = function system_characteristics() {
250
- return this.getDataElements({ category: 'system_characteristic' });
251
- };
252
-
253
- PatientSchema.methods.transfers = function transfers() {
254
- return this.getDataElements({ category: 'transfer' });
255
- };
256
-
257
- PatientSchema.methods.vital_signs = function vital_signs() {
258
- return this.getDataElements({ category: 'vital_sign' });
259
- };
260
-
261
- module.exports.PatientSchema = PatientSchema;
262
- module.exports.Patient = mongoose.model('Patient', PatientSchema);