cqm-models 0.8.4 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/assets/javascripts/AdverseEvent.js +2 -2
  4. data/app/assets/javascripts/AllDataElements.js +4 -8
  5. data/app/assets/javascripts/AllergyIntolerance.js +2 -2
  6. data/app/assets/javascripts/{CommunicationFromProviderToPatient.js → AssessmentOrder.js} +9 -9
  7. data/app/assets/javascripts/AssessmentPerformed.js +2 -2
  8. data/app/assets/javascripts/AssessmentRecommended.js +2 -3
  9. data/app/assets/javascripts/CareGoal.js +2 -2
  10. data/app/assets/javascripts/{CommunicationFromPatientToProvider.js → CommunicationPerformed.js} +13 -8
  11. data/app/assets/javascripts/Component.js +1 -1
  12. data/app/assets/javascripts/DeviceApplied.js +2 -3
  13. data/app/assets/javascripts/DeviceOrder.js +2 -2
  14. data/app/assets/javascripts/DeviceRecommended.js +2 -2
  15. data/app/assets/javascripts/Diagnosis.js +2 -2
  16. data/app/assets/javascripts/DiagnosticStudyOrder.js +2 -3
  17. data/app/assets/javascripts/DiagnosticStudyPerformed.js +2 -2
  18. data/app/assets/javascripts/DiagnosticStudyRecommended.js +2 -3
  19. data/app/assets/javascripts/EncounterOrder.js +2 -2
  20. data/app/assets/javascripts/EncounterPerformed.js +2 -2
  21. data/app/assets/javascripts/EncounterRecommended.js +2 -2
  22. data/app/assets/javascripts/FacilityLocation.js +1 -1
  23. data/app/assets/javascripts/FamilyHistory.js +2 -2
  24. data/app/assets/javascripts/Id.js +1 -1
  25. data/app/assets/javascripts/ImmunizationAdministered.js +2 -3
  26. data/app/assets/javascripts/ImmunizationOrder.js +2 -2
  27. data/app/assets/javascripts/InterventionOrder.js +2 -2
  28. data/app/assets/javascripts/InterventionPerformed.js +2 -2
  29. data/app/assets/javascripts/InterventionRecommended.js +2 -2
  30. data/app/assets/javascripts/LaboratoryTestOrder.js +2 -3
  31. data/app/assets/javascripts/LaboratoryTestPerformed.js +2 -2
  32. data/app/assets/javascripts/LaboratoryTestRecommended.js +2 -3
  33. data/app/assets/javascripts/MedicationActive.js +2 -3
  34. data/app/assets/javascripts/MedicationAdministered.js +2 -3
  35. data/app/assets/javascripts/MedicationDischarge.js +3 -2
  36. data/app/assets/javascripts/MedicationDispensed.js +5 -2
  37. data/app/assets/javascripts/MedicationOrder.js +5 -4
  38. data/app/assets/javascripts/Participation.js +2 -2
  39. data/app/assets/javascripts/Patient.js +4 -4
  40. data/app/assets/javascripts/PatientCareExperience.js +2 -2
  41. data/app/assets/javascripts/PatientCharacteristic.js +2 -2
  42. data/app/assets/javascripts/PatientCharacteristicBirthdate.js +2 -2
  43. data/app/assets/javascripts/PatientCharacteristicClinicalTrialParticipant.js +2 -2
  44. data/app/assets/javascripts/PatientCharacteristicEthnicity.js +2 -2
  45. data/app/assets/javascripts/PatientCharacteristicExpired.js +2 -2
  46. data/app/assets/javascripts/PatientCharacteristicPayer.js +2 -2
  47. data/app/assets/javascripts/PatientCharacteristicRace.js +2 -2
  48. data/app/assets/javascripts/PatientCharacteristicSex.js +2 -2
  49. data/app/assets/javascripts/PhysicalExamOrder.js +2 -3
  50. data/app/assets/javascripts/PhysicalExamPerformed.js +2 -2
  51. data/app/assets/javascripts/PhysicalExamRecommended.js +2 -3
  52. data/app/assets/javascripts/ProcedureOrder.js +2 -4
  53. data/app/assets/javascripts/ProcedurePerformed.js +2 -3
  54. data/app/assets/javascripts/ProcedureRecommended.js +2 -4
  55. data/app/assets/javascripts/ProviderCareExperience.js +2 -2
  56. data/app/assets/javascripts/ProviderCharacteristic.js +2 -2
  57. data/app/assets/javascripts/ResultComponent.js +1 -1
  58. data/app/assets/javascripts/SubstanceAdministered.js +2 -3
  59. data/app/assets/javascripts/SubstanceOrder.js +2 -3
  60. data/app/assets/javascripts/SubstanceRecommended.js +2 -4
  61. data/app/assets/javascripts/Symptom.js +2 -2
  62. data/app/assets/javascripts/basetypes/Any.js +3 -3
  63. data/app/assets/javascripts/basetypes/DateTime.js +1 -1
  64. data/app/assets/javascripts/basetypes/Interval.js +2 -2
  65. data/app/assets/javascripts/basetypes/Ratio.js +20 -0
  66. data/app/models/models.rb +4 -5
  67. data/app/models/qdm/adverse_event.rb +2 -2
  68. data/app/models/qdm/allergy_intolerance.rb +2 -2
  69. data/app/models/qdm/assessment_order.rb +14 -0
  70. data/app/models/qdm/assessment_performed.rb +2 -2
  71. data/app/models/qdm/assessment_recommended.rb +2 -3
  72. data/app/models/qdm/basetypes/ratio.rb +52 -0
  73. data/app/models/qdm/care_goal.rb +2 -2
  74. data/app/models/qdm/communication_performed.rb +19 -0
  75. data/app/models/qdm/component.rb +1 -1
  76. data/app/models/qdm/device_applied.rb +2 -3
  77. data/app/models/qdm/device_order.rb +2 -2
  78. data/app/models/qdm/device_recommended.rb +2 -2
  79. data/app/models/qdm/diagnosis.rb +2 -2
  80. data/app/models/qdm/diagnostic_study_order.rb +2 -3
  81. data/app/models/qdm/diagnostic_study_performed.rb +2 -2
  82. data/app/models/qdm/diagnostic_study_recommended.rb +2 -3
  83. data/app/models/qdm/encounter_order.rb +2 -2
  84. data/app/models/qdm/encounter_performed.rb +2 -2
  85. data/app/models/qdm/encounter_recommended.rb +2 -2
  86. data/app/models/qdm/facility_location.rb +1 -1
  87. data/app/models/qdm/family_history.rb +2 -2
  88. data/app/models/qdm/id.rb +1 -1
  89. data/app/models/qdm/immunization_administered.rb +2 -3
  90. data/app/models/qdm/immunization_order.rb +2 -2
  91. data/app/models/qdm/intervention_order.rb +2 -2
  92. data/app/models/qdm/intervention_performed.rb +2 -2
  93. data/app/models/qdm/intervention_recommended.rb +2 -2
  94. data/app/models/qdm/laboratory_test_order.rb +2 -3
  95. data/app/models/qdm/laboratory_test_performed.rb +2 -2
  96. data/app/models/qdm/laboratory_test_recommended.rb +2 -3
  97. data/app/models/qdm/medication_active.rb +2 -3
  98. data/app/models/qdm/medication_administered.rb +2 -3
  99. data/app/models/qdm/medication_discharge.rb +3 -2
  100. data/app/models/qdm/medication_dispensed.rb +5 -2
  101. data/app/models/qdm/medication_order.rb +5 -4
  102. data/app/models/qdm/participation.rb +2 -2
  103. data/app/models/qdm/patient.rb +3 -3
  104. data/app/models/qdm/patient_care_experience.rb +2 -2
  105. data/app/models/qdm/patient_characteristic.rb +2 -2
  106. data/app/models/qdm/patient_characteristic_birthdate.rb +2 -2
  107. data/app/models/qdm/patient_characteristic_clinical_trial_participant.rb +2 -2
  108. data/app/models/qdm/patient_characteristic_ethnicity.rb +2 -2
  109. data/app/models/qdm/patient_characteristic_expired.rb +2 -2
  110. data/app/models/qdm/patient_characteristic_payer.rb +2 -2
  111. data/app/models/qdm/patient_characteristic_race.rb +2 -2
  112. data/app/models/qdm/patient_characteristic_sex.rb +2 -2
  113. data/app/models/qdm/physical_exam_order.rb +2 -3
  114. data/app/models/qdm/physical_exam_performed.rb +2 -2
  115. data/app/models/qdm/physical_exam_recommended.rb +2 -3
  116. data/app/models/qdm/procedure_order.rb +2 -4
  117. data/app/models/qdm/procedure_performed.rb +2 -3
  118. data/app/models/qdm/procedure_recommended.rb +2 -4
  119. data/app/models/qdm/provider_care_experience.rb +2 -2
  120. data/app/models/qdm/provider_characteristic.rb +2 -2
  121. data/app/models/qdm/result_component.rb +1 -1
  122. data/app/models/qdm/substance_administered.rb +2 -3
  123. data/app/models/qdm/substance_order.rb +2 -3
  124. data/app/models/qdm/substance_recommended.rb +2 -4
  125. data/app/models/qdm/symptom.rb +2 -2
  126. data/cqm-models.gemspec +1 -1
  127. data/data/oids.json +209 -197
  128. data/dist/index.js +2114 -1230
  129. data/lib/generate_models.rb +14 -12
  130. data/modelinfo/qdm-modelinfo-5.4.xml +503 -0
  131. data/package.json +2 -2
  132. data/templates/models_template.rb.erb +2 -1
  133. data/templates/patient_extension.rb.erb +2 -2
  134. data/templates/patient_template.js.erb +3 -3
  135. data/yarn.lock +3 -3
  136. metadata +10 -11
  137. data/app/assets/javascripts/CommunicationFromProviderToProvider.js +0 -30
  138. data/app/assets/javascripts/Ratio.js +0 -26
  139. data/app/models/qdm/communication_from_patient_to_provider.rb +0 -14
  140. data/app/models/qdm/communication_from_provider_to_patient.rb +0 -14
  141. data/app/models/qdm/communication_from_provider_to_provider.rb +0 -14
  142. data/app/models/qdm/ratio.rb +0 -10
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cqm-models",
3
- "version": "0.8.4",
3
+ "version": "1.0.0",
4
4
  "description": "This library contains auto generated Mongo (Mongoose.js) models that correspond to the QDM (Quality Data Model) specification.",
5
5
  "main": "app/assets/javascripts/index.js",
6
6
  "browser": {
@@ -15,7 +15,7 @@
15
15
  ],
16
16
  "license": "Apache-2.0",
17
17
  "dependencies": {
18
- "cql-execution": "1.2.3",
18
+ "cql-execution": "1.3.0",
19
19
  "mongoose": "^5.0.7"
20
20
  },
21
21
  "devDependencies": {
@@ -8,9 +8,10 @@ require_relative 'qdm/id'
8
8
 
9
9
  # base types
10
10
  require_relative 'qdm/basetypes/code'
11
+ require_relative 'qdm/basetypes/data_element'
11
12
  require_relative 'qdm/basetypes/interval'
12
13
  require_relative 'qdm/basetypes/quantity'
13
- require_relative 'qdm/basetypes/data_element'
14
+ require_relative 'qdm/basetypes/ratio'
14
15
 
15
16
  # Tacoma-specific models
16
17
  require_relative 'qdm/tacoma/measure'
@@ -40,9 +40,9 @@
40
40
  # will return all Encounter QDM data types active on the patient.
41
41
  def get_data_elements(category = nil, status = nil)
42
42
  if category && status
43
- dataElements.where(category: category, qdmStatus: status) || []
43
+ dataElements.where(qdmCategory: category, qdmStatus: status) || []
44
44
  elsif category
45
- dataElements.where(category: category) || []
45
+ dataElements.where(qdmCategory: category) || []
46
46
  else
47
47
  dataElements || []
48
48
  end
@@ -70,10 +70,10 @@ PatientSchema.methods.getByQrdaOid = function getByQrdaOid(qrdaOid) {
70
70
  // Example: patient.getDataElements(category = 'encounters') will return
71
71
  // all Encounter QDM data types active on the patient.
72
72
  PatientSchema.methods.getDataElements = function getDataElements(params) {
73
- if (params.category && params.qdmStatus) {
74
- return this.dataElements.filter(element => (element.category === params.category) && (element.qdmStatus === params.qdmStatus));
73
+ if (params.qdmCategory && params.qdmStatus) {
74
+ return this.dataElements.filter(element => (element.qdmCategory === params.qdmCategory) && (element.qdmStatus === params.qdmStatus));
75
75
  } else if (params.category) {
76
- return this.dataElements.filter(element => element.category === params.category);
76
+ return this.dataElements.filter(element => element.qdmCategory === params.qdmCategory);
77
77
  }
78
78
  return this.dataElements;
79
79
  };
data/yarn.lock CHANGED
@@ -442,9 +442,9 @@ core-util-is@~1.0.0:
442
442
  version "1.0.2"
443
443
  resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
444
444
 
445
- cql-execution@1.2.3:
446
- version "1.2.3"
447
- resolved "https://registry.yarnpkg.com/cql-execution/-/cql-execution-1.2.3.tgz#2c51825da605148f4433f665b3cb6d9fcc9293ee"
445
+ cql-execution@1.3.0:
446
+ version "1.3.0"
447
+ resolved "https://registry.yarnpkg.com/cql-execution/-/cql-execution-1.3.0.tgz#8f02c29477807d080f423e979e1fffac10e21ef5"
448
448
  dependencies:
449
449
  moment "^2.20.1"
450
450
  ucum "0.0.7"
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: 0.8.4
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - aholmes@mitre.org
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2018-08-24 00:00:00.000000000 Z
13
+ date: 2018-09-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -131,12 +131,11 @@ files:
131
131
  - app/assets/javascripts/AdverseEvent.js
132
132
  - app/assets/javascripts/AllDataElements.js
133
133
  - app/assets/javascripts/AllergyIntolerance.js
134
+ - app/assets/javascripts/AssessmentOrder.js
134
135
  - app/assets/javascripts/AssessmentPerformed.js
135
136
  - app/assets/javascripts/AssessmentRecommended.js
136
137
  - app/assets/javascripts/CareGoal.js
137
- - app/assets/javascripts/CommunicationFromPatientToProvider.js
138
- - app/assets/javascripts/CommunicationFromProviderToPatient.js
139
- - app/assets/javascripts/CommunicationFromProviderToProvider.js
138
+ - app/assets/javascripts/CommunicationPerformed.js
140
139
  - app/assets/javascripts/Component.js
141
140
  - app/assets/javascripts/Concept.js
142
141
  - app/assets/javascripts/DeviceApplied.js
@@ -187,7 +186,6 @@ files:
187
186
  - app/assets/javascripts/ProcedureRecommended.js
188
187
  - app/assets/javascripts/ProviderCareExperience.js
189
188
  - app/assets/javascripts/ProviderCharacteristic.js
190
- - app/assets/javascripts/Ratio.js
191
189
  - app/assets/javascripts/Result.js
192
190
  - app/assets/javascripts/ResultComponent.js
193
191
  - app/assets/javascripts/SubstanceAdministered.js
@@ -201,20 +199,21 @@ files:
201
199
  - app/assets/javascripts/basetypes/DateTime.js
202
200
  - app/assets/javascripts/basetypes/Interval.js
203
201
  - app/assets/javascripts/basetypes/Quantity.js
202
+ - app/assets/javascripts/basetypes/Ratio.js
204
203
  - app/assets/javascripts/index.js
205
204
  - app/models/models.rb
206
205
  - app/models/qdm/adverse_event.rb
207
206
  - app/models/qdm/allergy_intolerance.rb
207
+ - app/models/qdm/assessment_order.rb
208
208
  - app/models/qdm/assessment_performed.rb
209
209
  - app/models/qdm/assessment_recommended.rb
210
210
  - app/models/qdm/basetypes/code.rb
211
211
  - app/models/qdm/basetypes/data_element.rb
212
212
  - app/models/qdm/basetypes/interval.rb
213
213
  - app/models/qdm/basetypes/quantity.rb
214
+ - app/models/qdm/basetypes/ratio.rb
214
215
  - app/models/qdm/care_goal.rb
215
- - app/models/qdm/communication_from_patient_to_provider.rb
216
- - app/models/qdm/communication_from_provider_to_patient.rb
217
- - app/models/qdm/communication_from_provider_to_provider.rb
216
+ - app/models/qdm/communication_performed.rb
218
217
  - app/models/qdm/component.rb
219
218
  - app/models/qdm/device_applied.rb
220
219
  - app/models/qdm/device_order.rb
@@ -261,7 +260,6 @@ files:
261
260
  - app/models/qdm/procedure_recommended.rb
262
261
  - app/models/qdm/provider_care_experience.rb
263
262
  - app/models/qdm/provider_characteristic.rb
264
- - app/models/qdm/ratio.rb
265
263
  - app/models/qdm/result_component.rb
266
264
  - app/models/qdm/substance_administered.rb
267
265
  - app/models/qdm/substance_order.rb
@@ -287,6 +285,7 @@ files:
287
285
  - modelinfo/qdm-modelinfo-5.0.2.xml
288
286
  - modelinfo/qdm-modelinfo-5.0.xml
289
287
  - modelinfo/qdm-modelinfo-5.3.xml
288
+ - modelinfo/qdm-modelinfo-5.4.xml
290
289
  - package.json
291
290
  - templates/all_data_elements_template.js.erb
292
291
  - templates/id_template.js.erb
@@ -317,7 +316,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
317
316
  version: '0'
318
317
  requirements: []
319
318
  rubyforge_project:
320
- rubygems_version: 2.6.14
319
+ rubygems_version: 2.6.12
321
320
  signing_key:
322
321
  specification_version: 4
323
322
  summary: Mongo models that correspond to the QDM specification.
@@ -1,30 +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
- 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 CommunicationFromProviderToProviderSchema = DataElementSchema({
18
- authorDatetime: DateTime,
19
- relatedTo: [IdSchema],
20
- negationRationale: Code,
21
- hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.3.10' },
22
- category: { type: String, default: 'communication' },
23
- qdmStatus: { type: String, default: 'from_provider_to_provider' },
24
- qdmVersion: { type: String, default: '5.3' },
25
- _type: { type: String, default: 'CommunicationFromProviderToProvider' },
26
-
27
- });
28
-
29
- module.exports.CommunicationFromProviderToProviderSchema = CommunicationFromProviderToProviderSchema;
30
- module.exports.CommunicationFromProviderToProvider = mongoose.model('CommunicationFromProviderToProvider', CommunicationFromProviderToProviderSchema);
@@ -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
- 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 RatioSchema = DataElementSchema({
18
- numerator: Quantity,
19
- denominator: Quantity,
20
- qdmVersion: { type: String, default: '5.3' },
21
- _type: { type: String, default: 'Ratio' },
22
-
23
- });
24
-
25
- module.exports.RatioSchema = RatioSchema;
26
- module.exports.Ratio = mongoose.model('Ratio', RatioSchema);
@@ -1,14 +0,0 @@
1
- module QDM
2
- # app/models/qdm/communication_from_patient_to_provider.rb
3
- class CommunicationFromPatientToProvider < DataElement
4
- include Mongoid::Document
5
- embedded_in :patient
6
- field :authorDatetime, type: DateTime
7
- embeds_many :relatedTo, class_name: 'QDM::Id'
8
- field :negationRationale, type: QDM::Code
9
- field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.8'
10
- field :category, type: String, default: 'communication'
11
- field :qdmStatus, type: String, default: 'from_patient_to_provider'
12
- field :qdmVersion, type: String, default: '5.3'
13
- end
14
- end
@@ -1,14 +0,0 @@
1
- module QDM
2
- # app/models/qdm/communication_from_provider_to_patient.rb
3
- class CommunicationFromProviderToPatient < DataElement
4
- include Mongoid::Document
5
- embedded_in :patient
6
- field :authorDatetime, type: DateTime
7
- embeds_many :relatedTo, class_name: 'QDM::Id'
8
- field :negationRationale, type: QDM::Code
9
- field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.9'
10
- field :category, type: String, default: 'communication'
11
- field :qdmStatus, type: String, default: 'from_provider_to_patient'
12
- field :qdmVersion, type: String, default: '5.3'
13
- end
14
- end
@@ -1,14 +0,0 @@
1
- module QDM
2
- # app/models/qdm/communication_from_provider_to_provider.rb
3
- class CommunicationFromProviderToProvider < DataElement
4
- include Mongoid::Document
5
- embedded_in :patient
6
- field :authorDatetime, type: DateTime
7
- embeds_many :relatedTo, class_name: 'QDM::Id'
8
- field :negationRationale, type: QDM::Code
9
- field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.10'
10
- field :category, type: String, default: 'communication'
11
- field :qdmStatus, type: String, default: 'from_provider_to_provider'
12
- field :qdmVersion, type: String, default: '5.3'
13
- end
14
- end
@@ -1,10 +0,0 @@
1
- module QDM
2
- # app/models/qdm/ratio.rb
3
- class Ratio < DataElement
4
- include Mongoid::Document
5
- embedded_in :patient
6
- field :numerator, type: QDM::Quantity
7
- field :denominator, type: QDM::Quantity
8
- field :qdmVersion, type: String, default: '5.3'
9
- end
10
- end