Rename PDF from barcode

I'm evaluating Hazel (also my favorite TV show). I run a series of competitive car shows and after each show I want to scan scoresheets which have been pre-printed each with a unique ID number along with a 3of9 barcode of that number. I would like to Hazel to look at a scanned PDF file and do the following:
- find and read the barcode
- change the name of the file to a Prefix+the read barcode. In other words if the file has the number 35 as the barcode I would want to rename the file Sears35 for example.
If a barcode doesn't work I can print the forms being scanned and read to have a number preceded by a fixed pattern such as **35 or **36 etc. instead of the barcode.
Has anyone done this? If so any help would be appreciated. I was hoping to find a sheet feed scanner to do all this automatically but it appears my best solution is to use Hazel after scanning,
- find and read the barcode
- change the name of the file to a Prefix+the read barcode. In other words if the file has the number 35 as the barcode I would want to rename the file Sears35 for example.
If a barcode doesn't work I can print the forms being scanned and read to have a number preceded by a fixed pattern such as **35 or **36 etc. instead of the barcode.
Has anyone done this? If so any help would be appreciated. I was hoping to find a sheet feed scanner to do all this automatically but it appears my best solution is to use Hazel after scanning,