additional prescription functions
authorpaul <paul@plutz.net>
Thu, 7 Apr 2016 04:07:58 +0000 (04:07 +0000)
committerpaul <paul@plutz.net>
Thu, 7 Apr 2016 04:07:58 +0000 (04:07 +0000)
svn path=/trunk/; revision=90

actions/update_prescription.sh
actions/update_therapy.sh
templates/edit_prescription.sh
templates/frame.html.sh
templates/prescriptions.css.sh
templates/text_prescriptions.sh
templates/therapy.css.sh
templates/therapy.html.sh
templates/view_client.sh
templates/view_prescription.sh

index 68cb7fd..a0d9371 100755 (executable)
@@ -50,4 +50,4 @@ case "${_POST[action]}" in
     ;;
 esac
 
     ;;
 esac
 
-redirect "?p=prescriptions&client=${client}"
+redirect "?p=prescriptions&client=${client}#${prescription}"
index 43a2e1f..cc95e39 100755 (executable)
@@ -42,13 +42,38 @@ if [ -n "$_POST[delete_session]" ]; then
 
 elif [ -n "$_POST[new_session]" ]; then
   sid="$_POST[new_session]"
 
 elif [ -n "$_POST[new_session]" ]; then
   sid="$_POST[new_session]"
-  printf '%s:exists\n' "$sid" >>"$tempfile"
 
   identify "$_EXEC/templates/therapy_background.png" \
   | sed -r 's;^.* ([0-9]+x[0-9]+) .*$;\1;' \
   | read dim
 
   convert -size "$dim" xc:transparent "${tpyfile%.tpy}_${sid}.png"
 
   identify "$_EXEC/templates/therapy_background.png" \
   | sed -r 's;^.* ([0-9]+x[0-9]+) .*$;\1;' \
   | read dim
 
   convert -size "$dim" xc:transparent "${tpyfile%.tpy}_${sid}.png"
+
+  printf '%s:exists\n' "$sid" >>"$tempfile"
+  printf '%s_open:checked\n' "$sid" >>"$tempfile"
+
+elif [ -n "$_POST[dotmark.x]" -a -n "$_POST[dotmark.y]" ]; then
+  sed -rn 's;^(session[0-9]+)_open:checked$;\1;p' "$tempfile" \
+  | sort -n \
+  | tail -n1 \
+  | read sid
+
+  x="$_POST[dotmark.x]"
+  y="$_POST[dotmark.y]"
+
+  case "$_POST[color]" in
+    c000) c="#000000";;
+    c001) c="#000088";;
+    c010) c="#008800";;
+    c011) c="#008888";;
+    c100) c="#880000";;
+    c101) c="#880088";;
+    c110) c="#888800";;
+    c111) c="#888888";;
+  esac
+
+  convert "${tpyfile%.tpy}_${sid}.png" -fill "$c" -stroke "$c" -draw "circle $x,$y $(($x+5)),$y" "${tpyfile%.tpy}_${sid}.png"
+
 fi
 
 mv "$tempfile" "$tpyfile"
 fi
 
 mv "$tempfile" "$tpyfile"
index b916258..4701ebb 100755 (executable)
@@ -21,6 +21,63 @@ cat <<END_HTML
 <form class="prescription" action="?action=update_prescription" method="POST">
 <input type="hidden" name="prescription" value="${mpx[prescription]}">
 
 <form class="prescription" action="?action=update_prescription" method="POST">
 <input type="hidden" name="prescription" value="${mpx[prescription]}">
 
+<table class="type"><tbody>
+  <tr>
+    <th>$(l10n doctor)</th>
+    <th>$(l10n dentist)</th>
+    <th>$(l10n noprescription)</th>
+    <th>$(l10n altpractition)</th>
+  </tr>
+  <tr>
+    <td class="selfpaid doctor">
+      <input type=radio name=presctype id=doctor_selfpaid value=doctor_selfpaid>
+      <label for=doctor_selfpaid>$(l10n selfpaid)</label>
+    </td>
+    <td class="selfpaid dentist">
+      <input type=radio name=presctype id=dentist_selfpaid value=dentist_selfpaid>
+      <label for=dentist_selfpaid>$(l10n selfpaid)</label>
+    </td>
+    <td class="selfpaid noprescription">
+      <input type=radio name=presctype id=noprescription_selfpaid value=noprescription_selfpaid>
+      <label for=noprescription_selfpaid>$(l10n selfpaid)</label>
+    </td>
+    <td class="selfpaid altpractition">
+      <input type=radio name=presctype id=altpractition_selfpaid value=altpractition_selfpaid>
+      <label for=altpractition_selfpaid>$(l10n selfpaid)</label>
+    </td>
+  </tr>
+  <tr>
+    <td class="private doctor">
+      <input type=radio name=presctype id=doctor_private value=doctor_private>
+      <label for=doctor_private>$(l10n private)</label>
+    </td>
+    <td class="private dentist">
+      <input type=radio name=presctype id=dentist_private value=dentist_private>
+      <label for=dentist_private>$(l10n private)</label>
+    </td>
+    <td class="private noprescription">
+    </td>
+    <td class="private altpractition">
+      <input type=radio name=presctype id=altpractition_private value=altpractition_private>
+      <label for=altpractition_private>$(l10n private)</label>
+    </td>
+  </tr>
+  <tr>
+    <td class="compulsory doctor">
+      <input type=radio name=presctype id=doctor_compulsory value=doctor_compulsory>
+      <label for=doctor_compulsory>$(l10n compulsory)</label>
+    </td>
+    <td class="compulsory dentist">
+      <input type=radio name=presctype id=dentist_compulsory value=dentist_compulsory>
+      <label for=dentist_compulsory>$(l10n compulsory)</label>
+    </td>
+    <td class="compulsory noprescription">
+    </td>
+    <td class="compulsory altpractition">
+    </td>
+  </tr>
+</tbody></table>
+
 <fieldset class="baseinfo">
 <label for="insurance">$(l10n insurance)</label>
 <input id="insurance" name="insurance" value="${mpx[insurance]}" placeholder="$(l10n insurance)">
 <fieldset class="baseinfo">
 <label for="insurance">$(l10n insurance)</label>
 <input id="insurance" name="insurance" value="${mpx[insurance]}" placeholder="$(l10n insurance)">
@@ -37,7 +94,7 @@ cat <<END_HTML
 </fieldset>
 
 <fieldset class="misc">
 </fieldset>
 
 <fieldset class="misc">
-<h1>$(l10n therapy_prescription)</h1>
+<h1 id="${mpx[prescription]}">$(l10n therapy_prescription)</h1>
 
 <label for="addcontrib">$(l10n addcontrib)</label>
 <input id="addcontrib" name="addcontrib" value="${mpx[addcontrib]}" placeholder="$(l10n addcontrib)">
 
 <label for="addcontrib">$(l10n addcontrib)</label>
 <input id="addcontrib" name="addcontrib" value="${mpx[addcontrib]}" placeholder="$(l10n addcontrib)">
@@ -94,11 +151,18 @@ cat <<END_HTML
 <input id="quantity_weekly1" name="quantity_weekly1" value="${mpx[quantity_weekly1]}" placeholder="$(l10n quantity_weekly)">
 
 <br>
 <input id="quantity_weekly1" name="quantity_weekly1" value="${mpx[quantity_weekly1]}" placeholder="$(l10n quantity_weekly)">
 
 <br>
+<p class="indicator_codes">
 <label for="indicator">$(l10n indicator)</label>
 <input id="indicator" name="indicator" value="${mpx[indicator]}" placeholder="$(l10n indicator)">
 <br>
 <label for="icd10">$(l10n icd10)</label>
 <input id="icd10" name="icd10" value="${mpx[icd10]}" placeholder="$(l10n icd10)">
 <label for="indicator">$(l10n indicator)</label>
 <input id="indicator" name="indicator" value="${mpx[indicator]}" placeholder="$(l10n indicator)">
 <br>
 <label for="icd10">$(l10n icd10)</label>
 <input id="icd10" name="icd10" value="${mpx[icd10]}" placeholder="$(l10n icd10)">
+</p>
+<br>
+<p class="indicator_reading">
+<label for="indicator_reading">$(l10n indicator_reading)</label>
+<textarea id="indicator_reading" name="indicator_reading" placeholder="$(l10n indicator_reading)">${mpx[indicator_reading]}</textarea>
+</p>
 </fieldset>
 
 <fieldset class="controls">
 </fieldset>
 
 <fieldset class="controls">
index 2cc13d1..5fd6e7c 100755 (executable)
@@ -26,6 +26,7 @@ cat <<EOF
 <html>
   <head>
     <title>$(l10n p_${PAGE})</title>
 <html>
   <head>
     <title>$(l10n p_${PAGE})</title>
+    <meta name="viewport" content="width=device-width">
     <style type="text/css">
     <!--
 * {
     <style type="text/css">
     <!--
 * {
index 3374f98..cd87760 100755 (executable)
@@ -50,6 +50,26 @@ cat <<EOF
   font-size: .75em;
 }
 
   font-size: .75em;
 }
 
+.prescription table {display: block; width: 100%; border-collapse: collapse;}
+.prescription table tbody {width: 100%; margin: 0 auto;}
+.prescription table tr {display: table-row; width: 100%; margin: 0 auto;}
+.prescription table tr th,
+.prescription table tr td {
+  display: table-cell;
+  text-align: left;
+  padding: .25ex 1ex;
+  border-left: 1px solid red;
+}
+.prescription table tr th { padding: .25em 1ex; border-bottom: 1px solid red;}
+.prescription table tr th:nth-of-type(1),
+.prescription table tr td:nth-of-type(1) { border-left: none;}
+
+td.private  {background-color: #BFB;}
+td.selfpaid {background-color: #FFB;}
+td.compulsory.doctor {background-color: #BBF;}
+td.compulsory.dentist {background-color: #FBB;}
+td.altpractition { background-color: #FBF;}
+
 .prescription fieldset {
   display: inline-block;
   margin: 0; padding: 1ex;
 .prescription fieldset {
   display: inline-block;
   margin: 0; padding: 1ex;
@@ -175,8 +195,8 @@ cat <<EOF
   }
   .catalogue label[for=presccontinual] { margin-right: 33%;}
 
   }
   .catalogue label[for=presccontinual] { margin-right: 33%;}
 
-.prescription .description { width: 100%; }
-  .description * { margin-right: -.625ex; vertical-align: top;}
+.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 {vertical-align: bottom;}
   .description label[for=quantity1],
   .description label[for=remidy1],
@@ -192,10 +212,16 @@ cat <<EOF
   .description #quantity_weekly,
   .description #quantity_weekly1 { width: 20%; height: 3em; text-align: center;}
 
   .description #quantity_weekly,
   .description #quantity_weekly1 { width: 20%; height: 3em; text-align: center;}
 
+  .description .indicator_codes {display: inline-block; width: 20%; padding: 0; padding-top: 1.5ex;}
   .description label[for=indicator],
   .description label[for=indicator],
-  .description label[for=icd10] { display: block; width: 20%;}
+  .description label[for=icd10] { display: block; width: 100%;}
   .description #icd10,
   .description #icd10,
-  .description #indicator {width: 20%; text-align: right;}
+  .description #indicator {width: 100%; text-align: right;}
+
+  .description .indicator_reading { display: inline-block; width: 78%; padding: 0; padding-top: 1.5ex;  margin-left: 2%;}
+  .description label[for=indicator_reading],
+  .description #indicator_reading { width: 100%; display: block;}
+  .description #indicator_reading { height: 4em;}
 
 .prescription .controls { width: 100%; }
   .controls a.button,
 
 .prescription .controls { width: 100%; }
   .controls a.button,
index 047dc49..4fa02a5 100755 (executable)
@@ -41,6 +41,7 @@ item_name[housecall]="Haus&shy;be&shy;such"
 item_name[report]="The&shy;ra&shy;pie&shy;be&shy;richt"
 item_name[indicator]="In&shy;di&shy;ka&shy;tions&shy;schlüssel"
 item_name[icd10]="ICD-10-Code"
 item_name[report]="The&shy;ra&shy;pie&shy;be&shy;richt"
 item_name[indicator]="In&shy;di&shy;ka&shy;tions&shy;schlüssel"
 item_name[icd10]="ICD-10-Code"
+item_name[indicator_reading]="Befund Beschreibung"
 item_name[insurance]="Krankenkasse bzw. Kostenträger"
 item_name[prescription_by_catalogue]="Verordnung nach Maßgabe des Kataloges (Regelfall)"
 item_name[therapy_start]="Be&shy;hand&shy;lungs&shy;be&shy;ginn spä&shy;test. am"
 item_name[insurance]="Krankenkasse bzw. Kostenträger"
 item_name[prescription_by_catalogue]="Verordnung nach Maßgabe des Kataloges (Regelfall)"
 item_name[therapy_start]="Be&shy;hand&shy;lungs&shy;be&shy;ginn spä&shy;test. am"
@@ -49,3 +50,11 @@ item_name[save]="Speichern"
 item_name[cancel]="Abbrechen"
 item_name[delete]="Löschen"
 item_name[therapy]="Zur Therapie"
 item_name[cancel]="Abbrechen"
 item_name[delete]="Löschen"
 item_name[therapy]="Zur Therapie"
+
+item_name[doctor]="Arzt"
+item_name[dentist]="Zahn&shy;arzt"
+item_name[altpractition]="Heil&shy;prak&shy;tiker"
+item_name[noprescription]="Ohne Ver&shy;ord&shy;nung"
+item_name[selfpaid]="Selbst&shy;zah&shy;lend"
+item_name[private]="Pri&shy;vat"
+item_name[compulsory]="Ge&shy;setz&shy;lich"
index 8a87a8e..807d47f 100755 (executable)
@@ -84,7 +84,7 @@ fieldset.color {
 }
 .dotmark.ov {
   position: absolute;
 }
 .dotmark.ov {
   position: absolute;
-  bottom: 5px; right: 0%;
+  bottom: 5px; right: 0;
   z-index: 1;
 }
 @media(min-width: 800px){
   z-index: 1;
 }
 @media(min-width: 800px){
index f6533f7..9d37db8 100755 (executable)
@@ -108,7 +108,6 @@ cat <<EOF
  --><input class=therapist name=${sid}_therapist value="" placeholder="$(l10n therapist)" /><!--
  --><button type=submit name=new_session value=$sid>+</button></span>
     <input type=hidden name="${sid}_note1" value="">
  --><input class=therapist name=${sid}_therapist value="" placeholder="$(l10n therapist)" /><!--
  --><button type=submit name=new_session value=$sid>+</button></span>
     <input type=hidden name="${sid}_note1" value="">
-    <input type=hidden name="${sid}_open" value="checked">
   </fieldset>
 EOF
 }
   </fieldset>
 EOF
 }
index bbcc091..ef214c5 100755 (executable)
@@ -89,7 +89,8 @@ cat <<END_HTML
     $(find "$_DATA/prescriptions/" -name "${id%.vcf}.*.mpx" \
       | while read pfile; do
         printf '%s\t%s\t%s\n'  
     $(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</a></li>' \
+        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")" \
           "${id}" \
           "$(sed -nr 's;^date:(.+)$;\1;p' "$pfile")" \
           "$(sed -nr 's;^indicator:(.+)$;\1;p' "$pfile")" \
index 57ff0b6..df89cdb 100755 (executable)
@@ -34,7 +34,7 @@ cat <<END_HTML
 </fieldset>
 
 <fieldset class="misc">
 </fieldset>
 
 <fieldset class="misc">
-<h1>$(l10n therapy_prescription)</h1>
+<h1 id="${mpx[prescription]}">$(l10n therapy_prescription)</h1>
 <br>
 <label for="addcontrib">$(l10n addcontrib)</label>
 <span id="addcontrib">${mpx[addcontrib]}</span>
 <br>
 <label for="addcontrib">$(l10n addcontrib)</label>
 <span id="addcontrib">${mpx[addcontrib]}</span>
@@ -85,15 +85,22 @@ cat <<END_HTML
 <span id="quantity_weekly1">${mpx[quantity_weekly1]}</span>
 
 <br>
 <span id="quantity_weekly1">${mpx[quantity_weekly1]}</span>
 
 <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>
+</p>
 </fieldset>
 
 <fieldset class="controls">
 </fieldset>
 
 <fieldset class="controls">
-<a class="button" href="?p=prescriptions&amp;edit=${mpx[prescription]}">$(l10n edit)</a>
+<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>
 </fieldset>
 
 <a class="button" href="?p=therapy&amp;id=${mpx[prescription]%.mpx}.tpy">$(l10n therapy)</a>
 </fieldset>