summaryrefslogtreecommitdiff
path: root/server/getdata
diff options
context:
space:
mode:
Diffstat (limited to 'server/getdata')
-rw-r--r--server/getdata/Makefile.am9
-rw-r--r--server/getdata/getdata.cc54
2 files changed, 43 insertions, 20 deletions
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 <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;