Thursday, July 16, 2009

Indian Seafood Soup

This afternoon my wife had to work, so dinner was on me.

She left me a bag of assorted frozen seafood we bought at Woodman's in Kenosha defrosting in the sink.

What to do, what to do...

  1. I had a half a vadalia onion left over in the fridge.

    Three bellpeppers (Capsicum annuum) from three...Image via Wikipedia

  2. One yellow bell pepper.
  3. One heaping teaspoon of chopped garlic ( from the jar ).
  4. One heaping teaspoon of ginger paste.
  5. One large tomato.
  6. Two heaping teaspoons of lemon grass ( from the jar ).
  7. 1/2 Can drained garbanzo (chickpeas) beans.
  8. 1 15oz can chicken broth.
  9. 1 15oz can coconut milk.
  10. 2 cans ( use one of the others you emptied ) water.
  11. 4 chicken bullion cubes.
  12. 1/2 teaspoon red chili pepper.
  13. 1 teaspoon ground coriander.
  14. 6 green cardomom seeds.
  15. 1/2 stick cinnamon.
  16. 1 teaspoon yellow curry.
  17. 1 teaspoon fish sauce.
  18. 2 teaspoons ghee.
  19. 2 tablespoons olive oil.
  20. Salt to taste.

Holy crap, that's allot of ingredients.

In large'ish pot, add ghee and oil (oil keeps ghee from burning...it tolerates higher heat).

Add chopped onion, garlic, diced tomato (you will dice it, won't you?), lemon grass, diced pepper, fish sauce, cinnamon, cardamom seed, ground coriander, curry and red pepper (you may want to monitor the pepper, lest your kitty tongue gets burned). Let it simmer up a bit.

Add the can of broth and coconut milk. Drain the beans, and add half the can.

Bring it up to a simmer again, and check the flavor. Add salt to taste and simmer for about 20 minutes, more if you have beer or mojito's to occupy your time (I had mojito's, but that'll be another post).

Add the water and bullion cubes, because by now it's cooked down a bit.

Bring it back to a simmer and add the thawed and rinsed seafood mix 10 minutes before you intend to devour it.

Ours was good, I might even say excellent, and this is EXACTLY how I made it...in between mojito's, tearing the light bar off the XVZ 1300, chasing the dog away from the WE Energies engineer, and taking the clothes off the line before it rained, and trying to find the 10mm socket my son took...full night at the Croson's once again.

Reblog this post [with Zemanta]

Using ImageMagick and Tesseract to sort TIFFs on Windows

Recently I wrote a post about my search for a TIFF iFilter that would enable me to use VBScript to query a Windows Indexing Services server for file management.

I found that since OCR is never always 100% accurate, neither were my attempts at sorting all the inbound EMR faxes we get each day.

I did however, find Tesseract, a great product that was originally developed by HP and proprietary, and is now developed by Google and licensed under the Apache License v2, open source.

It is one of the most accurate open source OCR engines available. It is quite basic, and in the version you obtain from the project page, it only operates from the command line, and without the libtiff library, will only do it's work on un-compressed TIFFs. More information can be found on the project pages, and Wikipedia. Doing some scouring, I aso found a front-end, and ArchivistaBox, a complete document management system.

ImageMagickImage via Wikipedia

I'm using it in Windows, so I needed to do one of two things: recompile the sources in Visual Studio Express to include the libtiff libraries, or use the convert program that is bundled with ImageMagick. I tried to recompile but ran into too many issues, so fell back to ImageMagick.

Following is the script I kick off daily to sort these:

Option Explicit

Dim oShell
Dim sCwhhm
Dim sAqscan
Dim sConv
Dim sOpts
Dim sTess
Dim FSO
Dim sFolder
Dim sFile
Dim sFileColl
Dim inFile
Dim sClinic
Dim sDOS
Dim sMoveTo
Dim sNumBse, sNumMdn, sNumUnk
Dim sStartTime, sFinishTime, sMail, sLog
Dim i, x, l, arrFileLines()

Set oShell = CreateObject("WScript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
Set sLog = FSO.CreateTextFile("C:\scripts\Log\CWHHM_FAXMOVELOG.TXT", True)

sStartTime = Now()

sLog.WriteLine(sStartTime & "---------------------------")

' ///////////////////////////////////////////
' Set the source and destination
' ///////////////////////////////////////////
sCwhhm = "F:\Incomi~1\CWHHM\"
sAqscan = "F:\Scanne~1\Aquarius\14CWHHM\"

' ///////////////////////////////////////////
' Set the convert program and flags
sConv = "C:\Progra~1\ImageM~1.3-Q\convert.exe"
sOpts = "-density 150x150 -compress none"

' ///////////////////////////////////////////
' Set the tesseract program
sTess = "C:\Progra~1\tesser~1.00\tesser~1.exe"

' ///////////////////////////////////////////
' First clean up the directory so we can
' build a list of all tifs
' ///////////////////////////////////////////

If (FSO.FileExists(sCwhhm & "Thumbs.db")) Then
    FSO.DeleteFile(sCwhhm & "Thumbs.db")
End If

If (FSO.FileExists(sCwhhm & "tesseract.log")) Then
    FSO.DeleteFile(sCwhhm & "tesseract.log")
End If

' ///////////////////////////////////////////
' Set the folder and file collection
' ///////////////////////////////////////////
Set sFolder = FSO.GetFolder(sCwhhm)
Set sFileColl = sFolder.Files

' ///////////////////////////////////////////
' Loop over remaining files
' ///////////////////////////////////////////
For Each sFile in sFileColl

    ' ///////////////////////////////////////////
    ' Convert the file to an uncompressed format
    oShell.Run sConv & " " & sCwhhm & sFile.Name & " " & sOpts & " " & sCwhhm & "out.tif", 0, true

    ' ///////////////////////////////////////////
    ' Now OCR it, then delete the old tif
    oShell.Run sTess & " " & sCwhhm & "out.tif " & sCwhhm & "ocr", 0, true
    FSO.DeleteFile(sCwhhm & "out.tif")


    ' ///////////////////////////////////////////
    ' Read the file in to our array

    Set inFile = FSO.OpenTextFile(sCwhhm & "ocr.txt", 1)
    
    i = 0
    Redim arrFileLines(i)
    
    Do Until inFile.AtEndOfStream
        Redim Preserve arrFileLines(i)
        arrFileLines(i) = inFile.ReadLine
        i = i + 1
    Loop
 
    ' close and delete the file, we don't need it anymore
    inFile.Close
    FSO.DeleteFile(sCwhhm & "ocr.txt")
    
    ' ///////////////////////////////////////////
    ' Now read the contents of the file, from the top down,

    For l = 0 to UBound(arrFileLines)
        
        ' ///////////////////////////////////////////
        ' Check for the header
        If UCase(Left(arrFileLines(l), 6)) = "CENTER" Then
            
            ' ///////////////////////////////////////////
            ' Test for the progress line on the next line, 3
            If UCase(Left(arrFileLines(l + 1), 8)) = "PROGRESS" Then
            
           
                ' ///////////////////////////////////////////
                ' We are pretty sure the next line, 4, is a clinic name
                sClinic = UCase(arrFileLines(l + 2))
                
                Select Case sClinic
                    Case "MERIDIAN CLINIC"
                        sClinic = "MDN\"
                        sNumMdn = sNumMdn + 1
                    Case "BOISE CLINIC"
                        sClinic = "BSE\"
                        sNumBse = sNumBse + 1
                    Case Else
                        sClinic = "UNK\"
                        sNumUnk = sNumUnk + 1
                 End Select
                        
                ' ///////////////////////////////////////////
                ' Get the DOS, which is supposed to be on line
                ' 8 of a progress report, but we'll check a couple
                ' to be sure. We are on line 2, CENTER.
                
                For x = 4 to 8
                    sDOS = UCase(Left(arrFileLines(l + x), 4))
                                        
                    If sDOS = "DATE" Then
                        
                        sDOS = Trim(Replace(Mid(arrFileLines(l + x), 17, 11), "/", ""))
                          
                            sMoveTo = sAqscan & sClinic & sDOS & "\"
                                                                                 
                            If FSO.FolderExists(sMoveTo) Then
                               FSO.MoveFile sCwhhm & sFile.Name, sMoveTo
                            Else
                               On Error Resume Next
                               FSO.CreateFolder(sMoveTo)
                               If Err.Number <> 0 Then
                                sLog.WriteLine("ERROR: " & Err.Number & " - " & Err.Description)
                                sLog.WriteLine("ERROR: " & sFile.Name & " was going to be moved to " & sMoveTo)
                                Set sMail = FSO.CreateTextFile("C:\Temp\TEMPMAIL.TXT", True)
                                sMail.WriteLine("TO: " & Chr(34) & "JOHN CROSON" & Chr(34) & "")
                                sMail.WriteLine("FROM: " & Chr(34) & "IHBS Administrator" & Chr(34) & "")
                                sMail.WriteLine("SUBJECT: CWHHM EMR File Sorting")
                                sMail.WriteBlankLines(1)
                                sMail.WriteLine("There has been an error. Check c:\scripts\log\CWHHM_FAXMOVELOG.TXT")
                                sMail.Close
                                FSO.MoveFile "C:\Temp\TEMPMAIL.TXT", "\\ibsts\c$\Inetpub\mailroot\Pickup\"
                               End If
                               FSO.MoveFile sCwhhm & sFile.Name, sMoveTo
                            End If
                            Exit For
                    End If 
                Next
                
              
            Else
                ' //////////////////////////////////////////
                ' This must be another file type, step to the next line
                sClinic = UCase(Left(arrFileLines(l + 1), 5))
                                
                Select Case sClinic
                   Case "MERID"
                        sClinic = "MDN\"
                        sNumMdn = sNumMdn + 1
                   Case "BOISE"
                        sClinic = "BSE\"
                        sNumBse = sNumBse + 1
                   Case Else
                        sClinic = "UNK\"
                        sNumUnk = sNumUnk + 1
                End Select
                
                ' ///////////////////////////////////////////
                ' Get the DOS, which could be on line
                ' 7 through 12.
                
                For x = 5 To 15
                    sDOS = UCase(Left(arrFileLines(l + x), 4))
                                       
                    If sDOS = "DATE" Then
                        
                        sDOS = Trim(Replace(Mid(arrFileLines(l + x), 17, 11), "/", ""))
                            sMoveTo = sAqscan & sClinic & sDOS & "\"

                            If FSO.FolderExists(sMoveTo) Then
                               FSO.MoveFile sCwhhm & sFile.Name, sMoveTo                           
                            Else
                               On Error Resume Next
                               FSO.CreateFolder(sMoveTo)
                               If Err.Number <> 0 Then
                                sLog.WriteLine("ERROR: " & Err.Number & " - " & Err.Description)
                                sLog.WriteLine("ERROR: " & sFile.Name & " was going to be moved to " & sMoveTo)
                                Set sMail = FSO.CreateTextFile("C:\Temp\TEMPMAIL.TXT", True)
                                sMail.WriteLine("TO: " & Chr(34) & "JOHN CROSON" & Chr(34) & "")
                                sMail.WriteLine("FROM: " & Chr(34) & "IHBS Administrator" & Chr(34) & "")
                                sMail.WriteLine("SUBJECT: CWHHM EMR File Sorting")
                                sMail.WriteBlankLines(1)
                                sMail.WriteLine("There has been an error. Check c:\scripts\log\CWHHM_FAXMOVELOG.TXT")
                                sMail.Close
                                FSO.MoveFile "C:\Temp\TEMPMAIL.TXT", "\\ibsts\c$\Inetpub\mailroot\Pickup\"
                               End If
                               FSO.MoveFile sCwhhm & sFile.Name, sMoveTo                               
                            End If
                            Exit For
                    End If
                Next
                
             sClinic = ""
             sDOS = ""
                             
            End If  '<- Progress Test 
       Exit For
       End If   '<- Header Test          
        
    Next         
Next

sFinishTime = Now()

sLog.WriteLine(sFinishTime & "---------------------------")
sLog.Close

' //////////////////////////////
' Now send an email notification that the
' files are ready.
Set sMail = FSO.CreateTextFile("C:\Temp\TEMPMAIL.TXT", True)
sMail.WriteLine("TO: " & Chr(34) & "JOHN CROSON" & Chr(34) & "")
sMail.WriteLine("FROM: " & Chr(34) & "IHBS Administrator" & Chr(34) & "")
sMail.WriteLine("SUBJECT: CWHHM EMR File Sorting")
sMail.WriteBlankLines(1)
sMail.WriteLine("CWHHM Electronic Medical Record sorting is finished.")
sMail.WriteBlankLines(1)
sMail.WriteLine("Start time was " & sStartTime & ". Finish time was " & sFinishTime & ".")
sMail.WriteBlankLines(1)
sMail.WriteLine("The number of Boise files was " & sNumBse & ".")
sMail.WriteBlankLines(1)
sMail.WriteLine("The number of Meridian files was " & sNumMdn & ".")
sMail.WriteBlankLines(1)
    If sNumUnk > 0 Then
        sMail.WriteLine("The number of Unkown files was " & sNumUnk & ".")
    End If
    
sMail.Close
FSO.MoveFile "C:\Temp\TEMPMAIL.TXT", "\\ibsts\c$\Inetpub\mailroot\Pickup\"
Reblog this post [with Zemanta]

Thursday, July 09, 2009

Traveling via Amtrak

My wife, son and I recently took a trip to St Louis, to visit her Mom and Dad. We always have a good time, but don't look forward to the drive, as it takes 7 hours or so one way from 'lil old SE Wisconsin.

City of St.Image via Wikipedia

Thankfully, she looked into an older style of travel for our most recent trip to visit G'ma and G'pa; Amtrak.

The cost is not much more than it is to drive. Fuel costs driving our mini-van is usually about $120, not to mention the fuel my son expends attempting to break out of his car seat...

The cost for our train ride was $188 with tax. Our son rode for 1/2 price since he is only 3.

The trip took nearly the same amount of time, and we could ALL nap on the way down. We were able to bring a small cooler with lunch, play for a couple of hours in the dining car (coloring books, puzzles, etc.)

The only complaint I will lodge is customer service is a bit lacking. Our initial inquiries indicated we had the ability to check a bag, but found we couldn't because our train was a commuter.

If we would have chosen a later departure, we could have checked our larger luggage. As it was, we were able to confine our packing to the 22x14x28 dimensional limit for carry-on baggage, for a total of two per passenger. Rules are similar to the airlines; purses and laptop bags don't count toward the limit.

Our future trips will likely be the train, especially with climbing fuel costs.

Reblog this post [with Zemanta]