]> git.plutz.net Git - lobster/commitdiff
allow additional remedies to be prescribed
authorpaul <paul@plutz.net>
Sat, 18 Jun 2016 17:04:11 +0000 (17:04 +0000)
committerpaul <paul@plutz.net>
Sat, 18 Jun 2016 17:04:11 +0000 (17:04 +0000)
svn path=/trunk/; revision=115

templates/edit_prescription.sh
templates/prescriptions.css.sh
templates/text_therapy.sh
templates/therapy.html.sh
templates/view_client.sh
templates/view_prescription.sh

index 8ac9bb7e5c6cef68d9f1d530cbb96370f2a7e34b..285739aa3f9134ff76acb9b3aa625af6979108cb 100755 (executable)
@@ -113,16 +113,28 @@ cat <<END_HTML
 <label for="quantity">$(l10n quantity)</label>
 <label for="remidy">$(l10n remidy)</label>
 <label for="quantity_weekly">$(l10n quantity_weekly)</label>
+<p>
 <input id="quantity" name="quantity" value="${mpx[quantity]}" placeholder="$(l10n quantity)">
 <textarea id="remidy" name="remidy" placeholder="$(l10n remidy)">${mpx[remidy]}</textarea>
 <input id="quantity_weekly" name="quantity_weekly" value="${mpx[quantity_weekly]}" placeholder="$(l10n quantity_weekly)">
+</p>
+
+$( for n in {0..10}; do
+  if [ "$n" -eq 0 -o -n "${mpx[quantity$n]}" -o -n "${mpx[remidy$n]}" -o -n "${mpx[quantity_weekly$n]}" ]; then
+    printf '<input type="checkbox" checked="checked">'
+  else
+    printf '<input type="checkbox">'
+  fi
+  printf '<p>
+    <input class="quantity" name="quantity" placeholder="%s" value="%s">
+    <textarea class="remidy" name="remidy" placeholder="%s">%s</textarea>
+    <input class="quantity_weekly" name="quantity_weekly" placeholder="%s" value="%s">
+    </p>
+  ' "$(l10n quantity)" "${mpx[quantity$n]}" \
+    "$(l10n remidy)" "${mpx[remidy$n]}" \
+    "$(l10n quantity_weekly)" "${mpx[quantity_weekly$n]}"
+done )
 
-<label for="quantity1">$(l10n quantity)</label>
-<label for="remidy1">$(l10n remidy)</label>
-<label for="quantity_weekly1">$(l10n quantity_weekly)</label>
-<input id="quantity1" name="quantity1" value="${mpx[quantity1]}" placeholder="$(l10n quantity)">
-<textarea id="remidy1" name="remidy1" placeholder="$(l10n remidy)">${mpx[remidy1]}</textarea>
-<input id="quantity_weekly1" name="quantity_weekly1" value="${mpx[quantity_weekly1]}" placeholder="$(l10n quantity_weekly)">
 
 <br>
 <p class="indicator_codes">
index 49db4976bcad9a89bf2c4083791a9a31943cd4bb..9d1baf8fe6e74c744e361cb1fdc96e5829c37a8a 100755 (executable)
 # You should have received a copy of the GNU Affero General Public License
 # along with Confetti.  If not, see <http://www.gnu.org/licenses/>. 
 
-. ${0%/*}/attendees.css.sh
+. ${0%/*}/cards.css.sh
 
 cat <<EOF
 /**/
+body {padding-bottom: 3em; }
 
 .prescription {
   display: inline-block;
@@ -29,6 +30,7 @@ cat <<EOF
   margin: 1em -1% 0 2%; padding: 0;
   border: 1px solid #888;
   overflow: hidden;
+  vertical-align: top;
 }
 form.prescription { padding-top: 1ex;}
 
@@ -210,19 +212,31 @@ input[name=presctype][value^=altpractition]:checked  ~ fieldset,
 .prescription .description { width: 100%; position: relative;}
   .description * { margin-right: -.625ex; vertical-align: top; }
   .description label {vertical-align: bottom;}
-  .description label[for=quantity1],
-  .description label[for=remidy1],
-  .description label[for=quantity_weekly1] {display: none;}
 
   .description label[for=quantity] { width: 20%;}
-  .description #quantity,
-  .description #quantity1 { width: 20%;  height: 3em; text-align: center;}
   .description label[for=remidy] { width: 60%; }
-  .description #remidy,
-  .description #remidy1 { width: 60%; height: 3em;}
   .description label[for=quantity_weekly] { width: 20%;}
+  .description #quantity,
+  .description .quantity { width: 20%;  height: 3em; text-align: center;}
+  .description #remidy,
+  .description .remidy { width: 60%; height: 3em;}
   .description #quantity_weekly,
-  .description #quantity_weekly1 { width: 20%; height: 3em; text-align: center;}
+  .description .quantity_weekly { width: 20%; height: 3em; text-align: center;}
+
+  .description input[type=checkbox] { display: none; }
+  .description input[type=checkbox] + p { display: none; }
+  .description input:checked + p { display: inline-block; }
+  .description input:checked + p + input { display: block;}
+  .description input:checked + p + input:after {
+     display: block; width: 3ex;
+     background-color: #FFF;
+     border: 1px solid black;
+     margin-top: .25em;
+     text-align: center;
+     content: '+';
+  }
+  .description input:checked + p + input:checked,
+  .description input:checked { display: none; }
 
   .description .indicator_codes {display: inline-block; width: 20%; padding: 0; padding-top: 1.5ex;}
   .description label[for=indicator],
index fff9150d71b51a6b4c77bfa63fd90aa1c27eac5a..bda1231de5b12d9a80d508a443b4fb90fd088498 100755 (executable)
@@ -23,3 +23,4 @@ item_name[therapist]="Therapeut"
 item_name[number]="Nr."
 item_name[signature]="Un&shy;ter&shy;schrift"
 item_name[weekly]="p. Woche"
+item_name[notes]="Notizen"
index 0c91487cee322764b670f06608a124cf98d7f1fe..05c50fd157f8338afa524c325cfbc568048703d2 100755 (executable)
@@ -147,10 +147,12 @@ cat <<EOF
      ${mpx[housecall]:+<span class="catalogue">$(l10n housecall)</span>}
         ${mpx[report]:+<span class="catalogue">$(l10n report)</span>}
 
-  <ul>
-    ${mpx[remidy]:+ <li>${mpx[quantity]}  ${mpx[remidy]}  ${mpx[quantity_weekly]:+($mpx[quantity_weekly] $(l10n weekly))}</li>}
-    ${mpx[remidy1]:+<li>${mpx[quantity1]} ${mpx[remidy1]} ${mpx[quantity_weekly1]:+($mpx[quantity_weekly1] $(l10n weekly))}</li>}
-  </ul>
+  <ul>$(for n in '' {0..10}; do
+    [ -n "${mpx[remidy$n]}" ] && \
+    printf '<li>%s %s %s</li>' "${mpx[quantity$n]}" \
+                               "${mpx[remidy$n]}" \
+                               "${mpx[quantity_weekly$n]:+($mpx[quantity_weekly$n] $(l10n weekly))}"
+  done)</ul>
 
   ${mpx[indicator]:+<span class="indicator"><label>$(l10n indicator):</label>${mpx[indicator]}</span>}
       ${mpx[icd10]:+<span class="icd10">    <label>$(l10n icd10):</label>${mpx[icd10]}</span>}
index ef214c586214833c639f0ae82b8c7977b7ec82c3..c83fac9fd18f966cc396eae2422e8a1500a99237 100755 (executable)
@@ -86,16 +86,20 @@ cat <<END_HTML
   --><div class="section prescriptions">
     <h3>$(l10n prescriptions)</h3>
     <ul>
-    $(find "$_DATA/prescriptions/" -name "${id%.vcf}.*.mpx" \
+    $(declare -A mpx
+      find "$_DATA/prescriptions/" -name "${id%.vcf}.*.mpx" \
       | while read pfile; do
-        printf '%s\t%s\t%s\n'  
-        printf '<li><a href="?p=prescriptions&amp;client=%s#%s" >%s: %s - %s%s</a></li>' \
-          "${id}" \
-          "${id}" \
-          "$(sed -nr 's;^date:(.+)$;\1;p' "$pfile")" \
-          "$(sed -nr 's;^indicator:(.+)$;\1;p' "$pfile")" \
-          "$(sed -nr 's;^quantity:(.+) ?$;\1x ;p' "$pfile")$(sed -nr 's;^remidy:(.+)$;\1;p' "$pfile")" \
-          "$(sed -nr 's;^quantity1:(.+) ?$;,\1x ;p' "$pfile")$(sed -nr 's;^remidy1:(.+)$;\1;p' "$pfile")"
+        mpx=(); cat "$pfile" |while read -r line; do
+          val="${line#*:}"
+          mpx[${line%%:*}]="$(htmlsafe "${val//\\n/$BR}")"
+        done
+        printf '<li><a href="?p=prescriptions&amp;client=%s#%s" >%s: %s - %s</a></li>' \
+          "${id}" "${pfile##*/}" "${mpx[date]}" "${mpx[indicator]}" \
+          "$([ -n "${mpx[remidy]}" ] && printf '%s %s' "${mpx[quantity]}" "${mpx[remidy]}" 
+             for n in {0..10}; do
+               [ -n "${mpx[remidy${n}]}" ] && printf ', %s %s' "${mpx[quantity${n}]}" "${mpx[remidy${n}]}" 
+             done
+           )"
       done |sort -r
     )
     </ul>
index ce2b4967b7bf2e7ca4bbb37f22662733220a5a21..78f995b97d425aa22ebe9c5df4354368addc4fd2 100755 (executable)
@@ -69,21 +69,20 @@ 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>