From eb91a2967ed18aa24166f13a635091e2193aecc0 Mon Sep 17 00:00:00 2001 From: deva Date: Mon, 25 Apr 2011 06:27:08 +0000 Subject: Initial version of praxisd communications class. --- server/getdata/Makefile.am | 9 +++++++- server/getdata/getdata.cc | 54 ++++++++++++++++++++++++++++++---------------- 2 files changed, 43 insertions(+), 20 deletions(-) (limited to 'server/getdata') diff --git a/server/getdata/Makefile.am b/server/getdata/Makefile.am index 8cd960f..c0e6f09 100644 --- a/server/getdata/Makefile.am +++ b/server/getdata/Makefile.am @@ -1,4 +1,4 @@ -bin_PROGRAMS = getdata +bin_PROGRAMS = getdata convertdata getdata_LDADD = $(LD_EFENCE) $(PQXX_LIBS) $(CONFIG_LIBS) @@ -7,6 +7,13 @@ getdata_CXXFLAGS = $(PQXX_CXXFLAGS) $(CONFIG_CXXFLAGS) getdata_SOURCES = \ getdata.cc +convertdata_LDADD = $(LD_EFENCE) $(PQXX_LIBS) $(CONFIG_LIBS) + +convertdata_CXXFLAGS = $(PQXX_CXXFLAGS) $(CONFIG_CXXFLAGS) + +convertdata_SOURCES = \ + convertdata.cc + EXTRA_DIST = ################ 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 #include #include +/* +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 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 fieldnames; int idx = 0; -- cgit v1.2.3