prescriptions) printf %s "Verordnungen";;
new_prescription) printf %s "Neue Verordnung";;
no_icd) printf %s "Kein ICD Code";;
+ therapy) printf %s "Therapie";;
therapies) printf %s "Therapien";;
X-ZACK-JOINDATE) printf %s "An­mel­de­da­tum";;
therapies)
client="$(pdi_value "$card" UID)"
printf '[h3 %s]' "$(l10n therapies)"
- (cd "$_DATA/prescriptions/"; printf '%s\n' "${client}".*.mpx) \
- | while read mpxfile; do
- [ "$mpxfile" = "${client}.*.mpx" ] && break
- mpx="${mpxfile%.mpx}";
- printf '[a .item .therapy href="/therapies/%s" . Therapy - %s]' \
- "${mpx%.*}/${mpx#*.}" "$(sed -E '/^date:.*/{s;^date:;;;q;};d;' "$_DATA/prescriptions/$mpxfile")"
+ (cd "$_DATA/therapies/"; printf '%s\n' "${client}".*.tpy) \
+ | while read tpyfile; do
+ [ "$tpyfile" = "${client}.*.tpy" ] && break
+ tpy="${tpyfile%.tpy}";
+ tpydates="$(sed -En 's;^session[0-9]+_date:;;p;' "$_DATA/therapies/$tpyfile" \
+ | sort \
+ | sed -E ':X;N;$!bX; s;^[\n ]+;;; s;[\n ]+$;;; s;(\n.*\n|\n); - ;;'
+ )"
+ printf '[a .item .therapy href="/therapies/%s" . %s %s]' \
+ "${tpy%.*}/${tpy#*.}" "$(l10n therapy)" "$(HTML "${tpydates:--}")"
done |sort -r
;;
*)[ $cnt -gt 0 ] && printf '[h3 %s]' "$(l10n "$item")"