Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions app/models/immunisation_import_row.rb
Original file line number Diff line number Diff line change
Expand Up @@ -851,13 +851,13 @@ def validate_dose_sequence
two_words_connector: " or "
)

dose_sequence_error_message =
"Enter a numeric which must be either #{dose_sequence_examples}."
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Enter a numeric ..."? Just double-checking this is correct, it doesn't sound better to me but happy to approve if this was deemed so.


if dose_sequence.present? ||
parsed_vaccination_description_string&.dig(:dose_sequence).present?
if dose_sequence_value.nil?
errors.add(
field.header,
"Enter a dose sequence number, for example, #{dose_sequence_examples}."
)
errors.add(field.header, dose_sequence_error_message)
elsif maximum_dose_sequence
if dose_sequence_value < 1
errors.add(field.header, "must be greater than 0")
Expand All @@ -879,10 +879,7 @@ def validate_dose_sequence
end
)
else
errors.add(
field.header,
"Enter a dose sequence number, for example, #{dose_sequence_examples}."
)
errors.add(field.header, dose_sequence_error_message)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/models/immunisation_import_row_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@
it "has the correct error message" do
immunisation_import_row.valid?
expect(immunisation_import_row.errors["DOSE_SEQUENCE"]).to include(
"Enter a dose sequence number, for example, 1 or 2."
"Enter a numeric which must be either 1 or 2."
)
end
end
Expand Down
Loading