From c6a870af7ee34c66e82202a67ce93dab45f74948 Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 19 Feb 2009 15:21:48 +0000 Subject: Renamed cpr to patientid --- server/src/database.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'server/src/database.h') diff --git a/server/src/database.h b/server/src/database.h index a5bed81..5a82d67 100644 --- a/server/src/database.h +++ b/server/src/database.h @@ -41,32 +41,32 @@ public: ~Database(); // Make a commit to the db - void commitTransaction(std::string user, std::string cpr, Macro ¯o, Fields &fields, time_t now = time(NULL)) { - PRACRO_DEBUG(db, "%s, %s, %s,...\n", user.c_str(), cpr.c_str(), macro.attributes["name"].c_str()); - if(dao) dao->commitTransaction(user, cpr, macro, fields, now); + void commitTransaction(std::string user, std::string patientid, Macro ¯o, Fields &fields, time_t now = time(NULL)) { + PRACRO_DEBUG(db, "%s, %s, %s,...\n", user.c_str(), patientid.c_str(), macro.attributes["name"].c_str()); + if(dao) dao->commitTransaction(user, patientid, macro, fields, now); } // Get a list of values from the db - Values getValues(std::string cpr, Fieldnames &fieldnames, time_t oldest = 0) { - PRACRO_DEBUG(db, "%s, <%u fieldnames>, %ld\n", cpr.c_str(), fieldnames.size(), oldest); - if(dao) return dao->getLatestValues(cpr, NULL, fieldnames, oldest); + Values getValues(std::string patientid, Fieldnames &fieldnames, time_t oldest = 0) { + PRACRO_DEBUG(db, "%s, <%u fieldnames>, %ld\n", patientid.c_str(), fieldnames.size(), oldest); + if(dao) return dao->getLatestValues(patientid, NULL, fieldnames, oldest); else return Values(); } // Check if a macro has been committed. - bool checkMacro(std::string cpr, std::string macro, time_t oldest = 0) { - PRACRO_DEBUG(db, "%s, %s, %ld\n", cpr.c_str(), macro.c_str(), oldest); + bool checkMacro(std::string patientid, std::string macro, time_t oldest = 0) { + PRACRO_DEBUG(db, "%s, %s, %ld\n", patientid.c_str(), macro.c_str(), oldest); if(!dao) return false; - return dao->nrOfCommits(cpr, macro, oldest) > 0; + return dao->nrOfCommits(patientid, macro, oldest) > 0; } // Get latest resume of a given macro - std::string getResume(std::string cpr, Macro ¯o, time_t oldest) { - PRACRO_DEBUG(db, "%s, %s, %ld\n", cpr.c_str(), macro.attributes["name"].c_str(), oldest); + std::string getResume(std::string patientid, Macro ¯o, time_t oldest) { + PRACRO_DEBUG(db, "%s, %s, %ld\n", patientid.c_str(), macro.attributes["name"].c_str(), oldest); if(!dao) return ""; Fieldnames fn; fn.push_back("journal.resume"); - Values v = dao->getLatestValues(cpr, ¯o, fn, oldest); + Values v = dao->getLatestValues(patientid, ¯o, fn, oldest); Values::iterator i = v.find("journal.resume"); if(i != v.end()) return i->second.value; else return ""; -- cgit v1.2.3