class EnqueueVaccinationsSearchInNHSJob
Enqueue jobs to search vaccination records in the NHS system for patients associated with upcoming sessions and for patients due for a rolling search.
The approach is to perform daily searches for patients that have upcoming sessions, starting from 2 days before invitations or consent requests are sent out and ending once the last date of the sessions has passed. For all other patients we want to ensure a search is performed every 28 days at most.
Public Instance Methods
Source
# File app/jobs/enqueue_vaccinations_search_in_nhs_job.rb, line 13 def perform(programme_types: nil) programme_types ||= Programme.all.map(&:type) patient_ids = [] if Flipper.enabled?(:imms_api_enqueue_session_searches) patient_ids += patient_ids_session_searches(programme_types:) end if Flipper.enabled?(:imms_api_enqueue_rolling_searches) patient_ids += patient_ids_for_rolling_searches end if patient_ids.any? SearchVaccinationRecordsInNHSJob.perform_bulk(patient_ids.uniq.zip) end end