summaryrefslogtreecommitdiff
path: root/server/src/pracrodaotest.cc
diff options
context:
space:
mode:
authordeva <deva>2011-01-14 10:23:38 +0000
committerdeva <deva>2011-01-14 10:23:38 +0000
commit7a8185affa101ba8239a310321a3524eb3e6f650 (patch)
tree48b56008f613e099738ed2a2ecfaa843c32ed36d /server/src/pracrodaotest.cc
parent890c42ec53e4743a0bc737aa32b54049184a8cfe (diff)
Add 'template' to transactions table in db.
Diffstat (limited to 'server/src/pracrodaotest.cc')
-rw-r--r--server/src/pracrodaotest.cc23
1 files changed, 13 insertions, 10 deletions
diff --git a/server/src/pracrodaotest.cc b/server/src/pracrodaotest.cc
index 7e77eb5..45cafc7 100644
--- a/server/src/pracrodaotest.cc
+++ b/server/src/pracrodaotest.cc
@@ -45,16 +45,18 @@ PracroDAOTest::~PracroDAOTest()
DEBUG(db, "Delete test (memory only) database\n");
}
-void PracroDAOTest::commitTransaction(std::string user, std::string patientid,
- Macro &_macro, Fields &fields, time_t now)
+void PracroDAOTest::commitTransaction(Transaction &transaction,
+ Commit &commit,
+ Macro &_macro,
+ time_t now)
{
DEBUG(db, "(%s, %s, %s, <%u fields>, %ld)\n",
- user.c_str(),
- patientid.c_str(),
+ transaction.user.c_str(),
+ transaction.cpr.c_str(),
_macro.attributes["name"].c_str(),
- fields.size(),
+ commit.fields.size(),
now);
- if(fields.size() == 0) return;
+ if(commit.fields.size() == 0) return;
std::string version = _macro.attributes["version"];
std::string macro = _macro.attributes["name"];
@@ -62,16 +64,17 @@ void PracroDAOTest::commitTransaction(std::string user, std::string patientid,
dbrow_t t;
t["uid"] = data.trseq.nextval();
- t["patientid"] = patientid;
+ t["patientid"] = transaction.cpr;
+ t["template"] = commit.templ;
t["macro"] = macro;
t["version"] = version;
t["timestamp"] = timestamp.str();
- t["user"] = user;
+ t["user"] = transaction.user;
data.transactions.push_back(t);
// Iterate fields...
- Fields::iterator fi = fields.begin();
- while(fi != fields.end()) {
+ Fields::iterator fi = commit.fields.begin();
+ while(fi != commit.fields.end()) {
if(ignore_fieldnames == false) {
// Search for it in fieldnames table