@@ -17,8 +17,7 @@ def initialize(
1717 triages :,
1818 attendance_record :,
1919 vaccination_records :,
20- parents :,
21- consent_notifications :
20+ parents :
2221 )
2322 @programme_type = programme_type
2423 @academic_year = academic_year
@@ -29,8 +28,6 @@ def initialize(
2928 @attendance_record = attendance_record
3029 @vaccination_records = vaccination_records
3130 @parents = parents
32- @consent_notifications =
33- find_matching_consent_notifications ( consent_notifications )
3431
3532 @vaccination_criteria =
3633 VaccinationCriteria . new (
@@ -175,8 +172,7 @@ def consent_vaccine_methods
175172 :triages ,
176173 :attendance_record ,
177174 :vaccination_criteria ,
178- :parents ,
179- :consent_notifications
175+ :parents
180176
181177 delegate :vaccinated? ,
182178 :vaccinated_vaccination_record ,
@@ -241,11 +237,11 @@ def should_be_needs_consent_request_failed?
241237 end
242238
243239 def should_be_needs_consent_request_scheduled?
244- is_eligible? && consent_status == :request_scheduled
240+ false # TODO: Implement this status.
245241 end
246242
247243 def should_be_needs_consent_request_not_scheduled?
248- is_eligible? && consent_status == :request_not_scheduled
244+ false # TODO: Implement this status.
249245 end
250246
251247 def should_be_needs_consent_no_contact_details?
@@ -292,13 +288,6 @@ def default_programme_year_groups
292288 Programme . find ( programme_type ) . default_year_groups
293289 end
294290
295- def find_matching_consent_notifications ( notifications )
296- notifications . select do |notification |
297- notification . programme_types . include? ( programme_type ) &&
298- notification . session &.team_location &.academic_year == academic_year
299- end
300- end
301-
302291 def consent_generator
303292 @consent_generator ||=
304293 StatusGenerator ::Consent . new (
@@ -307,9 +296,7 @@ def consent_generator
307296 patient :,
308297 consents :,
309298 vaccination_records :,
310- parents :,
311- sessions :,
312- consent_notifications :
299+ parents :
313300 )
314301 end
315302
@@ -322,34 +309,7 @@ def triage_generator
322309 consents :,
323310 triages :,
324311 vaccination_records :,
325- parents :,
326- sessions :,
327- consent_notifications :
312+ parents :
328313 )
329314 end
330-
331- def sessions
332- @sessions ||=
333- patient_locations
334- . reject { it . location . generic_clinic? }
335- . flat_map { sessions_for ( it ) }
336- . uniq
337- end
338-
339- def sessions_for ( patient_location )
340- patient_location
341- . location
342- . team_locations
343- . select { it . academic_year == academic_year }
344- . flat_map ( &:sessions )
345- . select { it . programme_types . include? ( programme_type ) }
346- . select { session_in_patient_location_date_range? ( it , patient_location ) }
347- . reject ( &:completed? )
348- end
349-
350- def session_in_patient_location_date_range? ( session , patient_location )
351- return true if session . dates . empty?
352-
353- session . dates . any? { |date | date . in? ( patient_location . date_range ) }
354- end
355315end
0 commit comments