Skip to content
Merged
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
12 changes: 0 additions & 12 deletions app/models/immunisation_import_row.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class ImmunisationImportRow
greater_than_or_equal_to: :campaign_start_date,
less_than_or_equal_to: :campaign_end_date_or_today
}
validates :reason, presence: true, if: -> { administered == false }

CARE_SETTING_SCHOOL = 1
CARE_SETTING_COMMUNITY = 2
Expand Down Expand Up @@ -90,7 +89,6 @@ def to_vaccination_record
patient_session:,
performed_by_family_name:,
performed_by_given_name:,
reason:,
vaccine:
)
end
Expand Down Expand Up @@ -147,16 +145,6 @@ def batch_number
@data["BATCH_NUMBER"]&.strip
end

REASONS = {
"did not attend" => :absent_from_session,
"vaccination contraindicated" => :contraindications,
"unwell" => :not_well
}.freeze

def reason
REASONS[@data["REASON_NOT_VACCINATED"]&.strip&.downcase]
end

DELIVERY_SITES = {
"left thigh" => :left_thigh,
"right thigh" => :right_thigh,
Expand Down
26 changes: 0 additions & 26 deletions spec/models/immunisation_import_row_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -581,32 +581,6 @@
end
end

describe "#reason" do
subject(:reason) { immunisation_import_row.reason }

context "without a reason" do
let(:data) { { "VACCINATED" => "N" } }

it { expect(immunisation_import_row).to be_invalid }
end

context "without an unknown reason" do
let(:data) do
{ "VACCINATED" => "N", "REASON_NOT_VACCINATED" => "Unknown" }
end

it { expect(immunisation_import_row).to be_invalid }
end

context "with a reason" do
let(:data) do
{ "VACCINATED" => "N", "REASON_NOT_VACCINATED" => "Did Not Attend" }
end

it { should eq(:absent_from_session) }
end
end

describe "#delivery_method" do
subject(:delivery_method) { immunisation_import_row.delivery_method }

Expand Down