Our facility recently implemented a realtime automated customer fax service that is seamless to our users. We had to find a fax solution provider that could handle our volume (our facility faxes more than 25,000 reports each month, with each report containing up to seven 8 1/2 x 11-inch pages) and provide the flexibility to customize the application as needed.
For each fax that's sent, data must pass through three systems running on our network:
The NT system creates the reports using either a proprietary report writer called NPR Report Writer or Microsoft Word. The AS/400 receives report data from the NT system and uses it to format information for the faxing system. The faxing system processes the AS/400-converted reports and carries out the fax process. We needed to develop a way to pass report data through these three systems without any intervention by the users.
Because the software on the NT system couldn't be modified, we had a complicated task ahead of us. If we modified the application ourselves, we'd breach our contract with the vendor and have an unsupported product. Fortunately, due to the robustness and flexibility of our software applications and AS/400 OS, we could use TCP/IP communications services to solve our dilemma and maintain our NT clinical application software integrity.
Client Access and TCP/IP to the Rescue
Our starting point was to capture the reports from the NT system without user intervention. We accomplished this by installing Client Access version 3.2 on the NT application servers that produced the reports, using a TCP/IP connection between the NT system and the AS/400.
After installing Client Access and establishing a connection, we performed the Add Printer function from the Windows Printer panel and followed the Add Printer wizard. In the wizard's network path name field, we entered the name of our AS/400 network printer ( Figure 1). At the next prompt, we specified the Manufacturer as IBM and the printer driver as SCS 3812 ( Figure 2).
We selected the SCS 3812 driver because it automatically converts reports created on an NT system to viewable and usable reports on the AS/400 with no programming involved. The only change we made to the Meditech application on the NT system was to add the new network printer name to the list of printers available for printing the reports.
Every time a report is printed from the Meditech system (which includes our AS/400 network printer in the list of available printers), the Meditech system sends the report to the NT print server, which in turn sends the report to our AS/400 network printer. The AS/400 network printer places the spooled output from the NT print server on the output queue associated with the path name. In our case, we didn't attach a physical printer to the AS/400 output queue because we wanted to capture the report data before printing and perform the necessary processing against the reports, creating new reports that contain additional customer information and faxing commands.
Our next step was to connect the AS/400 to the faxing server. We accomplished this by using the AS/400 WRKOUTD (Work with Output Queue Description) command, setting the Remote system to *INTNETADR, the Connection type to *IP, and the Internet address to the host IP address of the faxing server ( Figure 3).
With the help of the Client Access virtual print function and TCP/IP print services, we'd solved our problem of sending and receiving report data across the three systems. Our next step was to automate this process.
Automated Faxing Made Easier
The Faxstar software uses commands that can be inserted into an AS/400 spooled file. These commands control the fax number, forms overlay, cover sheets, logos, fonts, and fax status messaging as well as a variety of other functions. Due to our high-volume faxing needs, we automated the process by creating a batch program to handle the inserting of the fax commands.
To monitor for the arrival of a new report from the NT system, we attached a data queue to the AS/400 output queue that received the reports generated by the Windows NT Meditech application. A continuously running CL program checks the data queue every 30 seconds for the arrival of a new report from the NT system. When a new report arrives, the program converts the spooled file to a physical database file using the AS/400 CPYSPLF (Copy Spooled File) command.
Once the data is transferred to a physical file, it's read line by line by an RPG program. As each line is read, the program determines whether the line should be included or omitted from the detail lines of the new printer file used to create the report.
The program has logic to determine whether a fax command should be inserted into the printer file detail line. Template processing is performed against static text-heading information from the report heading area at the top of each page. If a match is found, the text following the heading information is parsed from the report and loaded into program variables. These variables can then be linked to a user-defined table where additional processing information is stored.
For example, static heading text such as "Customer Name" can be found in a report on record line 1, starting in position 1 for a length of 13. The program that processes this report checks to see whether the text on record line 1, starting in position 1 and ending in position 13, is equal to the text "Customer Name". If it finds a match, the program will parse the information next to "Customer Name" and load it into the customer name program variable.
The start and length positions of the customer name variable are predefined using a number of parameters. If the customer master file allows up to 40 characters, our program will parse out 40 characters from the start position of the customer name field on the report. The customer name variable is then used to access a table containing customer names, from which information (e.g., a fax number) can be retrieved.
Once the program retrieves the fax number, the program can insert it into the spooled file by using a command that the faxing server can interpret. In this case, we'd write a new record to
the printer file detail line with the text **Fax(fax number).
The fax server has a list of predefined commands that it can process. It searches each spooled file from beginning to end looking for these commands. When it comes across the **Fax() keyword, it uses the number inside the parentheses as the fax number and begins the fax process.
After the new report is created, the program sends the spooled file to the fax server automatically by placing it on the output queue associated with the fax server. The output queue uses the AS/400 STRRMTWTR (Start Remote Writer) command to send the spooled files across the TCP/IP network. Once a report is sent to the fax server, all processing is performed on the fax server with no performance impact to the NT or AS/400 host systems.
Depending on your needs, you can insert several fax commands into each faxed report. One example is the command LOGGING LEVEL(number), which specifies that the status of each fax is reported back to your host system automatically. Other options include printing status reports directly from the faxing server to a physical network printer.
On-Demand Faxing
The Windows version of the Faxstar software, which runs on the NT server over a TCP/IP network, also handles our on-demand faxing needs. From a PC desktop, we can fax documents and reports created in a Windows environment.
To send a fax, you simply print just as you'd normally print from Windows. Once the Print dialog box appears, you select the Faxstar print driver (if it's not your default printer) from the drop-down menu ( Figure 4). After you select this printer, you'll be prompted to enter a fax number.
You can optionally use the software's other features, which include the ability to create cover sheets, logos, and distribution lists and to check fax status and history information. You can also assign user authorities through the administrator component ( Figure 5).
Efficient and Flexible
Our solution produces fewer errors and eliminates the time that our users formerly spent faxing information manually to customers. As users spend their time more efficiently, we save time and money.
Note that you can apply the core elements of our solution to various tasks that require the transfer of printed data across AS/400 and NT servers.