]> git.plutz.net Git - confetti/blobdiff - templates/view_prescription.sh
parsing and processing of aggregated values, split values, vcard escapes
[confetti] / templates / view_prescription.sh
index ce2b4967b7bf2e7ca4bbb37f22662733220a5a21..ced72413830caa682ff56ef390c0f14714e2417a 100755 (executable)
@@ -69,36 +69,49 @@ cat <<END_HTML
 </fieldset>
 
 <fieldset class="description">
-
-<label for="quantity">$(l10n quantity)</label>
-<label for="remidy">$(l10n remidy)</label>
-<label for="quantity_weekly">$(l10n quantity_weekly)</label>
-<span id="quantity">${mpx[quantity]}</span>
-<span id="remidy">${mpx[remidy]}</span>
-<span id="quantity_weekly">${mpx[quantity_weekly]}</span>
-
-<label for="quantity1">$(l10n quantity)</label>
-<label for="remidy1">$(l10n remidy)</label>
-<label for="quantity_weekly1">$(l10n quantity_weekly)</label>
-<span id="quantity1">${mpx[quantity1]}</span>
-<span id="remidy1">${mpx[remidy1]}</span>
-<span id="quantity_weekly1">${mpx[quantity_weekly1]}</span>
-
+  <label for="quantity">$(l10n quantity)</label>
+  <label for="remidy">$(l10n remidy)</label>
+  <label for="quantity_weekly">$(l10n quantity_weekly)</label>
+  <span id="quantity">${mpx[quantity]}</span>
+  <span id="remidy">${mpx[remidy]}</span>
+  <span id="quantity_weekly">${mpx[quantity_weekly]}</span>
+$( for n in {0..10}; do
+  [ -n "${mpx[quantity$n]}" -o -n "${mpx[remidy$n]}" -o -n "${mpx[quantity_weekly$n]}" ] \
+  && printf '
+    <span id="quantity">%s</span>
+    <span id="remidy">%s</span>
+    <span id="quantity_weekly">%s</span>
+    ' "${mpx[quantity$n]}" "${mpx[remidy$n]}" "${mpx[quantity_weekly$n]}"
+done )
 <br>
 <p class="indicator_codes">
-<label for="indicator">$(l10n indicator)</label>
-<span id="indicator">${mpx[indicator]}</span>
-<br>
-<label for="icd10">$(l10n icd10)</label>
-<span id="icd10">${mpx[icd10]}</span>
+  <label for="indicator">$(l10n indicator)</label>
+  <span id="indicator">${mpx[indicator]}</span>
+  <br>
+  <label for="icd10">$(l10n icd10)</label>
+  <span id="icd10">${mpx[icd10]}</span>
 </p>
 <br>
 <p class="indicator_reading">
-<label for="indicator_reading">$(l10n indicator_reading)</label>
-<span id="indicator_reading">${mpx[indicator_reading]}</span>
+  <label for="indicator_reading">$(l10n indicator_reading)</label>
+  <span id="indicator_reading">${mpx[indicator_reading]}</span>
 </p>
 </fieldset>
 
+<p class="therapy_dates">
+  <label>$(l10n therapy_dates):</label>
+  $(therapy_dates "$id" \
+    | while read date; do
+      printf '<span>%s</span>' "$date"
+    done
+  )
+</p>
+
+<p class="issuer">
+  <label>$(l10n issuer)</label>
+  <span id="issuer">$mpx[issuer]</span>
+</p>
+
 <fieldset class="controls">
 <a class="button" href="?p=prescriptions&amp;edit=${mpx[prescription]}#${mpx[prescription]}">$(l10n edit)</a>
 <a class="button" href="?p=therapy&amp;id=${mpx[prescription]%.mpx}.tpy">$(l10n therapy)</a>