class Patients::EditController
Public Instance Methods
Source
# File app/controllers/patients/edit_controller.rb, line 49 def edit_ethnic_background render :ethnic_background end
Source
# File app/controllers/patients/edit_controller.rb, line 33 def edit_ethnic_group render :ethnic_group end
Source
# File app/controllers/patients/edit_controller.rb, line 11 def edit_nhs_number render :nhs_number end
Source
# File app/controllers/patients/edit_controller.rb, line 74 def edit_school render :school end
Source
# File app/controllers/patients/edit_controller.rb, line 53 def update_ethnic_background @patient.ethnic_background = ethnic_background @patient.ethnic_background_other = ethnic_background_other redirect_to edit_patient_path(@patient) and return unless @patient.changed? if @patient.save redirect_to edit_patient_path(@patient) else render :ethnic_background, status: :unprocessable_content end end
Source
# File app/controllers/patients/edit_controller.rb, line 37 def update_ethnic_group @patient.ethnic_group = ethnic_group redirect_to edit_patient_path(@patient) and return unless @patient.changed? if @patient.save redirect_to edit_ethnic_background_patient_path(@patient) else render :ethnic_group, status: :unprocessable_content end end
Source
# File app/controllers/patients/edit_controller.rb, line 15 def update_nhs_number @patient.nhs_number = nhs_number.presence redirect_to edit_patient_path(@patient) and return unless @patient.changed? render :nhs_number_merge and return if @existing_patient @patient.invalidated_at = nil if @patient.save PatientUpdateFromPDSJob.perform_later(@patient) redirect_to edit_patient_path(@patient) else render :nhs_number, status: :unprocessable_content end end
Source
# File app/controllers/patients/edit_controller.rb, line 66 def update_nhs_number_merge if @form.save redirect_to edit_patient_path(@existing_patient) else render :nhs_number_merge, status: :unprocessable_entity end end
Source
# File app/controllers/patients/edit_controller.rb, line 78 def update_school @patient.school_id = school_id redirect_to edit_patient_path(@patient) and return unless @patient.changed? if @patient.valid? SchoolMove.new( academic_year: AcademicYear.current, patient: @patient, school: @patient.school ).confirm!(user: current_user) redirect_to edit_patient_path(@patient) else render :school, status: :unprocessable_content end end