Sha256: 294aa0edff0431a255ce45517c919c1fd5a6527baaea07ccb720efeaba53c15c
Contents?: true
Size: 883 Bytes
Versions: 2
Compression:
Stored size: 883 Bytes
Contents
# frozen_string_literal: true module Renalware module HD class PatientListener def patient_modality_changed_to_death(patient:, 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.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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
renalware-core-2.1.1 | app/models/renalware/hd/patient_listener.rb |
renalware-core-2.1.0 | app/models/renalware/hd/patient_listener.rb |