diff options
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 |