Setting Up EDI Acquisitions

Introduction

Electronic Data Interchange (EDI) is used to exchange information between participating vendors and Evergreen. This chapter contains technical information for installation and configuration of the components necessary to run EDI Acquisitions for Evergreen.

Installation

Install EDI Translator

The EDI Translator is used to convert data into EDI format. It runs on localhost and listens on port 9191 by default. This is controlled via the edi_webrick.cnf file located in the edi_translator directory. It should not be necessary to edit this configuration if you install EDI Translator on the same server used for running Action/Triggers events.

If you are running Evergreen with a multi-server configuration, make sure to install EDI Translator on the same server used for Action/Trigger event generation.
Steps for Installing
  1. As the opensrf user, copy the EDI Translator code found in Open-ILS/src/edi_translator to somewhere accessible (for example, /openils/var/edi):

    cp -r Open-ILS/src/edi_translator /openils/var/edi
  2. Navigate to where you have saved the code to begin next step:

    cd /openils/var/edi
  3. Next, as the root user (or a user with sudo rights), install the dependencies, via "install.sh". This will perform some apt-get routines to install the code needed for the EDI translator to function. (Note: subversion must be installed first)

    ./install.sh
  4. Now, we’re ready to start "edi_webrick.bash" which is the script that calls the "Ruby" code to translate EDI. This script needs to be started in order for EDI to function so please take appropriate measures to ensure this starts following reboots/upgrades/etc. As the opensrf user:

    ./edi_webrick.bash
  5. You can check to see if EDI translator is running.

    • Using the command "ps aux | grep edi" should show you something similar if the script is running properly:

      root 	30349  0.8  0.1  52620 10824 pts/0	S	13:04   0:00 ruby ./edi_webrick.rb
    • To shutdown EDI Translator you can use something like pkill (assuming no other ruby processes are running on that server):

      kill -INT $(pgrep ruby)

Enable EDI cron Jobs

The EDI scripts are "edi_pusher.pl" and "edi_fetcher.pl" and are used to "push" and "fetch" EDI messages for configured EDI accounts.

  1. Un-comment the below lines in the opensrf user’s crontab in order to regularly push and receive EDI messages.

    • The example schedule for running the EDI scripts are:

      10 * * * * cd /openils/bin && /usr/bin/perl ./edi_pusher.pl > /dev/null
      0 1 * * * cd /openils/bin && /usr/bin/perl ./edi_fetcher.pl > /dev/null
    • edi_pusher.pl runs at 10 minutes past the hour, every hour.

    • edi_fetcher.pl runs at 1 AM every night.

You may choose to run the EDI scripts more or less frequently based on the necessary response times from your vendors.

Configuration

Configuring Providers

Please see the Providers documentation for information about setting up Providers.

Configuring EDI Accounts and SAN codes

Please see the EDI documentation for information about setting up EDI Accounts and SAN codes.

Troubleshooting

PO JEDI Template Issues

Some libraries may run into issues with the action/trigger (PO JEDI). The template has to be modified to handle different vendor codes that may be used. For instance, if you use "ingra" instead of INGRAM this may cause a problem because they are hardcoded in the template. The following is an example of one modification that seems to work.

Original template has:
"buyer":[
    [%   IF   target.provider.edi_default.vendcode && (target.provider.code == 'BT' || target.provider.name.match('(?i)^BAKER & TAYLOR'))  -%]
        {"id-qualifier": 91, "id":"[% target.ordering_agency.mailing_address.san _ ' ' _ target.provider.edi_default.vendcode %]"}
    [%- ELSIF target.provider.edi_default.vendcode && target.provider.code == 'INGRAM' -%]
        {"id":"[% target.ordering_agency.mailing_address.san %]"},
        {"id-qualifier": 91, "id":"[% target.provider.edi_default.vendcode %]"}
    [%- ELSE -%]
        {"id":"[% target.ordering_agency.mailing_address.san %]"}
    [%- END -%]
],
Modified template has the following where it matches on provider SAN instead of code:
"buyer":[
    [%   IF   target.provider.edi_default.vendcode && (target.provider.san == '1556150')  -%]
        {"id-qualifier": 91, "id":"[% target.ordering_agency.mailing_address.san _ ' ' _ target.provider.edi_default.vendcode %]"}
        {"id-qualifier": 91, "id":"[% target.ordering_agency.mailing_address.san _ ' ' _ target.provider.edi_default.vendcode %]"}
    [%- ELSIF target.provider.edi_default.vendcode && (target.provider.san == '1697978')  -%]
        {"id":"[% target.ordering_agency.mailing_address.san %]"},
        {"id-qualifier": 91, "id":"[% target.provider.edi_default.vendcode %]"}
    [%- ELSE -%]
        {"id":"[% target.ordering_agency.mailing_address.san %]"}
    [%- END -%]
],