[ <- Previous Page ] [ ^ Table Of Contents ^ ] [ Next Page -> ]
Setting Up A Delivery Interface

Chapter 9
Setting Up A Delivery Interface

This chapter documents the neccessary steps for establishing a data delivery program.

A sample C++ program zclient1 is included with the zWebit distribution that can be used as a client based data delivery program or as a model for new program development.

Data could be delivered to one of several types of destinations:




Delivery Interface Setup Steps

  1. Determine the interface name (like TOLAB or TORX)
  2. Identify existing program or create a new delivery program
  3. Create a script file for starting/stopping/statusing the interface
  4. Create an entry in the ptrkeys table for this interface
  5. Create a configuration file with startup/runtime parameters





Step 1: Determine Interface Name

interface names can be any unique name from one to twelve bytes in length. There is one reserved name, NEXT. Try to assign meaningful names to each interfaces, such as TOLAB or TORAD.






Step 2: Identify existing program or create a new delivery program

The included client delivery program utilizes the following files:

ItemDescription
zclient1.proProfile of runtime values
loadprofile.cFile containing logic for processing profile entries
zclient1.cppDelivery program source



Data Delivery Program Pseudocode

If you need to create a new program, the following pseudocode describes the steps in the program

  1. Open profile and pull values
  2. Verify profile values are acceptable
  3. Open a Postgres DBMS connection
  4. Perform any other needed initialization steps
  5. Enter a process loop
    1. For each record needing to be sent, pull record from idata table
      1. Reformat or modify data if necessary
      2. Add framing characters
      3. Send it to destination until receipt of acknowledgement
      4. Update seqno in ptrkeys table for this interface
    2. Wait for wake up call from any appropriate inbound interface
  6. Close any open files and connections

New programs need to be set up as belonging to user zwebit, group zwebit with the setuid bit set.






Step 3: Create A Script File

DescriptionCommand
change directorycd webit/bin
copy templatecp template1 myinterfacename.pro
edit profileedit myinterfacename.pro

Each interface requires a script file in the webit/bin directory.

    Update the following variables in the new script file






    Step 4: Create An Entry In The Ptrkeys Table

    Using the web based interface, for the appropriate test or prod system,

    1. Select Ptrkeys maintenance
    2. Select Add New
    1. Interface = Myinterface name
    2. Sequence Number=0
    3. Interface type = Outbound Connection
    4. ON / OFF Switch = OFF
    5. Description = A description of the interface
    6. Command = The fully qualified name of the script file created in step 3
    7. Add





    Step 5: Create A Config File

    For a test system interface, create a new configuration file in directory webit/test/config. For a prod system interface, create a new configuration file in webit/prod/config.

    This is the same file name that was set in the script file in step 3 field PROFNAME.

    If you are using the zclient1 program, you can use file webit/test/config/zclient1.pro as a starting point. If you create a new program, then set the values you need in the new profile.




    [ <- Previous Page ] [ ^ Table Of Contents ^ ] [ ^ Top Of Page ^ ] [ Next Page -> ]


    Visit the GNU home page.

    FSF & GNU inquiries & questions to gnu@gnu.org.

    Comments on these web pages to info@zhsac.com.

    Copyright (C) 2003 HealthCare Systems and Consulting

    Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.

    Last updated: 07/21/2003