Skip to content

Commit

Permalink
Take health questions from active vaccines
Browse files Browse the repository at this point in the history
The HPV programme has two discontinued vaccines (necessary to support
importing old vaccination records), however for new consent forms we
should make sure to get the health questions from the active vaccine to
ensure users are seeing the right information.
  • Loading branch information
thomasleese committed Oct 1, 2024
1 parent d1be780 commit 45fbf8c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/models/consent_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,10 @@ def reset_unused_fields

def seed_health_questions
return unless health_answers.empty?
vaccine = programme.vaccines.first

# TODO: handle multiple active vaccines
vaccine = programme.vaccines.active.first

self.health_answers = vaccine.health_questions.to_health_answers
end

Expand Down

0 comments on commit 45fbf8c

Please sign in to comment.