3 # Copyright 2016, 2020 Paul Hänsch
5 # This file is part of Lobster.
7 # Lobster is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Affero General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # Lobster is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU Affero General Public License for more details.
17 # You should have received a copy of the GNU Affero General Public License
18 # along with Lobster. If not, see <http://www.gnu.org/licenses/>.
21 /therapies/therapy.css)
22 . $_EXEC/cgilite/file.sh
23 FILE $_EXEC/therapies/therapy.css
26 /therapies/*.*_session*.png)
27 if [ -r "$_DATA/$_PATH" ]; then
28 . $_EXEC/cgilite/file.sh
34 card="${_PATH#/therapies/}"
36 uid="$(timeid)$(randomid)"
37 if [ -f "${_DATA}/vcard/${card}.vcf" ]; then
38 touch "${_DATA}/therapies/${card}.${uid}.tpy"
39 rm -f "${_DATA}/cache/${card}.vcf.cache"
40 REDIRECT "/therapies/${card}/${uid}"
47 . $_EXEC/therapies/l10n.sh
49 id="${_PATH#/therapies/}"
50 id="${id%/*}.${id#*/}"
52 read junkx junky bg_dim junkz <<-E_READ
53 $(identify "$_EXEC/therapies/therapy_background.png")
56 vcffile="${_DATA}/vcard/${id%.*}.vcf"
57 mpxfile="${_DATA}/prescriptions/${id}.mpx"
58 tpyfile="${_DATA}/therapies/${id}.tpy"
60 vcf="$(pdi_load "$vcffile")"
61 mpx="$(sed '1s;^;\n;; s/:/;:/' "$mpxfile")"
62 tpy="$(sed '1s;^;\n;; s/:/;:/' "$tpyfile")"
64 VCF(){ pdi_value "$vcf" "$@"; }
65 MPX(){ pdi_value "$mpx" "$@"; }
66 TPY(){ pdi_value "$tpy" "$@" >/dev/null && pdi_value "$tpy" "$@" |pdi_unescape; }
68 . $_EXEC/therapies/page.sh \
69 | yield_page therapy /therapies/therapy.css