Class: Qrda1R5

Constant Summary

Constants included from Qrda::Export::Helper::FrequencyHelper

Qrda::Export::Helper::FrequencyHelper::FREQUENCY_CODE_MAP

Instance Method Summary collapse

Methods included from HQMF::Util::EntityHelper

#care_partner_entity?, #location_entity?, #organization_entity?, #patient_entity?, #practitioner_entity?

Methods included from Qrda::Export::Helper::FrequencyHelper

#institution_not_specified_point_frequency, #institution_not_specified_range_frequency, #institution_specified_point_frequency, #institution_specified_range_frequency, #medication_frequency

Methods included from Qrda::Export::Helper::PatientViewHelper

#birthdate, #ethnic_group, #expiration, #gender, #given_name, #mrn, #patient, #payer, #provider, #provider_ccn, #provider_npi, #provider_street, #provider_tin, #provider_type_code, #race

Methods included from Qrda::Export::Helper::Cat1ViewHelper

#authordatetime_or_dispenserid?, #code_and_codesystem, #display_author_dispenser_id?, #display_author_prescriber_id?, #dose_quantity_value, #id_or_null_flavor, #integer_or_pq, #multiple_codes?, #negated, #negation_ind, #primary_code_and_codesystem, #refills_as_repeat_number, #result_value, #result_value_as_string, #translation_codes_and_codesystem_list, #value_as_float

Methods included from Qrda::Export::Helper::ViewHelper

#as_id, #hicn, #measures, #medicare_beneficiary_identifier, #object_id, #random_id, #submission_program

Methods included from Qrda::Export::Helper::DateHelper

#active_date_time, #author_effective_time, #author_time, #birth_date_time, #completed_prevalence_period, #current_time, #expired_date_time, #facility_period, #incision_datetime, #medication_duration_author_effective_time, #medication_duration_effective_time, #medication_supply_request_period, #participation_period, #performance_period_end, #performance_period_start, #prevalence_period, #received_date_time, #relevant_date_period_or_null_flavor, #relevant_date_time_value, #relevant_period, #result_date_time, #result_date_time?, #sent_date_time, #value_or_null_flavor

Constructor Details

#initialize(patient, measures, options = {}) ⇒ Qrda1R5

Returns a new instance of Qrda1R5.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 12

def initialize(patient, measures, options = {})
  @patient = patient
  @qdmPatient = patient.qdmPatient
  @measures = measures
  @provider = options[:provider]
  @patient_address_option = options[:patient_addresses]
  @patient_telecom_option = options[:patient_telecoms]
  @patient_email_option = options[:patient_email]
  @performance_period_start = options[:start_time]
  @performance_period_end = options[:end_time]
  @submission_program = options[:submission_program]
  @medicare_beneficiary_identifier = options[:medicare_beneficiary_identifier]
  @hicn = options[:hicn]
  @authoring_system = options[:authoring_system]
end

Instance Method Details

#adverse_eventObject



81
82
83
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 81

def adverse_event
  JSON.parse(@qdmPatient.get_data_elements('adverse_event', nil).to_json)
end

#allergy_intoleranceObject



85
86
87
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 85

def allergy_intolerance
  JSON.parse(@qdmPatient.get_data_elements('allergy', 'intolerance').to_json)
end

#assessment_orderObject



89
90
91
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 89

def assessment_order
  JSON.parse(@qdmPatient.get_data_elements('assessment', 'order').to_json)
end

#assessment_performedObject



93
94
95
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 93

def assessment_performed
  JSON.parse(@qdmPatient.get_data_elements('assessment', 'performed').to_json)
end


97
98
99
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 97

def assessment_recommended
  JSON.parse(@qdmPatient.get_data_elements('assessment', 'recommended').to_json)
end

#authoring_systemObject



28
29
30
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 28

def authoring_system
  @authoring_system || 'TestSystem'
end

#communication_performedObject



101
102
103
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 101

def communication_performed
  JSON.parse(@qdmPatient.get_data_elements('communication', 'performed').to_json)
end

#device_appliedObject



109
110
111
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 109

def device_applied
  JSON.parse(@qdmPatient.get_data_elements('device', 'applied').to_json)
end

#device_orderObject



113
114
115
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 113

def device_order
  JSON.parse(@qdmPatient.get_data_elements('device', 'order').to_json)
end


117
118
119
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 117

def device_recommended
  JSON.parse(@qdmPatient.get_data_elements('device', 'recommended').to_json)
end

#diagnosisObject



105
106
107
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 105

def diagnosis
  JSON.parse(@qdmPatient.get_data_elements('condition', nil).to_json)
end

#diagnostic_study_orderObject



121
122
123
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 121

def diagnostic_study_order
  JSON.parse(@qdmPatient.get_data_elements('diagnostic_study', 'order').to_json)
end

#diagnostic_study_performedObject



125
126
127
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 125

def diagnostic_study_performed
  JSON.parse(@qdmPatient.get_data_elements('diagnostic_study', 'performed').to_json)
end


129
130
131
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 129

def diagnostic_study_recommended
  JSON.parse(@qdmPatient.get_data_elements('diagnostic_study', 'recommended').to_json)
end

#encounter_orderObject



133
134
135
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 133

def encounter_order
  JSON.parse(@qdmPatient.get_data_elements('encounter', 'order').to_json)
end

#encounter_performedObject



137
138
139
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 137

def encounter_performed
  JSON.parse(@qdmPatient.get_data_elements('encounter', 'performed').to_json)
end


141
142
143
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 141

def encounter_recommended
  JSON.parse(@qdmPatient.get_data_elements('encounter', 'recommended').to_json)
end

#family_historyObject



145
146
147
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 145

def family_history
  JSON.parse(@qdmPatient.get_data_elements('family_history', nil).to_json)
end

#immunization_administeredObject



149
150
151
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 149

def immunization_administered
  JSON.parse(@qdmPatient.get_data_elements('immunization', 'administered').to_json)
end

#immunization_orderObject



153
154
155
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 153

def immunization_order
  JSON.parse(@qdmPatient.get_data_elements('immunization', 'order').to_json)
end

#intervention_orderObject



157
158
159
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 157

def intervention_order
  JSON.parse(@qdmPatient.get_data_elements('intervention', 'order').to_json)
end

#intervention_performedObject



161
162
163
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 161

def intervention_performed
  JSON.parse(@qdmPatient.get_data_elements('intervention', 'performed').to_json)
end


165
166
167
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 165

def intervention_recommended
  JSON.parse(@qdmPatient.get_data_elements('intervention', 'recommended').to_json)
end

#laboratory_test_orderObject



169
170
171
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 169

def laboratory_test_order
  JSON.parse(@qdmPatient.get_data_elements('laboratory_test', 'order').to_json)
end

#laboratory_test_performedObject



173
174
175
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 173

def laboratory_test_performed
  JSON.parse(@qdmPatient.get_data_elements('laboratory_test', 'performed').to_json)
end


177
178
179
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 177

def laboratory_test_recommended
  JSON.parse(@qdmPatient.get_data_elements('laboratory_test', 'recommended').to_json)
end

#medication_activeObject



181
182
183
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 181

def medication_active
  JSON.parse(@qdmPatient.get_data_elements('medication', 'active').to_json)
end

#medication_administeredObject



185
186
187
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 185

def medication_administered
  JSON.parse(@qdmPatient.get_data_elements('medication', 'administered').to_json) + JSON.parse(@qdmPatient.get_data_elements('substance', 'administered').to_json)
end

#medication_dischargeObject



189
190
191
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 189

def medication_discharge
  JSON.parse(@qdmPatient.get_data_elements('medication', 'discharge').to_json)
end

#medication_dispensedObject



193
194
195
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 193

def medication_dispensed
  JSON.parse(@qdmPatient.get_data_elements('medication', 'dispensed').to_json)
end

#medication_orderObject



197
198
199
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 197

def medication_order
  JSON.parse(@qdmPatient.get_data_elements('medication', 'order').to_json)
end

#patient_addressesObject



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 32

def patient_addresses
  @patient_address_option ||= [CQM::Address.new(
    use: 'HP',
    street: ['202 Burlington Rd.'],
    city: 'Bedford',
    state: 'MA',
    zip: '01730',
    country: 'US'
  )]
  JSON.parse(@patient_address_option.to_json)
end

#patient_care_experienceObject



201
202
203
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 201

def patient_care_experience
  JSON.parse(@qdmPatient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('patient_care_experience', '') }).to_json)
end

#patient_characteristic_birthdateObject



65
66
67
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 65

def patient_characteristic_birthdate
  JSON.parse(@qdmPatient.get_data_elements('patient_characteristic', 'birthdate').to_json)
end

#patient_characteristic_clinical_trial_participantObject



205
206
207
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 205

def patient_characteristic_clinical_trial_participant
  JSON.parse(@qdmPatient.get_data_elements('patient_characteristic', 'clinical_trial_participant').to_json)
end

#patient_characteristic_ethnicityObject



77
78
79
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 77

def patient_characteristic_ethnicity
  JSON.parse(@qdmPatient.get_data_elements('patient_characteristic', 'ethnicity').to_json)
end

#patient_characteristic_expiredObject



209
210
211
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 209

def patient_characteristic_expired
  JSON.parse(@qdmPatient.get_data_elements('patient_characteristic', 'expired').to_json)
end

#patient_characteristic_payerObject



61
62
63
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 61

def patient_characteristic_payer
  JSON.parse(@qdmPatient.get_data_elements('patient_characteristic', 'payer').to_json)
end

#patient_characteristic_raceObject



73
74
75
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 73

def patient_characteristic_race
  JSON.parse(@qdmPatient.get_data_elements('patient_characteristic', 'race').to_json)
end

#patient_characteristic_sexObject



69
70
71
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 69

def patient_characteristic_sex
  JSON.parse(@qdmPatient.get_data_elements('patient_characteristic', 'gender').to_json)
end

#patient_emailObject



52
53
54
55
56
57
58
59
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 52

def patient_email
  return unless @patient_email_option
  telecom_email = [CQM::Telecom.new(
    use: 'HP',
    value: @patient_email_option
  )]
  JSON.parse(telecom_email.to_json)
end

#patient_telecomsObject



44
45
46
47
48
49
50
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 44

def patient_telecoms
  @patient_telecom_option ||= [CQM::Telecom.new(
    use: 'HP',
    value: '555-555-2003'
  )]
  JSON.parse(@patient_telecom_option.to_json)
end

#physical_exam_orderObject



213
214
215
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 213

def physical_exam_order
  JSON.parse(@qdmPatient.get_data_elements('physical_exam', 'order').to_json)
end

#physical_exam_performedObject



217
218
219
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 217

def physical_exam_performed
  JSON.parse(@qdmPatient.get_data_elements('physical_exam', 'performed').to_json)
end


221
222
223
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 221

def physical_exam_recommended
  JSON.parse(@qdmPatient.get_data_elements('physical_exam', 'recommended').to_json)
end

#procedure_orderObject



225
226
227
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 225

def procedure_order
  JSON.parse(@qdmPatient.get_data_elements('procedure', 'order').to_json)
end

#procedure_performedObject



229
230
231
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 229

def procedure_performed
  JSON.parse(@qdmPatient.get_data_elements('procedure', 'performed').to_json)
end


233
234
235
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 233

def procedure_recommended
  JSON.parse(@qdmPatient.get_data_elements('procedure', 'recommended').to_json)
end

#program_participationObject



237
238
239
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 237

def program_participation
  JSON.parse(@qdmPatient.get_data_elements('participation', nil).to_json)
end

#provider_care_experienceObject



241
242
243
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 241

def provider_care_experience
  JSON.parse(@qdmPatient.dataElements.where(hqmfOid: { '$in' => HQMF::Util::HQMFTemplateHelper.get_all_hqmf_oids('provider_care_experience', '') }).to_json)
end


245
246
247
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 245

def related_person
  JSON.parse(@qdmPatient.get_data_elements('related_person', nil).to_json)
end

#substance_administeredObject



249
250
251
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 249

def substance_administered
  JSON.parse(@qdmPatient.get_data_elements('substance', 'administered').to_json)
end

#substance_orderObject



253
254
255
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 253

def substance_order
  JSON.parse(@qdmPatient.get_data_elements('substance', 'order').to_json)
end


257
258
259
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 257

def substance_recommended
  JSON.parse(@qdmPatient.get_data_elements('substance', 'recommended').to_json)
end

#symptomObject



261
262
263
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 261

def symptom
  JSON.parse(@qdmPatient.get_data_elements('symptom', nil).to_json)
end