|
|
@ -123,9 +123,9 @@ module Imports |
|
|
|
attributes["rp_hardship"] = unsafe_string_as_integer(xml_doc, "Q14b4").present? ? 1 : nil |
|
|
|
attributes["rp_hardship"] = unsafe_string_as_integer(xml_doc, "Q14b4").present? ? 1 : nil |
|
|
|
attributes["rp_dontknow"] = unsafe_string_as_integer(xml_doc, "Q14b5").present? ? 1 : nil |
|
|
|
attributes["rp_dontknow"] = unsafe_string_as_integer(xml_doc, "Q14b5").present? ? 1 : nil |
|
|
|
|
|
|
|
|
|
|
|
attributes["cbl"] = unsafe_string_as_integer(xml_doc, "Q15CBL").present? ? 1 : nil |
|
|
|
attributes["cbl"] = allocation_system(unsafe_string_as_integer(xml_doc, "Q15CBL")) |
|
|
|
attributes["chr"] = unsafe_string_as_integer(xml_doc, "Q15CHR").present? ? 1 : nil |
|
|
|
attributes["chr"] = allocation_system(unsafe_string_as_integer(xml_doc, "Q15CHR")) |
|
|
|
attributes["cap"] = unsafe_string_as_integer(xml_doc, "Q15CAP").present? ? 1 : nil |
|
|
|
attributes["cap"] = allocation_system(unsafe_string_as_integer(xml_doc, "Q15CAP")) |
|
|
|
|
|
|
|
|
|
|
|
attributes["referral"] = unsafe_string_as_integer(xml_doc, "Q16") |
|
|
|
attributes["referral"] = unsafe_string_as_integer(xml_doc, "Q16") |
|
|
|
attributes["period"] = unsafe_string_as_integer(xml_doc, "Q17") |
|
|
|
attributes["period"] = unsafe_string_as_integer(xml_doc, "Q17") |
|
|
@ -553,6 +553,15 @@ module Imports |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def allocation_system(value) |
|
|
|
|
|
|
|
case value |
|
|
|
|
|
|
|
when 1 |
|
|
|
|
|
|
|
1 |
|
|
|
|
|
|
|
when 2 |
|
|
|
|
|
|
|
0 |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def apply_date_consistency!(attributes) |
|
|
|
def apply_date_consistency!(attributes) |
|
|
|
return if attributes["voiddate"].nil? || attributes["startdate"].nil? |
|
|
|
return if attributes["voiddate"].nil? || attributes["startdate"].nil? |
|
|
|
|
|
|
|
|
|
|
|