cqm-models 3.0.4 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +56 -0
  3. data/README.md +3 -2
  4. data/app/assets/javascripts/AdverseEvent.js +2 -2
  5. data/app/assets/javascripts/AllDataElements.js +2 -2
  6. data/app/assets/javascripts/AllergyIntolerance.js +2 -2
  7. data/app/assets/javascripts/AssessmentOrder.js +2 -2
  8. data/app/assets/javascripts/AssessmentPerformed.js +3 -2
  9. data/app/assets/javascripts/AssessmentRecommended.js +2 -2
  10. data/app/assets/javascripts/CareGoal.js +2 -2
  11. data/app/assets/javascripts/CommunicationPerformed.js +3 -3
  12. data/app/assets/javascripts/DeviceOrder.js +2 -2
  13. data/app/assets/javascripts/DeviceRecommended.js +2 -2
  14. data/app/assets/javascripts/Diagnosis.js +2 -2
  15. data/app/assets/javascripts/DiagnosticStudyOrder.js +2 -2
  16. data/app/assets/javascripts/DiagnosticStudyPerformed.js +4 -2
  17. data/app/assets/javascripts/DiagnosticStudyRecommended.js +2 -2
  18. data/app/assets/javascripts/EncounterOrder.js +2 -2
  19. data/app/assets/javascripts/EncounterPerformed.js +7 -3
  20. data/app/assets/javascripts/EncounterRecommended.js +2 -2
  21. data/app/assets/javascripts/FamilyHistory.js +2 -2
  22. data/app/assets/javascripts/ImmunizationAdministered.js +2 -2
  23. data/app/assets/javascripts/ImmunizationOrder.js +2 -2
  24. data/app/assets/javascripts/InterventionOrder.js +2 -2
  25. data/app/assets/javascripts/InterventionPerformed.js +3 -2
  26. data/app/assets/javascripts/InterventionRecommended.js +2 -2
  27. data/app/assets/javascripts/LaboratoryTestOrder.js +2 -2
  28. data/app/assets/javascripts/LaboratoryTestPerformed.js +4 -2
  29. data/app/assets/javascripts/LaboratoryTestRecommended.js +2 -2
  30. data/app/assets/javascripts/MedicationActive.js +2 -2
  31. data/app/assets/javascripts/MedicationAdministered.js +2 -2
  32. data/app/assets/javascripts/MedicationDischarge.js +3 -3
  33. data/app/assets/javascripts/MedicationDispensed.js +4 -3
  34. data/app/assets/javascripts/MedicationOrder.js +3 -2
  35. data/app/assets/javascripts/Participation.js +1 -2
  36. data/app/assets/javascripts/PatientCareExperience.js +2 -2
  37. data/app/assets/javascripts/PatientCharacteristic.js +1 -1
  38. data/app/assets/javascripts/PatientCharacteristicBirthdate.js +1 -1
  39. data/app/assets/javascripts/PatientCharacteristicClinicalTrialParticipant.js +1 -1
  40. data/app/assets/javascripts/PatientCharacteristicEthnicity.js +1 -1
  41. data/app/assets/javascripts/PatientCharacteristicExpired.js +1 -1
  42. data/app/assets/javascripts/PatientCharacteristicPayer.js +1 -1
  43. data/app/assets/javascripts/PatientCharacteristicRace.js +1 -1
  44. data/app/assets/javascripts/PatientCharacteristicSex.js +1 -1
  45. data/app/assets/javascripts/PhysicalExamOrder.js +2 -2
  46. data/app/assets/javascripts/PhysicalExamPerformed.js +3 -2
  47. data/app/assets/javascripts/PhysicalExamRecommended.js +3 -3
  48. data/app/assets/javascripts/ProcedureOrder.js +2 -2
  49. data/app/assets/javascripts/ProcedurePerformed.js +3 -3
  50. data/app/assets/javascripts/ProcedureRecommended.js +2 -2
  51. data/app/assets/javascripts/ProviderCareExperience.js +2 -2
  52. data/app/assets/javascripts/QDMPatient.js +1 -1
  53. data/app/assets/javascripts/RelatedPerson.js +1 -1
  54. data/app/assets/javascripts/SubstanceAdministered.js +2 -2
  55. data/app/assets/javascripts/SubstanceOrder.js +2 -2
  56. data/app/assets/javascripts/SubstanceRecommended.js +2 -2
  57. data/app/assets/javascripts/Symptom.js +2 -2
  58. data/app/assets/javascripts/attributes/Component.js +2 -2
  59. data/app/assets/javascripts/attributes/DiagnosisComponent.js +1 -1
  60. data/app/assets/javascripts/attributes/Entity.js +2 -2
  61. data/app/assets/javascripts/attributes/FacilityLocation.js +1 -1
  62. data/app/assets/javascripts/attributes/Identifier.js +1 -1
  63. data/app/assets/javascripts/attributes/Location.js +32 -0
  64. data/app/assets/javascripts/attributes/Organization.js +1 -1
  65. data/app/assets/javascripts/basetypes/Any.js +6 -0
  66. data/app/assets/javascripts/basetypes/AnyEntity.js +3 -0
  67. data/app/models/hqmfOid_to_datatype_map.json +2 -2
  68. data/app/models/models.rb +2 -2
  69. data/app/models/qdm/adverse_event.rb +2 -2
  70. data/app/models/qdm/allergy_intolerance.rb +2 -2
  71. data/app/models/qdm/assessment_order.rb +2 -2
  72. data/app/models/qdm/assessment_performed.rb +3 -2
  73. data/app/models/qdm/assessment_recommended.rb +2 -2
  74. data/app/models/qdm/attributes/component.rb +1 -1
  75. data/app/models/qdm/attributes/diagnosis_component.rb +1 -1
  76. data/app/models/qdm/attributes/entity.rb +1 -1
  77. data/app/models/qdm/attributes/facility_location.rb +1 -1
  78. data/app/models/qdm/attributes/identifier.rb +1 -1
  79. data/app/models/qdm/attributes/location.rb +9 -0
  80. data/app/models/qdm/attributes/organization.rb +1 -1
  81. data/app/models/qdm/basetypes/data_element.rb +5 -0
  82. data/app/models/qdm/care_goal.rb +2 -2
  83. data/app/models/qdm/communication_performed.rb +3 -3
  84. data/app/models/qdm/device_order.rb +2 -2
  85. data/app/models/qdm/device_recommended.rb +2 -2
  86. data/app/models/qdm/diagnosis.rb +2 -2
  87. data/app/models/qdm/diagnostic_study_order.rb +2 -2
  88. data/app/models/qdm/diagnostic_study_performed.rb +4 -2
  89. data/app/models/qdm/diagnostic_study_recommended.rb +2 -2
  90. data/app/models/qdm/encounter_order.rb +2 -2
  91. data/app/models/qdm/encounter_performed.rb +4 -3
  92. data/app/models/qdm/encounter_recommended.rb +2 -2
  93. data/app/models/qdm/family_history.rb +2 -2
  94. data/app/models/qdm/immunization_administered.rb +2 -2
  95. data/app/models/qdm/immunization_order.rb +2 -2
  96. data/app/models/qdm/intervention_order.rb +2 -2
  97. data/app/models/qdm/intervention_performed.rb +3 -2
  98. data/app/models/qdm/intervention_recommended.rb +2 -2
  99. data/app/models/qdm/laboratory_test_order.rb +2 -2
  100. data/app/models/qdm/laboratory_test_performed.rb +4 -2
  101. data/app/models/qdm/laboratory_test_recommended.rb +2 -2
  102. data/app/models/qdm/medication_active.rb +2 -2
  103. data/app/models/qdm/medication_administered.rb +2 -2
  104. data/app/models/qdm/medication_discharge.rb +3 -3
  105. data/app/models/qdm/medication_dispensed.rb +4 -3
  106. data/app/models/qdm/medication_order.rb +3 -2
  107. data/app/models/qdm/participation.rb +1 -2
  108. data/app/models/qdm/patient.rb +1 -1
  109. data/app/models/qdm/patient_care_experience.rb +2 -2
  110. data/app/models/qdm/patient_characteristic.rb +1 -1
  111. data/app/models/qdm/patient_characteristic_birthdate.rb +1 -1
  112. data/app/models/qdm/patient_characteristic_clinical_trial_participant.rb +1 -1
  113. data/app/models/qdm/patient_characteristic_ethnicity.rb +1 -1
  114. data/app/models/qdm/patient_characteristic_expired.rb +1 -1
  115. data/app/models/qdm/patient_characteristic_payer.rb +1 -1
  116. data/app/models/qdm/patient_characteristic_race.rb +1 -1
  117. data/app/models/qdm/patient_characteristic_sex.rb +1 -1
  118. data/app/models/qdm/physical_exam_order.rb +2 -2
  119. data/app/models/qdm/physical_exam_performed.rb +3 -2
  120. data/app/models/qdm/physical_exam_recommended.rb +3 -3
  121. data/app/models/qdm/procedure_order.rb +2 -2
  122. data/app/models/qdm/procedure_performed.rb +3 -3
  123. data/app/models/qdm/procedure_recommended.rb +2 -2
  124. data/app/models/qdm/provider_care_experience.rb +2 -2
  125. data/app/models/qdm/related_person.rb +1 -1
  126. data/app/models/qdm/substance_administered.rb +2 -2
  127. data/app/models/qdm/substance_order.rb +2 -2
  128. data/app/models/qdm/substance_recommended.rb +2 -2
  129. data/app/models/qdm/symptom.rb +2 -2
  130. data/bin/validate_generator.sh +2 -2
  131. data/cqm-models.gemspec +1 -1
  132. data/data/oids_qdm_5.5.json +2 -2
  133. data/data/oids_qdm_5.6.json +335 -0
  134. data/dist/browser.js +61015 -93235
  135. data/dist/index.js +61015 -93235
  136. data/lib/generate_entities.rb +18 -10
  137. data/lib/generate_models.rb +28 -20
  138. data/lib/generate_patients.rb +1 -1
  139. data/modelinfo/qdm-modelinfo-5.6.xml +1102 -0
  140. data/package.json +3 -3
  141. data/templates/models_template.rb.erb +3 -1
  142. data/templates/mongoose_template.js.erb +9 -2
  143. data/templates/patient_template.js.erb +24 -4
  144. data/yarn.lock +426 -230
  145. metadata +12 -10
  146. data/.travis.yml +0 -52
  147. data/app/assets/javascripts/DeviceApplied.js +0 -48
  148. data/app/models/qdm/device_applied.rb +0 -19
@@ -29,12 +29,12 @@ const SubstanceOrderSchema = DataElementSchema({
29
29
  refills: Number,
30
30
  route: Code,
31
31
  negationRationale: Code,
32
- requester: AnyEntity,
32
+ requester: [AnyEntity],
33
33
  qdmTitle: { type: String, default: 'Substance, Order' },
34
34
  hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.4.77' },
35
35
  qdmCategory: { type: String, default: 'substance' },
36
36
  qdmStatus: { type: String, default: 'order' },
37
- qdmVersion: { type: String, default: '5.5' },
37
+ qdmVersion: { type: String, default: '5.6' },
38
38
  _type: { type: String, default: 'QDM::SubstanceOrder' },
39
39
 
40
40
  });
@@ -27,12 +27,12 @@ const SubstanceRecommendedSchema = DataElementSchema({
27
27
  refills: Number,
28
28
  route: Code,
29
29
  negationRationale: Code,
30
- requester: AnyEntity,
30
+ requester: [AnyEntity],
31
31
  qdmTitle: { type: String, default: 'Substance, Recommended' },
32
32
  hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.4.78' },
33
33
  qdmCategory: { type: String, default: 'substance' },
34
34
  qdmStatus: { type: String, default: 'recommended' },
35
- qdmVersion: { type: String, default: '5.5' },
35
+ qdmVersion: { type: String, default: '5.6' },
36
36
  _type: { type: String, default: 'QDM::SubstanceRecommended' },
37
37
 
38
38
  });
@@ -22,12 +22,12 @@ const [Number, String] = [
22
22
  const SymptomSchema = DataElementSchema({
23
23
  prevalencePeriod: Interval,
24
24
  severity: Code,
25
- recorder: AnyEntity,
25
+ recorder: [AnyEntity],
26
26
  qdmTitle: { type: String, default: 'Symptom' },
27
27
  hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.4.116' },
28
28
  qrdaOid: { type: String, default: '2.16.840.1.113883.10.20.24.3.136' },
29
29
  qdmCategory: { type: String, default: 'symptom' },
30
- qdmVersion: { type: String, default: '5.5' },
30
+ qdmVersion: { type: String, default: '5.6' },
31
31
  _type: { type: String, default: 'QDM::Symptom' },
32
32
 
33
33
  });
@@ -17,7 +17,7 @@ const [Number, String] = [
17
17
  const ComponentSchema = new mongoose.Schema({
18
18
  code: Code,
19
19
  result: Any,
20
- qdmVersion: { type: String, default: '5.5' },
20
+ qdmVersion: { type: String, default: '5.6' },
21
21
  _type: { type: String, default: 'QDM::Component' },
22
22
 
23
23
  });
@@ -34,7 +34,7 @@ function ComponentSchemaFunction(add, options) {
34
34
  const extended = new Schema({
35
35
  code: Code,
36
36
  result: Any,
37
- qdmVersion: { type: String, default: '5.5' },
37
+ qdmVersion: { type: String, default: '5.6' },
38
38
  _type: { type: String, default: 'QDM::Component' },
39
39
 
40
40
 
@@ -17,7 +17,7 @@ const DiagnosisComponentSchema = new mongoose.Schema({
17
17
  code: Code,
18
18
  presentOnAdmissionIndicator: Code,
19
19
  rank: Number,
20
- qdmVersion: { type: String, default: '5.5' },
20
+ qdmVersion: { type: String, default: '5.6' },
21
21
  _type: { type: String, default: 'QDM::DiagnosisComponent' },
22
22
 
23
23
  });
@@ -18,7 +18,7 @@ const [Number, String] = [
18
18
  const EntitySchema = new mongoose.Schema({
19
19
  id: String,
20
20
  identifier: IdentifierSchema,
21
- qdmVersion: { type: String, default: '5.5' },
21
+ qdmVersion: { type: String, default: '5.6' },
22
22
  _type: { type: String, default: 'QDM::Entity' },
23
23
 
24
24
  });
@@ -34,7 +34,7 @@ class Entity extends mongoose.Document {
34
34
  function EntitySchemaFunction(add, options) {
35
35
  const extended = new Schema({
36
36
  identifier: IdentifierSchema,
37
- qdmVersion: { type: String, default: '5.5' },
37
+ qdmVersion: { type: String, default: '5.6' },
38
38
  _type: { type: String, default: 'QDM::Entity' },
39
39
 
40
40
 
@@ -16,7 +16,7 @@ const [Number, String] = [
16
16
  const FacilityLocationSchema = new mongoose.Schema({
17
17
  code: Code,
18
18
  locationPeriod: Interval,
19
- qdmVersion: { type: String, default: '5.5' },
19
+ qdmVersion: { type: String, default: '5.6' },
20
20
  _type: { type: String, default: 'QDM::FacilityLocation' },
21
21
 
22
22
  });
@@ -8,7 +8,7 @@ const [Number, String] = [
8
8
  const IdentifierSchema = mongoose.Schema({
9
9
  namingSystem: String,
10
10
  value: String,
11
- qdmVersion: { type: String, default: '5.5' },
11
+ qdmVersion: { type: String, default: '5.6' },
12
12
  _type: { type: String, default: 'QDM::Identifier' },
13
13
 
14
14
  }, { _id: false, id: false });
@@ -0,0 +1,32 @@
1
+ const mongoose = require('mongoose/browser');
2
+
3
+ const { EntitySchemaFunction } = require('./Entity');
4
+ const Code = require('../basetypes/Code');
5
+ const Interval = require('../basetypes/Interval');
6
+ const Quantity = require('../basetypes/Quantity');
7
+ const DateTime = require('../basetypes/DateTime');
8
+ const QDMDate = require('../basetypes/QDMDate');
9
+ const Any = require('../basetypes/Any');
10
+
11
+ const [Number, String] = [
12
+ mongoose.Schema.Types.Number,
13
+ mongoose.Schema.Types.String,
14
+ ];
15
+
16
+ const LocationSchema = EntitySchemaFunction({
17
+ locationType: Code,
18
+ hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.4.142' },
19
+ _type: { type: String, default: 'QDM::Location' },
20
+
21
+ });
22
+
23
+ module.exports.LocationSchema = LocationSchema;
24
+ class Location extends mongoose.Document {
25
+ constructor(object) {
26
+ super(object, LocationSchema);
27
+ this._type = 'QDM::Location';
28
+ }
29
+ }
30
+
31
+ module.exports.Location = Location;
32
+
@@ -14,7 +14,7 @@ const [Number, String] = [
14
14
  ];
15
15
 
16
16
  const OrganizationSchema = EntitySchemaFunction({
17
- type: Code,
17
+ organizationType: Code,
18
18
  hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.4.135' },
19
19
  qrdaOid: { type: String, default: '2.16.840.1.113883.10.20.24.3.163' },
20
20
  _type: { type: String, default: 'QDM::Organization' },
@@ -11,6 +11,12 @@ function RecursiveCast(any) {
11
11
  return new cql.Quantity(any.value, any.unit);
12
12
  }
13
13
 
14
+ if (any && any.numerator && any.denominator) {
15
+ const numerator = new cql.Quantity(any.numerator.value, any.numerator.unit);
16
+ const denominator = new cql.Quantity(any.denominator.value, any.denominator.unit);
17
+ return new cql.Ratio(numerator, denominator);
18
+ }
19
+
14
20
  if (any.isCode || any.isConcept || any.isValueSet || any.isList ||
15
21
  any.isDateTime || any.isDate || any.isRatio || any.isQuantiy ||
16
22
  any.isInterval || any.isBooleanLiteral || any.isIntegerLiteral ||
@@ -3,6 +3,7 @@ const { PatientEntity } = require('../attributes/PatientEntity');
3
3
  const { Practitioner } = require('../attributes/Practitioner');
4
4
  const { CarePartner } = require('../attributes/CarePartner');
5
5
  const { Organization } = require('../attributes/Organization');
6
+ const { Location } = require('../attributes/Location');
6
7
 
7
8
  function AnyEntity(key, options) {
8
9
  mongoose.SchemaType.call(this, key, options, 'AnyEntity');
@@ -32,6 +33,8 @@ AnyEntity.prototype.cast = (entity) => {
32
33
  return new CarePartner(entity);
33
34
  case 'QDM::Organization':
34
35
  return new Organization(entity);
36
+ case 'QDM::Location':
37
+ return new Location(entity);
35
38
  default:
36
39
  throw new Error(`Could not find entity type "${entity._type}".`);
37
40
  }
@@ -4,6 +4,7 @@
4
4
  "2.16.840.1.113883.10.20.28.4.141": "RelatedPerson",
5
5
  "2.16.840.1.113883.10.20.28.4.137": "Practitioner",
6
6
  "2.16.840.1.113883.10.20.28.4.135": "Organization",
7
+ "2.16.840.1.113883.10.20.28.4.142": "Location",
7
8
  "2.16.840.1.113883.10.20.28.4.61": "PhysicalExamOrder",
8
9
  "2.16.840.1.113883.10.20.28.4.130": "Participation",
9
10
  "2.16.840.1.113883.10.20.28.4.55": "PatientCharacteristicSex",
@@ -38,11 +39,10 @@
38
39
  "2.16.840.1.113883.10.20.28.4.28": "EncounterRecommended",
39
40
  "2.16.840.1.113883.10.20.28.4.67": "ProcedurePerformed",
40
41
  "2.16.840.1.113883.10.20.28.4.119": "AllergyIntolerance",
41
- "22.16.840.1.113883.10.20.28.4.63": "PhysicalExamRecommended",
42
+ "2.16.840.1.113883.10.20.28.4.63": "PhysicalExamRecommended",
42
43
  "2.16.840.1.113883.10.20.28.4.54": "PatientCharacteristicBirthdate",
43
44
  "2.16.840.1.113883.10.20.28.4.120": "AdverseEvent",
44
45
  "2.16.840.1.113883.10.20.28.4.16": "DeviceRecommended",
45
- "2.16.840.1.113883.10.20.28.4.13": "DeviceApplied",
46
46
  "2.16.840.1.113883.10.20.28.4.48": "MedicationDischarge",
47
47
  "2.16.840.1.113883.10.20.28.4.36": "InterventionPerformed",
48
48
  "2.16.840.1.113883.10.20.28.4.43": "LaboratoryTestRecommended",
data/app/models/models.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Base QDM module (generated from lib/generate_models.rb) for QDM 5.5
1
+ # Base QDM module (generated from lib/generate_models.rb) for QDM 5.6
2
2
  module QDM
3
3
  end
4
4
  require 'mongoid'
@@ -25,6 +25,7 @@ require_relative 'qdm/attributes/diagnosis_component'
25
25
  require_relative 'qdm/attributes/organization'
26
26
  require_relative 'qdm/attributes/patient_entity'
27
27
  require_relative 'qdm/attributes/practitioner'
28
+ require_relative 'qdm/attributes/location'
28
29
  require_relative 'qdm/attributes/result_component'
29
30
 
30
31
  # Tacoma-specific models
@@ -85,7 +86,6 @@ require_relative 'qdm/physical_exam_recommended'
85
86
  require_relative 'qdm/patient_characteristic_birthdate'
86
87
  require_relative 'qdm/adverse_event'
87
88
  require_relative 'qdm/device_recommended'
88
- require_relative 'qdm/device_applied'
89
89
  require_relative 'qdm/medication_discharge'
90
90
  require_relative 'qdm/intervention_performed'
91
91
  require_relative 'qdm/laboratory_test_recommended'
@@ -8,10 +8,10 @@ module QDM
8
8
  field :severity, type: QDM::Code
9
9
  field :facilityLocation, type: QDM::FacilityLocation
10
10
  field :type, type: QDM::Code
11
- embeds_one :recorder, class_name: 'QDM::Entity'
11
+ embeds_many :recorder, class_name: 'QDM::Entity'
12
12
  field :qdmTitle, type: String, default: 'Adverse Event'
13
13
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.120'
14
14
  field :qdmCategory, type: String, default: 'adverse_event'
15
- field :qdmVersion, type: String, default: '5.5'
15
+ field :qdmVersion, type: String, default: '5.6'
16
16
  end
17
17
  end
@@ -7,11 +7,11 @@ module QDM
7
7
  field :prevalencePeriod, type: QDM::Interval
8
8
  field :type, type: QDM::Code
9
9
  field :severity, type: QDM::Code
10
- embeds_one :recorder, class_name: 'QDM::Entity'
10
+ embeds_many :recorder, class_name: 'QDM::Entity'
11
11
  field :qdmTitle, type: String, default: 'Allergy/Intolerance'
12
12
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.119'
13
13
  field :qdmCategory, type: String, default: 'allergy'
14
14
  field :qdmStatus, type: String, default: 'intolerance'
15
- field :qdmVersion, type: String, default: '5.5'
15
+ field :qdmVersion, type: String, default: '5.6'
16
16
  end
17
17
  end
@@ -6,11 +6,11 @@ module QDM
6
6
  field :authorDatetime, type: DateTime
7
7
  field :negationRationale, type: QDM::Code
8
8
  field :reason, type: QDM::Code
9
- embeds_one :requester, class_name: 'QDM::Entity'
9
+ embeds_many :requester, class_name: 'QDM::Entity'
10
10
  field :qdmTitle, type: String, default: 'Assessment, Order'
11
11
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.131'
12
12
  field :qdmCategory, type: String, default: 'assessment'
13
13
  field :qdmStatus, type: String, default: 'order'
14
- field :qdmVersion, type: String, default: '5.5'
14
+ field :qdmVersion, type: String, default: '5.6'
15
15
  end
16
16
  end
@@ -10,13 +10,14 @@ module QDM
10
10
  field :reason, type: QDM::Code
11
11
  field :method, type: QDM::Code
12
12
  field :result
13
+ field :interpretation, type: QDM::Code
13
14
  field :components, type: Array
14
15
  field :relatedTo, type: Array
15
- embeds_one :performer, class_name: 'QDM::Entity'
16
+ embeds_many :performer, class_name: 'QDM::Entity'
16
17
  field :qdmTitle, type: String, default: 'Assessment, Performed'
17
18
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.117'
18
19
  field :qdmCategory, type: String, default: 'assessment'
19
20
  field :qdmStatus, type: String, default: 'performed'
20
- field :qdmVersion, type: String, default: '5.5'
21
+ field :qdmVersion, type: String, default: '5.6'
21
22
  end
22
23
  end
@@ -6,11 +6,11 @@ module QDM
6
6
  field :authorDatetime, type: DateTime
7
7
  field :negationRationale, type: QDM::Code
8
8
  field :reason, type: QDM::Code
9
- embeds_one :requester, class_name: 'QDM::Entity'
9
+ embeds_many :requester, class_name: 'QDM::Entity'
10
10
  field :qdmTitle, type: String, default: 'Assessment, Recommended'
11
11
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.118'
12
12
  field :qdmCategory, type: String, default: 'assessment'
13
13
  field :qdmStatus, type: String, default: 'recommended'
14
- field :qdmVersion, type: String, default: '5.5'
14
+ field :qdmVersion, type: String, default: '5.6'
15
15
  end
16
16
  end
@@ -4,6 +4,6 @@ module QDM
4
4
  include Mongoid::Document
5
5
  field :code, type: QDM::Code
6
6
  field :result
7
- field :qdmVersion, type: String, default: '5.5'
7
+ field :qdmVersion, type: String, default: '5.6'
8
8
  end
9
9
  end
@@ -5,6 +5,6 @@ module QDM
5
5
  field :code, type: QDM::Code
6
6
  field :presentOnAdmissionIndicator, type: QDM::Code
7
7
  field :rank, type: Integer
8
- field :qdmVersion, type: String, default: '5.5'
8
+ field :qdmVersion, type: String, default: '5.6'
9
9
  end
10
10
  end
@@ -5,7 +5,7 @@ module QDM
5
5
  embedded_in :data_element
6
6
  field :id, type: String
7
7
  embeds_one :identifier, class_name: 'QDM::Identifier'
8
- field :qdmVersion, type: String, default: '5.5'
8
+ field :qdmVersion, type: String, default: '5.6'
9
9
  def initialize(options = {})
10
10
  super(options)
11
11
  # default id to the mongo ObjectId for this DataElement if it isnt already defined
@@ -4,6 +4,6 @@ module QDM
4
4
  include Mongoid::Document
5
5
  field :code, type: QDM::Code
6
6
  field :locationPeriod, type: QDM::Interval
7
- field :qdmVersion, type: String, default: '5.5'
7
+ field :qdmVersion, type: String, default: '5.6'
8
8
  end
9
9
  end
@@ -4,6 +4,6 @@ module QDM
4
4
  include Mongoid::Document
5
5
  field :namingSystem, type: String
6
6
  field :value, type: String
7
- field :qdmVersion, type: String, default: '5.5'
7
+ field :qdmVersion, type: String, default: '5.6'
8
8
  end
9
9
  end
@@ -0,0 +1,9 @@
1
+ module QDM
2
+ # app/models/qdm/location.rb
3
+ class Location < Entity
4
+ include Mongoid::Document
5
+ embedded_in :data_element
6
+ field :locationType, type: QDM::Code
7
+ field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.142'
8
+ end
9
+ end
@@ -3,7 +3,7 @@ module QDM
3
3
  class Organization < Entity
4
4
  include Mongoid::Document
5
5
  embedded_in :data_element
6
- field :type, type: QDM::Code
6
+ field :organizationType, type: QDM::Code
7
7
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.135'
8
8
  field :qrdaOid, type: String, default: '2.16.840.1.113883.10.20.24.3.163'
9
9
  end
@@ -17,6 +17,11 @@ module QDM
17
17
  field :id, type: String
18
18
 
19
19
  def initialize(options = {})
20
+ # class is reserved word. changed to clazz
21
+ if options['class']
22
+ options['clazz'] = options['class']
23
+ options.delete('class')
24
+ end
20
25
  super(options)
21
26
  # default id to the mongo ObjectId for this DataElement if it isnt already defined
22
27
  self.id = _id.to_s unless id?
@@ -7,10 +7,10 @@ module QDM
7
7
  field :relevantPeriod, type: QDM::Interval
8
8
  field :relatedTo, type: Array
9
9
  field :targetOutcome
10
- embeds_one :performer, class_name: 'QDM::Entity'
10
+ embeds_many :performer, class_name: 'QDM::Entity'
11
11
  field :qdmTitle, type: String, default: 'Care Goal'
12
12
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.7'
13
13
  field :qdmCategory, type: String, default: 'care_goal'
14
- field :qdmVersion, type: String, default: '5.5'
14
+ field :qdmVersion, type: String, default: '5.6'
15
15
  end
16
16
  end
@@ -6,8 +6,8 @@ module QDM
6
6
  field :authorDatetime, type: DateTime
7
7
  field :category, type: QDM::Code
8
8
  field :medium, type: QDM::Code
9
- embeds_one :sender, class_name: 'QDM::Entity'
10
- embeds_one :recipient, class_name: 'QDM::Entity'
9
+ embeds_many :sender, class_name: 'QDM::Entity'
10
+ embeds_many :recipient, class_name: 'QDM::Entity'
11
11
  field :relatedTo, type: Array
12
12
  field :sentDatetime, type: DateTime
13
13
  field :receivedDatetime, type: DateTime
@@ -16,6 +16,6 @@ module QDM
16
16
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.132'
17
17
  field :qdmCategory, type: String, default: 'communication'
18
18
  field :qdmStatus, type: String, default: 'performed'
19
- field :qdmVersion, type: String, default: '5.5'
19
+ field :qdmVersion, type: String, default: '5.6'
20
20
  end
21
21
  end
@@ -6,11 +6,11 @@ module QDM
6
6
  field :authorDatetime, type: DateTime
7
7
  field :negationRationale, type: QDM::Code
8
8
  field :reason, type: QDM::Code
9
- embeds_one :requester, class_name: 'QDM::Entity'
9
+ embeds_many :requester, class_name: 'QDM::Entity'
10
10
  field :qdmTitle, type: String, default: 'Device, Order'
11
11
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.15'
12
12
  field :qdmCategory, type: String, default: 'device'
13
13
  field :qdmStatus, type: String, default: 'order'
14
- field :qdmVersion, type: String, default: '5.5'
14
+ field :qdmVersion, type: String, default: '5.6'
15
15
  end
16
16
  end
@@ -6,11 +6,11 @@ module QDM
6
6
  field :authorDatetime, type: DateTime
7
7
  field :negationRationale, type: QDM::Code
8
8
  field :reason, type: QDM::Code
9
- embeds_one :requester, class_name: 'QDM::Entity'
9
+ embeds_many :requester, class_name: 'QDM::Entity'
10
10
  field :qdmTitle, type: String, default: 'Device, Recommended'
11
11
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.16'
12
12
  field :qdmCategory, type: String, default: 'device'
13
13
  field :qdmStatus, type: String, default: 'recommended'
14
- field :qdmVersion, type: String, default: '5.5'
14
+ field :qdmVersion, type: String, default: '5.6'
15
15
  end
16
16
  end