diff options
author | deva <deva> | 2008-06-04 11:41:46 +0000 |
---|---|---|
committer | deva <deva> | 2008-06-04 11:41:46 +0000 |
commit | dad77becc53e2f2c3b0880ee4fddd97d69099f94 (patch) | |
tree | 9b7889ef626c226632278bb71d690ced4ab823b1 /server/xml | |
parent | 294ed0c031072489f520c90e373b2f24aa16ed8c (diff) |
Modulized the template/course/macro system.
Diffstat (limited to 'server/xml')
-rw-r--r-- | server/xml/Makefile.am | 8 | ||||
-rw-r--r-- | server/xml/commit.xml | 6 | ||||
-rw-r--r-- | server/xml/example.xml | 55 | ||||
-rw-r--r-- | server/xml/example2.xml | 107 | ||||
-rw-r--r-- | server/xml/macros/.cvsignore | 2 | ||||
-rw-r--r-- | server/xml/macros/Makefile.am | 7 | ||||
-rw-r--r-- | server/xml/macros/example.xml | 58 | ||||
-rw-r--r-- | server/xml/patient.xml | 10 | ||||
-rw-r--r-- | server/xml/request.xml | 4 | ||||
-rw-r--r-- | server/xml/templates/.cvsignore | 2 | ||||
-rw-r--r-- | server/xml/templates/Makefile.am | 7 | ||||
-rw-r--r-- | server/xml/templates/example.xml | 14 |
12 files changed, 92 insertions, 188 deletions
diff --git a/server/xml/Makefile.am b/server/xml/Makefile.am index 62905db..a478a79 100644 --- a/server/xml/Makefile.am +++ b/server/xml/Makefile.am @@ -1,9 +1,5 @@ -EXTRA_DIST = \ - patient.xml \ - start.xml +EXTRA_DIST = xmldir = $(datadir)/xml -xml_DATA = \ - patient.xml \ - start.xml +xml_DATA = diff --git a/server/xml/commit.xml b/server/xml/commit.xml deleted file mode 100644 index 0e9ff86..0000000 --- a/server/xml/commit.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<commit name="test_macro" cpr="1505050505" version="1.0"> - <field name="visus_subjective" value="2.85"/> - <field name="visus_objective" value="2.91"/> - <field name="eye" value="osin"/> -</commit> diff --git a/server/xml/example.xml b/server/xml/example.xml deleted file mode 100644 index b9974a8..0000000 --- a/server/xml/example.xml +++ /dev/null @@ -1,55 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<macro name="example" version="1.0" - resume="Det koster 50$$\\100kr\nLinse: ${linse1}\n${linse_note}\nHævelse: ${radio}\n\n${spl_note}"> - <window name="mainwindow" - caption="Fundus" - width="500" - height="560" - layout="vbox"> - <include name="patient"/> - <frame name="spl_frame" caption="Spl:" layout="vbox"> - <lineedit name="spl_note" regexp=".*" value="På begge sider alderssvarende forhold. Der er let katarakt, som dog ikke er operationskrævende." help="Hjælpenisse"/> - </frame> - <frame name="linse_frame" caption="Linser:" layout="vbox"> - <frame name="linse_framea" layout="hbox"> - <label name="a" width="300" caption="Linse1 er en lidt længere streng end de to andre:"/> - <lineedit name="linse1" regexp="[0-9]{1,3}D" value="90K" help="Hjælpenisse"/> - </frame> - <frame name="linse_frameb" layout="hbox"> - <label name="b" width="300" caption="Linse2:"/> - <lineedit name="linse2" regexp="[0-9]{1,3}D" value="90D" help="Hjælpenisse"/> - </frame> - <frame name="linse_framec" layout="hbox"> - <label name="c" width="300" caption="Linse3:"/> - <lineedit name="linse3" regexp="[0-9]{1,3}D" value="90D" help="Hjælpenisse"/> - </frame> - </frame> - <frame name="swelling_frame" layout="hbox"> - <label name="swelling" caption="Der findes central hævelse med:"/> - <frame name="swelling_radios" layout="hbox"> - <radiobuttons name="radio" value="" layout="vbox" help="Hjælpenisse"> - <item caption="Radio Randblødning" value="rand"/> - <item caption="Radio Exsudater" value="exsudater"/> - <item caption="Radio Blahblah" value="blabla"/> - </radiobuttons> - <combobox name="combo" value="fiskesuppe" help="Hjælpenisse"> - <item caption="Combo Randblødning" value="rand"/> - <item caption="Combo Exsudater" value="exsudater"/> - <item caption="Combo Blahblah" value="blabla"/> - <item caption="Combo Blahblah" value="fisk"/> - </combobox> - <listbox name="list" value="exsudate" help="Hjælpenisse"> - <item caption="List Randblødning" value="rand"/> - <item caption="List Exsudater" value="exsudater"/> - <item caption="List Blahblah" value="blabla"/> - </listbox> - </frame> - </frame> - <frame name="buttons" layout="hbox"> - <lineedit name="next_macro" regexp="[a-z_]+[a-z_0-9]*" value="example"/> - <button name="cancel" caption="Annuller" action="cancel" help="Hjælpenisse"/> - <button name="continue" caption="Fortsæt" action="continue" field="next_macro" help="Hjælpenisse"/> - <button name="commit" caption="Godkend" action="commit" help="Hjælpenisse"/> - </frame> - </window> -</macro> diff --git a/server/xml/example2.xml b/server/xml/example2.xml deleted file mode 100644 index 826b694..0000000 --- a/server/xml/example2.xml +++ /dev/null @@ -1,107 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<template name="testcourse"> - <course name="example2"> - <macro name="example1" version="1.0" - resume="${linse1}${linse2}"> - <queries> - <query class="lensmeter" ttl="10000" automap="true"/> - </queries> - <maps> - <map name="axis"> - -- LUA program - return math.pi, 1234567890 - </map> - <map name="right.axis" uses="lensmeter, lensmeter.right.axis"> - -- LUA program - right_axis = 0 - if( lensmeter.right.axis ) right_axis = lensmeter.right.axis.value - return right_axis, lensmeter.right.sphere.timestamp - </map> - <map name="cyl"> - -- LUA program - return lensmeter.right.cyl.value, lensmeter.right.cyl.timestamp - </map> - </maps> - <luaprograms> - <luaprogram name="theanswer"> - fisk = getValue('sphere') - if( tonumber(fisk) == tonumber(value) ) - then - setValue('cyl', value) - return true - else - return false - end - </luaprogram> - </luaprograms> - <window name="mainwindow" - caption="Fundus" - width="500" - height="560" - layout="vbox"> - <frame name="linse_frame" caption="Linser:" layout="vbox"> - <frame name="linse_framea" layout="hbox"> - <label name="a" width="300" caption="Akse rotation:"/> - <lineedit name="axis" regexp="[24]*" map="axis" lua="theanswer" value="244"/> - </frame> - <frame name="linse_frameb" layout="hbox"> - <label name="b" width="300" caption="Sphere:"/> - <lineedit name="sphere" regexp="[24]*" map="sphere" value="42"/> - </frame> - <frame name="linse_framec" layout="hbox"> - <label name="c" width="300" caption="Cyl:"/> - <lineedit name="cyl" regexp="[24]*" map="cyl" value=""/> - </frame> - </frame> - <frame name="buttons" layout="hbox"> - <button name="cancel" caption="Annuller" action="cancel"/> - <button name="commit" caption="Godkend" action="commit"/> - </frame> - </window> - </macro> - <macro name="example2" version="1.0" - resume="${linse1}${linse2}"> - <queries> - <query device_id="lensmeter" device_type="lensmeter" class="lensmeter" ttl="10000"/> - </queries> - <maps> - <map name="axis"> - -- LUA program - return right.axis - </map> - <map name="sphere"> - -- LUA program - return right.sphere - </map> - <map name="cyl"> - -- LUA program - return right.cyl - </map> - </maps> - <window name="mainwindow" - caption="Fundus" - width="500" - height="560" - layout="vbox"> - <frame name="linse_frame" caption="Linser:" layout="vbox"> - <frame name="linse_framea" layout="hbox"> - <label name="a" width="300" caption="Akse rotation:"/> - <lineedit name="linse1" regexp="[0-9]{1,3}" map="axis" value="90K"/> - </frame> - <frame name="linse_frameb" layout="hbox"> - <label name="b" width="300" caption="Sphere:"/> - <lineedit name="linse2" regexp="[0-9]{1,3}" map="sphere" value="90K"/> - </frame> - <frame name="linse_framec" layout="hbox"> - <label name="c" width="300" caption="Sphere:"/> - <lineedit name="linse3" regexp="[0-9]{1,3}" map="cyl" value="90K"/> - </frame> - </frame> - <frame name="buttons" layout="hbox"> - <button name="cancel" caption="Annuller" action="cancel"/> - <button name="commit" caption="Godkend" action="commit"/> - </frame> - </window> - </macro> - </course> -</template> diff --git a/server/xml/macros/.cvsignore b/server/xml/macros/.cvsignore new file mode 100644 index 0000000..3dda729 --- /dev/null +++ b/server/xml/macros/.cvsignore @@ -0,0 +1,2 @@ +Makefile.in +Makefile diff --git a/server/xml/macros/Makefile.am b/server/xml/macros/Makefile.am new file mode 100644 index 0000000..8056e2a --- /dev/null +++ b/server/xml/macros/Makefile.am @@ -0,0 +1,7 @@ +EXTRA_DIST = \ + example.xml + +xmldir = $(datadir)/xml/macros + +xml_DATA = \ + example.xml diff --git a/server/xml/macros/example.xml b/server/xml/macros/example.xml new file mode 100644 index 0000000..ce6e2c0 --- /dev/null +++ b/server/xml/macros/example.xml @@ -0,0 +1,58 @@ +<?xml version='1.0' encoding='UTF-8'?> +<macro name="example" version="1.0" resume="${linse1}${linse2}"> + <queries> + <query class="lensmeter" ttl="10000" automap="true"/> + </queries> + <maps> + <map name="axis"> + -- LUA program + return math.pi, 1234567890 + </map> + <map name="right.axis" uses="lensmeter, lensmeter.right.axis"> + -- LUA program + right_axis = 0 + if( lensmeter.right.axis ) right_axis = lensmeter.right.axis.value + return right_axis, lensmeter.right.sphere.timestamp + </map> + <map name="cyl"> + -- LUA program + return lensmeter.right.cyl.value, lensmeter.right.cyl.timestamp + </map> + </maps> + <luaprograms> + <luaprogram name="theanswer"> + fisk = getValue('sphere') + if( tonumber(fisk) == tonumber(value) ) + then + setValue('cyl', value) + return true + else + return false + end + </luaprogram> + </luaprograms> + <window name="mainwindow" + caption="Fundus" + width="500" + height="560" + layout="vbox"> + <frame name="linse_frame" caption="Linser:" layout="vbox"> + <frame name="linse_framea" layout="hbox"> + <label name="a" width="300" caption="Akse rotation:"/> + <lineedit name="axis" regexp="[24]*" map="axis" lua="theanswer" value="244"/> + </frame> + <frame name="linse_frameb" layout="hbox"> + <label name="b" width="300" caption="Sphere:"/> + <lineedit name="sphere" regexp="[24]*" map="sphere" value="42"/> + </frame> + <frame name="linse_framec" layout="hbox"> + <label name="c" width="300" caption="Cyl:"/> + <lineedit name="cyl" regexp="[24]*" map="cyl" value=""/> + </frame> + </frame> + <frame name="buttons" layout="hbox"> + <button name="cancel" caption="Annuller" action="cancel"/> + <button name="commit" caption="Godkend" action="commit"/> + </frame> + </window> +</macro> diff --git a/server/xml/patient.xml b/server/xml/patient.xml deleted file mode 100644 index 8be7e7f..0000000 --- a/server/xml/patient.xml +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<macro name="patient" version="1.0"> - <frame name="cpr_frame" caption="CPR og navn" layout="vbox"> - <lineedit name="patient_cpr" regexp="\d{6}-{0,1}\d{4}" value="1505050505"/> - <lineedit name="patient_navn" regexp=".+" value="Birger Fiskenolder"/> - </frame> - <frame name="name_frame" caption="Noter" layout="vbox"> - <lineedit name="patient_note" regexp=".*" value="Noget note om et eller andet"/> - </frame> -</macro> diff --git a/server/xml/request.xml b/server/xml/request.xml deleted file mode 100644 index 369d5ea..0000000 --- a/server/xml/request.xml +++ /dev/null @@ -1,4 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<request cpr="1505050505" version="1.0"> - <macro name="example"/> -</request> diff --git a/server/xml/templates/.cvsignore b/server/xml/templates/.cvsignore new file mode 100644 index 0000000..3dda729 --- /dev/null +++ b/server/xml/templates/.cvsignore @@ -0,0 +1,2 @@ +Makefile.in +Makefile diff --git a/server/xml/templates/Makefile.am b/server/xml/templates/Makefile.am new file mode 100644 index 0000000..7d487a6 --- /dev/null +++ b/server/xml/templates/Makefile.am @@ -0,0 +1,7 @@ +EXTRA_DIST = \ + example.xml + +xmldir = $(datadir)/xml/templates + +xml_DATA = \ + example.xml diff --git a/server/xml/templates/example.xml b/server/xml/templates/example.xml new file mode 100644 index 0000000..2fdbb9c --- /dev/null +++ b/server/xml/templates/example.xml @@ -0,0 +1,14 @@ +<?xml version='1.0' encoding='UTF-8'?> +<course name="example" version="1.0"> + <!-- There can be several macros in a single course --> + + <!-- <macro name="example" required="true"></macro> --> + + <!-- + <macro name="example"> + <dependency name="example"/> + </macro> + --> + <macro name="example"/> + +</course> |