08-05-05 07:48 AM
Hello John,
I think it is not a BTS issue, because I wrote such a watcher service and an
asp.net
web application to put files in the source directory and it was not working.
As if the FileSystemWatcher did not see the file drop.
So, if anyone had this issue and solved it, I would be interrested to know h
ow.
Best Regards
Yves Peneveyre
[vbcol=seagreen]
Hi all,
I am trying to pickup a file dropped off by BTS 2004, and then move it to a
new location. I have created a simple file watcher service to do this (see
code below). This works great if I manually drop a file in the source
folder. However, if BTS puts the file there, nothing happens. Any hints as
to why would be great. The file is being dropped by a file send port, using
a custom HIPAA pipeline, along with a HIPAA send port, using PassThruTransmi
t
pipe. Thanks.
John
Private SrcPath As String = "D:\BTS\CLAIMS\Claim_OUT\"
Private CIGNATgtPath As String = "D:\BTS\CLAIMS\Claim_OUT\DOODAD\CIGNA\"
Private CTCareTgtPath As String
=" D:\BTS\CLAIMS\Claim_OUT\DOODAD\CONNECTIC
ARE\"
Protected Overrides Sub OnStart(ByVal args() As String)
Me.FileSystemWatcher1.Path = SrcPath
Me.FileSystemWatcher1.EnableRaisingEvents = True
End Sub
Protected Overrides Sub OnStop()
' Add code here to perform any tear-down necessary to stop your
service.
Me.FileSystemWatcher1.EnableRaisingEvents = False
End Sub
Protected Overrides Sub OnContinue()
Me.FileSystemWatcher1.Path = SrcPath
Me.FileSystemWatcher1.EnableRaisingEvents = True
End Sub
Protected Overrides Sub OnPause()
Me.FileSystemWatcher1.EnableRaisingEvents = False
End Sub
Private Sub FileSystemWatcher1_Created(ByVal sender As Object, ByVal e
As System.IO.FileSystemEventArgs) Handles FileSystemWatcher1.Created
If e.ChangeType = WatcherChangeTypes.Created Then
Me.FileSystemWatcher1.Filter = "*.837"
If e.Name.StartsWith("62308") Then
TransportFiles(e.Name, CIGNATgtPath)
ElseIf e.Name.StartsWith("06105") Then
TransportFiles(e.Name, CTCareTgtPath)
End If
End If
End Sub
Private Sub TransportFiles(ByVal strFileName As String, ByVal destPath
As String)
Try
Dim strDestfileName As String = destPath & strFileName
If File.Exists(strDestfileName) Then File.Delete(strDestfileName)
File.Move(SrcPath + strFileName, strDestfileName)
Catch ex As Exception
Throw New ApplicationException("The Doodad Claim File Management
Service threw the following exception: " & ex.ToString)
End Try
End Sub
--
John
[ Post a follow-up to this message ]
|