Class: Renalware::HD::PatientsController

Inherits:
BaseController show all
Defined in:
app/controllers/renalware/hd/patients_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#patient

Instance Method Details

#dialysing_at_hospitalObject



17
18
19
20
21
# File 'app/controllers/renalware/hd/patients_controller.rb', line 17

def dialysing_at_hospital
  skip_authorization
  patients = all_hd_patients_matching_search_term
  render json: simplify(patients).to_json
end

#dialysing_at_unitObject



8
9
10
11
12
13
14
15
# File 'app/controllers/renalware/hd/patients_controller.rb', line 8

def dialysing_at_unit
  skip_authorization
  unit_id = params.fetch(:unit_id)
  patients = all_hd_patients_matching_search_term
              .eager_load(:hd_profile)
              .merge(HD::Profile.dialysing_at_unit(unit_id))
  render json: simplify(patients).to_json
end