Commit 5d85e36b authored by HERBERT Ryan's avatar HERBERT Ryan
Browse files

modified the patient/custom page to allow comparison results for one patient....

modified the patient/custom page to allow comparison results for one patient. The page can now list the results history when viewing for a single patient
parent c45e6edb
......@@ -144,7 +144,24 @@ def custom():
request.vars["custom_list"] = [request.vars["custom_list"]]
q = ((auth.accessible_query('read', db.patient))
if request.vars["patient_id"]:
q = ((auth.accessible_query('read', db.patient))
& (auth.accessible_query('read', db.config))
& (db.patient.id==request.vars["patient_id"])
& (db.sequence_file.patient_id==db.patient.id)
& (db.results_file.sequence_file_id==db.sequence_file.id)
& (db.results_file.data_file != '')
& (db.config.id==db.results_file.config_id)
)
query = db(q).select(
db.patient.id, db.patient.info, db.patient.first_name, db.patient.last_name, db.results_file.id, db.results_file.config_id, db.sequence_file.sampling_date,
db.sequence_file.pcr, db.config.name, db.results_file.run_date, db.results_file.data_file, db.sequence_file.filename,
db.sequence_file.patient_id, db.sequence_file.data_file, db.sequence_file.id, db.sequence_file.info,
db.sequence_file.size_file,
orderby = ~db.sequence_file.patient_id|db.sequence_file.id|db.results_file.run_date
)
else:
q = ((auth.accessible_query('read', db.patient))
& (auth.accessible_query('read', db.config))
& (db.sequence_file.patient_id==db.patient.id)
& (db.results_file.sequence_file_id==db.sequence_file.id)
......@@ -152,7 +169,7 @@ def custom():
& (db.config.id==db.results_file.config_id)
)
query = db(q).select(
query = db(q).select(
db.patient.id, db.patient.info, db.patient.first_name, db.patient.last_name, db.results_file.id, db.results_file.config_id, db.sequence_file.sampling_date,
db.sequence_file.pcr, db.config.name, db.results_file.run_date, db.results_file.data_file, db.sequence_file.filename,
db.sequence_file.patient_id, db.sequence_file.data_file, db.sequence_file.id, db.sequence_file.info,
......
......@@ -5,7 +5,11 @@
<div>
<h3>Compare samples from different patients</h3>
{{ if request.vars['patient_id']: }}
<h3>Compare samples</h3>
{{ else: }}
<h3>Compare samples from different patients</h3>
{{pass}}
<p>Select up to 10 samples to be compared.</p>
......
......@@ -58,7 +58,6 @@
<td class="column_100">status</td>
<td class="column5"></td>
<td class="column5"></td>
<td class="column5"></td>
<td class="column4"></td>
</tr>
......@@ -106,14 +105,13 @@
type="application/octet-stream">dl</a>
{{pass}}
</td>
<td class="button" onclick="db.call('results_file/list', {'sequence_file_id': '{{=row.sequence_file.id}}', 'config_id': '{{=config_id}}' })">h</td>
{{if (auth.can_modify_patient(request.vars["id"]) and auth.can_process_file()):}}
<td class="pointer" onclick="db.call('results_file/confirm', {'results_file_id' :'{{=row.results_file.id}}'})" > X </td>
{{else:}}
<td></td>
{{pass}}
{{else:}}
<td></td><td></td><td></td><td></td>
<td></td><td></td><td></td>
{{pass}}
<td>
{{if row.sequence_file.data_file != None and ( row.results_file.id == None or ( status != "RUNNING" and status != "QUEUED" and status != "ASSIGNED") ):}}
......@@ -163,7 +161,7 @@
<span class="button2" onclick="db.call('file/add', { 'id' : '{{=request.vars["id"]}}' } )"> + add file </span>
{{pass}}
<span class="button2" onclick="db.call('patient/custom', {'patient_id': '{{=request.vars["id"]}}', 'filter': ''} )">Compare Samples for this patient</span>
</div>
......
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