]> git.plutz.net Git - lobster/commitdiff
list therapies in vcard overview
authorPaul Hänsch <paul@plutz.net>
Wed, 11 Dec 2019 20:08:41 +0000 (21:08 +0100)
committerPaul Hänsch <paul@plutz.net>
Wed, 11 Dec 2019 20:08:41 +0000 (21:08 +0100)
cards/l10n.sh
cards/list.sh
cards/widgets.sh

index 044a6a1eec654dc8f66bc454813b902ac28449c7..ec02d65f19b7dd2c87cb094e4a2834e3be6baac7 100755 (executable)
@@ -85,6 +85,7 @@ l10n(){
     prescriptions) printf %s "Verordnungen";;
     new_prescription) printf %s "Neue Verordnung";;
     no_icd) printf %s "Kein ICD Code";;
+    therapies) printf %s "Therapien";;
   
     X-ZACK-JOINDATE)  printf %s "An&shy;mel&shy;de&shy;da&shy;tum";;
     X-ZACK-LEAVEDATE) printf %s "Ab&shy;mel&shy;de&shy;da&shy;tum";;
index 9ff31254f488fa32ebaabb020b190dd873d6cb55..9224ace75460e82691b865dcb970b27c36910643 100755 (executable)
@@ -63,6 +63,7 @@ print_card(){
       [div .section .phone     $(card_item "$card" TEL EMAL IMPP URL)]
       [div .section .insurance $(card_item "$card" X-HEALTH-INSURANCE)]
       [div .section .note      $(card_item "$card" NOTE X-CLIENT-REFERRAL)]
+      [div .section .therapies $(card_item "$card" therapies)]
       [div .control
         [a .item href="/cards/edit_card.sh?card=${cardfile##*/}" $(l10n edit)]
         [a .item href="/cards/export_card.sh?card=${cardfile##*/}" $(l10n vcf_export)]
index 4d0f7337cbc22fbab0d6c1f1093caa51d92d43c5..d2ed32611932d5fd9bf7067b904679892f797e69 100755 (executable)
@@ -21,7 +21,7 @@ cat <<EOF
   [fieldset .item
     [legend $(l10n filter_item):]
 
-    $(for field in any name street zip TEL BDAY CATEGORIES; do
+    $(for field in any name street zip TEL BDAY; do
       printf '[input id="%s%i" type="radio" name="filter_type%i" value="%s" %s]
               [label for="%s%i" %s ]' \
               "$field" "$n" "$n" "$field" "$([ "$1" = "$field" ] && printf checked )" \
@@ -132,6 +132,17 @@ card_item(){
                    "$(l10n hi_status)" "$(unescape "$hi_status" |HTML)"
         done
         ;;
+      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")"
+        done |sort -r
+        ;;
       *)[ $cnt -gt 0 ] && printf '[h3 %s]' "$(l10n "$item")"
         shy="$(printf '\302\255')"
         seq 1 $cnt |while read c; do