4701ebb813a51f42671ce3e21325ade4960c93b3
[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 <table class="type"><tbody>
25   <tr>
26     <th>$(l10n doctor)</th>
27     <th>$(l10n dentist)</th>
28     <th>$(l10n noprescription)</th>
29     <th>$(l10n altpractition)</th>
30   </tr>
31   <tr>
32     <td class="selfpaid doctor">
33       <input type=radio name=presctype id=doctor_selfpaid value=doctor_selfpaid>
34       <label for=doctor_selfpaid>$(l10n selfpaid)</label>
35     </td>
36     <td class="selfpaid dentist">
37       <input type=radio name=presctype id=dentist_selfpaid value=dentist_selfpaid>
38       <label for=dentist_selfpaid>$(l10n selfpaid)</label>
39     </td>
40     <td class="selfpaid noprescription">
41       <input type=radio name=presctype id=noprescription_selfpaid value=noprescription_selfpaid>
42       <label for=noprescription_selfpaid>$(l10n selfpaid)</label>
43     </td>
44     <td class="selfpaid altpractition">
45       <input type=radio name=presctype id=altpractition_selfpaid value=altpractition_selfpaid>
46       <label for=altpractition_selfpaid>$(l10n selfpaid)</label>
47     </td>
48   </tr>
49   <tr>
50     <td class="private doctor">
51       <input type=radio name=presctype id=doctor_private value=doctor_private>
52       <label for=doctor_private>$(l10n private)</label>
53     </td>
54     <td class="private dentist">
55       <input type=radio name=presctype id=dentist_private value=dentist_private>
56       <label for=dentist_private>$(l10n private)</label>
57     </td>
58     <td class="private noprescription">
59     </td>
60     <td class="private altpractition">
61       <input type=radio name=presctype id=altpractition_private value=altpractition_private>
62       <label for=altpractition_private>$(l10n private)</label>
63     </td>
64   </tr>
65   <tr>
66     <td class="compulsory doctor">
67       <input type=radio name=presctype id=doctor_compulsory value=doctor_compulsory>
68       <label for=doctor_compulsory>$(l10n compulsory)</label>
69     </td>
70     <td class="compulsory dentist">
71       <input type=radio name=presctype id=dentist_compulsory value=dentist_compulsory>
72       <label for=dentist_compulsory>$(l10n compulsory)</label>
73     </td>
74     <td class="compulsory noprescription">
75     </td>
76     <td class="compulsory altpractition">
77     </td>
78   </tr>
79 </tbody></table>
80
81 <fieldset class="baseinfo">
82 <label for="insurance">$(l10n insurance)</label>
83 <input id="insurance" name="insurance" value="${mpx[insurance]}" placeholder="$(l10n insurance)">
84 <br>
85 <label for="name">$(l10n name)</label>
86 <label for="bday">$(l10n bday)</label>
87 <br>
88 <textarea id="name" name="name" placeholder="$(l10n name)">${mpx[name]}</textarea>
89 <input id="bday" name="bday" value="${mpx[bday]}" placeholder="$(l10n bday)">
90
91 <br>
92 <label for="date">$(l10n date)</label>
93 <input id="date" name="date" value="${mpx[date]}" placeholder="$(l10n date)">
94 </fieldset>
95
96 <fieldset class="misc">
97 <h1 id="${mpx[prescription]}">$(l10n therapy_prescription)</h1>
98
99 <label for="addcontrib">$(l10n addcontrib)</label>
100 <input id="addcontrib" name="addcontrib" value="${mpx[addcontrib]}" placeholder="$(l10n addcontrib)">
101 <label for="contribconfirm">$(l10n contribconfirm)</label>
102 <input id="contribconfirm" name="contribconfirm" value="${mpx[contribconfirm]}" placeholder="$(l10n contribconfirm)">
103 <input type="checkbox" id="contribreceipt" name="contribreceipt" value="true" ${mpx[contribreceipt]:+checked}>
104 <label for="contribreceipt">$(l10n contribreceipt)</label>
105 </fieldset>
106
107 <input type="checkbox" id="prescreviewed" name="prescreviewed" value="true" ${mpx[prescreviewed]:+checked}>
108 <label for="prescreviewed">$(l10n prescreviewed)</label>
109
110 <fieldset class="catalogue">
111 <h2>$(l10n prescription_by_catalogue)</h2>
112 <input type="radio" id="prescfirst" name="prescno" value="first" $(check "$mpx[prescno]" first)>
113 <label for="prescfirst">$(l10n prescfirst)</label>
114 <br>
115 <input type="radio" id="prescfollow1" name="prescno" value="follow1" $(check "$mpx[prescno]" follow1)>
116 <label for="prescfollow1">$(l10n prescfollow1)</label>
117 <br>
118 <input type="radio" id="prescfollow2" name="prescno" value="follow2" $(check "$mpx[prescno]" follow2)>
119 <label for="prescfollow2">$(l10n prescfollow2)</label>
120 <br>
121 <input type="radio" id="prescother" name="prescno" value="other" $(check "$mpx[prescno]" other)>
122 <label for="prescother">$(l10n prescother)</label>
123 <br>
124 <input type="radio" id="presccontinual" name="prescno" value="continual" $(check "$mpx[prescno]" continual)>
125 <label for="presccontinual">$(l10n presccontinual)</label>
126
127 <br>
128 <input type="checkbox" id="grouptherapy" name="grouptherapy" value="true" ${mpx[grouptherapy]:+checked}>
129 <label for="grouptherapy">$(l10n grouptherapy)</label>
130 <br>
131 <input type="checkbox" id="housecall" name="housecall" value="true" ${mpx[housecall]:+checked}>
132 <label for="housecall">$(l10n housecall)</label>
133 <br>
134 <input type="checkbox" id="report" name="report" value="true" ${mpx[report]:+checked}>
135 <label for="report">$(l10n report)</label>
136 </fieldset>
137
138 <fieldset class="description">
139 <label for="quantity">$(l10n quantity)</label>
140 <label for="remidy">$(l10n remidy)</label>
141 <label for="quantity_weekly">$(l10n quantity_weekly)</label>
142 <input id="quantity" name="quantity" value="${mpx[quantity]}" placeholder="$(l10n quantity)">
143 <textarea id="remidy" name="remidy" placeholder="$(l10n remidy)">${mpx[remidy]}</textarea>
144 <input id="quantity_weekly" name="quantity_weekly" value="${mpx[quantity_weekly]}" placeholder="$(l10n quantity_weekly)">
145
146 <label for="quantity1">$(l10n quantity)</label>
147 <label for="remidy1">$(l10n remidy)</label>
148 <label for="quantity_weekly1">$(l10n quantity_weekly)</label>
149 <input id="quantity1" name="quantity1" value="${mpx[quantity1]}" placeholder="$(l10n quantity)">
150 <textarea id="remidy1" name="remidy1" placeholder="$(l10n remidy)">${mpx[remidy1]}</textarea>
151 <input id="quantity_weekly1" name="quantity_weekly1" value="${mpx[quantity_weekly1]}" placeholder="$(l10n quantity_weekly)">
152
153 <br>
154 <p class="indicator_codes">
155 <label for="indicator">$(l10n indicator)</label>
156 <input id="indicator" name="indicator" value="${mpx[indicator]}" placeholder="$(l10n indicator)">
157 <br>
158 <label for="icd10">$(l10n icd10)</label>
159 <input id="icd10" name="icd10" value="${mpx[icd10]}" placeholder="$(l10n icd10)">
160 </p>
161 <br>
162 <p class="indicator_reading">
163 <label for="indicator_reading">$(l10n indicator_reading)</label>
164 <textarea id="indicator_reading" name="indicator_reading" placeholder="$(l10n indicator_reading)">${mpx[indicator_reading]}</textarea>
165 </p>
166 </fieldset>
167
168 <fieldset class="controls">
169 <button type="submit" name="action" value="save">$(l10n save)</button>
170 <button type="submit" name="action" value="cancel">$(l10n cancel)</button>
171 <button type="submit" name="action" value="delete">$(l10n delete)</button>
172 </fieldset>
173
174 </form>
175 END_HTML