X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=templates%2Ftherapy.html.sh;h=63216ad703ced7ce40ca7120f70d4362e2932c3a;hp=7d42aff111e893f384e3b8effb3f5ebcb1b81c67;hb=2d1ff8e80efbded90e01dc0fe477757bbc7e08f0;hpb=3ed59adf9bde7e038389d6b21c7e221abf6b3b28;ds=sidebyside diff --git a/templates/therapy.html.sh b/templates/therapy.html.sh index 7d42aff..63216ad 100755 --- a/templates/therapy.html.sh +++ b/templates/therapy.html.sh @@ -33,8 +33,13 @@ t_session_note(){ *) c7=checked;; esac +if [ "$note_n" -eq 1 -o -n "${tpy[session${session_n}_note${note_n}]}" ]; then + printf '' +else + printf '' +fi cat < +
@@ -54,16 +59,8 @@ t_session(){ sid=session${session_n} if [ "$tpy[${sid}_sigset]" = pos ]; then - sig=neg - sigcheck=checked - elif [ "$tpy[${sid}_sigset]" = neg ]; then - sig=pos - unset sigcheck - elif [ "$tpy[${sid}_signature]" = pos ]; then - sig=neg sigcheck=checked else - sig=pos unset sigcheck fi @@ -76,19 +73,13 @@ cat <${tpy[${sid}_therapist]} + -->
- $(n=1; while [ -n "${tpy[${sid}_note${n}]+x}" ]; do - t_session_note $session_n $n - n=$(($n+1)) - done - printf '' "$sid" "$n" - ) + $( for n in {1..50}; do t_session_note $session_n $n; done ) -
EOF } @@ -125,46 +116,67 @@ case "$tpy[color]" in esac cat <Behandlungen +

$(l10n therapy)

-
-

$client_name

- < $(l10n prescriptionlist) -
+
+

$client_name

+ < $(l10n prescriptionlist) +
-
-

$(l10n therapy_prescription)

- ${mpx[insurance]} - ${mpx[date]} - -
    - ${mpx[remidy]:+
  • ${mpx[quantity]} ${mpx[remidy]}
  • } - ${mpx[remidy1]:+
  • ${mpx[quantity1]} ${mpx[remidy1]}
  • } -
- - ${mpx[addcontrib]:+ - - } -
+
+

$(l10n therapy_prescription)

+ ${mpx[insurance]} + ${mpx[date]} + + + + ${mpx[prescno]:+$(l10n presc${mpx[prescno]})} + ${mpx[grouptherapy]:+$(l10n grouptherapy)} + ${mpx[housecall]:+$(l10n housecall)} + ${mpx[report]:+$(l10n report)} + +
    $(for n in '' {0..10}; do + [ -n "${mpx[remidy$n]}" ] && \ + printf '
  • %s %s %s
  • ' "${mpx[quantity$n]}" \ + "${mpx[remidy$n]}" \ + "${mpx[quantity_weekly$n]:+($mpx[quantity_weekly$n] $(l10n weekly))}" + done)
+ + ${mpx[indicator]:+${mpx[indicator]}} + ${mpx[icd10]:+ ${mpx[icd10]}} + + ${mpx[addcontrib]:+ + + } +
+ +
+ + + +
+ +EOF - $(therapy_sessions) +therapy_sessions +cat < @@ -179,68 +191,108 @@ cat < - - - + stx=relX(x), sty=relY(y) + + image.beginPath() + draw(x, y) // why must this not use relative Coords ??? + + image_serialize = " polyline" +} + +function drawstop() { + + // if path ends close to beginning ( < 50 px); then close path and fill + if ( mouse == 1 && Math.sqrt( Math.pow(stx - cux, 2) + Math.pow(sty - cuy, 2)) <= 50 ){ + image.lineTo( stx, sty ) + image.stroke() + + image.globalAlpha = .5 + image.fill() + image.globalAlpha = 1 + + image_serialize += " " + stx + "," + sty + data.value += " fill " + c + "8" + image_serialize + } else if (mouse == 1) { + data.value += " fill #0000 " + image_serialize + } + dbg.innerHTML = " stx: " + stx + " cux: " + cux + " sty: " + sty + " cuy: " + cuy + + image.closePath() + image_serialize = "" + mouse = 0 +} + +window.addEventListener( 'mouseup', function() { drawstop() } ) +canvas.addEventListener( 'mousedown', function(e) { drawstart(e.clientX, e.clientY) } ) +canvas.addEventListener( 'mousemove', function(e) { draw(e.clientX, e.clientY) } ) +window.addEventListener( 'touchend', function() { drawstop() } ) +canvas.addEventListener( 'touchstart', function(e) { drawstart(e.touches[0].clientX, e.touches[0].clientY) } ) +canvas.addEventListener( 'touchmove', function(e) { e.preventDefault(); draw(e.touches[0].clientX, e.touches[0].clientY) } ) +--> EOF # vi:set filetype=html: