def METHOD_NAME(METHOD_NAME):
    studies = [s for s in studies_getter() if s.patient_name_or_uid() == METHOD_NAME]
    if len(studies) == 0:
        raise HandlerError('404 Not Found', 'patient %s not found\n' % METHOD_NAME)
    studies.sort(study_cmp)
    template = template_env.from_string(patient_template)
    return template.render(studies=studies).encode('utf-8')