|
|
|
@ -97,7 +97,7 @@ module Imports |
|
|
|
attributes["pregla"] = 1 if string_or_nil(xml_doc, "PREGLA") == "Yes" |
|
|
|
attributes["pregla"] = 1 if string_or_nil(xml_doc, "PREGLA") == "Yes" |
|
|
|
attributes["pregghb"] = 1 if string_or_nil(xml_doc, "PREGHBA") == "Yes" |
|
|
|
attributes["pregghb"] = 1 if string_or_nil(xml_doc, "PREGHBA") == "Yes" |
|
|
|
attributes["pregother"] = 1 if string_or_nil(xml_doc, "PREGOTHER") == "Yes" |
|
|
|
attributes["pregother"] = 1 if string_or_nil(xml_doc, "PREGOTHER") == "Yes" |
|
|
|
attributes["ppostcode_full"] = compose_postcode(xml_doc, "PPOSTC1", "PPOSTC2") |
|
|
|
attributes["ppostcode_full"] = parse_postcode(string_or_nil(xml_doc, "Q7Postcode")) |
|
|
|
attributes["prevloc"] = string_or_nil(xml_doc, "Q7ONSLACode") |
|
|
|
attributes["prevloc"] = string_or_nil(xml_doc, "Q7ONSLACode") |
|
|
|
attributes["ppcodenk"] = previous_postcode_known(xml_doc, attributes["ppostcode_full"], attributes["prevloc"]) # Q7UNKNOWNPOSTCODE check mapping |
|
|
|
attributes["ppcodenk"] = previous_postcode_known(xml_doc, attributes["ppostcode_full"], attributes["prevloc"]) # Q7UNKNOWNPOSTCODE check mapping |
|
|
|
attributes["ppostc1"] = string_or_nil(xml_doc, "PPOSTC1") |
|
|
|
attributes["ppostc1"] = string_or_nil(xml_doc, "PPOSTC1") |
|
|
|
@ -124,7 +124,7 @@ module Imports |
|
|
|
attributes["mortgagelenderother"] = mortgage_lender_other(xml_doc, attributes) |
|
|
|
attributes["mortgagelenderother"] = mortgage_lender_other(xml_doc, attributes) |
|
|
|
attributes["pcode1"] = string_or_nil(xml_doc, "PCODE1") |
|
|
|
attributes["pcode1"] = string_or_nil(xml_doc, "PCODE1") |
|
|
|
attributes["pcode2"] = string_or_nil(xml_doc, "PCODE2") |
|
|
|
attributes["pcode2"] = string_or_nil(xml_doc, "PCODE2") |
|
|
|
attributes["postcode_full"] = compose_postcode(xml_doc, "PCODE1", "PCODE2") |
|
|
|
attributes["postcode_full"] = parse_postcode(string_or_nil(xml_doc, "Q14Postcode")) |
|
|
|
attributes["pcodenk"] = 0 if attributes["postcode_full"].present? # known if given |
|
|
|
attributes["pcodenk"] = 0 if attributes["postcode_full"].present? # known if given |
|
|
|
attributes["soctenant"] = soctenant(attributes) |
|
|
|
attributes["soctenant"] = soctenant(attributes) |
|
|
|
attributes["ethnic_group2"] = nil # 23/24 variable |
|
|
|
attributes["ethnic_group2"] = nil # 23/24 variable |
|
|
|
@ -442,6 +442,12 @@ module Imports |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def parse_postcode(postcode) |
|
|
|
|
|
|
|
return if postcode.blank? |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UKPostcode.parse(postcode).to_s |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def set_default_values(attributes) |
|
|
|
def set_default_values(attributes) |
|
|
|
attributes["armedforcesspouse"] ||= 7 |
|
|
|
attributes["armedforcesspouse"] ||= 7 |
|
|
|
attributes["hhregres"] ||= 8 |
|
|
|
attributes["hhregres"] ||= 8 |
|
|
|
|