Commit 8c26aa48 authored by Mathieu Giraud's avatar Mathieu Giraud Committed by Vidjil Team
Browse files

controllers/patient.py: patient/stats, remove empty columns

parent 17f07c6a
......@@ -201,7 +201,7 @@ def stats():
keys += r.groupindex.keys()
keys += sorted(json_paths.keys())
d['stats'] = keys
found = {}
for row in d['query']:
results_f = row.results_file.data_file
......@@ -217,11 +217,19 @@ def stats():
for key in keys:
if key in row_result:
row[key] = row_result[key]
found[key] = True
elif key in row_fused:
row[key] = row_fused[key]
found[key] = True
else:
row[key] = ''
# Keep only non-empty columns
d['stats'] = []
for key in keys:
if key in found:
d['stats'] += [key]
log.debug("patient/stats (%.3fs)" % (time.time()-start))
return d
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment