EDI Claim History Project

kevmccor wrote on Tuesday, October 09, 2012:

The drop box to select a csv table to view is populated when the csv files have content.  If you have not processed any files through the New Files tab there will be only a heading row in the csv files and they will not be listed in the drop down.  This is checked when the the frame is opened when you click the EDI History in the left nav frame.

kevmccor wrote on Wednesday, October 10, 2012:

I have put some small edits into my new edihistory_3 branch - trying to improve appearances.

Also working on a function to check whether an era file has been processed through the Payments screen.  It should show up in the ar_session table, I believe.

kaushleshsingh wrote on Wednesday, October 10, 2012:

Hi Kevin,

I am unable to locate any updates. Can you please send me the direct link to download those code.

Thanks Regards
Sunny

bradymiller wrote on Thursday, October 11, 2012:

Hi,
I just committed Kevin’s updates to sourceforge (on the master branch). Kevin, note I just brought in all of your commits (for now on, suggest starting(or ending) each commit with something like EDI History module or something like that so obvious what the commit is for. Keep the improvement coming in, though (just let me know when you want me to commit them to sourceforge).
thanks for the contributions,
-Brady
OpenEMR

bradymiller wrote on Thursday, October 11, 2012:

To clarify above,
I just mean to place ‘EDI History module’ os soemthing like that at the start or end of each commit comment in the future.

kevmccor wrote on Thursday, October 11, 2012:

I began the comments with “edihistory.”  I pushed a few more little tweaks and fixes.

Thanks

bradymiller wrote on Friday, October 12, 2012:

Hi,

Just committed all your new commits to sourceforge, including the one that requested review. Also placed a review of that commit here:
http://github.com/kevmccor/openemr/commit/b65a1356f03a5282cdea5fceb4e026953ef276b0

-brady
OpenEMR

kevmccor wrote on Monday, October 15, 2012:

OK, the comments were very helpful.  I think I got the function to check whether an ERA file had been processed through the Payments screen to do what I want - find a row with the check number, or not.

I did a few more small tweaks and added a check for whether a 997/999 response for a batch file is present.

Pushed these to my edihistory_3 branch.

At this point, I think I need some others to test things -
see if their files upload correctly
see if they can get wrong files to upload (get through the upload filter)
usability, css, etc.

I would like to get the eligibility request and response working, since this is the remaining edi item of importance.  I am more interested in the response files, but the request has to be made to get any of these.

Thanks

bradymiller wrote on Tuesday, October 16, 2012:

Hi Kevin,
Just committed your stuff to sourceforge.
-brady
OpenEMR

kevmccor wrote on Wednesday, November 14, 2012:

I just pushed some edits to the project at branch edihistory_3.  These mainly cleanup the 277 file reading functions and some interface improvements.

I am hoping I can get someone to start trying this out - all you need are edi files.  I would like some feedback if anyone is interested.

Thanks

kevmccor wrote on Wednesday, November 14, 2012:

My github is at https://github.com/kevmccor/openemr/ and the branch is edihistory_3.  I thought that link was in the last post, but I must have missed it.

bradymiller wrote on Thursday, November 15, 2012:

Hi Kevin,

I merged your changes into sourceforge codebase (will be mirrored to github and other repos in 10 or so minutes). Regarding testing, you wouldn’t happen to have (or know where we can get) some dummy 277 files for those of us that don’t have any?

thanks,
-brady
OpenEMR

bradymiller wrote on Thursday, November 15, 2012:

Also,

For future, suggest updating your git repo to keep other code current. Suggest:
1. Updating your master branch (let us know if need the commands to do this)
2. creating another branch from it called edihistory_4 (this will contain all your code since it’s all been committed to sourceforge).

-brady
OpenEMR

kevmccor wrote on Thursday, November 15, 2012:

I just pushed another fix to the 277_read file.  I wasn’t getting all the particulars to the functions that select individual responses.  I am pretty happy with the project right now (no one has complained yet), and it is doing most of what I wanted.

Brady, I pushed this before I saw your message. 
  (1)  The 277 files I have are the 277CA variety, unsolicited responses issued by clearinghouses or payers on their initial processing of batch claims.  I expect many users will have these or have access to them.  Send me an e-mail.
  (2) I think you already explained updating the git repo.  I will look into it and give it a try.  I’m just a little lazy about that, since I then have to reconfigure things for my development setup. 

bradymiller wrote on Thursday, November 15, 2012:

Hi Kevin,

I just merged in your most recent commit to sourceforge.

thanks,
-brady
OpenEMR

openemrdev wrote on Monday, September 09, 2013:

Hi all

When i try to upload the .835 file to edi history new section.it shows below error.

Warning: scandir(C:WindowsTEMP/edihist) [function.scandir]: failed to open dir: No such file or directory in C:\wamp\www\OEMR_contibution\library\edihistory\csv_record_include.php on line 400

Warning: scandir() [function.scandir]: (errno 2): No such file or directory in C:\wamp\www\OEMR_contibution\library\edihistory\csv_record_include.php on line 400

Warning: Invalid argument supplied for foreach() in C:\wamp\www\OEMR_contibution\library\edihistory\csv_record_include.php on line 402

Am using wamp with openemr 4.1.3 dev version

What i am doing wrong

kevmccor wrote on Sunday, September 15, 2013:

Warning: scandir(C:WindowsTEMP/edihist) [function.scandir]: failed

The “C:WindowsTEMP/edihist” path is wrong. The temporary directory is derived from the following function (line 249 csv_record_include.php):

function csv_edih_tmpdir() {
    //define("IBR_UPLOAD_DIR", "/tmp/edihist"); 
    $systmp = sys_get_temp_dir();
    $systmp = stripcslashes($systmp);
    return $systmp."/edihist";
}

So, the php call sys_get_temp_dir(); must be returning "C:WindowsTEMP". I would have expected "C:\Windows\Temp". Basically the file handling sequence is to copy uploaded files into the temporary directory, scan and categorize the files, save accepted files, do reading and extracting, and produce output. Then the temporary directory is cleared. If the temporary directory path is wrong it just won’t work.

You could try to change the line (252, 253):

  // $systmp = stripcslashes($systmp);
  return $systmp."/edihist"; to be: return $systmp."edihist"; 

(take out the slash) and see what happens. Also, try commenting out the stripcslashes().

Another possibility is to completely change the csv_edih_tmpdir() function to create a surrogate temporary directory under the edi history path:

  function csv_edih_tmpdir() {
     $systmp = csv_edih_basedir();  //$GLOBALS['OE_SITE_DIR'].'/edi/history';
     if ($systmp) {
        return $systmp.DIRECTORY_SEPARATOR."edihist";
     } else {
        return FALSE;
     }
   }

I do not think there are any hardcoded references to the temporary directory in the scripts, so every time the temporary directory is accessed it should be through the csv_edih_tmpdir() function. However, please use a test setup if you do this because the csv_clear_tmpdir() function deletes all the uploaded files from the temporary directory.

Issues with directory paths will happen with different operating systems, virtual computers, and environment variables. The PHP manual online says that sys_get_temp_dir(); gives inconsistent results, but I was not able to test on different systems. Since the edi history project is really all about uploaded files it is somewhat unique and the file handling was a big part of the project. The directory paths functions need people to try it on different systems and report issues. I appreciate your comment.

Kevin

kevmccor wrote on Monday, September 16, 2013:

I have posted an attempted fix for this issue at my github at GitHub - kevmccor/openemr: Mirror of official OpenEMR Sourceforge repository. I made a branch, edihistory_4, and did somne other github stuff like trying to get everything current with openemr, but I am pretty fuzzy on it. Anyway, the temporary directory path issue is embarrasing, but I see how it never came up in my setup.

bradymiller wrote on Saturday, September 21, 2013:

Hi Kevin,

Is this the commit:

-brady
OpenEMR

kevmccor wrote on Saturday, September 21, 2013:

Yes, and if you know any other “gotcha’s” with determining the temporary directory, let me know. I also updated the ibr_code_arrays.php and ibr_status_code_arrays.php since there were some new codes from http://www.wpc-edi.com.

I am also working on improving the javascript, but that may take a while. I cannot put as much time in as I used to be able to. So, if I am not doing the git repository right, feel free to comment on that as well.

Thanks