]> git.plutz.net Git - confetti/blobdiff - templates/view_client.sh
page to categorize vcards into groups
[confetti] / templates / view_client.sh
index 4860e853ff91c87534dcfa42ef207eba2f6fe0a3..c1e3987c09dc7807fdc8ae92d637004b6754fddc 100755 (executable)
@@ -90,10 +90,14 @@ cat <<END_HTML
   --><div class="section prescriptions">
     <h3>$(l10n prescriptions)</h3>
     <ul>
-    $(sed -rn 's:(.*)\t'$id'$:\1:p' "$_DATA/mappings/attendance" |while read each; do
-      cname="$(sed -rn 's:^SUMMARY\:(.*)$:\1:p' "$_DATA/ical/$each")"
-      echo '   <li><a class="item attendance" href="?p=courses#'$each'">'$cname'</a></li>'
-    done)
+    $(find "$_DATA/prescriptions/" -name "${id%.vcf}.*.mpx" \
+      | while read pfile; do
+        printf '%s\t%s\t%s\n' "$(grep '^date' "$pfile")" "$(sed -nr 's;^icd10:(.*)$;\1;p' "$pfile")"
+      done \
+      | sort -r | cut -f2 \
+      | while read icd; do
+        printf '<li><a href="?p=prescriptions&amp;client=%s" >%s</a></li>' "${id}" "${icd:-$(l10n no_icd)}"
+      done)
     </ul>
   </div>
 END_HTML