{{extend 'db_layout.html'}} {{import vidjil_utils}} {{total_file_count = 0 ; total_size = 0}}

search
{{if isAdmin:}} {{pass}} {{if isAdmin:}} {{pass}} {{for row in query :}} {{if isAdmin:}} {{pass}} {{if isAdmin:}} {{pass}} {{ total_file_count += row['file_count'] ; total_size += row['size'] }} {{if isAdmin:}} {{else:}} {{pass}} {{if row['has_permission']:}} {{else:}} {{pass}} {{pass}}
name birth info results groups creator files
{{ patient_name = vidjil_utils.anon_names(row['id'], row['first_name'], row['last_name'], row['anon_allowed'])}} {{= patient_name}} {{ if row['birth'] is not None: }} {{=row['birth'] }} {{ pass }} {{=row['info'] }} {{ configs = [] }} {{for conf in row['conf_list'] :}} {{filename = patient_name + " (" + conf['name'] + ")"}} {{if conf['fused_file'] is not None :}} {{ configs.append(str(A(conf['name'], _href="index.html?patient=" + str(row['id']) + "&config=" + str(conf['id']), _type="text/html", _onclick="event.preventDefault();event.stopPropagation();if( event.which == 2 ) { window.open(this.href); } else { db.load_data( { 'patient' : '" + str(row['id']) + "' , 'config' : " + str(conf['id']) + " }, '" + filename + "' ); }"))) }} {{else:}} {{ configs.append(conf['name']) }} {{pass}} {{pass}} {{= XML(", ".join(configs)) }} {{=row['groups']}} {{=row['creator']}} {{=row['file_count']}} ({{=vidjil_utils.format_size(row['size'])}})
{{if auth.can_create_patient():}} + new patient compare samples/patients {{else:}} {{pass}}

{{ =len(query) }} patients, {{ =total_file_count }} files ({{ =vidjil_utils.format_size(total_size) }})