def omrs_datetime_to_date(value):
    """
    Converts an OpenMRS datetime to a CommCare date

    >>> omrs_datetime_to_date('2017-06-27T00:00:00.000+0000') == '2017-06-27'
    True

    """
    if value and 'T' in value:
        return value.split('T')[0]
    return value