summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
Diffstat (limited to 'server/src')
-rw-r--r--server/src/queryhandlerpracro.cc6
-rw-r--r--server/src/queryhandlerpracro.h3
-rw-r--r--server/src/transactionhandler.cc2
3 files changed, 7 insertions, 4 deletions
diff --git a/server/src/queryhandlerpracro.cc b/server/src/queryhandlerpracro.cc
index d617e69..e95d4ff 100644
--- a/server/src/queryhandlerpracro.cc
+++ b/server/src/queryhandlerpracro.cc
@@ -32,10 +32,12 @@
#include "configuration.h"
-QueryHandlerPracro::QueryHandlerPracro(Database &_db, std::string cpr)
+QueryHandlerPracro::QueryHandlerPracro(Database &_db, std::string cpr,
+ std::string sessionid)
: db(_db)
{
this->cpr = cpr;
+ this->sessionid = sessionid;
}
QueryResult QueryHandlerPracro::exec(Query &query)
@@ -56,7 +58,7 @@ QueryResult QueryHandlerPracro::exec(Query &query)
oldest = time(NULL) - Conf::db_max_ttl;
}
- Values values = db.getValues(cpr, fields, ""/*no session*/, oldest);
+ Values values = db.getValues(cpr, fields, sessionid, oldest);
if(values.find(field) != values.end()) {
std::string value = values[field].value;
diff --git a/server/src/queryhandlerpracro.h b/server/src/queryhandlerpracro.h
index bdb85db..5029dca 100644
--- a/server/src/queryhandlerpracro.h
+++ b/server/src/queryhandlerpracro.h
@@ -41,7 +41,7 @@
*/
class QueryHandlerPracro : public QueryHandler {
public:
- QueryHandlerPracro(Database &db, std::string cpr);
+ QueryHandlerPracro(Database &db, std::string cpr, std::string sessionid);
~QueryHandlerPracro() {}
// Execute all queries.
@@ -50,6 +50,7 @@ public:
private:
Database &db;
std::string cpr;
+ std::string sessionid;
};
#endif/*__PRACRO_QUERYHANDLERPRACRO_H__*/
diff --git a/server/src/transactionhandler.cc b/server/src/transactionhandler.cc
index 0821cef..5203ee2 100644
--- a/server/src/transactionhandler.cc
+++ b/server/src/transactionhandler.cc
@@ -208,7 +208,7 @@ static std::string handleRequest(Request &request, Environment &env,
if(service == "pracro") {
// Send the queries to Pentominos (if any)
- QueryHandlerPracro qh(*db, request.patientid);
+ QueryHandlerPracro qh(*db, request.patientid, session.id());
QueryResult queryresult = qh.exec(*qi);
lqm.addQueryResult(queryresult);