diff options
Diffstat (limited to 'server/xml/macros/current-1.0.xml')
-rw-r--r-- | server/xml/macros/current-1.0.xml | 283 |
1 files changed, 283 insertions, 0 deletions
diff --git a/server/xml/macros/current-1.0.xml b/server/xml/macros/current-1.0.xml new file mode 100644 index 0000000..1bfd6ea --- /dev/null +++ b/server/xml/macros/current-1.0.xml @@ -0,0 +1,283 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!-- + 20081203: Bent Bisballe Nyeng + Feltnavnene ændret så de giver mening. + --> +<!-- + 20090108: Bent Bisballe Nyeng + Alt tekst ændret. + Layout af multilist input er ændret så det er liniebaseret. + --> +<!-- + 20090225: Bent Bisballe Nyeng + Resume format ændret så det er parsbart. + --> +<!-- + 20090226: Bent Bisballe Nyeng + Rettet så den rent faktisk indeholder de felter den skal... + --> +<!-- + 20090320: Bent Bisballe Nyeng + Begge øjne er nu på, på samme tid. Resume er lavet intelligent. + --> +<macro name="current" version="1.0"> + <resume language="lua"> + out = 'Aktuelle:\n' + + if ( getValue('current.symptoms.right') == '' and getValue('current.symptoms.left') == '' ) + then + out = out .. 'ingen\n' + end + + if ( getValue('current.symptoms.right') ~= '' ) + then + out = out .. 'På højre øje har der været\n' + out = out .. getValue('current.symptoms.right') .. '\n' + end + + if ( getValue('current.symptoms.left') ~= '' ) + then + out = out .. 'På venstre øje har der været\n' + out = out .. getValue('current.symptoms.left') .. '\n' + end + + if ( getValue('current.symptoms.right') ~= '' or getValue('current.symptoms.left') ~= '' ) + then + out = out .. 'Symptomerne er opstået ' .. getValue('current.when') + .. ' og efterfølgende ' .. getValue('current.then') + end + + return out + </resume> + <queries> + </queries> + <maps> + <map name="now"> + -- Set date to now if no other data available within last 24 hours. + return os.time(), os.time() - 24*60*60, 'system' + </map> + </maps> + <scripts> + <script language="lua" name="evolution_enable"> + if( getValue('current.symptoms.right') ~= '' or getValue('current.symptoms.left') ~= '' ) + then + enable('evolution') + else + disable('evolution') + end + + return true + </script> + </scripts> + <window caption="Aktuelle (B.2.1.3)" + layout="vbox"> + + <frame layout="vbox"> + <label caption="Symptomlister:"/> + + <frame layout="hbox"> + <frame caption="Højre" layout="vbox"> + + <multilist name="current.symptoms.right" value="" + innerwidget="aktuelle_entry_right" script="evolution_enable"> + + <metawidget name="aktuelle_entry_right" layout="hbox" + formatlanguage="lua" + format= + " + days = (os.time() - tonumber(getValue('date_right'))) / (60 * 60 * 24) + num = 0 + identifier = '' + suffix = '' + + if(num == 0 and math.abs(days) ~= days) + then + num = 0.1 + identifier = 'dag' + suffix = 'e' + end + + if(num == 0 and math.floor(days/7) == 0) + then + num = days + identifier = 'dag' + suffix = 'e' + end + + if(num == 0 and math.floor(days/31) == 0) + then + num = days / 7 + identifier = 'uge' + suffix = 'r' + end + + if(num == 0 and math.floor(days/365) == 0) + then + num = days / 31 + identifier = 'måned' + suffix = 'er' + end + + if(num == 0) + then + num = days / 365 + identifier = 'år' + suffix = '' + end + + num = math.floor(num * 2) / 2 + if(num == 1) + then + suffix = '' + end + + return getValue('observeret_right') .. ': igennem ' .. num .. ' ' + .. identifier .. suffix .. '.' + "> + + <frame layout="vbox"> + <label caption="Observeret:"/> + <altcombobox name="observeret_right" layout="vbox" value="Sløret syn"> + <item caption="Sløret syn" value="Sløret syn"/> + <item caption="Mørk plet i synsfeltet" value="Mørk plet i synsfeltet"/> + <item caption="Metamorfopsier" value="Metamorfopsier"/> + <item caption="Mikropsi" value="Mikropsi"/> + <item caption="Dyskromatopsi" value="Dyskromatopsi"/> + <altitem caption="Andet" value="andet" layout="hbox" innerwidget="andet_right"> + <label caption="Andet:"/> + <lineedit name="andet_right" value=""/> + </altitem> + </altcombobox> + </frame> + + <frame layout="vbox"> + <label caption="Dato:"/> + <datetime name="date_right" fuzziness="3" map="now"/> + <label caption=""/> + </frame> + + </metawidget> + + </multilist> + + </frame> + <frame caption="Venstre" layout="vbox"> + <multilist name="current.symptoms.left" value="" + innerwidget="aktuelle_entry_left" script="evolution_enable"> + + <metawidget name="aktuelle_entry_left" layout="hbox" + formatlanguage="lua" + format= + " + days = (os.time() - tonumber(getValue('date_left'))) / (60 * 60 * 24) + num = 0 + identifier = '' + suffix = '' + + if(num == 0 and math.abs(days) ~= days) + then + num = 0 + identifier = 'dag' + suffix = 'e' + end + + if(num == 0 and math.floor(days/7) == 0) + then + num = days + identifier = 'dag' + suffix = 'e' + end + + if(num == 0 and math.floor(days/31) == 0) + then + num = days / 7 + identifier = 'uge' + suffix = 'r' + end + + if(num == 0 and math.floor(days/365) == 0) + then + num = days / 31 + identifier = 'måned' + suffix = 'er' + end + + if(num == 0) + then + num = days / 365 + identifier = 'år' + suffix = '' + end + + num = math.floor(num * 2) / 2 + if(num == 1) + then + suffix = '' + end + + return getValue('observeret_left') .. ': igennem ' .. num .. ' ' + .. identifier .. suffix .. '.' + "> + + <frame layout="vbox"> + <label caption="Observeret:"/> + <altcombobox name="observeret_left" layout="vbox" value="Sløret syn"> + <item caption="Sløret syn" value="Sløret syn"/> + <item caption="Mørk plet i synsfeltet" value="Mørk plet i synsfeltet"/> + <item caption="Metamorfopsier" value="Metamorfopsier"/> + <item caption="Mikropsi" value="Mikropsi"/> + <item caption="Dyskromatopsi" value="Dyskromatopsi"/> + <altitem caption="Andet" value="andet" layout="hbox" innerwidget="andet_left"> + <label caption="Andet:"/> + <lineedit name="andet_left" value=""/> + </altitem> + </altcombobox> + </frame> + + <frame layout="vbox"> + <label caption="Dato:"/> + <datetime name="date_left" fuzziness="3" map="now"/> + <label caption=""/> + </frame> + + </metawidget> + + </multilist> + + </frame> + </frame> + </frame> + + <frame name="evolution" layout="hbox"> + + <frame layout="vbox"> + <label caption="Opstået:"/> + <radiobuttons name="current.when" value="." layout="hbox"> + <radiobutton caption="Pludseligt" + value="pludseligt"/> + <radiobutton caption="Gradvist" + value="gradvist"/> + </radiobuttons> + <label caption=""/> + </frame> + + <frame layout="vbox"> + <label caption="Efterfølgende:"/> + <combobox name="current.then" value="og har efterfølgende været uændrede"> + <item caption="Uændret" value="uændrede"/> + <item caption="Forværret" value="forværret"/> + <item caption="Forbedret" value="forbedret"/> + </combobox> + <label caption=""/> + </frame> + + <spacer/> + + </frame> + + <frame layout="hbox"> + <spacer/> + <button caption="Gem" action="commit"/> + </frame> + </window> +</macro> |