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
# 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]
end

Instance Method Details

#adverse_eventObject



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

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

#allergy_intoleranceObject



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

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

#assessment_orderObject



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

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

#assessment_performedObject



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

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


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

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

#communication_performedObject



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

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

#device_appliedObject



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

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

#device_orderObject



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

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


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

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

#diagnosisObject



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

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

#diagnostic_study_orderObject



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

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

#diagnostic_study_performedObject



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

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


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

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

#encounter_orderObject



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

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

#encounter_performedObject



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

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


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

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

#family_historyObject



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

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

#immunization_administeredObject



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

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

#immunization_orderObject



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

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

#intervention_orderObject



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

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

#intervention_performedObject



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

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


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

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

#laboratory_test_orderObject



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

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

#laboratory_test_performedObject



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

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


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

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

#medication_activeObject



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

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

#medication_administeredObject



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

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



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

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

#medication_dispensedObject



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

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

#medication_orderObject



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

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

#patient_addressesObject



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 27

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



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

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



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

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

#patient_characteristic_clinical_trial_participantObject



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

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

#patient_characteristic_ethnicityObject



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

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

#patient_characteristic_expiredObject



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

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

#patient_characteristic_payerObject



56
57
58
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 56

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

#patient_characteristic_raceObject



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

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

#patient_characteristic_sexObject



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

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

#patient_emailObject



47
48
49
50
51
52
53
54
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 47

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



39
40
41
42
43
44
45
# File 'lib/qrda-export/catI-r5/qrda1_r5.rb', line 39

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



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

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

#physical_exam_performedObject



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

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


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

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

#procedure_orderObject



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

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

#procedure_performedObject



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

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


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

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

#program_participationObject



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

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

#provider_care_experienceObject



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

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


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

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

#substance_administeredObject



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

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

#substance_orderObject



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

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


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

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

#symptomObject



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

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