diff options
author | deva <deva> | 2009-11-12 12:02:41 +0000 |
---|---|---|
committer | deva <deva> | 2009-11-12 12:02:41 +0000 |
commit | ef8ca720c38d91e9892eb3ed85f4b7d459d43b83 (patch) | |
tree | 508aed30eda43272ccb35986f380ed1bf073567d /server | |
parent | 93500a9656dffde57ab32410642c2dd74098b9f8 (diff) |
Fixed missing macro check.
Diffstat (limited to 'server')
-rw-r--r-- | server/src/pracrodaotest.cc | 5 |
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 |