Skip to content

Commit 4d88a6c

Browse files
Overwrite incoming address if matching postcode, and any incoming address field is present
1 parent 5703073 commit 4d88a6c

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

app/models/patient_import_row.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,7 @@ def nhs_number_value
207207

208208
def auto_overwrite_address?(existing_patient)
209209
existing_patient.address_postcode == address_postcode&.to_postcode &&
210-
existing_patient.address_line_1.blank? &&
211-
existing_patient.address_line_2.blank? &&
212-
existing_patient.address_town.blank?
210+
[address_line_1, address_line_2, address_town].any?(&:present?)
213211
end
214212

215213
def parent_1_exists?

0 commit comments

Comments
 (0)