def parse_deceased_field_common(split_deceased_field, fleg): """ Parse the deceased field. :param list split_deceased_field: [description] :param dict fleg: a dictionary containing First, Last, Ethnicity, Gender fields :return: a dictionary representing the deceased field. :rtype: dict """ # Populate FLEG. d = parse_fleg(fleg) # Extract and clean up DOB. raw_dob = split_deceased_field[-1].strip() dob_guess = date_utils.parse_date(raw_dob) d[Fields.DOB] = date_utils.check_dob(dob_guess) return d
def test_check_dob_00(date, expected): """Ensure a DOB is valid.""" assert date_utils.check_dob(date) == expected