summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
authordeva <deva>2009-11-12 12:02:41 +0000
committerdeva <deva>2009-11-12 12:02:41 +0000
commitef8ca720c38d91e9892eb3ed85f4b7d459d43b83 (patch)
tree508aed30eda43272ccb35986f380ed1bf073567d /server/src
parent93500a9656dffde57ab32410642c2dd74098b9f8 (diff)
Fixed missing macro check.
Diffstat (limited to 'server/src')
-rw-r--r--server/src/pracrodaotest.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/src/pracrodaotest.cc b/server/src/pracrodaotest.cc
index d6a0e1f..86e5941 100644
--- a/server/src/pracrodaotest.cc
+++ b/server/src/pracrodaotest.cc
@@ -106,9 +106,10 @@ void PracroDAOTest::commitTransaction(std::string user, std::string patientid,
Values PracroDAOTest::getLatestValues(std::string patientid, Macro *macro,
Fieldnames &fieldnames, time_t oldest)
{
+ std::string macro_name = macro ? macro->attributes["name"].c_str() : "(null)";
PRACRO_DEBUG(db, "(%s, %s, <%u fieldnames>, %ld)\n",
patientid.c_str(),
- macro ? macro->attributes["name"].c_str() : "(null)", fieldnames.size(),
+ macro_name.c_str(), fieldnames.size(),
oldest);
Values values;
@@ -124,7 +125,7 @@ Values PracroDAOTest::getLatestValues(std::string patientid, Macro *macro,
while(ti != data.transactions.end()) {
std::map<std::string, std::string> &transaction = *ti;
time_t timestamp = atol(transaction["timestamp"].c_str());
- if(transaction["patientid"] == patientid && timestamp >= oldest) {
+ if(transaction["patientid"] == patientid && timestamp >= oldest && (transaction["macro"] == macro_name || macro == NULL)) {
std::string tid = transaction["uid"];
// Find transaction values