class PatientArchiveForm
Attributes
Public Instance Methods
Source
# File app/forms/patient_archive_form.rb, line 37 def duplicate? = type == "duplicate" def other? = type == "other" private def team = current_user.selected_team def nhs_number_is_different return if nhs_number.blank? return if nhs_number != patient.nhs_number errors.add( :nhs_number, "No other child record has this NHS number. Enter the NHS number of the duplicate record." )
Source
# File app/forms/patient_archive_form.rb, line 45 def nhs_number_is_different return if nhs_number.blank? return if nhs_number != patient.nhs_number errors.add( :nhs_number, "No other child record has this NHS number. Enter the NHS number of the duplicate record." ) end
Source
# File app/forms/patient_archive_form.rb, line 39 def other? = type == "other" private def team = current_user.selected_team def nhs_number_is_different return if nhs_number.blank? return if nhs_number != patient.nhs_number errors.add( :nhs_number, "No other child record has this NHS number. Enter the NHS number of the duplicate record." ) end
Source
# File app/forms/patient_archive_form.rb, line 27 def save return false unless valid? if duplicate? super else PatientArchiver.call(patient:, team:, type:, other_details:) end end
Calls superclass method
PatientMergeFormConcern#save
Source
# File app/forms/patient_archive_form.rb, line 43 def team = current_user.selected_team def nhs_number_is_different return if nhs_number.blank? return if nhs_number != patient.nhs_number errors.add( :nhs_number, "No other child record has this NHS number. Enter the NHS number of the duplicate record." ) end end