class UpdatePatientsFromPDS
Public Class Methods
Source
# File app/lib/update_patients_from_pds.rb, line 21 def self.call(...) = new(...).call private_class_method :new private attr_reader :patients, :queue def enqueue? Flipper.enabled?(:pds) && Flipper.enabled?(:pds_enqueue_bulk_updates) end end
Source
# File app/lib/update_patients_from_pds.rb, line 4 def initialize(patients, queue:) @patients = patients @queue = queue end
Public Instance Methods
Source
# File app/lib/update_patients_from_pds.rb, line 9 def call return unless enqueue? patients.find_each do |patient| if patient.nhs_number.nil? PDSCascadingSearchJob.set(queue:).perform_later(patient) else PatientUpdateFromPDSJob.set(queue:).perform_later(patient) end end end
Source
# File app/lib/update_patients_from_pds.rb, line 29 def enqueue? Flipper.enabled?(:pds) && Flipper.enabled?(:pds_enqueue_bulk_updates) end