templates/patient_extension.rb.erb in cqm-models-1.0.3 vs templates/patient_extension.rb.erb in cqm-models-1.1.1.0
- old
+ new
@@ -1,8 +1,6 @@
- field :givenNames, type: Array
- field :familyName, type: String
- field :bundleId, type: String
+ embedded_in :tacomaPatient, class_name: 'CQM::Patient'
# These are the "data criteria", or QDM datatype elements that exist on a
# patient.
embeds_many :dataElements, class_name: 'QDM::DataElement'
@@ -131,10 +129,15 @@
# Helper method; returns medication data element types on this patient.
def medications
get_data_elements('medication')
end
+ # Helper method; returns patient_characteristic data element types on this patient.
+ def patient_characteristics
+ get_data_elements('patient_characteristic')
+ end
+
# Helper method; returns physical_exam data element types on this patient.
def physical_exams
get_data_elements('physical_exam')
end
@@ -198,8 +201,8 @@
_id
end
# Include '_type' in any JSON output. This is necessary for deserialization.
def to_json(options = nil)
- serializable_hash(methods: :_type).to_json(options)
+ serializable_hash(methods: :_type, include: :_type).to_json(options)
end
end
\ No newline at end of file