{{extend 'db_layout.html'}} {{('message' in globals())}} {{if 'message' in globals():}} {{patient = db.patient[request.vars["id"]]}} {{if request.vars["config_id"] and not request.vars["config_id"] == -1 :}} {{config_id = long(request.vars["config_id"])}} {{config = True}} {{ patient_name = patient.first_name + " " + patient.last_name config_name = db.config[request.vars["config_id"]].name fused = db( (db.fused_file.patient_id == patient) & (db.fused_file.config_id == config_id) ) fused_count = fused.count() fused_file = fused.select() fused_filename = patient_name +"_"+ config_name + ".data" analysis = db( (db.analysis_file.patient_id == patient) & (db.analysis_file.config_id == config_id) ) analysis_count = analysis.count() analysis_file = analysis.select() analysis_filename = patient_name +"_"+ config_name + ".analysis" }} {{else:}} {{config_id = -1}} {{config = False}} {{fused_count = 0}} {{pass}} {{ query = db( (db.sequence_file.patient_id==db.patient.id) & (db.patient.id==request.vars["id"]) ).select( left=db.data_file.on( (db.data_file.sequence_file_id==db.sequence_file.id) & (db.data_file.config_id==str(config_id) ) ) ) }}

{{=patient.last_name + " " + patient.first_name}} ({{=request.vars["id"]}})

config
{{for row in query :}} {{if row.sequence_file.data_file is None :}} {{filename = ''}} {{else:}} {{(filename, str) = db.sequence_file.data_file.retrieve(row.sequence_file.data_file)}} {{pass}} {{if row.data_file.scheduler_task_id is None :}} {{status = '' }} {{else:}} {{status = db.scheduler_task[row.data_file.scheduler_task_id ].status }} {{pass}} {{pass}}
file name sampling date info last processing
{{=filename}} {{if filename != '':}}dl{{pass}} {{=row.sequence_file.sampling_date}} {{=row.sequence_file.info}} e X {{if row.data_file.run_date :}}{{=row.data_file.run_date }}{{pass}} {{if filename != '' and config_id != -1:}} {{if row.data_file.id == None or ( status != "RUNNING" and status != "QUEUED" and status != "ASSIGNED"):}} {{if auth.has_permission("run", "data_file") :}} run >> {{else:}} run >> {{pass}} {{else:}} {{=status}} {{pass}} {{pass}}
{{if auth.has_permission("upload", "sequence_file") :}} add file {{else:}} add file {{pass}}
result : {{for row in db(db.fused_file.patient_id == request.vars["id"]).select() :}} {{=db.config[row.config_id].name}} {{pass}}
{{if fused_count >0:}}
download {{=db.config[config_id].name}} .data {{if analysis_count >0:}} .analysis {{pass}}
{{pass}} {{elif 'content' in globals():}} {{=content}} {{else:}} {{=BEAUTIFY(response._vars)}} {{pass}}