-
Notifications
You must be signed in to change notification settings - Fork 77
Analyzer setup
The model being used is that the analyzer will write a results file to the file system and a perl script will monitor the directory where the results files are written. That directory is referred to as the staging directory. When a new file is detected it is copied to another directory called the transmissionQueue. The script will then send the file to a service in OpenELIS and as soon as it is successfully sent it will be deleted from the transmissionQueue.
Some points to keep in mind:
-
The file is copied from the staging directory to the transmissionQueue. Management of the staging directory is not part of the model
-
The script depends on the timestamp of the files in the staging directory to insure that they are not moved to the transmissionQueue more than once. There are some strangely named files in the transmissionQueue that track the timestamp, do not delete them or all of the files from the staging directory will be resent.
-
The file in the transmissionQueue is deleted after successful transmission.
-
During development it is easiest to copy (not move) the test file to the transmissionQueue directory rather than updating the timestamp and adding it to the staging directory.
The perl file is in openelisgloble-core\tools\AnalyzerSideDataImport\FlatFileTransport.pl
Depending on where perl is installed on your system the script will be invoked with something similar to: c:\Perl\bin\perl.exe FlatFileTransport.pl
There are four configurable values in the file:
-
The location of curl
Curl is the application that actually sends the file to OpenELIS. In the perl script it is assumed that it is installed in the root of the C drive.my $curlExe = 'C:\curl\curl.exe';
If it differs on the host machine this should be edited -
The target application
In the following case the application is haitiOpenElis on the local host.my $upLoadtargetURL = 'http://localhost:8080/[openelisURL]/importAnalyzer';
-
The user name and password.
This user name and password must have been added as a user to the application. The user should be added with no roles.my $upLoadUserName = ''; my $upLoadPassword = '';
-
The location of the staging directory.
The directory to which the analyzer is writing it's output files. In the perl script is an example of a single script supporting two analyzers but one of them has been commented out. In this example the name of the directory is a directory relative to the perl script named stagingmy $stagingDir1 = ".\\staging";
* In this example the directory has been mapped from one machine to the machine the perl script is on to a drive named Y
'my $stagingDir2 = "Y:";`
Troubleshooting:
Perl and curl give good error messages so most problems in the script will be obvious. However sometimes the server returns errors which are not as obvious.
If you get an HTML response it is one of two things.
-
A response from Tomcat that it could not find the resources. This is usually about three lines of HTML and buried in it is the missing resource message. That indicates that the url is not correct
-
A response from openELIS than an exception has been thrown. This is the HTML for the gray screen of death and is usually dozens of lines wrong. This indicates that there was an error in the code and you should look for the stack trace in the console or in the logs
Another common message is that the user name or password was not correct. Revisit the section above about setting them correctly