cqm-models 2.0.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (171) hide show
  1. checksums.yaml +4 -4
  2. data/.eslintrc.json +1 -1
  3. data/README.md +9 -6
  4. data/app/assets/javascripts/AdverseEvent.js +9 -3
  5. data/app/assets/javascripts/AllDataElements.js +18 -6
  6. data/app/assets/javascripts/AllergyIntolerance.js +8 -2
  7. data/app/assets/javascripts/AssessmentOrder.js +8 -2
  8. data/app/assets/javascripts/AssessmentPerformed.js +11 -3
  9. data/app/assets/javascripts/AssessmentRecommended.js +8 -2
  10. data/app/assets/javascripts/CareGoal.js +10 -3
  11. data/app/assets/javascripts/CommunicationPerformed.js +12 -6
  12. data/app/assets/javascripts/DeviceApplied.js +9 -2
  13. data/app/assets/javascripts/DeviceOrder.js +8 -2
  14. data/app/assets/javascripts/DeviceRecommended.js +8 -2
  15. data/app/assets/javascripts/Diagnosis.js +8 -2
  16. data/app/assets/javascripts/DiagnosticStudyOrder.js +8 -2
  17. data/app/assets/javascripts/DiagnosticStudyPerformed.js +9 -2
  18. data/app/assets/javascripts/DiagnosticStudyRecommended.js +8 -2
  19. data/app/assets/javascripts/EncounterOrder.js +9 -2
  20. data/app/assets/javascripts/EncounterPerformed.js +11 -5
  21. data/app/assets/javascripts/EncounterRecommended.js +8 -2
  22. data/app/assets/javascripts/FamilyHistory.js +8 -2
  23. data/app/assets/javascripts/ImmunizationAdministered.js +9 -2
  24. data/app/assets/javascripts/ImmunizationOrder.js +8 -2
  25. data/app/assets/javascripts/InterventionOrder.js +8 -2
  26. data/app/assets/javascripts/InterventionPerformed.js +9 -2
  27. data/app/assets/javascripts/InterventionRecommended.js +8 -2
  28. data/app/assets/javascripts/LaboratoryTestOrder.js +8 -2
  29. data/app/assets/javascripts/LaboratoryTestPerformed.js +9 -2
  30. data/app/assets/javascripts/LaboratoryTestRecommended.js +8 -2
  31. data/app/assets/javascripts/MedicationActive.js +9 -2
  32. data/app/assets/javascripts/MedicationAdministered.js +9 -2
  33. data/app/assets/javascripts/MedicationDischarge.js +9 -2
  34. data/app/assets/javascripts/MedicationDispensed.js +10 -4
  35. data/app/assets/javascripts/MedicationOrder.js +9 -4
  36. data/app/assets/javascripts/Participation.js +8 -2
  37. data/app/assets/javascripts/PatientCareExperience.js +8 -2
  38. data/app/assets/javascripts/PatientCharacteristic.js +7 -2
  39. data/app/assets/javascripts/PatientCharacteristicBirthdate.js +7 -2
  40. data/app/assets/javascripts/PatientCharacteristicClinicalTrialParticipant.js +7 -2
  41. data/app/assets/javascripts/PatientCharacteristicEthnicity.js +7 -2
  42. data/app/assets/javascripts/PatientCharacteristicExpired.js +7 -2
  43. data/app/assets/javascripts/PatientCharacteristicPayer.js +7 -2
  44. data/app/assets/javascripts/PatientCharacteristicRace.js +7 -2
  45. data/app/assets/javascripts/PatientCharacteristicSex.js +7 -2
  46. data/app/assets/javascripts/PhysicalExamOrder.js +8 -2
  47. data/app/assets/javascripts/PhysicalExamPerformed.js +9 -2
  48. data/app/assets/javascripts/PhysicalExamRecommended.js +8 -2
  49. data/app/assets/javascripts/ProcedureOrder.js +10 -3
  50. data/app/assets/javascripts/ProcedurePerformed.js +11 -3
  51. data/app/assets/javascripts/ProcedureRecommended.js +9 -3
  52. data/app/assets/javascripts/ProviderCareExperience.js +8 -2
  53. data/app/assets/javascripts/QDMPatient.js +25 -9
  54. data/app/assets/javascripts/RelatedPerson.js +42 -0
  55. data/app/assets/javascripts/SubstanceAdministered.js +9 -2
  56. data/app/assets/javascripts/SubstanceOrder.js +9 -2
  57. data/app/assets/javascripts/SubstanceRecommended.js +8 -2
  58. data/app/assets/javascripts/Symptom.js +8 -2
  59. data/app/assets/javascripts/attributes/CarePartner.js +31 -0
  60. data/app/assets/javascripts/attributes/Component.js +22 -1
  61. data/app/assets/javascripts/attributes/DiagnosisComponent.js +34 -0
  62. data/app/assets/javascripts/attributes/Entity.js +58 -0
  63. data/app/assets/javascripts/attributes/FacilityLocation.js +4 -1
  64. data/app/assets/javascripts/attributes/Identifier.js +23 -0
  65. data/app/assets/javascripts/attributes/Organization.js +31 -0
  66. data/app/assets/javascripts/attributes/PatientEntity.js +30 -0
  67. data/app/assets/javascripts/attributes/Practitioner.js +33 -0
  68. data/app/assets/javascripts/attributes/ResultComponent.js +31 -0
  69. data/app/assets/javascripts/basetypes/Any.js +24 -14
  70. data/app/assets/javascripts/basetypes/AnyEntity.js +44 -0
  71. data/app/assets/javascripts/basetypes/Code.js +8 -11
  72. data/app/assets/javascripts/basetypes/DataElement.js +14 -6
  73. data/app/assets/javascripts/basetypes/Interval.js +2 -2
  74. data/app/assets/javascripts/basetypes/QDMDate.js +36 -0
  75. data/app/assets/javascripts/basetypes/Quantity.js +1 -1
  76. data/app/assets/javascripts/basetypes/Ratio.js +1 -1
  77. data/app/assets/javascripts/cqm/Provider.js +0 -2
  78. data/app/models/cqm/provider.rb +4 -4
  79. data/app/models/hqmfOid_to_datatype_map.json +1 -1
  80. data/app/models/models.rb +12 -5
  81. data/app/models/qdm/adverse_event.rb +3 -2
  82. data/app/models/qdm/allergy_intolerance.rb +2 -1
  83. data/app/models/qdm/assessment_order.rb +2 -1
  84. data/app/models/qdm/assessment_performed.rb +5 -2
  85. data/app/models/qdm/assessment_recommended.rb +2 -1
  86. data/app/models/qdm/attributes/care_partner.rb +8 -0
  87. data/app/models/qdm/attributes/component.rb +1 -1
  88. data/app/models/qdm/attributes/diagnosis_component.rb +10 -0
  89. data/app/models/qdm/attributes/entity.rb +15 -0
  90. data/app/models/qdm/attributes/facility_location.rb +1 -1
  91. data/app/models/qdm/{id.rb → attributes/identifier.rb} +3 -4
  92. data/app/models/qdm/attributes/organization.rb +8 -0
  93. data/app/models/qdm/attributes/patient_entity.rb +7 -0
  94. data/app/models/qdm/attributes/practitioner.rb +10 -0
  95. data/app/models/qdm/{result_component.rb → attributes/result_component.rb} +1 -3
  96. data/app/models/qdm/basetypes/code.rb +8 -10
  97. data/app/models/qdm/basetypes/data_element.rb +19 -6
  98. data/app/models/qdm/basetypes/date.rb +38 -0
  99. data/app/models/qdm/basetypes/interval.rb +2 -2
  100. data/app/models/qdm/care_goal.rb +4 -2
  101. data/app/models/qdm/communication_performed.rb +6 -5
  102. data/app/models/qdm/device_applied.rb +3 -1
  103. data/app/models/qdm/device_order.rb +2 -1
  104. data/app/models/qdm/device_recommended.rb +2 -1
  105. data/app/models/qdm/diagnosis.rb +2 -1
  106. data/app/models/qdm/diagnostic_study_order.rb +2 -1
  107. data/app/models/qdm/diagnostic_study_performed.rb +3 -1
  108. data/app/models/qdm/diagnostic_study_recommended.rb +2 -1
  109. data/app/models/qdm/encounter_order.rb +3 -1
  110. data/app/models/qdm/encounter_performed.rb +3 -2
  111. data/app/models/qdm/encounter_recommended.rb +2 -1
  112. data/app/models/qdm/family_history.rb +2 -1
  113. data/app/models/qdm/immunization_administered.rb +3 -1
  114. data/app/models/qdm/immunization_order.rb +2 -1
  115. data/app/models/qdm/intervention_order.rb +2 -1
  116. data/app/models/qdm/intervention_performed.rb +3 -1
  117. data/app/models/qdm/intervention_recommended.rb +2 -1
  118. data/app/models/qdm/laboratory_test_order.rb +2 -1
  119. data/app/models/qdm/laboratory_test_performed.rb +3 -1
  120. data/app/models/qdm/laboratory_test_recommended.rb +2 -1
  121. data/app/models/qdm/medication_active.rb +3 -1
  122. data/app/models/qdm/medication_administered.rb +3 -1
  123. data/app/models/qdm/medication_discharge.rb +3 -1
  124. data/app/models/qdm/medication_dispensed.rb +4 -3
  125. data/app/models/qdm/medication_order.rb +3 -3
  126. data/app/models/qdm/participation.rb +2 -1
  127. data/app/models/qdm/patient.rb +1 -1
  128. data/app/models/qdm/patient_care_experience.rb +2 -1
  129. data/app/models/qdm/patient_characteristic.rb +1 -1
  130. data/app/models/qdm/patient_characteristic_birthdate.rb +1 -1
  131. data/app/models/qdm/patient_characteristic_clinical_trial_participant.rb +1 -1
  132. data/app/models/qdm/patient_characteristic_ethnicity.rb +1 -1
  133. data/app/models/qdm/patient_characteristic_expired.rb +1 -1
  134. data/app/models/qdm/patient_characteristic_payer.rb +1 -1
  135. data/app/models/qdm/patient_characteristic_race.rb +1 -1
  136. data/app/models/qdm/patient_characteristic_sex.rb +1 -1
  137. data/app/models/qdm/physical_exam_order.rb +2 -1
  138. data/app/models/qdm/physical_exam_performed.rb +3 -1
  139. data/app/models/qdm/physical_exam_recommended.rb +2 -1
  140. data/app/models/qdm/procedure_order.rb +4 -2
  141. data/app/models/qdm/procedure_performed.rb +5 -2
  142. data/app/models/qdm/procedure_recommended.rb +3 -2
  143. data/app/models/qdm/provider_care_experience.rb +2 -1
  144. data/app/models/qdm/related_person.rb +13 -0
  145. data/app/models/qdm/substance_administered.rb +3 -1
  146. data/app/models/qdm/substance_order.rb +3 -1
  147. data/app/models/qdm/substance_recommended.rb +2 -1
  148. data/app/models/qdm/symptom.rb +2 -1
  149. data/bin/validate_generator.sh +1 -1
  150. data/cqm-models.gemspec +2 -2
  151. data/data/oids_qdm_5.5.json +321 -0
  152. data/dist/browser.js +3434 -3356
  153. data/dist/index.js +3433 -3355
  154. data/lib/generate_models.rb +78 -39
  155. data/lib/generate_patients.rb +3 -3
  156. data/lib/generate_types.rb +1 -1
  157. data/lib/generator_helpers.rb +14 -0
  158. data/modelinfo/qdm-modelinfo-5.5.xml +982 -0
  159. data/package.json +2 -2
  160. data/templates/entity_extension.rb.erb +6 -0
  161. data/templates/identifier_extension.rb.erb +58 -0
  162. data/templates/{id_template.js.erb → identifier_template.js.erb} +6 -5
  163. data/templates/models_template.rb.erb +19 -4
  164. data/templates/mongoose_template.js.erb +86 -12
  165. data/templates/patient_template.js.erb +0 -4
  166. data/yarn.lock +245 -201
  167. metadata +31 -11
  168. data/app/assets/javascripts/Id.js +0 -21
  169. data/app/assets/javascripts/ProviderCharacteristic.js +0 -36
  170. data/app/assets/javascripts/ResultComponent.js +0 -33
  171. data/app/models/qdm/provider_characteristic.rb +0 -12
@@ -1,9 +1,7 @@
1
1
  module QDM
2
2
  # app/models/qdm/result_component.rb
3
- class ResultComponent < DataElement
3
+ class ResultComponent < Component
4
4
  include Mongoid::Document
5
- embedded_in :patient
6
5
  field :referenceRange, type: QDM::Interval
7
- field :qdmVersion, type: String, default: '5.4'
8
6
  end
9
7
  end
@@ -1,20 +1,19 @@
1
1
  module QDM
2
2
  # Represents a Code
3
3
  class Code
4
- attr_accessor :code, :codeSystem, :descriptor, :codeSystemOid, :version
4
+ attr_accessor :code, :display, :system, :version
5
5
 
6
6
  # Code and code system are required (at minimum).
7
- def initialize(code, codeSystemOid, descriptor = nil, codeSystem = nil, version = nil)
7
+ def initialize(code, sys, display = nil, version = nil)
8
8
  @code = code
9
- @codeSystem = codeSystem
10
- @descriptor = descriptor
11
- @codeSystemOid = codeSystemOid
9
+ @system = sys
10
+ @display = display
12
11
  @version = version
13
12
  end
14
13
 
15
14
  # Converts an object of this instance into a database friendly value.
16
15
  def mongoize
17
- { code: @code, codeSystemOid: @codeSystemOid, descriptor: @descriptor, codeSystem: @codeSystem, version: @version, _type: 'QDM::Code' }
16
+ { code: @code, system: @system, display: @display, version: @version, _type: 'QDM::Code' }
18
17
  end
19
18
 
20
19
  class << self
@@ -22,11 +21,11 @@ module QDM
22
21
  # this custom class from it.
23
22
  #
24
23
  # The array elements in demongoize are the same 5 elements used in mongoize, i.e.
25
- # [ code, codeSystem, descriptor, codeSystemOid, version ].
24
+ # [ code, system, display, version ].
26
25
  def demongoize(object)
27
26
  return nil unless object
28
27
  object = object.symbolize_keys
29
- QDM::Code.new(object[:code], object[:codeSystemOid], object[:descriptor], object[:codeSystem], object[:version])
28
+ QDM::Code.new(object[:code], object[:system], object[:display], object[:version])
30
29
  end
31
30
 
32
31
  # Takes any possible object and converts it to how it would be
@@ -37,8 +36,7 @@ module QDM
37
36
  when QDM::Code then object.mongoize
38
37
  when Hash
39
38
  object = object.symbolize_keys
40
- codeSystemOid = object[:system] ? object[:system] : object[:codeSystemOid]
41
- QDM::Code.new(object[:code], codeSystemOid, object[:descriptor], object[:codeSystem], object[:version]).mongoize
39
+ QDM::Code.new(object[:code], object[:system], object[:display], object[:version]).mongoize
42
40
  else object
43
41
  end
44
42
  end
@@ -14,12 +14,12 @@ module QDM
14
14
  # Valueset oid of the specific type.
15
15
  field :codeListId, type: String
16
16
 
17
- embeds_one :id, class_name: 'QDM::Id'
17
+ field :id, type: String
18
18
 
19
19
  def initialize(options = {})
20
20
  super(options)
21
21
  # default id to the mongo ObjectId for this DataElement if it isnt already defined
22
- self.id = QDM::Id.new(value: _id.to_s) unless id?
22
+ self.id = _id.to_s unless id?
23
23
  end
24
24
 
25
25
  # Returns the attribute requested on the datatype.
@@ -31,7 +31,7 @@ module QDM
31
31
  # to the CQL execution engine.
32
32
  def code_system_pairs
33
33
  codes.collect do |code|
34
- { code: code.code, system: code.codeSystemOid }
34
+ { code: code.code, system: code.system }
35
35
  end
36
36
  end
37
37
 
@@ -91,12 +91,25 @@ module QDM
91
91
  # back to the 28th in non leap years
92
92
  def shift_years(year_shift)
93
93
  fields.keys.each do |field|
94
- if send(field).is_a? DateTime
94
+ if send(field).is_a?(QDM::Date) || send(field).is_a?(DateTime)
95
+ # Do not shift Time values. They are stored as DateTimes with year 0.
96
+ next if send(field).year.zero?
95
97
  if send(field).year + year_shift > 9999 || send(field).year + year_shift < 1
96
98
  raise RangeError, 'Year was shifted after 9999 or before 0001'
97
99
  end
98
- if send(field).month == 2 && send(field).day == 29 && !Date.leap?(year_shift + send(field).year)
99
- send(field + '=', send(field).change(year: year_shift + send(field).year, day: 28))
100
+ if send(field).month == 2 && send(field).day == 29 && !::Date.leap?(year_shift + send(field).year)
101
+ if send(field).is_a?(QDM::Date)
102
+ shifted_date = send(field)
103
+ shifted_date.year = shifted_date.year + year_shift
104
+ shifted_date.day = 28
105
+ send(field + '=', shifted_date)
106
+ else
107
+ send(field + '=', send(field).change(year: year_shift + send(field).year, day: 28))
108
+ end
109
+ elsif send(field).is_a?(QDM::Date)
110
+ shifted_date = send(field)
111
+ shifted_date.year = shifted_date.year + year_shift
112
+ send(field + '=', shifted_date)
100
113
  else
101
114
  send(field + '=', send(field).change(year: year_shift + send(field).year))
102
115
  end
@@ -0,0 +1,38 @@
1
+ module QDM
2
+ # Represents a QDM/CQL Date
3
+ class Date
4
+ attr_accessor :year, :month, :day
5
+
6
+ def initialize(year = nil, month = nil, day = nil)
7
+ @year = year
8
+ @month = month
9
+ @day = day
10
+ end
11
+
12
+ # Converts an object of this instance into a database friendly value.
13
+ def mongoize
14
+ "#{format('%04d', year)}-#{format('%02d', month)}-#{format('%02d', day)}"
15
+ end
16
+
17
+ class << self
18
+ # Get the string as it was stored in the database, and instantiate
19
+ # this custom class from it.
20
+ def demongoize(date_str)
21
+ return nil unless date_str
22
+ year = date_str[0..3].to_i
23
+ month = date_str[5..6].to_i
24
+ day = date_str[8..10].to_i
25
+ QDM::Date.new(year, month, day)
26
+ end
27
+
28
+ # Converts the object that was supplied to a criteria and converts it
29
+ # into a database friendly form.
30
+ def evolve(object)
31
+ case object
32
+ when QDM::Date then object.mongoize
33
+ else object
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -38,7 +38,7 @@ module QDM
38
38
  raise RangeError, 'Year was shifted after 9999 or before 0001'
39
39
  end
40
40
  low_shift = @low.year + year_shift
41
- @low = if @low.month == 2 && @low.day == 29 && !Date.leap?(low_shift)
41
+ @low = if @low.month == 2 && @low.day == 29 && !::Date.leap?(low_shift)
42
42
  @low.change(year: low_shift, day: 28)
43
43
  else
44
44
  @low.change(year: low_shift)
@@ -49,7 +49,7 @@ module QDM
49
49
  raise RangeError, 'Year was shifted after 9999 or before 0001'
50
50
  end
51
51
  high_shift = @high.year + year_shift
52
- @high = if @high.month == 2 && @high.day == 29 && !Date.leap?(high_shift)
52
+ @high = if @high.month == 2 && @high.day == 29 && !::Date.leap?(high_shift)
53
53
  @high.change(year: high_shift, day: 28)
54
54
  else
55
55
  @high.change(year: high_shift)
@@ -3,12 +3,14 @@ module QDM
3
3
  class CareGoal < DataElement
4
4
  include Mongoid::Document
5
5
  embedded_in :patient
6
+ field :statusDate, type: Date
6
7
  field :relevantPeriod, type: QDM::Interval
7
- embeds_many :relatedTo, class_name: 'QDM::Id'
8
+ field :relatedTo, type: Array
8
9
  field :targetOutcome
10
+ embeds_one :performer, class_name: 'QDM::Entity'
9
11
  field :qdmTitle, type: String, default: 'Care Goal'
10
12
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.7'
11
13
  field :qdmCategory, type: String, default: 'care_goal'
12
- field :qdmVersion, type: String, default: '5.4'
14
+ field :qdmVersion, type: String, default: '5.5'
13
15
  end
14
16
  end
@@ -6,15 +6,16 @@ module QDM
6
6
  field :authorDatetime, type: DateTime
7
7
  field :category, type: QDM::Code
8
8
  field :medium, type: QDM::Code
9
- field :sender, type: QDM::Code
10
- field :recipient, type: QDM::Code
11
- embeds_many :relatedTo, class_name: 'QDM::Id'
12
- field :relevantPeriod, type: QDM::Interval
9
+ embeds_one :sender, class_name: 'QDM::Entity'
10
+ embeds_one :recipient, class_name: 'QDM::Entity'
11
+ field :relatedTo, type: Array
12
+ field :sentDatetime, type: DateTime
13
+ field :receivedDatetime, type: DateTime
13
14
  field :negationRationale, type: QDM::Code
14
15
  field :qdmTitle, type: String, default: 'Communication, Performed'
15
16
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.132'
16
17
  field :qdmCategory, type: String, default: 'communication'
17
18
  field :qdmStatus, type: String, default: 'performed'
18
- field :qdmVersion, type: String, default: '5.4'
19
+ field :qdmVersion, type: String, default: '5.5'
19
20
  end
20
21
  end
@@ -4,14 +4,16 @@ module QDM
4
4
  include Mongoid::Document
5
5
  embedded_in :patient
6
6
  field :authorDatetime, type: DateTime
7
+ field :relevantDatetime, type: DateTime
7
8
  field :relevantPeriod, type: QDM::Interval
8
9
  field :negationRationale, type: QDM::Code
9
10
  field :reason, type: QDM::Code
10
11
  field :anatomicalLocationSite, type: QDM::Code
12
+ embeds_one :performer, class_name: 'QDM::Entity'
11
13
  field :qdmTitle, type: String, default: 'Device, Applied'
12
14
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.13'
13
15
  field :qdmCategory, type: String, default: 'device'
14
16
  field :qdmStatus, type: String, default: 'applied'
15
- field :qdmVersion, type: String, default: '5.4'
17
+ field :qdmVersion, type: String, default: '5.5'
16
18
  end
17
19
  end
@@ -6,10 +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
10
  field :qdmTitle, type: String, default: 'Device, Order'
10
11
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.15'
11
12
  field :qdmCategory, type: String, default: 'device'
12
13
  field :qdmStatus, type: String, default: 'order'
13
- field :qdmVersion, type: String, default: '5.4'
14
+ field :qdmVersion, type: String, default: '5.5'
14
15
  end
15
16
  end
@@ -6,10 +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
10
  field :qdmTitle, type: String, default: 'Device, Recommended'
10
11
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.16'
11
12
  field :qdmCategory, type: String, default: 'device'
12
13
  field :qdmStatus, type: String, default: 'recommended'
13
- field :qdmVersion, type: String, default: '5.4'
14
+ field :qdmVersion, type: String, default: '5.5'
14
15
  end
15
16
  end
@@ -7,10 +7,11 @@ module QDM
7
7
  field :prevalencePeriod, type: QDM::Interval
8
8
  field :anatomicalLocationSite, type: QDM::Code
9
9
  field :severity, type: QDM::Code
10
+ embeds_one :recorder, class_name: 'QDM::Entity'
10
11
  field :qdmTitle, type: String, default: 'Diagnosis'
11
12
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.110'
12
13
  field :qrdaOid, type: String, default: '2.16.840.1.113883.10.20.24.3.135'
13
14
  field :qdmCategory, type: String, default: 'condition'
14
- field :qdmVersion, type: String, default: '5.4'
15
+ field :qdmVersion, type: String, default: '5.5'
15
16
  end
16
17
  end
@@ -6,10 +6,11 @@ module QDM
6
6
  field :authorDatetime, type: DateTime
7
7
  field :reason, type: QDM::Code
8
8
  field :negationRationale, type: QDM::Code
9
+ embeds_one :requester, class_name: 'QDM::Entity'
9
10
  field :qdmTitle, type: String, default: 'Diagnostic Study, Order'
10
11
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.22'
11
12
  field :qdmCategory, type: String, default: 'diagnostic_study'
12
13
  field :qdmStatus, type: String, default: 'order'
13
- field :qdmVersion, type: String, default: '5.4'
14
+ field :qdmVersion, type: String, default: '5.5'
14
15
  end
15
16
  end
@@ -4,6 +4,7 @@ module QDM
4
4
  include Mongoid::Document
5
5
  embedded_in :patient
6
6
  field :authorDatetime, type: DateTime
7
+ field :relevantDatetime, type: DateTime
7
8
  field :relevantPeriod, type: QDM::Interval
8
9
  field :reason, type: QDM::Code
9
10
  field :result
@@ -13,10 +14,11 @@ module QDM
13
14
  field :facilityLocation, type: QDM::FacilityLocation
14
15
  field :negationRationale, type: QDM::Code
15
16
  field :components, type: Array
17
+ embeds_one :performer, class_name: 'QDM::Entity'
16
18
  field :qdmTitle, type: String, default: 'Diagnostic Study, Performed'
17
19
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.23'
18
20
  field :qdmCategory, type: String, default: 'diagnostic_study'
19
21
  field :qdmStatus, type: String, default: 'performed'
20
- field :qdmVersion, type: String, default: '5.4'
22
+ field :qdmVersion, type: String, default: '5.5'
21
23
  end
22
24
  end
@@ -5,11 +5,12 @@ module QDM
5
5
  embedded_in :patient
6
6
  field :authorDatetime, type: DateTime
7
7
  field :negationRationale, type: QDM::Code
8
+ embeds_one :requester, class_name: 'QDM::Entity'
8
9
  field :qdmTitle, type: String, default: 'Diagnostic Study, Recommended'
9
10
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.24'
10
11
  field :qrdaOid, type: String, default: '2.16.840.1.113883.10.20.24.3.19'
11
12
  field :qdmCategory, type: String, default: 'diagnostic_study'
12
13
  field :qdmStatus, type: String, default: 'recommended'
13
- field :qdmVersion, type: String, default: '5.4'
14
+ field :qdmVersion, type: String, default: '5.5'
14
15
  end
15
16
  end
@@ -7,10 +7,12 @@ module QDM
7
7
  field :reason, type: QDM::Code
8
8
  field :facilityLocation, type: QDM::FacilityLocation
9
9
  field :negationRationale, type: QDM::Code
10
+ embeds_one :requester, class_name: 'QDM::Entity'
11
+ field :priority, type: QDM::Code
10
12
  field :qdmTitle, type: String, default: 'Encounter, Order'
11
13
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.27'
12
14
  field :qdmCategory, type: String, default: 'encounter'
13
15
  field :qdmStatus, type: String, default: 'order'
14
- field :qdmVersion, type: String, default: '5.4'
16
+ field :qdmVersion, type: String, default: '5.5'
15
17
  end
16
18
  end
@@ -9,13 +9,14 @@ module QDM
9
9
  field :dischargeDisposition, type: QDM::Code
10
10
  field :facilityLocations, type: Array, default: []
11
11
  field :diagnoses, type: Array
12
- field :principalDiagnosis, type: QDM::Code
13
12
  field :negationRationale, type: QDM::Code
14
13
  field :lengthOfStay, type: QDM::Quantity
14
+ field :priority, type: QDM::Code
15
+ embeds_one :participant, class_name: 'QDM::Entity'
15
16
  field :qdmTitle, type: String, default: 'Encounter, Performed'
16
17
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.5'
17
18
  field :qdmCategory, type: String, default: 'encounter'
18
19
  field :qdmStatus, type: String, default: 'performed'
19
- field :qdmVersion, type: String, default: '5.4'
20
+ field :qdmVersion, type: String, default: '5.5'
20
21
  end
21
22
  end
@@ -7,10 +7,11 @@ module QDM
7
7
  field :reason, type: QDM::Code
8
8
  field :facilityLocation, type: QDM::FacilityLocation
9
9
  field :negationRationale, type: QDM::Code
10
+ embeds_one :requester, class_name: 'QDM::Entity'
10
11
  field :qdmTitle, type: String, default: 'Encounter, Recommended'
11
12
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.28'
12
13
  field :qdmCategory, type: String, default: 'encounter'
13
14
  field :qdmStatus, type: String, default: 'recommended'
14
- field :qdmVersion, type: String, default: '5.4'
15
+ field :qdmVersion, type: String, default: '5.5'
15
16
  end
16
17
  end
@@ -5,10 +5,11 @@ module QDM
5
5
  embedded_in :patient
6
6
  field :authorDatetime, type: DateTime
7
7
  field :relationship, type: QDM::Code
8
+ embeds_one :recorder, class_name: 'QDM::Entity'
8
9
  field :qdmTitle, type: String, default: 'Family History'
9
10
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.111'
10
11
  field :qrdaOid, type: String, default: '2.16.840.1.113883.10.20.24.3.12'
11
12
  field :qdmCategory, type: String, default: 'family_history'
12
- field :qdmVersion, type: String, default: '5.4'
13
+ field :qdmVersion, type: String, default: '5.5'
13
14
  end
14
15
  end
@@ -4,15 +4,17 @@ module QDM
4
4
  include Mongoid::Document
5
5
  embedded_in :patient
6
6
  field :authorDatetime, type: DateTime
7
+ field :relevantDatetime, type: DateTime
7
8
  field :reason, type: QDM::Code
8
9
  field :dosage, type: QDM::Quantity
9
10
  field :route, type: QDM::Code
10
11
  field :negationRationale, type: QDM::Code
12
+ embeds_one :performer, class_name: 'QDM::Entity'
11
13
  field :qdmTitle, type: String, default: 'Immunization, Administered'
12
14
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.112'
13
15
  field :qrdaOid, type: String, default: '2.16.840.1.113883.10.20.24.3.140'
14
16
  field :qdmCategory, type: String, default: 'immunization'
15
17
  field :qdmStatus, type: String, default: 'administered'
16
- field :qdmVersion, type: String, default: '5.4'
18
+ field :qdmVersion, type: String, default: '5.5'
17
19
  end
18
20
  end
@@ -10,10 +10,11 @@ module QDM
10
10
  field :reason, type: QDM::Code
11
11
  field :route, type: QDM::Code
12
12
  field :negationRationale, type: QDM::Code
13
+ embeds_one :requester, class_name: 'QDM::Entity'
13
14
  field :qdmTitle, type: String, default: 'Immunization, Order'
14
15
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.113'
15
16
  field :qdmCategory, type: String, default: 'immunization'
16
17
  field :qdmStatus, type: String, default: 'order'
17
- field :qdmVersion, type: String, default: '5.4'
18
+ field :qdmVersion, type: String, default: '5.5'
18
19
  end
19
20
  end
@@ -6,10 +6,11 @@ module QDM
6
6
  field :authorDatetime, type: DateTime
7
7
  field :reason, type: QDM::Code
8
8
  field :negationRationale, type: QDM::Code
9
+ embeds_one :requester, class_name: 'QDM::Entity'
9
10
  field :qdmTitle, type: String, default: 'Intervention, Order'
10
11
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.35'
11
12
  field :qdmCategory, type: String, default: 'intervention'
12
13
  field :qdmStatus, type: String, default: 'order'
13
- field :qdmVersion, type: String, default: '5.4'
14
+ field :qdmVersion, type: String, default: '5.5'
14
15
  end
15
16
  end
@@ -4,15 +4,17 @@ module QDM
4
4
  include Mongoid::Document
5
5
  embedded_in :patient
6
6
  field :authorDatetime, type: DateTime
7
+ field :relevantDatetime, type: DateTime
7
8
  field :relevantPeriod, type: QDM::Interval
8
9
  field :reason, type: QDM::Code
9
10
  field :result
10
11
  field :status, type: QDM::Code
11
12
  field :negationRationale, type: QDM::Code
13
+ embeds_one :performer, class_name: 'QDM::Entity'
12
14
  field :qdmTitle, type: String, default: 'Intervention, Performed'
13
15
  field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.36'
14
16
  field :qdmCategory, type: String, default: 'intervention'
15
17
  field :qdmStatus, type: String, default: 'performed'
16
- field :qdmVersion, type: String, default: '5.4'
18
+ field :qdmVersion, type: String, default: '5.5'
17
19
  end
18
20
  end