cqm-models 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (178) hide show
  1. checksums.yaml +7 -0
  2. data/.eslintignore +1 -0
  3. data/.eslintrc.json +26 -0
  4. data/.github/PULL_REQUEST_TEMPLATE.md +32 -0
  5. data/.gitignore +21 -0
  6. data/.rspec +2 -0
  7. data/.rubocop.yml +42 -0
  8. data/.travis.yml +21 -0
  9. data/Gemfile +5 -0
  10. data/LICENSE.txt +201 -0
  11. data/README.md +26 -0
  12. data/Rakefile +12 -0
  13. data/app/assets/javascripts/AdverseEvent.js +27 -0
  14. data/app/assets/javascripts/AllDataElements.js +120 -0
  15. data/app/assets/javascripts/AllergyIntolerance.js +27 -0
  16. data/app/assets/javascripts/AssessmentPerformed.js +30 -0
  17. data/app/assets/javascripts/AssessmentRecommended.js +27 -0
  18. data/app/assets/javascripts/CareGoal.js +25 -0
  19. data/app/assets/javascripts/CommunicationFromPatientToProvider.js +26 -0
  20. data/app/assets/javascripts/CommunicationFromProviderToPatient.js +26 -0
  21. data/app/assets/javascripts/CommunicationFromProviderToProvider.js +26 -0
  22. data/app/assets/javascripts/Component.js +22 -0
  23. data/app/assets/javascripts/Concept.js +14 -0
  24. data/app/assets/javascripts/DeviceApplied.js +29 -0
  25. data/app/assets/javascripts/DeviceOrder.js +26 -0
  26. data/app/assets/javascripts/DeviceRecommended.js +26 -0
  27. data/app/assets/javascripts/Diagnosis.js +27 -0
  28. data/app/assets/javascripts/DiagnosticStudyOrder.js +27 -0
  29. data/app/assets/javascripts/DiagnosticStudyPerformed.js +33 -0
  30. data/app/assets/javascripts/DiagnosticStudyRecommended.js +27 -0
  31. data/app/assets/javascripts/EncounterOrder.js +27 -0
  32. data/app/assets/javascripts/EncounterPerformed.js +32 -0
  33. data/app/assets/javascripts/EncounterRecommended.js +27 -0
  34. data/app/assets/javascripts/FacilityLocation.js +22 -0
  35. data/app/assets/javascripts/FamilyHistory.js +25 -0
  36. data/app/assets/javascripts/Id.js +22 -0
  37. data/app/assets/javascripts/ImmunizationAdministered.js +30 -0
  38. data/app/assets/javascripts/ImmunizationOrder.js +30 -0
  39. data/app/assets/javascripts/InterventionOrder.js +26 -0
  40. data/app/assets/javascripts/InterventionPerformed.js +29 -0
  41. data/app/assets/javascripts/InterventionRecommended.js +26 -0
  42. data/app/assets/javascripts/LaboratoryTestOrder.js +27 -0
  43. data/app/assets/javascripts/LaboratoryTestPerformed.js +33 -0
  44. data/app/assets/javascripts/LaboratoryTestRecommended.js +27 -0
  45. data/app/assets/javascripts/Measure.js +76 -0
  46. data/app/assets/javascripts/MeasurePackage.js +20 -0
  47. data/app/assets/javascripts/MedicationActive.js +28 -0
  48. data/app/assets/javascripts/MedicationAdministered.js +31 -0
  49. data/app/assets/javascripts/MedicationDischarge.js +30 -0
  50. data/app/assets/javascripts/MedicationDispensed.js +31 -0
  51. data/app/assets/javascripts/MedicationOrder.js +34 -0
  52. data/app/assets/javascripts/Participation.js +21 -0
  53. data/app/assets/javascripts/Patient.js +248 -0
  54. data/app/assets/javascripts/PatientCareExperience.js +23 -0
  55. data/app/assets/javascripts/PatientCharacteristic.js +23 -0
  56. data/app/assets/javascripts/PatientCharacteristicBirthdate.js +24 -0
  57. data/app/assets/javascripts/PatientCharacteristicClinicalTrialParticipant.js +26 -0
  58. data/app/assets/javascripts/PatientCharacteristicEthnicity.js +23 -0
  59. data/app/assets/javascripts/PatientCharacteristicExpired.js +25 -0
  60. data/app/assets/javascripts/PatientCharacteristicPayer.js +24 -0
  61. data/app/assets/javascripts/PatientCharacteristicRace.js +23 -0
  62. data/app/assets/javascripts/PatientCharacteristicSex.js +23 -0
  63. data/app/assets/javascripts/PhysicalExamOrder.js +28 -0
  64. data/app/assets/javascripts/PhysicalExamPerformed.js +31 -0
  65. data/app/assets/javascripts/PhysicalExamRecommended.js +28 -0
  66. data/app/assets/javascripts/ProcedureOrder.js +30 -0
  67. data/app/assets/javascripts/ProcedurePerformed.js +35 -0
  68. data/app/assets/javascripts/ProcedureRecommended.js +30 -0
  69. data/app/assets/javascripts/ProviderCareExperience.js +23 -0
  70. data/app/assets/javascripts/ProviderCharacteristic.js +23 -0
  71. data/app/assets/javascripts/Ratio.js +22 -0
  72. data/app/assets/javascripts/Result.js +28 -0
  73. data/app/assets/javascripts/ResultComponent.js +21 -0
  74. data/app/assets/javascripts/SubstanceAdministered.js +30 -0
  75. data/app/assets/javascripts/SubstanceOrder.js +32 -0
  76. data/app/assets/javascripts/SubstanceRecommended.js +32 -0
  77. data/app/assets/javascripts/Symptom.js +25 -0
  78. data/app/assets/javascripts/ValueSet.js +30 -0
  79. data/app/assets/javascripts/basetypes/Code.js +25 -0
  80. data/app/assets/javascripts/basetypes/DataElement.js +36 -0
  81. data/app/assets/javascripts/basetypes/DateTime.js +18 -0
  82. data/app/assets/javascripts/basetypes/Interval.js +35 -0
  83. data/app/assets/javascripts/basetypes/Quantity.js +20 -0
  84. data/app/assets/javascripts/index.js +12 -0
  85. data/app/models/models.rb +78 -0
  86. data/app/models/qdm/adverse_event.rb +15 -0
  87. data/app/models/qdm/allergy_intolerance.rb +15 -0
  88. data/app/models/qdm/assessment_performed.rb +18 -0
  89. data/app/models/qdm/assessment_recommended.rb +15 -0
  90. data/app/models/qdm/basetypes/code.rb +56 -0
  91. data/app/models/qdm/basetypes/data_element.rb +42 -0
  92. data/app/models/qdm/basetypes/interval.rb +54 -0
  93. data/app/models/qdm/basetypes/quantity.rb +52 -0
  94. data/app/models/qdm/care_goal.rb +13 -0
  95. data/app/models/qdm/communication_from_patient_to_provider.rb +14 -0
  96. data/app/models/qdm/communication_from_provider_to_patient.rb +14 -0
  97. data/app/models/qdm/communication_from_provider_to_provider.rb +14 -0
  98. data/app/models/qdm/component.rb +10 -0
  99. data/app/models/qdm/device_applied.rb +17 -0
  100. data/app/models/qdm/device_order.rb +14 -0
  101. data/app/models/qdm/device_recommended.rb +14 -0
  102. data/app/models/qdm/diagnosis.rb +15 -0
  103. data/app/models/qdm/diagnostic_study_order.rb +15 -0
  104. data/app/models/qdm/diagnostic_study_performed.rb +21 -0
  105. data/app/models/qdm/diagnostic_study_recommended.rb +15 -0
  106. data/app/models/qdm/encounter_order.rb +15 -0
  107. data/app/models/qdm/encounter_performed.rb +20 -0
  108. data/app/models/qdm/encounter_recommended.rb +15 -0
  109. data/app/models/qdm/facility_location.rb +10 -0
  110. data/app/models/qdm/family_history.rb +13 -0
  111. data/app/models/qdm/id.rb +10 -0
  112. data/app/models/qdm/immunization_administered.rb +18 -0
  113. data/app/models/qdm/immunization_order.rb +18 -0
  114. data/app/models/qdm/intervention_order.rb +14 -0
  115. data/app/models/qdm/intervention_performed.rb +17 -0
  116. data/app/models/qdm/intervention_recommended.rb +14 -0
  117. data/app/models/qdm/laboratory_test_order.rb +15 -0
  118. data/app/models/qdm/laboratory_test_performed.rb +21 -0
  119. data/app/models/qdm/laboratory_test_recommended.rb +15 -0
  120. data/app/models/qdm/medication_active.rb +16 -0
  121. data/app/models/qdm/medication_administered.rb +19 -0
  122. data/app/models/qdm/medication_discharge.rb +18 -0
  123. data/app/models/qdm/medication_dispensed.rb +19 -0
  124. data/app/models/qdm/medication_order.rb +22 -0
  125. data/app/models/qdm/participation.rb +9 -0
  126. data/app/models/qdm/patient.rb +201 -0
  127. data/app/models/qdm/patient_care_experience.rb +11 -0
  128. data/app/models/qdm/patient_characteristic.rb +11 -0
  129. data/app/models/qdm/patient_characteristic_birthdate.rb +12 -0
  130. data/app/models/qdm/patient_characteristic_clinical_trial_participant.rb +14 -0
  131. data/app/models/qdm/patient_characteristic_ethnicity.rb +11 -0
  132. data/app/models/qdm/patient_characteristic_expired.rb +13 -0
  133. data/app/models/qdm/patient_characteristic_payer.rb +12 -0
  134. data/app/models/qdm/patient_characteristic_race.rb +11 -0
  135. data/app/models/qdm/patient_characteristic_sex.rb +11 -0
  136. data/app/models/qdm/physical_exam_order.rb +16 -0
  137. data/app/models/qdm/physical_exam_performed.rb +19 -0
  138. data/app/models/qdm/physical_exam_recommended.rb +16 -0
  139. data/app/models/qdm/procedure_order.rb +18 -0
  140. data/app/models/qdm/procedure_performed.rb +23 -0
  141. data/app/models/qdm/procedure_recommended.rb +18 -0
  142. data/app/models/qdm/provider_care_experience.rb +11 -0
  143. data/app/models/qdm/provider_characteristic.rb +11 -0
  144. data/app/models/qdm/ratio.rb +10 -0
  145. data/app/models/qdm/result_component.rb +9 -0
  146. data/app/models/qdm/substance_administered.rb +18 -0
  147. data/app/models/qdm/substance_order.rb +20 -0
  148. data/app/models/qdm/substance_recommended.rb +20 -0
  149. data/app/models/qdm/symptom.rb +13 -0
  150. data/app/models/qdm/tacoma/concept.rb +14 -0
  151. data/app/models/qdm/tacoma/measure.rb +172 -0
  152. data/app/models/qdm/tacoma/measure_package.rb +10 -0
  153. data/app/models/qdm/tacoma/valueset.rb +68 -0
  154. data/bin/console +14 -0
  155. data/bin/setup +8 -0
  156. data/bin/validate_dist.sh +17 -0
  157. data/config/mongoid.yml +6 -0
  158. data/cqm-models.gemspec +29 -0
  159. data/data/oids.json +584 -0
  160. data/dist/index.js +157647 -0
  161. data/lib/cqm/models.rb +1 -0
  162. data/lib/generate_models.rb +330 -0
  163. data/modelinfo/qdm-modelinfo-4.2.xml +515 -0
  164. data/modelinfo/qdm-modelinfo-4.3.xml +521 -0
  165. data/modelinfo/qdm-modelinfo-5.0.1.xml +436 -0
  166. data/modelinfo/qdm-modelinfo-5.0.2.xml +445 -0
  167. data/modelinfo/qdm-modelinfo-5.0.xml +429 -0
  168. data/modelinfo/qdm-modelinfo-5.3.xml +524 -0
  169. data/package.json +34 -0
  170. data/templates/all_data_elements_template.js.erb +4 -0
  171. data/templates/index_template.js.erb +12 -0
  172. data/templates/models_template.rb.erb +21 -0
  173. data/templates/mongoose_template.js.erb +20 -0
  174. data/templates/patient_extension.rb.erb +194 -0
  175. data/templates/patient_template.js.erb +247 -0
  176. data/tmp/.keep +0 -0
  177. data/yarn.lock +1901 -0
  178. metadata +320 -0
@@ -0,0 +1,24 @@
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 [Number, String] = [
9
+ mongoose.Schema.Types.Number,
10
+ mongoose.Schema.Types.String,
11
+ ];
12
+
13
+ const PatientCharacteristicBirthdateSchema = DataElementSchema({
14
+ birthDatetime: DateTime,
15
+ hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.3.54' },
16
+ category: { type: String, default: 'patient_characteristic' },
17
+ qdmStatus: { type: String, default: 'birthdate' },
18
+ qdmVersion: { type: String, default: '5.3' },
19
+ _type: { type: String, default: 'PatientCharacteristicBirthdate' },
20
+
21
+ });
22
+
23
+ module.exports.PatientCharacteristicBirthdateSchema = PatientCharacteristicBirthdateSchema;
24
+ module.exports.PatientCharacteristicBirthdate = mongoose.model('PatientCharacteristicBirthdate', PatientCharacteristicBirthdateSchema);
@@ -0,0 +1,26 @@
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 [Number, String] = [
9
+ mongoose.Schema.Types.Number,
10
+ mongoose.Schema.Types.String,
11
+ ];
12
+
13
+ const PatientCharacteristicClinicalTrialParticipantSchema = DataElementSchema({
14
+ reason: Code,
15
+ relevantPeriod: Interval,
16
+ hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.3.6' },
17
+ qrdaOid: { type: String, default: '2.16.840.1.113883.10.20.24.3.51' },
18
+ category: { type: String, default: 'patient_characteristic' },
19
+ qdmStatus: { type: String, default: 'clinical_trial_participant' },
20
+ qdmVersion: { type: String, default: '5.3' },
21
+ _type: { type: String, default: 'PatientCharacteristicClinicalTrialParticipant' },
22
+
23
+ });
24
+
25
+ module.exports.PatientCharacteristicClinicalTrialParticipantSchema = PatientCharacteristicClinicalTrialParticipantSchema;
26
+ module.exports.PatientCharacteristicClinicalTrialParticipant = mongoose.model('PatientCharacteristicClinicalTrialParticipant', PatientCharacteristicClinicalTrialParticipantSchema);
@@ -0,0 +1,23 @@
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 [Number, String] = [
9
+ mongoose.Schema.Types.Number,
10
+ mongoose.Schema.Types.String,
11
+ ];
12
+
13
+ const PatientCharacteristicEthnicitySchema = DataElementSchema({
14
+ hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.3.56' },
15
+ category: { type: String, default: 'patient_characteristic' },
16
+ qdmStatus: { type: String, default: 'ethnicity' },
17
+ qdmVersion: { type: String, default: '5.3' },
18
+ _type: { type: String, default: 'PatientCharacteristicEthnicity' },
19
+
20
+ });
21
+
22
+ module.exports.PatientCharacteristicEthnicitySchema = PatientCharacteristicEthnicitySchema;
23
+ module.exports.PatientCharacteristicEthnicity = mongoose.model('PatientCharacteristicEthnicity', PatientCharacteristicEthnicitySchema);
@@ -0,0 +1,25 @@
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 [Number, String] = [
9
+ mongoose.Schema.Types.Number,
10
+ mongoose.Schema.Types.String,
11
+ ];
12
+
13
+ const PatientCharacteristicExpiredSchema = DataElementSchema({
14
+ expiredDatetime: DateTime,
15
+ cause: Code,
16
+ hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.3.57' },
17
+ category: { type: String, default: 'patient_characteristic' },
18
+ qdmStatus: { type: String, default: 'expired' },
19
+ qdmVersion: { type: String, default: '5.3' },
20
+ _type: { type: String, default: 'PatientCharacteristicExpired' },
21
+
22
+ });
23
+
24
+ module.exports.PatientCharacteristicExpiredSchema = PatientCharacteristicExpiredSchema;
25
+ module.exports.PatientCharacteristicExpired = mongoose.model('PatientCharacteristicExpired', PatientCharacteristicExpiredSchema);
@@ -0,0 +1,24 @@
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 [Number, String] = [
9
+ mongoose.Schema.Types.Number,
10
+ mongoose.Schema.Types.String,
11
+ ];
12
+
13
+ const PatientCharacteristicPayerSchema = DataElementSchema({
14
+ relevantPeriod: Interval,
15
+ hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.3.58' },
16
+ category: { type: String, default: 'patient_characteristic' },
17
+ qdmStatus: { type: String, default: 'payer' },
18
+ qdmVersion: { type: String, default: '5.3' },
19
+ _type: { type: String, default: 'PatientCharacteristicPayer' },
20
+
21
+ });
22
+
23
+ module.exports.PatientCharacteristicPayerSchema = PatientCharacteristicPayerSchema;
24
+ module.exports.PatientCharacteristicPayer = mongoose.model('PatientCharacteristicPayer', PatientCharacteristicPayerSchema);
@@ -0,0 +1,23 @@
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 [Number, String] = [
9
+ mongoose.Schema.Types.Number,
10
+ mongoose.Schema.Types.String,
11
+ ];
12
+
13
+ const PatientCharacteristicRaceSchema = DataElementSchema({
14
+ hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.3.59' },
15
+ category: { type: String, default: 'patient_characteristic' },
16
+ qdmStatus: { type: String, default: 'race' },
17
+ qdmVersion: { type: String, default: '5.3' },
18
+ _type: { type: String, default: 'PatientCharacteristicRace' },
19
+
20
+ });
21
+
22
+ module.exports.PatientCharacteristicRaceSchema = PatientCharacteristicRaceSchema;
23
+ module.exports.PatientCharacteristicRace = mongoose.model('PatientCharacteristicRace', PatientCharacteristicRaceSchema);
@@ -0,0 +1,23 @@
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 [Number, String] = [
9
+ mongoose.Schema.Types.Number,
10
+ mongoose.Schema.Types.String,
11
+ ];
12
+
13
+ const PatientCharacteristicSexSchema = DataElementSchema({
14
+ hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.3.55' },
15
+ category: { type: String, default: 'patient_characteristic' },
16
+ qdmStatus: { type: String, default: 'gender' },
17
+ qdmVersion: { type: String, default: '5.3' },
18
+ _type: { type: String, default: 'PatientCharacteristicSex' },
19
+
20
+ });
21
+
22
+ module.exports.PatientCharacteristicSexSchema = PatientCharacteristicSexSchema;
23
+ module.exports.PatientCharacteristicSex = mongoose.model('PatientCharacteristicSex', PatientCharacteristicSexSchema);
@@ -0,0 +1,28 @@
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 [Number, String] = [
9
+ mongoose.Schema.Types.Number,
10
+ mongoose.Schema.Types.String,
11
+ ];
12
+
13
+ const PhysicalExamOrderSchema = DataElementSchema({
14
+ authorDatetime: DateTime,
15
+ reason: Code,
16
+ method: Code,
17
+ anatomicalLocationSite: Code,
18
+ negationRationale: Code,
19
+ hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.3.61' },
20
+ category: { type: String, default: 'physical_exam' },
21
+ qdmStatus: { type: String, default: 'order' },
22
+ qdmVersion: { type: String, default: '5.3' },
23
+ _type: { type: String, default: 'PhysicalExamOrder' },
24
+
25
+ });
26
+
27
+ module.exports.PhysicalExamOrderSchema = PhysicalExamOrderSchema;
28
+ module.exports.PhysicalExamOrder = mongoose.model('PhysicalExamOrder', PhysicalExamOrderSchema);
@@ -0,0 +1,31 @@
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 [Number, String] = [
9
+ mongoose.Schema.Types.Number,
10
+ mongoose.Schema.Types.String,
11
+ ];
12
+
13
+ const PhysicalExamPerformedSchema = DataElementSchema({
14
+ authorDatetime: DateTime,
15
+ relevantPeriod: Interval,
16
+ reason: Code,
17
+ method: Code,
18
+ result: {},
19
+ anatomicalLocationSite: Code,
20
+ negationRationale: Code,
21
+ components: [],
22
+ hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.3.62' },
23
+ category: { type: String, default: 'physical_exam' },
24
+ qdmStatus: { type: String, default: 'performed' },
25
+ qdmVersion: { type: String, default: '5.3' },
26
+ _type: { type: String, default: 'PhysicalExamPerformed' },
27
+
28
+ });
29
+
30
+ module.exports.PhysicalExamPerformedSchema = PhysicalExamPerformedSchema;
31
+ module.exports.PhysicalExamPerformed = mongoose.model('PhysicalExamPerformed', PhysicalExamPerformedSchema);
@@ -0,0 +1,28 @@
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 [Number, String] = [
9
+ mongoose.Schema.Types.Number,
10
+ mongoose.Schema.Types.String,
11
+ ];
12
+
13
+ const PhysicalExamRecommendedSchema = DataElementSchema({
14
+ authorDatetime: DateTime,
15
+ reason: Code,
16
+ method: Code,
17
+ anatomicalLocationSite: Code,
18
+ negationRationale: Code,
19
+ hqmfOid: { type: String, default: '22.16.840.1.113883.10.20.28.3.63' },
20
+ category: { type: String, default: 'physical_exam' },
21
+ qdmStatus: { type: String, default: 'recommended' },
22
+ qdmVersion: { type: String, default: '5.3' },
23
+ _type: { type: String, default: 'PhysicalExamRecommended' },
24
+
25
+ });
26
+
27
+ module.exports.PhysicalExamRecommendedSchema = PhysicalExamRecommendedSchema;
28
+ module.exports.PhysicalExamRecommended = mongoose.model('PhysicalExamRecommended', PhysicalExamRecommendedSchema);
@@ -0,0 +1,30 @@
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 [Number, String] = [
9
+ mongoose.Schema.Types.Number,
10
+ mongoose.Schema.Types.String,
11
+ ];
12
+
13
+ const ProcedureOrderSchema = DataElementSchema({
14
+ authorDatetime: DateTime,
15
+ reason: Code,
16
+ method: Code,
17
+ anatomicalApproachSite: Code,
18
+ anatomicalLocationSite: Code,
19
+ ordinality: Code,
20
+ negationRationale: Code,
21
+ hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.3.66' },
22
+ category: { type: String, default: 'procedure' },
23
+ qdmStatus: { type: String, default: 'order' },
24
+ qdmVersion: { type: String, default: '5.3' },
25
+ _type: { type: String, default: 'ProcedureOrder' },
26
+
27
+ });
28
+
29
+ module.exports.ProcedureOrderSchema = ProcedureOrderSchema;
30
+ module.exports.ProcedureOrder = mongoose.model('ProcedureOrder', ProcedureOrderSchema);
@@ -0,0 +1,35 @@
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 [Number, String] = [
9
+ mongoose.Schema.Types.Number,
10
+ mongoose.Schema.Types.String,
11
+ ];
12
+
13
+ const ProcedurePerformedSchema = DataElementSchema({
14
+ authorDatetime: DateTime,
15
+ relevantPeriod: Interval,
16
+ reason: Code,
17
+ method: Code,
18
+ result: {},
19
+ status: Code,
20
+ anatomicalApproachSite: Code,
21
+ anatomicalLocationSite: Code,
22
+ ordinality: Code,
23
+ incisionDatetime: DateTime,
24
+ negationRationale: Code,
25
+ components: [],
26
+ hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.3.67' },
27
+ category: { type: String, default: 'procedure' },
28
+ qdmStatus: { type: String, default: 'performed' },
29
+ qdmVersion: { type: String, default: '5.3' },
30
+ _type: { type: String, default: 'ProcedurePerformed' },
31
+
32
+ });
33
+
34
+ module.exports.ProcedurePerformedSchema = ProcedurePerformedSchema;
35
+ module.exports.ProcedurePerformed = mongoose.model('ProcedurePerformed', ProcedurePerformedSchema);
@@ -0,0 +1,30 @@
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 [Number, String] = [
9
+ mongoose.Schema.Types.Number,
10
+ mongoose.Schema.Types.String,
11
+ ];
12
+
13
+ const ProcedureRecommendedSchema = DataElementSchema({
14
+ authorDatetime: DateTime,
15
+ reason: Code,
16
+ method: Code,
17
+ anatomicalApproachSite: Code,
18
+ anatomicalLocationSite: Code,
19
+ ordinality: Code,
20
+ negationRationale: Code,
21
+ hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.3.68' },
22
+ category: { type: String, default: 'procedure' },
23
+ qdmStatus: { type: String, default: 'recommended' },
24
+ qdmVersion: { type: String, default: '5.3' },
25
+ _type: { type: String, default: 'ProcedureRecommended' },
26
+
27
+ });
28
+
29
+ module.exports.ProcedureRecommendedSchema = ProcedureRecommendedSchema;
30
+ module.exports.ProcedureRecommended = mongoose.model('ProcedureRecommended', ProcedureRecommendedSchema);
@@ -0,0 +1,23 @@
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 [Number, String] = [
9
+ mongoose.Schema.Types.Number,
10
+ mongoose.Schema.Types.String,
11
+ ];
12
+
13
+ const ProviderCareExperienceSchema = DataElementSchema({
14
+ authorDatetime: DateTime,
15
+ hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.3.70' },
16
+ category: { type: String, default: 'care_experience' },
17
+ qdmVersion: { type: String, default: '5.3' },
18
+ _type: { type: String, default: 'ProviderCareExperience' },
19
+
20
+ });
21
+
22
+ module.exports.ProviderCareExperienceSchema = ProviderCareExperienceSchema;
23
+ module.exports.ProviderCareExperience = mongoose.model('ProviderCareExperience', ProviderCareExperienceSchema);
@@ -0,0 +1,23 @@
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 [Number, String] = [
9
+ mongoose.Schema.Types.Number,
10
+ mongoose.Schema.Types.String,
11
+ ];
12
+
13
+ const ProviderCharacteristicSchema = DataElementSchema({
14
+ authorDatetime: DateTime,
15
+ hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.3.71' },
16
+ category: { type: String, default: 'provider_characteristic' },
17
+ qdmVersion: { type: String, default: '5.3' },
18
+ _type: { type: String, default: 'ProviderCharacteristic' },
19
+
20
+ });
21
+
22
+ module.exports.ProviderCharacteristicSchema = ProviderCharacteristicSchema;
23
+ module.exports.ProviderCharacteristic = mongoose.model('ProviderCharacteristic', ProviderCharacteristicSchema);
@@ -0,0 +1,22 @@
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 [Number, String] = [
9
+ mongoose.Schema.Types.Number,
10
+ mongoose.Schema.Types.String,
11
+ ];
12
+
13
+ const RatioSchema = DataElementSchema({
14
+ numerator: Quantity,
15
+ denominator: Quantity,
16
+ qdmVersion: { type: String, default: '5.3' },
17
+ _type: { type: String, default: 'Ratio' },
18
+
19
+ });
20
+
21
+ module.exports.RatioSchema = RatioSchema;
22
+ module.exports.Ratio = mongoose.model('Ratio', RatioSchema);
@@ -0,0 +1,28 @@
1
+ const mongoose = require('mongoose');
2
+
3
+ const PlaceholderResultSchema = mongoose.Schema({
4
+ cache_id: String,
5
+ measure_id: String,
6
+ sub_id: String,
7
+ test_id: String,
8
+ effective_date: Number,
9
+ filters: Object,
10
+ prefilter: Object,
11
+ calculation_time: Date,
12
+ status: Object,
13
+ population_ids: Object,
14
+ STRAT: Number,
15
+ IPP: Number,
16
+ DENOM: Number,
17
+ NUMER: Number,
18
+ NUMEX: Number,
19
+ DENEX: Number,
20
+ DENEXCEP: Number,
21
+ MSRPOPL: Number,
22
+ OBSERV: Number,
23
+ MSRPOPLEX: Number,
24
+ supplemental_data: Object,
25
+ });
26
+
27
+ module.exports.ResultSchema = PlaceholderResultSchema;
28
+ module.exports.Result = mongoose.model('Result', PlaceholderResultSchema);
@@ -0,0 +1,21 @@
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 [Number, String] = [
9
+ mongoose.Schema.Types.Number,
10
+ mongoose.Schema.Types.String,
11
+ ];
12
+
13
+ const ResultComponentSchema = DataElementSchema({
14
+ referenceRange: Interval,
15
+ qdmVersion: { type: String, default: '5.3' },
16
+ _type: { type: String, default: 'ResultComponent' },
17
+
18
+ });
19
+
20
+ module.exports.ResultComponentSchema = ResultComponentSchema;
21
+ module.exports.ResultComponent = mongoose.model('ResultComponent', ResultComponentSchema);
@@ -0,0 +1,30 @@
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 [Number, String] = [
9
+ mongoose.Schema.Types.Number,
10
+ mongoose.Schema.Types.String,
11
+ ];
12
+
13
+ const SubstanceAdministeredSchema = DataElementSchema({
14
+ authorDatetime: DateTime,
15
+ relevantPeriod: Interval,
16
+ dosage: Quantity,
17
+ supply: Quantity,
18
+ frequency: Code,
19
+ route: Code,
20
+ negationRationale: Code,
21
+ hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.3.73' },
22
+ category: { type: String, default: 'substance' },
23
+ qdmStatus: { type: String, default: 'administered' },
24
+ qdmVersion: { type: String, default: '5.3' },
25
+ _type: { type: String, default: 'SubstanceAdministered' },
26
+
27
+ });
28
+
29
+ module.exports.SubstanceAdministeredSchema = SubstanceAdministeredSchema;
30
+ module.exports.SubstanceAdministered = mongoose.model('SubstanceAdministered', SubstanceAdministeredSchema);
@@ -0,0 +1,32 @@
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 [Number, String] = [
9
+ mongoose.Schema.Types.Number,
10
+ mongoose.Schema.Types.String,
11
+ ];
12
+
13
+ const SubstanceOrderSchema = DataElementSchema({
14
+ authorDatetime: DateTime,
15
+ reason: Code,
16
+ dosage: Quantity,
17
+ supply: Quantity,
18
+ frequency: Code,
19
+ method: Code,
20
+ refills: Number,
21
+ route: Code,
22
+ negationRationale: Code,
23
+ hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.3.77' },
24
+ category: { type: String, default: 'substance' },
25
+ qdmStatus: { type: String, default: 'order' },
26
+ qdmVersion: { type: String, default: '5.3' },
27
+ _type: { type: String, default: 'SubstanceOrder' },
28
+
29
+ });
30
+
31
+ module.exports.SubstanceOrderSchema = SubstanceOrderSchema;
32
+ module.exports.SubstanceOrder = mongoose.model('SubstanceOrder', SubstanceOrderSchema);
@@ -0,0 +1,32 @@
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 [Number, String] = [
9
+ mongoose.Schema.Types.Number,
10
+ mongoose.Schema.Types.String,
11
+ ];
12
+
13
+ const SubstanceRecommendedSchema = DataElementSchema({
14
+ authorDatetime: DateTime,
15
+ reason: Code,
16
+ dosage: Quantity,
17
+ supply: Quantity,
18
+ frequency: Code,
19
+ method: Code,
20
+ refills: Number,
21
+ route: Code,
22
+ negationRationale: Code,
23
+ hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.3.78' },
24
+ category: { type: String, default: 'substance' },
25
+ qdmStatus: { type: String, default: 'recommended' },
26
+ qdmVersion: { type: String, default: '5.3' },
27
+ _type: { type: String, default: 'SubstanceRecommended' },
28
+
29
+ });
30
+
31
+ module.exports.SubstanceRecommendedSchema = SubstanceRecommendedSchema;
32
+ module.exports.SubstanceRecommended = mongoose.model('SubstanceRecommended', SubstanceRecommendedSchema);
@@ -0,0 +1,25 @@
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 [Number, String] = [
9
+ mongoose.Schema.Types.Number,
10
+ mongoose.Schema.Types.String,
11
+ ];
12
+
13
+ const SymptomSchema = DataElementSchema({
14
+ prevalencePeriod: Interval,
15
+ severity: Code,
16
+ hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.3.116' },
17
+ qrdaOid: { type: String, default: '2.16.840.1.113883.10.20.24.3.136' },
18
+ category: { type: String, default: 'symptom' },
19
+ qdmVersion: { type: String, default: '5.3' },
20
+ _type: { type: String, default: 'Symptom' },
21
+
22
+ });
23
+
24
+ module.exports.SymptomSchema = SymptomSchema;
25
+ module.exports.Symptom = mongoose.model('Symptom', SymptomSchema);
@@ -0,0 +1,30 @@
1
+ const mongoose = require('mongoose');
2
+ const Concept = require('./Concept.js');
3
+
4
+ const [mString, Mixed, ObjectId] = [
5
+ mongoose.Schema.Types.String,
6
+ mongoose.Schema.Types.Mixed,
7
+ mongoose.Schema.Types.ObjectId,
8
+ ];
9
+
10
+ const ValueSetSchema = mongoose.Schema(
11
+ {
12
+ oid: mString,
13
+ display_name: mString,
14
+ version: mString,
15
+ categories: Mixed,
16
+
17
+ concepts: [Concept.ConceptSchema],
18
+
19
+ user: { type: ObjectId, ref: 'User', index: true }, // Bonnie-specific
20
+ bundle: { type: ObjectId, ref: 'Bundle' }, // Cypress-specific
21
+ measures: [{ type: ObjectId, ref: 'Measure' }],
22
+ },
23
+ // Options
24
+ {
25
+ timestamps: { createdAt: 'created_at', updatedAt: 'updated_at' },
26
+ }
27
+ );
28
+
29
+ module.exports.ValueSetSchema = ValueSetSchema;
30
+ module.exports.ValueSet = mongoose.model('value_set', ValueSetSchema);