summaryrefslogtreecommitdiff
path: root/server/src/database.h
diff options
context:
space:
mode:
authordeva <deva>2009-02-19 15:21:48 +0000
committerdeva <deva>2009-02-19 15:21:48 +0000
commitc6a870af7ee34c66e82202a67ce93dab45f74948 (patch)
tree970c412dd0e968fddea58b4d6e83f67e417be39c /server/src/database.h
parent9d8fe5f651d6f907e2fbc88f8976d96c8a90f3e4 (diff)
Renamed cpr to patientid
Diffstat (limited to 'server/src/database.h')
-rw-r--r--server/src/database.h24
1 files changed, 12 insertions, 12 deletions
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 &macro, 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 &macro, 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 &macro, 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 &macro, 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, &macro, fn, oldest);
+ Values v = dao->getLatestValues(patientid, &macro, fn, oldest);
Values::iterator i = v.find("journal.resume");
if(i != v.end()) return i->second.value;
else return "";