Class: Renalware::Letters::PatientListener

Inherits:
Object
  • Object
show all
Defined in:
app/models/renalware/letters/patient_listener.rb

Instance Method Summary collapse

Instance Method Details

#patient_modality_changed_to_death(patient:, modality:, actor:) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'app/models/renalware/letters/patient_listener.rb', line 6

def patient_modality_changed_to_death(patient:, modality:, actor:)
  # Using update_columns here (bypassing validation) because currently, once the Death
  # modality is assigned, attempting to update the patient triggers validation
  # on cause_of_death which will at this stage be missing.
  patient.update_columns(
    cc_on_all_letters: false,
    cc_decision_on: modality.started_on
  )
end