InboundFilesDetected

Top  Previous  Next

Object: EHL7.EHL7Processor

FileName: EHL7.dll

 

EVENT

 

Name: InboundFilesDetected

Parameters:

1.nFileCount (Long) contains the number of files detected in the folder.
2.objFileRS (object) a Microsoft ADO Recordset

 

Description: This event fires whenever the 'InboundPath' folder is polled and HL7 files are found (see PollingInterval for the frequency) and BEFORE the InputFileDetected event.  The nFileCount parameter will contain the number of files detected during the polling cycle.

 

*Note* This event is slightly different from every other event in the EasyHL7 system in that it passes to you in the 2nd parameter an updateable Microsoft ADO Recordset containing information about all of the HL7 files detected.  This can allow you to 'pre-process' files in batch before they continue processing.  The ADO recordset is updateable and was opened with a lock type of LockBatchOptimistic (see Microsofts web site for information on programming with ADO objects).

 

The ADO recordset has the following structure:

Field 1: FileName Varchar[1250] - Contains the full path and filename of the HL7 file

Field 2: FileTitle Varchar[256] - Contains just the filename (no path)

Field 3: FileDate DateTime - Contains the system date of the file

Field 4: FileSize (Long) - Contains the size of the file in bytes

Field 5: Process (Long) - Contains a boolean (True).  If this field is set to false, the file will not be processed and the  InputFileIgnored event will be raised with the nReason parameter set to enFileLocked.

 

 

Example Code:

'Declare

Private myProcessor As EHL7.EHL7Processor

'Event handler

Private Sub myProcessor_InboundFilesDetected(nFileCount, objFileRS)

Dim fn$

Do While Not objFileRS.Eof

    'I don't want to process files where the filename

    'begins with the letter 'Q' for some reason

     If ucase(left(objFileRS("FileTitle"),1)) = "Q" Then

           'Do something with the file

             Kill objFileRS("FileName")

           'Update the recordset so that processor object will not try and process it.

            objFileRS("Process") = False

            objFileRS.UpdateBatch

     End If

    ObjFileRS.MoveNext

Loop

End Sub

 

 

Related Items: EasyHL7 Events in VB, PollingInterval, InboundPath, InputFileDetected