File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ def to_h
4040 consent_link :,
4141 day_month_year_of_vaccination :,
4242 full_and_preferred_patient_name :,
43+ has_multiple_dates :,
4344 location_name :,
4445 next_or_today_session_date :,
4546 next_or_today_session_dates :,
@@ -132,6 +133,16 @@ def full_and_preferred_patient_name
132133 ( consent_form || patient ) . full_name_with_known_as ( context : :parents )
133134 end
134135
136+ def has_multiple_dates
137+ return nil if session . nil?
138+
139+ if session . today_or_future_dates . length > 1
140+ "yes"
141+ else
142+ "no"
143+ end
144+ end
145+
135146 def host
136147 if Rails . env . local?
137148 "http://localhost:4000"
Original file line number Diff line number Diff line change 5555 consent_link :
5656 "http://localhost:4000/consents/#{ session . slug } /hpv/start" ,
5757 full_and_preferred_patient_name : "John Smith" ,
58+ has_multiple_dates : "no" ,
5859 location_name : "Hogwarts" ,
5960 next_or_today_session_date : "Thursday 1 January" ,
6061 next_or_today_session_dates : "Thursday 1 January" ,
128129 expect ( to_h ) . to match (
129130 hash_including (
130131 consent_deadline : "Wednesday 31 December" ,
132+ has_multiple_dates : "yes" ,
131133 next_or_today_session_date : "Thursday 1 January" ,
132134 next_or_today_session_dates :
133135 "Thursday 1 January and Friday 2 January" ,
You can’t perform that action at this time.
0 commit comments