1 Integrating SQL-Ledger with OpenEMR
5 1. Install sql-ledger according to sql-ledger's instructions. Make sure it is
6 working before adding the support for openemr. Installation basically amounts
7 to untarring sql-ledger in a directory, creating an alias/virtual directory in
8 your web server, creating the sql-ledger user in the postgresql database, see
9 the sql-ledger README for the details:
11 http://www.sql-ledger.org/cgi-bin/nav.pl?page=source/readme.txt&title=README
13 OpenEMR configuration:
15 2. Create a sql-ledger user for openemr to post as. Bring up sql-ledger in
16 admin mode [http://localhost/sql-ledger/admin.pl]. Login as the sql-ledger
17 user. Create a dataset (database) for openemr to put its data (I called mine
18 openemr) and used the default set of books (accounting codes). Create a user
19 to use this dataset. I created a user called openemr. Note, this user is not a
20 postgresql user, it is a sql-ledger user. You see that you need to put a user
21 to log into postgresql as. Here I used the default sql-ledger user. Make sure
22 you select the Pg (postgresql) driver.
24 3.Edit the sql-ledger.conf file. Add the following to the default
31 $oemr_services_partnumber
33 to the use vars section at the top
35 Add the following also:
37 # Some constants relevant to OpenEMR import.
39 $oemr_username = 'openemr'; # sql-ledger user to post as
40 $oemr_ar_acc = '1200'; # account number for accounts receivable
41 $oemr_cash_acc = '1060'; # account number for checking (copay deposits)
43 # In SQL-Ledger you must create a services item for medical services
44 # before you do any OpenEMR billing. Specify its "part number" here:
46 $oemr_services_partnumber = 'MS';
48 # This is the number of days added to the OpenEMR transaction date to
49 # produce the invoice due date when there is insurance. This affects the
50 # patient portion of the outstanding balance shown in the OpenEMR patient
51 # summary, and of course SQL-Ledger's aging reports and statements.
55 Note: $oemr_username is the same user you created in step 2.
57 Also note: A sample sql-ledger.conf including the above parameters is
58 included, however it may be incomplete from the standpoint of the current
61 4. Copy ws_server.pl to the sql-ledger directory if you are using SQL-Ledger
62 2.4.x. If you are using 2.6.x then copy ws_server_26.pl to that directory
63 as ws_server.pl. Alternatively you can create a suitable symbolic link in
64 that directory. Then, examine the resulting ws_server.pl and change the
65 "use lib qw" statement as indicated.
67 5. Edit the openemr/interface/globals.php and put the right data for the
70 $sl_dbname = 'openemr'; // sql-ledger database name
71 $sl_dbuser = 'sql-ledger'; // sql-ledger database login name
72 $sl_dbpass = 'secret'; // sql-ledger database login password
74 Note: $sl_user is a postgresql user
75 $sl_dbname is the dataset you created in step 2.