Commit 5047ff3b authored by HERBERT Ryan's avatar HERBERT Ryan Committed by Vidjil Team

builder.js database.js contraollers/default.py patient_info save

Added a save button and save mechanism to javascript for saving patient
info
parent aa7b73cf
......@@ -566,6 +566,7 @@ Builder.prototype = {
build_top_container: function () {
var parent = document.getElementById("top_filename");
var self = this;
parent.innerHTML = "";
var div_data_file = document.createElement('div');
//div_data_file.id = "info_data_file"
......@@ -574,6 +575,10 @@ Builder.prototype = {
parent.appendChild(div_data_file)
var div_patient_info = this.create_info_container(this.m.info, 'div', 'input', 'patient_info', 'patient_info_text');
var save_patient_info = this.create_save_button('save_info button', function(){
self.db.save_patient_info(self.m.patient, $('.patient_info_text').val());
});
div_patient_info.appendChild(save_patient_info);
parent.appendChild(div_patient_info)
},
......
......@@ -826,6 +826,14 @@ Database.prototype = {
this.request('file/save_info', {id: database_id, info: info});
},
save_patient_info: function (patient_id, info) {
self.m.info = info;
var database_id = self.m.patient_id;
this.request('patient/save_info', {id: database_id, info: info});
},
// Log functions, to server
// 'quiet' is set to true to avoid infinite loops with timeouts
......
......@@ -205,6 +205,7 @@ def get_data():
config_name = db.config[request.vars["config"]].name
command = db.config[request.vars["config"]].command
data["patient_id"] = request.vars["patient"]
data["patient_name"] = patient_name
data["config_name"] = config_name
data["dataFileName"] = patient_name + " (" + config_name + ")"
......
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