Class: Renalware::Clinical::ProfilesController

Inherits:
BaseController show all
Defined in:
app/controllers/renalware/clinical/profiles_controller.rb

Overview

Note that there is no concrete Clinical::Profile, most data here is persisted in the patient

Instance Method Summary collapse

Methods inherited from BaseController

#patient

Methods inherited from BaseController

#patient

Instance Method Details

#editObject



17
18
19
20
# File 'app/controllers/renalware/clinical/profiles_controller.rb', line 17

def edit
  authorize patient
  render locals: { patient: patient }
end

#showObject



9
10
11
12
13
14
15
# File 'app/controllers/renalware/clinical/profiles_controller.rb', line 9

def show
  authorize patient
  render locals: {
    patient: patient,
    profile: Clinical::ProfilePresenter.new(patient: patient, params: params)
  }
end

#updateObject



22
23
24
25
26
27
28
29
30
# File 'app/controllers/renalware/clinical/profiles_controller.rb', line 22

def update
  authorize patient
  if update_patient
    redirect_to patient_clinical_profile_path(patient),
                notice: t(".success", model_name: "clinical history")
  else
    render :edit, locals: { patient: patient }
  end
end