summaryrefslogtreecommitdiff
path: root/server/src/luapraxisd.h
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/luapraxisd.h')
-rw-r--r--server/src/luapraxisd.h165
1 files changed, 145 insertions, 20 deletions
diff --git a/server/src/luapraxisd.h b/server/src/luapraxisd.h
index 71225bf..82445e1 100644
--- a/server/src/luapraxisd.h
+++ b/server/src/luapraxisd.h
@@ -34,6 +34,7 @@
* Praxisd Class
* @class Praxisd
* @serverside
+ * @clientside
* The praxisd class connects and handles communication with the praxisd
* daemon process.
*/
@@ -50,65 +51,134 @@
int px_new(lua_State *L);
/***
- * @method stringlist praxisd:cavelist()
+ * @method stringlist-list praxisd:cavelist()
* Get server cave list.
* To retrieve cavelist for a patient see @see praxisd:getcave().
* @return The complete list of known (possible) cave from the server.
+ * The returned stringlist are indexed as follows: 1: cave - 2: bemaerkning1 -
+ * 3: bemaerkning2 - 4: bemaerkning3
* @example Create a new praxisd object, get and print cavelist:
* px = Praxisd.new('localhost', 10000)
* lst = px:cavelist()
* for i=0,#lst do
- * print(lst[i])
+ * print('cave: ' .. lst[i][1])
+ * print('bemaerkning1: ' .. lst[i][2])
+ * print('bemaerkning2: ' .. lst[i][3])
+ * print('bemaerkning3: ' .. lst[i][4])
* end
*/
int px_cavelist(lua_State *L);
/***
- * @method stringlist praxisd:getcave(string patientid)
+ * @method stringlist-list praxisd:behandlinglist()
+ * Get server behandling list.
+ * To retrieve behandlinglist for a patient see @see praxisd:getbehandling().
+ * @return The complete list of known (possible) behandling from the server.
+ * The returned stringlist are indexed as follows: 1: kode - 2: behandling -
+ * 3: bemaerkning - 4: udregning.
+ * @example Create a new praxisd object, get and print behandlinglist:
+ * px = Praxisd.new('localhost', 10000)
+ * lst = px:behandlinglist()
+ * for i=0,#lst do
+ * print('kode: ' .. lst[i][1])
+ * print('behandling: ' .. lst[i][2])
+ * print('bemaerkning: ' .. lst[i][3])
+ * print('udregning: ' .. lst[i][4])
+ * end
+ */
+int px_behandlinglist(lua_State *L);
+
+/***
+ * @method stringlist-list praxisd:diagnoselist()
+ * Get server diagnose list.
+ * To retrieve diagnoselist for a patient see @see praxisd:getdiagnose().
+ * @return The complete list of known (possible) diagnose from the server.
+ * The returned stringlist are indexed as follows: 1: kode - 2: diagnose -
+ * 3: bemaerkning.
+ * @example Create a new praxisd object, get and print diagnoselist:
+ * px = Praxisd.new('localhost', 10000)
+ * lst = px:diagnoselist()
+ * for i=0,#lst do
+ * print('kode: ' .. lst[i][1])
+ * print('diagnose: ' .. lst[i][2])
+ * print('bemaerkning: ' .. lst[i][3])
+ * end
+ */
+int px_diagnoselist(lua_State *L);
+
+/***
+ * @method stringlist-list praxisd:getcave(string patientid)
* Get cave list from a patient.
* To retrieve cavelist from the server see @see praxisd:cavelist(). To add cave
* to a patient see @see praxisd:addcave().
* @param patientid A string containing the patientid.
* @return The list cave registered with the patient.
+ * The returned stringlist are indexed as follows: 1: cave - 2: bemaerkning1 -
+ * 3: bemaerkning2 - 4: bemaerkning3 - 5: sogetxt - 6: sogedato.
* @example Create a new praxisd object, get and print cavelist:
* px = Praxisd.new('localhost', 10000)
* lst = px:getcave('1234567890')
* for i=0,#lst do
- * print(lst[i])
+ * print('cave: ' .. lst[i][1])
+ * print('bemaerkning1: ' .. lst[i][2])
+ * print('bemaerkning2: ' .. lst[i][3])
+ * print('bemaerkning3: ' .. lst[i][4])
+ * print('sogetxt: ' .. lst[i][5])
+ * print('sogedato: ' .. lst[i][6])
* end
*/
int px_getcave(lua_State *L);
/***
- * @method nil praxisd:adddiagnose(string patientid, string diagnose, string text)
- * Add a diagnose to a patient.
+ * @method stringlist-list praxisd:getbehandling(string patientid)
+ * Get behandling list from a patient.
+ * To retrieve behandlinglist from the server see @see praxisd:behandlinglist(). To add behandling
+ * to a patient see @see praxisd:addbehandling().
* @param patientid A string containing the patientid.
- * @param diagnose The diagnose code.
- * @param text A text to store with the diagnose code. The string mat be up to 6
- * characters long. If longer it will be trunkated.
- * @example Create a new praxisd object and add a diagnose:
+ * @return The list behandling registered with the patient.
+ * The returned stringlist are indexed as follows: 1: kode - 2: behandling -
+ * 3: bemaerkning - 4: udregning - 5: sogetxt - 6: sogedato.
+ * @example Create a new praxisd object, get and print behandlinglist:
* px = Praxisd.new('localhost', 10000)
- * px:adddiagnose('1234567890', 'C0001', 'o.dxt')
+ * lst = px:getbehandling('1234567890')
+ * for i=0,#lst do
+ * print('kode: ' .. lst[i][1])
+ * print('behandling: ' .. lst[i][2])
+ * print('bemaerkning: ' .. lst[i][3])
+ * print('udregning: ' .. lst[i][4])
+ * print('sogetxt: ' .. lst[i][5])
+ * print('sogedato: ' .. lst[i][6])
+ * end
*/
-int px_adddiagnose(lua_State *L);
+int px_getbehandling(lua_State *L);
/***
- * @method nil praxisd:addbehandling(string patientid, string behandling, string text)
- * Add a behandling to a patient.
+ * @method stringlist-list praxisd:getdiagnose(string patientid)
+ * Get diagnose list from a patient.
+ * To retrieve diagnoselist from the server see @see praxisd:diagnoselist(). To add diagnose
+ * to a patient see @see praxisd:adddiagnose().
* @param patientid A string containing the patientid.
- * @param diagnose The behandling code.
- * @param text A text to store with the behandling code. The string mat be up to 6
- * characters long. If longer it will be trunkated.
- * @example Create a new praxisd object and add a behandling:
+ * @return The list diagnose registered with the patient.
+ * The returned stringlist are indexed as follows: 1: kode - 2: diagnose -
+ * 3: bemaerkning - 4: sogetxt - 5: sogedato.
+ * @example Create a new praxisd object, get and print diagnoselist:
* px = Praxisd.new('localhost', 10000)
- * px:addbehandling('1234567890', 'B0001', 'o.sin')
+ * lst = px:getdiagnose('1234567890')
+ * for i=0,#lst do
+ * print('kode: ' .. lst[i][1])
+ * print('diagnose: ' .. lst[i][2])
+ * print('bemaerkning: ' .. lst[i][3])
+ * print('sogetxt: ' .. lst[i][4])
+ * print('sogedato: ' .. lst[i][5])
+ * end
*/
-int px_addbehandling(lua_State *L);
+int px_getdiagnose(lua_State *L);
/***
* @method nil praxisd:addcave(string patientid, string cave, string text)
* Add a cave entry to a patient. To retrieve list of cave from a patient
* see @see praxisd:getcave().
+ * NOTE: This function is only available on the server.
* @param patientid A string containing the patientid.
* @param diagnose The cave string.
* @param text A text to store with the cave entry. NOTE: This is not shown in
@@ -120,6 +190,61 @@ int px_addbehandling(lua_State *L);
*/
int px_addcave(lua_State *L);
+/***
+ * @method nil praxisd:addbehandling(string patientid, string behandling, string text)
+ * Add a behandling to a patient. To retrieve list of behandling from a patient
+ * see @see praxisd:getbehandling().
+ * NOTE: This function is only available on the server.
+ * @param patientid A string containing the patientid.
+ * @param diagnose The behandling code.
+ * @param text A text to store with the behandling code. The string mat be up to 6
+ * characters long. If longer it will be trunkated.
+ * @example Create a new praxisd object and add a behandling:
+ * px = Praxisd.new('localhost', 10000)
+ * px:addbehandling('1234567890', 'B0001', 'o.sin')
+ */
+int px_addbehandling(lua_State *L);
+
+/***
+ * @method nil praxisd:adddiagnose(string patientid, string diagnose, string text)
+ * Add a diagnose to a patient. To retrieve list of diagnose from a patient
+ * see @see praxisd:getdiagnose().
+ * NOTE: This function is only available on the server.
+ * @param patientid A string containing the patientid.
+ * @param diagnose The diagnose code.
+ * @param text A text to store with the diagnose code. The string mat be up to 6
+ * characters long. If longer it will be trunkated.
+ * @example Create a new praxisd object and add a diagnose:
+ * px = Praxisd.new('localhost', 10000)
+ * px:adddiagnose('1234567890', 'C0001', 'o.dxt')
+ */
+int px_adddiagnose(lua_State *L);
+
+/***
+ * @method nil __gc()
+ * Garbage collector. Closes connection and frees all allocated memory.
+ */
+int px_gc(lua_State *L);
+
void register_praxisd(lua_State *L);
+const struct luaL_Reg px_meths[] = {
+ {"__gc", px_gc},
+ {"cavelist", px_cavelist},
+ {"behandliglist", px_behandlinglist},
+ {"diagnoselist", px_diagnoselist},
+ {"getcave", px_getcave},
+ {"getbehandling", px_getbehandling},
+ {"getdiagnose", px_getdiagnose},
+ {"addcave", px_addcave},
+ {"addbehandling", px_addbehandling},
+ {"adddiagnose", px_adddiagnose},
+ {NULL, NULL}
+};
+
+const struct luaL_reg px_funcs[] = {
+ {"new", px_new},
+ {NULL, NULL}
+};
+
#endif/*__PRACRO_LUAPRAXISD_H__*/