Sha256: e0c0c582bf370edff7d55c26e354790949d08d9aa50161d4988ac8d6140ca81f
Contents?: true
Size: 902 Bytes
Versions: 44
Compression:
Stored size: 902 Bytes
Contents
# frozen_string_literal: true module Renalware module HD class PatientListener def patient_modality_changed_to_death(patient:, modality:, actor:) nullify_significant_hd_profile_attributes(patient, by: actor) end def request_default_electronic_cc_recipients_for_use_in_letters(patient:, array_of_user_ids:) patient = HD.cast_patient(patient) if patient.current_modality_hd? named_nurse_id = patient.hd_profile&.named_nurse&.id array_of_user_ids.push(named_nurse_id) if named_nurse_id.present? end end private def nullify_significant_hd_profile_attributes(patient, by:) hd_profile = HD.cast_patient(patient).hd_profile return if hd_profile.nil? hd_profile.hospital_unit = nil hd_profile.schedule_definition = nil hd_profile.save_by!(by) end end end end
Version data entries
44 entries across 44 versions & 1 rubygems