Skip to content

Commit 3141a4a

Browse files
committed
Revert "Create ImportantNoticeGeneratorJob to create notices for patients"
This reverts commit bdad6e3.
1 parent 5e378a3 commit 3141a4a

5 files changed

Lines changed: 0 additions & 363 deletions

File tree

app/jobs/important_notice_generator_job.rb

Lines changed: 0 additions & 207 deletions
This file was deleted.

app/models/patient.rb

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ class Patient < ApplicationRecord
6868
has_many :consent_statuses
6969
has_many :consents
7070
has_many :gillick_assessments
71-
has_many :important_notices, dependent: :destroy
7271
has_many :notes
7372
has_many :notify_log_entries
7473
has_many :parent_relationships, -> { order(:created_at) }
@@ -455,7 +454,6 @@ class Patient < ApplicationRecord
455454
end
456455

457456
after_update :sync_vaccinations_to_nhs_immunisations_api
458-
after_update :generate_important_notice_if_needed
459457
after_commit :search_vaccinations_from_nhs_immunisations_api, on: :update
460458
before_destroy :destroy_childless_parents
461459

@@ -847,16 +845,4 @@ def search_vaccinations_from_nhs_immunisations_api
847845
SearchVaccinationRecordsInNHSJob.perform_async(id)
848846
end
849847
end
850-
851-
def should_generate_important_notice?
852-
nhs_number_previously_changed? || invalidated_at_previously_changed? ||
853-
restricted_at_previously_changed? ||
854-
date_of_death_recorded_at_previously_changed?
855-
end
856-
857-
def generate_important_notice_if_needed
858-
if should_generate_important_notice?
859-
ImportantNoticeGeneratorJob.perform_now(id)
860-
end
861-
end
862848
end

app/models/team.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ class ActiveRecord_Relation < ActiveRecord::Relation
5050
has_many :cohort_imports
5151
has_many :consent_forms
5252
has_many :consents
53-
has_many :important_notices
5453
has_many :locations
5554
has_many :patient_specific_directions
5655
has_many :sessions

app/models/vaccination_record.rb

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,6 @@ class ActiveRecord_Relation < ActiveRecord::Relation
232232
unless: :nhs_immunisations_api_id
233233
}
234234

235-
after_save :generate_important_notice_if_needed
236-
237235
delegate :fhir_record, to: :fhir_mapper
238236

239237
class << self
@@ -307,14 +305,4 @@ def recalculate_next_dose_delay_triage_date
307305

308306
StatusUpdater.call(patient:)
309307
end
310-
311-
def should_generate_important_notice?
312-
notify_parents_previously_changed?
313-
end
314-
315-
def generate_important_notice_if_needed
316-
if should_generate_important_notice?
317-
ImportantNoticeGeneratorJob.perform_later(patient_id)
318-
end
319-
end
320308
end

0 commit comments

Comments
 (0)