Sha256: b0a192c6c729abe2235c20b1fc98b20e9fc0cdb4be0091c3c3e2140d5ddee3fe

Contents?: true

Size: 509 Bytes

Versions: 12

Compression:

Stored size: 509 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/medications"

module Renalware
  module Medications
    class TerminateAllPatientPrescriptions
      attr_reader :patient, :by

      def self.call(patient:, by:)
        new(patient, by).call
      end

      def initialize(patient, by)
        @patient = patient
        @by = by
      end

      def call
        patient.prescriptions.each do |prescription|
          prescription.terminate(by: by).save!
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
renalware-core-2.0.22 app/models/renalware/medications/terminate_all_patient_prescriptions.rb
renalware-core-2.0.21 app/models/renalware/medications/terminate_all_patient_prescriptions.rb
renalware-core-2.0.20 app/models/renalware/medications/terminate_all_patient_prescriptions.rb
renalware-core-2.0.18 app/models/renalware/medications/terminate_all_patient_prescriptions.rb
renalware-core-2.0.17 app/models/renalware/medications/terminate_all_patient_prescriptions.rb
renalware-core-2.0.16 app/models/renalware/medications/terminate_all_patient_prescriptions.rb
renalware-core-2.0.15 app/models/renalware/medications/terminate_all_patient_prescriptions.rb
renalware-core-2.0.14 app/models/renalware/medications/terminate_all_patient_prescriptions.rb
renalware-core-2.0.13 app/models/renalware/medications/terminate_all_patient_prescriptions.rb
renalware-core-2.0.12 app/models/renalware/medications/terminate_all_patient_prescriptions.rb
renalware-core-2.0.11 app/models/renalware/medications/terminate_all_patient_prescriptions.rb
renalware-core-2.0.9 app/models/renalware/medications/terminate_all_patient_prescriptions.rb