summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordeva <deva>2011-03-30 12:59:13 +0000
committerdeva <deva>2011-03-30 12:59:13 +0000
commit7c94eb6c877d5c1613a968f344ae42cc6d2c6735 (patch)
tree1a5133ca519430735dd480d6ae7b238e4867db42
parentd7044d310387d3752774831c1a8a768c0ca1ed67 (diff)
Temporarily revert multiuser journal commits.
-rw-r--r--server/src/journal_uploadserver.cc33
1 files changed, 31 insertions, 2 deletions
diff --git a/server/src/journal_uploadserver.cc b/server/src/journal_uploadserver.cc
index 8bc6e2d..06882b5 100644
--- a/server/src/journal_uploadserver.cc
+++ b/server/src/journal_uploadserver.cc
@@ -29,6 +29,8 @@
#include "journal_commit.h"
+//#define USE_MULTIPLE_USERS
+
static inline bool iswhitespace(char c)
{
return c == ' ' || c == '\n' || c == '\t' || c == '\r';
@@ -162,6 +164,7 @@ JournalUploadServer::JournalUploadServer(std::string host,
void JournalUploadServer::commit()
{
+#ifdef USE_MULTIPLE_USERS
std::string resume;
std::string olduser;
@@ -174,7 +177,6 @@ void JournalUploadServer::commit()
}
if(i->second.user != olduser && olduser != "" && resume != "") {
- // Connect to praxisuploadserver and commit all resumes in one bulk.
journal_commit(patientID().c_str(), olduser.c_str(),
host.c_str(), port,
resume.c_str(), resume.size());
@@ -191,10 +193,37 @@ void JournalUploadServer::commit()
if(resume == "") return;
- // Connect to praxisuploadserver and commit all resumes in one bulk.
journal_commit(patientID().c_str(), olduser.c_str(),
host.c_str(), port,
resume.c_str(), resume.size());
+#else
+ std::string resume;
+ std::string user;
+
+ // Iterate through all resumes, and create a string containing them all.
+ std::map< int, ResumeEntry >::iterator i = entrylist.begin();
+ while(i != entrylist.end()) {
+ if(i->second.dirty) {
+ i++;
+ continue;
+ }
+
+ if(user == "") {
+ user = i->second.user;
+ }
+
+ if(resume != "") resume += "\n\n";
+ resume += stripTrailingWhitepace(addNewlines(i->second.resume, 60));
+ i++;
+ }
+
+ if(resume == "") return;
+
+ // Connect to praxisuploadserver and commit all resumes in one bulk.
+ journal_commit(patientID().c_str(), user.c_str(),
+ host.c_str(), port,
+ resume.c_str(), resume.size());
+#endif/*USE_MULTIPLE_USERS*/
}