cfd2b5be8dcfd141cb263d659e5b62ddb87c8dbb
[confetti] / templates / edit_prescription.sh
1 # Copyright 2016 Paul Hänsch
2 #
3 # This file is part of Confetti.
4
5 # Confetti is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9
10 # Confetti is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU Affero General Public License for more details.
14
15 # You should have received a copy of the GNU Affero General Public License
16 # along with Confetti.  If not, see <http://www.gnu.org/licenses/>. 
17
18 check(){ [ "$1" = "$2" ] && printf checked}
19
20 cat <<END_HTML
21 <form class="prescription" action="?action=update_prescription" method="POST">
22 <input type="hidden" name="prescription" value="${mpx[prescription]}">
23
24 <h1>$(l10n therapy_prescription)</h1>
25
26 <label for="insurance">$(l10n insurance)</label>
27 <input id="insurance" name="insurance" value="${mpx[insurance]}" placeholder="$(l10n insurance)">
28 <br>
29 <label for="name">$(l10n name)</label>
30 <textarea id="name" name="name" placeholder="$(l10n name)">${mpx[name]}</textarea>
31 <br>
32 <label for="bday">$(l10n bday)</label>
33 <input id="bday" name="bday" value="${mpx[bday]}" placeholder="$(l10n bday)">
34
35 <br>
36 <label for="date">$(l10n date)</label>
37 <input id="date" name="date" value="${mpx[date]}" placeholder="$(l10n date)">
38
39 <br>
40 <label for="addcontrib">$(l10n addcontrib)</label>
41 <input id="addcontrib" name="addcontrib" value="${mpx[addcontrib]}" placeholder="$(l10n addcontrib)">
42 <input type="checkbox" id="contribconfirm" name="contribconfirm" value="true" ${mpx[contribconfirm]:+checked}>
43 <label for="contribconfirm">$(l10n contribconfirm)</label>
44
45 <h2>$(l10n prescription_by_catalogue)</h2>
46 <input type="radio" id="prescfirst" name="prescno" value="first" $(check "$mpx[prescno]" first)>
47 <label for="prescfirst">$(l10n prescfirst)</label>
48 <br>
49 <input type="radio" id="prescfollow1" name="prescno" value="follow1" $(check "$mpx[prescno]" follow1)>
50 <label for="prescfollow1">$(l10n prescfollow1)</label>
51 <br>
52 <input type="radio" id="prescfollow2" name="prescno" value="follow2" $(check "$mpx[prescno]" follow2)>
53 <label for="prescfollow2">$(l10n prescfollow2)</label>
54 <br>
55 <input type="radio" id="prescother" name="prescno" value="other" $(check "$mpx[prescno]" other)>
56 <label for="prescother">$(l10n prescother)</label>
57 <br>
58 <input type="radio" id="presccontinual" name="prescno" value="continual" $(check "$mpx[prescno]" continual)>
59 <label for="presccontinual">$(l10n presccontinual)</label>
60
61 <br>
62 <input type="checkbox" id="grouptherapy" name="grouptherapy" value="true" ${mpx[grouptherapy]:+checked}>
63 <label for="grouptherapy">$(l10n grouptherapy)</label>
64 <br>
65 <input type="checkbox" id="housecall" name="housecall" value="true" ${mpx[housecall]:+checked}>
66 <label for="housecall">$(l10n housecall)</label>
67 <br>
68 <input type="checkbox" id="report" name="report" value="true" ${mpx[report]:+checked}>
69 <label for="report">$(l10n report)</label>
70
71 <br>
72 <label for="remidy">$(l10n remidy)</label>
73 <textarea id="remidy" name="remidy" placeholder="$(l10n remidy)">${mpx[remidy]}</textarea>
74 <br>
75 <label for="quantity">$(l10n quantity)</label>
76 <input id="quantity" name="quantity" value="${mpx[quantity]}" placeholder="$(l10n quantity)">
77 <br>
78 <label for="quantity_weekly">$(l10n quantity_weekly)</label>
79 <input id="quantity_weekly" name="quantity_weekly" value="${mpx[quantity_weekly]}" placeholder="$(l10n quantity_weekly)">
80
81 <br>
82 <label for="remidy1">$(l10n remidy)</label>
83 <textarea id="remidy1" name="remidy1" placeholder="$(l10n remidy)">${mpx[remidy1]}</textarea>
84 <br>
85 <label for="quantity1">$(l10n quantity)</label>
86 <input id="quantity1" name="quantity1" value="${mpx[quantity1]}" placeholder="$(l10n quantity)">
87 <br>
88 <label for="quantity_weekly1">$(l10n quantity_weekly)</label>
89 <input id="quantity_weekly1" name="quantity_weekly1" value="${mpx[quantity_weekly1]}" placeholder="$(l10n quantity_weekly)">
90
91 <br>
92 <label for="indicator">$(l10n indicator)</label>
93 <input id="indicator" name="indicator" value="${mpx[indicator]}" placeholder="$(l10n indicator)">
94 <br>
95 <label for="icd10">$(l10n icd10)</label>
96 <input id="icd10" name="icd10" value="${mpx[icd10]}" placeholder="$(l10n icd10)">
97
98 <br>
99 <input type="checkbox" id="prescreviewed" name="prescreviewed" value="true" ${mpx[prescreviewed]:+checked}>
100 <label for="prescreviewed">$(l10n prescreviewed)</label>
101
102 <br>
103 <button type="submit" name="action" value="save">$(l10n save)</button>
104 <button type="submit" name="action" value="cancel">$(l10n cancel)</button>
105 <button type="submit" name="action" value="delete">$(l10n delete)</button>
106
107 </form>
108 END_HTML