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 # unescape() { [ $# = 0 ] && sed -E 's;\\(.);\1;g' || printf %s "$*" |sed -E 's;\\(.);\1;g'; }
50 # upcase=' y;abcdefghijklmnopqrstuvwxyzäöüé;ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜÉ;; '
55 id="${_PATH#/therapies/}"
56 id="${id%/*}.${id#*/}"
58 read junkx junky bg_dim junkz <<-E_READ
59 $(identify "$_EXEC/therapies/therapy_background.png")
62 vcffile="${_DATA}/vcard/${id%.*}.vcf"
63 mpxfile="${_DATA}/prescriptions/${id}.mpx"
64 tpyfile="${_DATA}/therapies/${id}.tpy"
66 vcf="$(pdi_load "$vcffile")"
67 mpx="$(sed '1s;^;\n;; s/:/;:/' "$mpxfile")"
68 tpy="$(sed '1s;^;\n;; s/:/;:/' "$tpyfile")"
70 VCF(){ pdi_value "$vcf" "$@"; }
71 MPX(){ pdi_value "$mpx" "$@"; }
72 TPY(){ pdi_value "$tpy" "$@"; }
74 . $_EXEC/therapies/page.sh \
75 | yield_page therapy /therapies/therapy.css