Hi,<br><br>I am trying to finish a script for medical office scanning and thought it would be a nice project to share. <br><br>Really I could use the help. :-]<br><br>>> How do I scan Duplex and save the images? <<
<br><br>Anyway, here is how an office might scan documents.<br><br>Employee sits down w/ pile of papers.<br>Separate papers into piles destined for different patient charts.<br>Pick up one pile and load into ADF.<br><br>start script
<br><br>...ask preliminary filing questions and confirm a few times for accuracy<br>...menu for one or two sides<br>...menu for sizes commonly scanned<br>...scan documents<br>...glue images into multipage tif if needed<br>
...file documents<br>...log user and time for accountability<br><br>end script<br><br>so here is what I have so far...<br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
#!/bin/bash<br><br># local script variables<br><br># fujitsu scanner options<br># forked scanimage variables<br>DEVICE="fujitsu:/dev/sg0" export DEVICE<br>SOURCE="ADF Back" export SOURCE<br>FORMAT="tiff" export FORMAT
<br>OUTFILE="foo.tif" export OUTFILE<br><br># clear the screen<br>clear<br><br># gather file information<br>echo " *** Hi, before you start, please check that you're shoes are on the right feet. If not, please stop here and ask for assistance!"
<br>echo ""<br><br>echo "*** Please enter your name or initials then press the enter key."<br>read NAME<br><br>echo "*** Welcome back $NAME!"<br>echo ""<br><br>echo "*** First, some questions regarding your documents..."
<br>echo "*** Enter the patient's chart ID (no leading zeros!) then press the enter key"<br>read CHART<br><br>#debugging rx<br>#echo "length of $CHART" is ${#CHART}<br><br>for ((ADDZEROS = (6 - ${#CHART}); ADDZEROS >= 0; ADDZEROS = ADDZEROS - 1));
<br>do<br>CHART="0$CHART"<br>done<br><br>echo "*** You entered $CHART, is that the chart number you want? (y/n)"<br>read CONFIRM<br><br>echo "*** Enter a name for the document (maximum of 8 keystrokes!) then press the enter key"
<br>read DOCUMENT<br><br>echo "*** You entered $DOCUMENT, is that the document name you want? (y/n)"<br>read CONFIRM<br><br>echo ">>> One last look! <<<"<br>echo "You want to scan $DOCUMENT and file it into chart number $CHART? (OK or NO)"
<br>read CONFIRM<br><br># navigate and prepare file directory<br>cd /home/prairie/Desktop/records<br><br>#mkdir /home/prairie/Desktop/records/emr/$chart<br>#chmod +rw /home/prairie/Desktop/records/emr/$chart<br><br># entertain a little...
<br><br>echo "*** OK already! here goes! ***"<br>echo "*** You should hear the scanner start now...if not, check your shoes."<br><br>#scan it!<br>scanimage --device-name "$DEVICE" --format "$FORMAT" --source "$SOURCE" > "$OUTFILE"
<br><br># check for errors<br>echo "*** Would you like to save $DOCUMENT to $CHART? (y/n)"<br>read CONFIRMATION<br><br># wrap it up<br>echo "*** Your document has been scanned and filed successfully!"<br>
echo "*** Remember $NAME, always check your shoes before scanning!"<br><br></blockquote>