This article mainly covers how data goes from the EDI Lab Data Files (see SDWIS/Stat Fixed-Format Lab EDI File Structure) into Hach WIMS Client and updates LabCal Samples and Tests.
Work Flow:
- The interface will first get a listing (array) of all files in the source folder.
- Each file is opened and examed; if it is invalid then the file is logged and skipped
- Each record in the file is added to a list (array) depending on the record type: header/summary records (HDR) or detailed records (DTR)
- After all the files and records are added to the lists, the program goes thru each record listed and attempts to import data into Hach WIMS Client. It will:
- Validate the result, and the date and time of the sample
- Check the data against the business rules (see EDI Lab Data and LabCal Business Rules)
- Get the variable ID for the resulting value, from the Sample Test table
- Update LabCal Sample and Sample Test tables, setting the status to received
- Update LabCal Sample Notes if option values present (all are in the HDR record):
- Sampling Point; field no. 10
- Sampling Location; field no. 11
- Sampling Rejection Reason; field no. 23
- Collection Method Code, 24
- Update the variable with the result
- After all records processed, it will scan the LabCal Sample table to see if we can set any of the updated Samples to Analyzed (only when all of the Tests in the Sample have a result for that sample date)
Technical Notes:
- Facilities can be limited by creating a 'Facility.ini' file where the interface application is located. Add the facility names (like OPSWWTUTOR) to the file, one facility per line.
- Note that the interface will import results if the cross reference works, but the LabCal update fails. This is by design so that values will be updated.
- Note that when the interface fails to process a file and skips it, that file will remain in the folder and the interface will continue to process it. So if the user set up Archive and Delete but files are not being moved, then it's possible the interface is not processing the file, or doesn't have permissions to move the file.
- Most issues will cause the interface to write information to the log file, and other messages are based on the Verbosity setting in Configuration > Advanced Configuration. If you need more information, try setting this to 3, then 5, then 7 and then finally 9. As the number goes up, more information will be logged.
|