SQL-Ledger - works but for AR Transactions

kashurjmax wrote on Friday, March 17, 2006:

I finally got as far as getting new patinets to be added to sql-ledger when you add them to openemr. However, when I add a new encounter all the way through Billing and Marking cleared, the AR transaction does not get created in SQL Ledger and I do not see any errors either.
I tried putting debug statements in SL\AR.pm - but I am not getting any output.
I have couple of questions -
1. Has anyone seen this and knows the solution?
2. If noone has the solution can someone tell me when the AR.pm ar_transaction function is called -
a) when you create encounter
b) when you create X12 in billing
c) when you start batch processing
d) when you mark the billing to be cleared

That would help me debug.
Thanks a lot !

sunsetsystems wrote on Friday, March 17, 2006:

It used to be that “Mark as Cleared” did not update SQL-Ledger, but that should be fixed in 2.8.1.  If you’re using an earlier release then the posting only happened with “generate electronic batch and clear”.

– Rod
www.sunsetsystems.com

kashurjmax wrote on Friday, March 17, 2006:

Rod,
Thanks.
I am probably missing the step to create the "Service" "MS" in sql-ledger - I cannot get to the CVS - can you or someone else please post the sql-ledger MS Service creation sql script. I am assuming that needs to be run on the sql-ledger database.
Thanks

kashurjmax wrote on Friday, March 17, 2006:

I think the file I am looking for is sql-ledger\sql\US_Medical-chart.sql  - IS this file needed to be run on the database for ARs to be inserted into sql-ledger?

kashurjmax wrote on Friday, March 17, 2006:

Thanks - got the file finally from CVS (what a pain). Now I know I have the right DB Schema and values. I had to create a Service "MS" manually in sql-ledger.
However, I still have my original problme - I cannot create any AR entries in the sql-ledger DB. I manually created a AR entry thru sql-ledger for a patient and it DOES show up in the "Amount Due" in the Patient Notes area - so I know openemr is talking to sql-ledger thru ws_server.pl - I still cannot debug why it cannot create AR entries.
Any help would be appreciated.
Thanks

ajperezcrespo wrote on Friday, March 17, 2006:

How about your SL user account?
Make sure it matches  with the with the one in Globals.php.
#–Globals.php
$sl_dbname      = ‘sql-ledger’; // sql-ledger database name
$sl_dbuser      = ‘sql-ledger’; // sql-ledger database login name
$sl_dbpass      = ‘secret’;     // sql-ledger database login password

kashurjmax wrote on Friday, March 17, 2006:

Alfonso - thanks - the passwords are fine. I am able to create and update patients in SQL Ledger thru openemr - just not able to create AR entries. If the password were wrong, I would not be able to create patients either.
I am also able to view AR entries created manually through sql-ledger in openemr "Amount Due" area and through EOB screens, I just cannot create AR entries.
Any help debugging would be helpful.
I have openemr 2.8.0 and sql-ledger 2.4.x I had first tried the latest sql-ledger and then downgraded becuase I read about the incompatibilties.

sunsetsystems wrote on Friday, March 17, 2006:

Make sure that:

(1) The value for $GLOBALS[‘oer_config’][‘ws_accounting’][‘income_acct’] in includes/config.php is correct and has a matching chart of accounts entry in SQL-Ledger

(2) $oemr_ar_acc and $oemr_cash_acc in sql-ledger.conf are correct and have matching chart of accounts entries in SQL-Ledger

(3) Your MS service is linked to the income account

– Rod
www.sunsetsystems.com

kashurjmax wrote on Saturday, March 18, 2006:

Rod,
I checked all the values, they are all correct.
As far as the MS service, hereis what I did -
in sql-ledger I went to "Goods and Services" and "Add service" and added a service "MS" - is that the right way?
Still no luck.
How can I debug this - if I put "print" lines in the sql-ledger AR.pm file, it does not really print anywhere.
Thanks

bradymiller wrote on Sunday, March 19, 2006:

hey,
I know the pain you feel pain. I was having the same problem for several days. You need to edit your user settings on openemr and make sure the user is authorized. Then when you ‘mark as cleared’ it will work. I’m putting together a HowTo for all the components of OpenEMR at www.bradymd.com if you need to start from scratch.
later,
brady

kashurjmax wrote on Sunday, March 19, 2006:

Brady - thanks. The user in openemr is authorized and can “Mark cleared” the billings.
Are you putting a How-to in a wiki format - so people can edit and add notes? There are many how-to’s - we should look at consolidating all that as a wiki. I am ready to help.
Your site is down right now, will check it out when it is up.

kashurjmax wrote on Monday, March 20, 2006:

SOLVED -
Thanks for all your help.
The problem was in 2.8.0 you have to click "Mark as Cleared" to update SQL-Ledger, and NOT "Make electronic batch and clear".
Rod, your earlier message threw me for a 2 days debugging loop there ! You said it was the otehr way.
Anyway, it was a great learning exercise. We really need a manula for all this. I will reinstall this on a new machine and start putting it together.

sunsetsystems wrote on Monday, March 20, 2006:

Apologies if I gave you bad information, but I am skeptical that I did.

As I recall 2.8.0 was released in December, and according to the CVS log I fixed the “mark as cleared” bug on January 9.  What’s the date of your library/classes/WSClaim.class.php?

Also if “Make Electronic Batch and Clear” is not updating SQL-Ledger then electronic billing is badly broken; I’ve not heard any reports of that.

– Rod
www.sunsetsystems.com

bradymiller wrote on Monday, March 20, 2006:

I spent approx. 2 long days re-installing many different versions of SQL-Ledger, until I realized I just simply had to ‘authorize’ the user. Luckily, there wasn’t a shotgun around. The Howto’s not in a wiki format. Just an openoffice doc converted to html for now. Still a work in progress, although the OpenEMR install part is mostly done (goal is to basically allow even linux naive people to do a full install).

kashurjmax wrote on Monday, March 20, 2006:

Rod,
No sweat. You have been very helpful to everyone on this forum. I really appreciate that. I double checked and that is what was happening in 2.8.0. However, it is water under the bridge - I also upgraded to 2.8.1 last night and will test everything today to make sure it works.
I had one nagging question - When you create a new dataset in postgresql through sql-ledger, do you select default as the type of account/chart or US Services?
I used US Services (or similar sounding name) and then ran the sql-ledger\sql\US_Medical-chart.sql on the dataset. Is that necessary? Can you just use default and not have to alter the dataset?
I did see a bunch of new table creations in the sql-ledger\sql\US_Medical-chart.sql script and some alter tables, is that mostly for the EOB integration with openemr?

sunsetsystems wrote on Monday, March 20, 2006:

For OpenEMR it’s not critical which chart of accounts you use; this is more a question of which one best fits your business model, if you want to use SL for your general accounting.  I generally choose the default.

Not sure I understand about US_Medical-chart.sql.  You should be using a stock SQL-Ledger from www.sql-ledger.org; the customized one in CVS is obsolete.

See accounting/README.sql-ledger in the OpenEMR distribution for further details.

– Rod
www.sunsetsystems.com