(params, location=None)
return parsed
Inserts date and OpenMRS location UUID into report params
Inserts date and OpenMRS location UUID into report params
Inserts date and OpenMRS location UUID into report params
def parse_params(params, location=None):
    """
    Inserts date and OpenMRS location UUID into report params
    """
    today = datetime.today().strftime('%Y-%m-%d')
    location_uuid = location.metadata[LOCATION_OPENMRS] if location else None

    parsed = {}
    for key, value in params.items():
        if isinstance(value, str) and '{{' in value:
            template = Template(value)
            value = template.render(today=today, location=location_uuid)
        parsed[key] = value
    return parsed
def parse_params ( params , location = None ) : today = datetime . today ( ) . strftime ( '%Y-%m-%d' ) location_uuid = location . metadata [ LOCATION_OPENMRS ] if location else None parsed = { } for key , value in params . items ( ) : if isinstance ( value , str ) and '{{' in value : template = Template ( value ) value = template . render ( today = today , location = location_uuid ) parsed [ key ] = value return parsed