(patient, importer)
return case_name, fields_to_update
Returns case name and dictionary of case properties to update

    Raises ConfigurationError if a value cannot be deserialized using
    the data types given in a column mapping.
Returns case name and dictionary of case properties to update
Returns case name and dictionary of case properties to update
def get_case_properties(patient, importer):
    """
    Returns case name and dictionary of case properties to update

    Raises ConfigurationError if a value cannot be deserialized using
    the data types given in a column mapping.
    """
    name_columns = importer.name_columns.split(' ')
    case_name = ' '.join([patient[column] for column in name_columns])
    errors = []
    fields_to_update = {}
    tz = importer.get_timezone()
    for mapping in importer.column_map:
        value = patient[mapping.column]
        try:
            fields_to_update[mapping.property] = deserialize(mapping, value, tz)
        except (TypeError, ValueError) as err:
            errors.append(
                f'Unable to deserialize value {repr(value)} '
                f'in column "{mapping.column}" for case property '
                f'"{mapping.property}". OpenMRS data type is given as '
                f'"{mapping.data_type}". CommCare data type is given as '
                f'"{mapping.commcare_data_type}": {err}'
            )
    if errors:
        raise ConfigurationError(
            f'Errors importing from {importer}:\n' + '\n'.join(errors)
        )
    return case_name, fields_to_update
def get_case_properties ( patient , importer ) : name_columns = importer . name_columns . split ( ' ' ) case_name = ' ' . join ( [ patient [ column ] for column in name_columns ] ) errors = [ ] fields_to_update = { } tz = importer . get_timezone ( ) for mapping in importer . column_map : value = patient [ mapping . column ] try : fields_to_update [ mapping . property ] = deserialize ( mapping , value , tz ) except ( TypeError , ValueError ) as err : errors . append ( f'Unable to deserialize value {repr(value)} ' f'in column "{mapping.column}" for case property ' f'"{mapping.property}". OpenMRS data type is given as ' f'"{mapping.data_type}". CommCare data type is given as ' f'"{mapping.commcare_data_type}": {err}' ) if errors : raise ConfigurationError ( f'Errors importing from {importer}:\n' + '\n' . join ( errors ) ) return case_name , fields_to_update