def parse_record(parent_field, record):
    field_names = []
    field_values = []
    for name in record:
        if isinstance(record[name], dict):
            new_parent_field = parent_field.copy()
            new_parent_field.append(name)
            names = " ".join(new_parent_field)
            if "converted" in record[name]:
                field_names.append(names)
                field_values.append(record[name]["converted"])
            elif "raw" in record[name]:
                field_names.append(names)
                field_values.append(record[name]["raw"])
            else:
                # Must have subgroups:
                sub_names, sub_values = parse_record(new_parent_field, record[name])
                field_names.extend(sub_names)
                field_values.extend(sub_values)
        else:
            raise Exception("Unhandled parsing")

    return field_names, field_values