diff options
Diffstat (limited to 'server/getdata/getdata.cc')
-rw-r--r-- | server/getdata/getdata.cc | 54 |
1 files changed, 35 insertions, 19 deletions
diff --git a/server/getdata/getdata.cc b/server/getdata/getdata.cc index b051de0..717d1a9 100644 --- a/server/getdata/getdata.cc +++ b/server/getdata/getdata.cc @@ -28,22 +28,16 @@ #include <string> #include <pqxx/pqxx> #include <stdlib.h> +/* +Commits: + patientid | template | version | timestamp | uid | status + +Transactions: + macro | version | timestamp | user | uid | cid -enum { - PATIENTID = 0, - MACRO = 1, - VERSION = 2, - TIMESTAMP = 3, - USER = 4, - UID = 5, - TEMPLATE = 6 -}; - -enum { - TRANSACTION = 0, - NAME = 1, - VALUE = 2 -}; +Fields: + transaction | name | value +*/ #define SEP "\t" @@ -62,6 +56,32 @@ std::string escape(std::string str) int main() { + std::vector<std::string> fields; + fields.push_back("visus.egen_korr.mangler.odxt"); + fields.push_back("visus.egen_korr.kontrast.odxt"); + fields.push_back("visus.egen_korr.snellen.odxt"); + fields.push_back("visus.egen_korr.etdrs.odxt"); + fields.push_back("visus.egen_korr.korr.sf.odxt"); + fields.push_back("visus.egen_korr.korr.cyl.odxt"); + fields.push_back("visus.egen_korr.korr.grader.odxt"); + fields.push_back("visus.egen_korr.st_hul.odxt"); + fields.push_back("visus.egen_korr.st_hul.snellen.odxt"); + fields.push_back("visus.egen_korr.st_hul.etdrs.odxt"); + fields.push_back("visus.egen_korr.mangler.osin"); + fields.push_back("visus.egen_korr.kontrast.osin"); + fields.push_back("visus.egen_korr.snellen.osin"); + fields.push_back("visus.egen_korr.etdrs.osin"); + fields.push_back("visus.egen_korr.korr.sf.osin"); + fields.push_back("visus.egen_korr.korr.cyl.osin"); + fields.push_back("visus.egen_korr.korr.grader.osin"); + fields.push_back("visus.egen_korr.st_hul.osin"); + fields.push_back("visus.egen_korr.st_hul.snellen.osin"); + fields.push_back("visus.egen_korr.st_hul.etdrs.osin"); + fields.push_back("visus.egen_korr.ou"); + fields.push_back("visus.egen_korr.kontrast.ou"); + fields.push_back("visus.egen_korr.snellen.ou"); + fields.push_back("visus.egen_korr.etdrs.ou"); + std::string like = "ref"; std::string host = "localhost"; @@ -76,11 +96,7 @@ int main() pqxx::connection conn(cs); pqxx::work W(conn); - // transactions: - // patientid | macro | version | timestamp | user | uid | template - // fields: - // transaction | name | value std::map<std::string, int> fieldnames; int idx = 0; |