1 # Copyright 2016 Paul Hänsch
3 # This file is part of Confetti.
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.
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.
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/>.
22 color=session${session_n}_note${note_n}_color
23 unset c0 c1 c2 c3 c4 c5 c6 c7
25 case "$tpy[$color]" in
36 if [ "$note_n" -eq 1 -o -n "${tpy[session${session_n}_note${note_n}]}" ]; then
37 printf '<input class="trailbtn" type="checkbox" checked="checked">'
39 printf '<input class="trailbtn" type="checkbox">'
42 <fieldset class="note trailbox">
43 <input class=color type=radio name="$color" value="#888" id=${color}_000 $c0><label for=${color}_000></label>
44 <input class=color type=radio name="$color" value="#00A" id=${color}_001 $c1><label for=${color}_001></label>
45 <input class=color type=radio name="$color" value="#0A0" id=${color}_010 $c2><label for=${color}_010></label>
46 <input class=color type=radio name="$color" value="#0AA" id=${color}_011 $c3><label for=${color}_011></label>
47 <input class=color type=radio name="$color" value="#A00" id=${color}_100 $c4><label for=${color}_100></label>
48 <input class=color type=radio name="$color" value="#A0A" id=${color}_101 $c5><label for=${color}_101></label>
49 <input class=color type=radio name="$color" value="#AA0" id=${color}_110 $c6><label for=${color}_110></label>
50 <input class=color type=radio name="$color" value="#FFF" id=${color}_111 $c7><label for=${color}_111></label>
51 <textarea name="session${session_n}_note${note_n}">${tpy[session${session_n}_note${note_n}]}</textarea>
59 sid=session${session_n}
61 if [ "$tpy[${sid}_sigset]" = pos ]; then
68 <input type=hidden name=$sid value=exists>
69 <input class="tab" type="checkbox" id=${sid}_open name="${sid}_open" value="checked" ${tpy[${sid}_open]}>
70 <label class="tab" for="${sid}_open">
71 <span class=no>${session_n}.</span><!--
72 --><span class=date>${tpy[${sid}_date]}</span><!--
73 --><input class="date" name="${sid}_date" value="${tpy[${sid}_date]}" placeholder="$(l10n date)"><!--
74 --><span class=therapist>${tpy[${sid}_therapist]}</span><!--
75 --><input class="therapist" name="${sid}_therapist" value="${tpy[${sid}_therapist]}" placeholder="$(l10n therapist)"><!--
76 --><span class=signature><input type="checkbox" name="${sid}_sigset" value="pos" $sigcheck></span>
79 <img class="dotmark ov" src="/therapies/${id%.tpy}_${sid}.png" alt="">
81 while [ -n "${tpy[session${session_n}_note${n}]+x}" ]; do
82 if [ -n "${tpy[session${session_n}_note${n}]}" ]; then
87 for n in $(seq 1 $((${x:-0} + 3)) ); do t_session_note $session_n $n; done
89 <button class="trailbtn" type="submit">$(l10n trailsave)</button>
90 <button class=delete type=submit name=delete_session value=${session_n}>$(l10n delete_session)</button>
96 n=1; while [ -n "${tpy[session${n}]}" ]; do
104 <fieldset class="tab">
105 <button class=no type=submit name=new_session value=$sid>+</button><!--
106 --><input class=date name=${sid}_date value="" placeholder="$(l10n date)" /><!--
107 --><input class=therapist name=${sid}_therapist value="" placeholder="$(l10n therapist)" /><!--
108 --><span class=signature><span></span>
109 <input type=hidden name="${sid}_note1" value="">
114 unset c0 c1 c2 c3 c4 c5 c6 c7
115 case "$tpy[color]" in
116 \#00A) c1="checked";;
117 \#0A0) c2="checked";;
118 \#0AA) c3="checked";;
119 \#A00) c4="checked";;
120 \#A0A) c5="checked";;
121 \#AA0) c6="checked";;
122 \#FFF) c7="checked";;
127 <h1>$(l10n therapy)</h1>
129 <div class="patient">
130 <h2>$client_name</h2>
131 <a href="?p=prescriptions&client=${id%%.*}.vcf">< $(l10n prescriptionlist)</a>
134 <div class="prescription">
135 <h2>$(l10n therapy_prescription)</h2>
136 <span class="insurance">${mpx[insurance]}</span>
137 <span class="date"><label>$(l10n date):</label>${mpx[date]}</span>
139 <label class="checkbox ${mpx[prescreviewed]:+checked}" for="prescreviewed">
140 $([ -n "${mpx[prescreviewed]}" ] && printf %s "$(l10n prescreviewed)" \
141 || printf %s "$(l10n prescreview)" )
144 ${mpx[prescno]:+<span class="prescno">$(l10n presc${mpx[prescno]})</span>}
145 ${mpx[grouptherapy]:+<span class="catalogue">$(l10n grouptherapy)</span>}
146 ${mpx[housecall]:+<span class="catalogue">$(l10n housecall)</span>}
147 ${mpx[report]:+<span class="catalogue">$(l10n report)</span>}
149 <ul>$(for n in '' {0..10}; do
150 [ -n "${mpx[remidy$n]}" ] && \
151 printf '<li>%s %s %s</li>' "${mpx[quantity$n]}" \
153 "${mpx[quantity_weekly$n]:+($mpx[quantity_weekly$n] $(l10n weekly))}"
156 ${mpx[indicator]:+<span class="indicator"><label>$(l10n indicator):</label>${mpx[indicator]}</span>}
157 ${mpx[icd10]:+<span class="icd10"> <label>$(l10n icd10):</label>${mpx[icd10]}</span>}
160 <label class='checkbox ${mpx[contribconfirm]:+checked}' for="addcontrib">
161 $([ -n "${mpx[contribconfirm]}" ] && printf %s "$(l10n contribconfirm)" ${mpx[contribconfirm]} \
162 || printf %s "$(l10n addcontrib)" )
166 <input class="tab" type="checkbox" id="indicator_reading">
167 <label class="tab" for="indicator_reading">$(l10n indicator_reading)</label>
168 <div class="tab">${mpx[indicator_reading]}</div>
171 <form id="report" method="POST" action="?action=update_therapy">
172 <input type="hidden" name="id" value="${id}">
174 <input class="stickynote" type="checkbox" name="c_stickynote" id="show_stickynote">
175 <fieldset class="stickynote">
176 <label for="show_stickynote">$(l10n notes)</label>
177 <textarea name="stickynote">${tpy[stickynote]}</textarea>
178 <button type=submit>$(l10n save)</button>
181 <!--input class="tab" type="checkbox" id="lookout">
182 <label class="tab" for="lookout">$(l10n indicator_reading)</label>
183 <div class="tab"><textarea name="lookout">${mpx[lookout]}</textarea -->
185 <label class="tab heading">
186 <span class=no>$(l10n number)</span><!--
187 --><span class=date>$(l10n date)</span><!--
188 --><span class=therapist>$(l10n therapist)</span><!--
189 --><span class=signature>$(l10n signature)</span>
196 <fieldset class=color>
197 <input class="color" type="radio" name="color" value="#000" id="c000" $c0><label for="c000"></label>
198 <input class="color" type="radio" name="color" value="#00A" id="c001" $c1><label for="c001"></label>
199 <input class="color" type="radio" name="color" value="#0A0" id="c010" $c2><label for="c010"></label>
200 <input class="color" type="radio" name="color" value="#0AA" id="c011" $c3><label for="c011"></label>
201 <input class="color" type="radio" name="color" value="#A00" id="c100" $c4><label for="c100"></label>
202 <input class="color" type="radio" name="color" value="#A0A" id="c101" $c5><label for="c101"></label>
203 <input class="color" type="radio" name="color" value="#AA0" id="c110" $c6><label for="c110"></label>
204 <input class="color" type="radio" name="color" value="#FFF" id="c111" $c7><label for="c111"></label>
206 <img class="dotmark bg" src="?static=therapy_background.png" alt="WARNING: Background Image not available!">
207 <canvas id="canvas" class="dotmark ov" width="${bg_dim%x*}" height="${bg_dim#*x}"></canvas>
209 <input type=hidden id=image_serialize name=imagedata value="">
211 <button type="submit">$(l10n save)</button>
214 <span id="jsdebug" style="display: none; position: fixed; right:0; bottom:0">Debug</span>
216 <script type="text/javascript" src="?static=therapy_draw.js"></script>
218 # vi:set filetype=html: