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>&gt;&gt; How do I scan Duplex and save the images? &lt;&lt;
<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=&quot;fujitsu:/dev/sg0&quot; export DEVICE<br>SOURCE=&quot;ADF Back&quot; export SOURCE<br>FORMAT=&quot;tiff&quot; export FORMAT
<br>OUTFILE=&quot;foo.tif&quot; export OUTFILE<br><br># clear the screen<br>clear<br><br># gather file information<br>echo &quot; *** Hi, before you start, please check that you&#39;re shoes are on the right feet. If not, please stop here and ask for assistance!&quot;
<br>echo &quot;&quot;<br><br>echo &quot;*** Please enter your name or initials then press the enter key.&quot;<br>read NAME<br><br>echo &quot;*** Welcome back $NAME!&quot;<br>echo &quot;&quot;<br><br>echo &quot;*** First, some questions regarding your documents...&quot;
<br>echo &quot;*** Enter the patient&#39;s chart ID (no leading zeros!) then press the enter key&quot;<br>read CHART<br><br>#debugging rx<br>#echo &quot;length of $CHART&quot; is ${#CHART}<br><br>for ((ADDZEROS = (6 - ${#CHART}); ADDZEROS &gt;= 0; ADDZEROS = ADDZEROS - 1));
<br>do<br>CHART=&quot;0$CHART&quot;<br>done<br><br>echo &quot;*** You entered $CHART, is that the chart number you want? (y/n)&quot;<br>read CONFIRM<br><br>echo &quot;*** Enter a name for the document (maximum of 8 keystrokes!) then press the enter key&quot;
<br>read DOCUMENT<br><br>echo &quot;*** You entered $DOCUMENT, is that the document name you want? (y/n)&quot;<br>read CONFIRM<br><br>echo &quot;&gt;&gt;&gt; One last look! &lt;&lt;&lt;&quot;<br>echo &quot;You want to scan $DOCUMENT and file it into chart number $CHART? (OK or NO)&quot;
<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 &quot;*** OK already! here goes! ***&quot;<br>echo &quot;*** You should hear the scanner start now...if not, check your shoes.&quot;<br><br>#scan it!<br>scanimage --device-name &quot;$DEVICE&quot; --format &quot;$FORMAT&quot; --source &quot;$SOURCE&quot; &gt; &quot;$OUTFILE&quot;
<br><br># check for errors<br>echo &quot;*** Would you like to save $DOCUMENT to $CHART? (y/n)&quot;<br>read CONFIRMATION<br><br># wrap it up<br>echo &quot;*** Your document has been scanned and filed successfully!&quot;<br>
echo &quot;*** Remember $NAME, always check your shoes before scanning!&quot;<br><br></blockquote>