+ X-HEALTH-INSURANCE)
+ [ $cnt -gt 0 ] && printf '[h3 %s]' "$(l10n X-HEALTH-INSURANCE)"
+ seq 1 $cnt |while read c; do
+ IFS=\; read -r hi_name hi_number hi_status <<-EOF
+ $(pdi_value "$card" X-HEALTH-INSURANCE $c)
+ EOF
+ printf '[span .item .hi_company . %s]
+ [span .item .hi_number [label %s:] %s]
+ [span .item .hi_status [label %s:] %s]
+ ' "$(unescape "$hi_name" |HTML)" \
+ "$(l10n hi_number)" "$(unescape "$hi_number" |HTML)" \
+ "$(l10n hi_status)" "$(unescape "$hi_status" |HTML)"
+ done
+ ;;
+ therapies)
+ client="$(pdi_value "$card" UID)"
+ printf '[h3 %s]' "$(l10n therapies)"
+ (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] ' \
+ "${tpy%.*}/${tpy#*.}" "$(HTML "${tpydates:--}")"
+ done |sort -n
+ printf '[a .item .therapy href="/therapies/%s/new" . +]' "${client}"
+ ;;