Commit 50578219 authored by Ryan Herbert's avatar Ryan Herbert
Browse files

default.py, export.js generic sample_name

patient name and run name were separate in the model, however run name
was never included into reports. Switching to a more generic model is
not only cleaner but also allows run names to be included in reports
without any extra code.
parent 1bc25c26
......@@ -151,8 +151,8 @@ Report.prototype = {
this.w = window.open("report.html", "_blank", "selected=0, toolbar=yes, scrollbars=yes, resizable=yes");
var text = "contamination report: "
if (typeof this.m.patient_name != 'undefined')
text += this.m.patient_name
if (typeof this.m.sample_name != 'undefined')
text += this.m.sample_name
this.w.onload = function(){
self.w.document.title = text
......@@ -182,8 +182,8 @@ Report.prototype = {
date_min = this.m.dateMin()
date_max = this.m.dateMax()
if (typeof this.m.patient_name != 'undefined')
text += this.m.patient_name
if (typeof this.m.sample_name != 'undefined')
text += this.m.sample_name
else
text += this.m.dataFileName
if (date_max != "0" && date_min != "0")
......@@ -219,8 +219,8 @@ Report.prototype = {
this.w = window.open("report.html", "_blank", "selected=0, toolbar=yes, scrollbars=yes, resizable=yes");
var text = ""
if (typeof this.m.patient_name != 'undefined')
text += this.m.patient_name
if (typeof this.m.sample_name != 'undefined')
text += this.m.sample_name
else
text += this.m.dataFileName
text += ""+ this.m.getStrTime(this.m.t, "name")
......
......@@ -337,7 +337,7 @@ def get_data():
data["dataFileName"] = patient_name + " (" + config_name + ")"
data["info"] = db.patient[row.id].info
data["patient_id"] = row.id
data["patient_name"] = patient_name
data["sample_name"] = patient_name
if (sample_set.sample_type == "run") :
for row in db( db.run.sample_set_id == request.vars["sample_set_id"] ).select() :
......@@ -346,7 +346,7 @@ def get_data():
data["dataFileName"] = run_name + " (" + config_name + ")"
data["info"] = db.run[row.id].info
data["run_id"] = row.id
data["run_name"] = run_name
data["sample_name"] = run_name
log_query = db( ( db.user_log.record_id == log_reference_id )
& ( db.user_log.table_name == sample_set.sample_type )
......@@ -383,9 +383,8 @@ def get_data():
data["samples"]["db_key"] = []
data["samples"]["id"] = []
data["samples"]["patient_id"] = []
data["samples"]["patient_name"] = []
data["samples"]["sample_name"] = []
data["samples"]["run_id"] = []
data["samples"]["run_name"] = []
for i in range(len(data["samples"]["original_names"])) :
o_n = data["samples"]["original_names"][i].split('/')[-1]
data["samples"]["original_names"][i] = data["samples"]["original_names"][i].split('/')[-1]
......@@ -401,9 +400,8 @@ def get_data():
data["samples"]["names"].append(row.sequence_file.filename.split('.')[0])
data["samples"]["id"].append(row.sequence_file.id)
data["samples"]["patient_id"].append(get_patient_id(row.sequence_file.id))
data["samples"]["patient_name"].append(row.sequence_file.id)
data["samples"]["sample_name"].append(row.sequence_file.id)
data["samples"]["run_id"].append(row.sequence_file.id)
data["samples"]["run_name"].append(row.sequence_file.id)
else :
data["samples"]["info"].append("this file has been deleted from the database, info relative to this sample are no longer available")
data["samples"]["timestamp"].append("None")
......@@ -457,7 +455,7 @@ def get_custom_data():
return error_message(str(error))
generic_info = "Compare sample sets"
data["patient_name"] = generic_info
data["sample_name"] = generic_info
data["dataFileName"] = generic_info
data["info"] = generic_info
data["samples"]["original_names"] = []
......
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