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/>.
18 check(){ [ "$1" = "$2" ] && printf checked}
21 <div class="prescription ${mpx[presctype]%_*} ${mpx[presctype]#*_}">
22 <fieldset class="baseinfo">
23 <label for="insurance">$(l10n insurance)</label>
24 <span id="insurance">${mpx[insurance]}</span>
26 <label for="name">$(l10n name)</label>
27 <label for="bday">$(l10n bday)</label>
28 <span id="name">${mpx[name]}</span>
29 <span id="bday">${mpx[bday]}</span>
32 <label for="date">$(l10n date)</label>
33 <span id="date">${mpx[date]}</span>
36 <fieldset class="misc">
37 <h1 id="${mpx[prescription]}">$(l10n therapy_prescription)</h1>
39 <label for="addcontrib">$(l10n addcontrib)</label>
40 <span id="addcontrib">${mpx[addcontrib]}</span>
41 <label for="contribconfirm">$(l10n contribconfirm)</label>
42 <span id="contribconfirm">${mpx[contribconfirm]}</span>
43 <label class="checkbox ${mpx[contribreceipt]:+checked}" for="contribreceipt">$(l10n contribreceipt)</label>
46 <label class="checkbox ${mpx[prescreviewed]:+checked}" for="prescreviewed">
47 $([ -n "${mpx[prescreviewed]}" ] && printf %s "$(l10n prescreviewed)" \
48 || printf %s "$(l10n prescreview)" )
51 <fieldset class="catalogue">
52 <h2>$(l10n prescription_by_catalogue)</h2>
53 <label class="radio $(check "$mpx[prescno]" first)" for="prescfirst">$(l10n prescfirst)</label>
55 <label class="radio $(check "$mpx[prescno]" follow1)" for="prescfollow1">$(l10n prescfollow1)</label>
57 <label class="radio $(check "$mpx[prescno]" follow2)" for="prescfollow2">$(l10n prescfollow2)</label>
59 <label class="radio $(check "$mpx[prescno]" other)" for="prescother">$(l10n prescother)</label>
61 <label class="radio $(check "$mpx[prescno]" continual)" for="presccontinual">$(l10n presccontinual)</label>
64 <label class="checkbox ${mpx[grouptherapy]:+checked}" for="grouptherapy">$(l10n grouptherapy)</label>
66 <label class="checkbox ${mpx[housecall]:+checked}" for="housecall">$(l10n housecall)</label>
68 <label class="checkbox ${mpx[report]:+checked}" for="report">$(l10n report)</label>
71 <fieldset class="description">
72 <label for="quantity">$(l10n quantity)</label>
73 <label for="remidy">$(l10n remidy)</label>
74 <label for="quantity_weekly">$(l10n quantity_weekly)</label>
75 <span id="quantity">${mpx[quantity]}</span>
76 <span id="remidy">${mpx[remidy]}</span>
77 <span id="quantity_weekly">${mpx[quantity_weekly]}</span>
78 $( for n in {0..10}; do
79 [ -n "${mpx[quantity$n]}" -o -n "${mpx[remidy$n]}" -o -n "${mpx[quantity_weekly$n]}" ] \
81 <span id="quantity">%s</span>
82 <span id="remidy">%s</span>
83 <span id="quantity_weekly">%s</span>
84 ' "${mpx[quantity$n]}" "${mpx[remidy$n]}" "${mpx[quantity_weekly$n]}"
87 <p class="indicator_codes">
88 <label for="indicator">$(l10n indicator)</label>
89 <span id="indicator">${mpx[indicator]}</span>
91 <label for="icd10">$(l10n icd10)</label>
92 <span id="icd10">${mpx[icd10]}</span>
95 <p class="indicator_reading">
96 <label for="indicator_reading">$(l10n indicator_reading)</label>
97 <span id="indicator_reading">${mpx[indicator_reading]}</span>
101 <p class="therapy_dates">
102 <label>$(l10n therapy_dates):</label>
103 $(therapy_dates "$id" \
104 | while read date; do
105 printf '<span>%s</span>' "$date"
111 <label>$(l10n issuer)</label>
112 <span id="issuer">$mpx[issuer]</span>
115 <fieldset class="controls">
116 <a class="button" href="?p=prescriptions&edit=${mpx[prescription]}#${mpx[prescription]}">$(l10n edit)</a>
117 <a class="button" href="?p=therapy&id=${mpx[prescription]%.mpx}.tpy">$(l10n therapy)</a>