(freq, props=[], suppress_errors=False)
For a given set of properties, (dot_a_one, etc...)

    return the comma separated string of the regimen frequency/dose times
    morning,noon,evening...etc
For a given set of properties, (dot_a_one, etc...)
For a given set of properties ( dot_a_one etc ... )
def string_from_regimen_props(freq, props=[], suppress_errors=False):
    """
    For a given set of properties, (dot_a_one, etc...)

    return the comma separated string of the regimen frequency/dose times
    morning,noon,evening...etc
    """
    str_props = []
    for prop in props:
        if prop == "" or prop is None:
            break
        str_props.append(DAY_SLOTS_BY_IDX[prop])

    if len(str_props) == freq:
        return ','.join(str_props)
    else:
        message = "Error, frequency %d given does not match properties %s" % (freq, props)
        if suppress_errors:
            return message
        else:
            raise Exception(message)
def string_from_regimen_props ( freq , props = [ ] , suppress_errors = False ) : str_props = [ ] for prop in props : if prop == "" or prop is None : break str_props . append ( DAY_SLOTS_BY_IDX [ prop ] ) if len ( str_props ) == freq : return ',' . join ( str_props ) else : message = "Error, frequency %d given does not match properties %s" % ( freq , props ) if suppress_errors : return message else : raise Exception ( message )