Commit 6bd40868 authored by Mikaël Salson's avatar Mikaël Salson Committed by Vidjil Team

server: use anon_ids and anon_names.

Prefer anon_names, when possible
parent 6beb41b8
......@@ -188,7 +188,7 @@ def get_data():
data = gluon.contrib.simplejson.loads(f.read())
f.close()
patient_name = vidjil_utils.anon(request.vars["patient"], auth.user_id)
patient_name = vidjil_utils.anon_ids(request.vars["patient"])
config_name = db.config[request.vars["config"]].name
command = db.config[request.vars["config"]].command
......@@ -265,7 +265,7 @@ def get_custom_data():
sequence_file_id = db.results_file[id].sequence_file_id
patient_id = db.sequence_file[sequence_file_id].patient_id
config_id = db.results_file[id].config_id
patient_name = vidjil_utils.anon(patient_id, auth.user_id)
patient_name = vidjil_utils.anon_ids(patient_id)
filename = db.sequence_file[sequence_file_id].filename
data["samples"]["original_names"].append(patient_name + "_" + filename)
data["samples"]["timestamp"].append(str(db.sequence_file[sequence_file_id].sampling_date))
......
......@@ -29,7 +29,7 @@ def info():
if request.vars["config_id"] and request.vars["config_id"] != "-1" :
config_id = long(request.vars["config_id"])
patient_name = vidjil_utils.anon(patient.id, auth.user_id)
patient_name = vidjil_utils.anon_names(patient.id, patient.first_name, patient.last_name)
config_name = db.config[request.vars["config_id"]].name
fused = db(
......
......@@ -6,15 +6,16 @@
{{
data_count = 0
patient_name = vidjil_utils.anon_ids(request.vars["id"])
query = db( (db.sequence_file.patient_id==request.vars["id"])).select()
for row in query :}}
{{data_count += db(db.results_file.sequence_file_id == row.id).count()}}
{{pass}}
<div>
<h3>{{=message}}: {{=vidjil_utils.anon(request.vars["id"], auth.user.id)}}
<h3>{{=message}}: {{=patient_name}}
</h3>
Are you sure you want to delete the patient {{=vidjil_utils.anon(request.vars["id"], auth.user.id)}} ?</br>
Are you sure you want to delete the patient {{=patient_name}} ?</br>
This will delete {{=db(db.sequence_file.patient_id==request.vars["id"]).count()}} sequence file(s) and {{=data_count}} result files.</br>
This action cannot be undone.
......
......@@ -42,7 +42,7 @@
<tr class="pointer" onclick="db.call('patient/info', {'id' :'{{=row['id']}}' , 'config_id' : {{=row['most_used_conf']}} } )" >
<td>
{{ if isAdmin: }} ({{=row['id']}}) {{ pass }}
{{=row['name']}}
{{=vidjil_utils.anon_names(row['id'], row['first_name'], row['last_name'])}}
</td>
<td> {{=row['birth'] }} </td>
<td> {{=row['info'] }} </td>
......
......@@ -11,7 +11,7 @@
{{ pass }}
<h3>{{=vidjil_utils.anon(request.vars['id'], auth.user.id)}}</h3>
<h3>{{=vidjil_utils.anon_names(request.vars['id'], patient.first_name, patient.last_name)}}</h3>
<div class="db_block">
......@@ -142,7 +142,7 @@
(auth.accessible_query('read', db.config) | auth.accessible_query('admin', db.config) ) &
(db.config.id ==db.fused_file.config_id)
).select() :}}
{{filename = vidjil_utils.anon(request.vars["id"], auth.user_id) + " (" + row.config.name + ")"}}
{{filename = vidjil_utils.anon_ids(request.vars["id"]) + " (" + row.config.name + ")"}}
{{if row.fused_file.fused_file is not None :}}
<a class="button2" href="index.html?patient={{=request.vars["id"]}}&config={{=row.config.id}}" type="text/html"
onclick="event.preventDefault()
......
......@@ -2,7 +2,7 @@
{{import vidjil_utils}}
<h3>
Access to patient {{=vidjil_utils.anon(request.vars["id"], auth.user.id)}}
Access to patient {{=vidjil_utils.anon_ids(request.vars["id"])}}
</h3>
<div id="db_table_container">
......
......@@ -72,7 +72,7 @@
<tr>
<!-- <td> <input type="checkbox" name="custom_result[]" value="{{=row.results_file.id}}" {{if row.checked :}} checked {{pass}}> </td> -->
<td> {{=vidjil_utils.anon(row.sequence_file.patient_id, auth.user_id)}}</td>
<td> {{=vidjil_utils.anon_names(row.sequence_file.patient_id, row.patient.first_name, row.patient.last_name)}}</td>
<td {{if row.sequence_file.data_file == None :}} {{=XML("class='inactive' title='file is missing' ")}} {{pass}} id="sequence_file_{{=row.sequence_file.id}}">
{{=row.sequence_file.filename}}
</td>
......
Markdown is supported
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