Lab Library ... Just a thought

juggernautsei wrote on Thursday, April 14, 2016:

I am in the process of building a requisition form. I looked to see if there was a library. where I could find all the current SQL calls to the procedure tables. To my surprise, there were no entries in any of the library files. I know this is a community project and things develope as they develop.

However if no one throws out the idea. Thinks never happen.

I looked and there was no library for sql calls to the database. There are 78 calls scattered over 38 files. None of which are like the formdata.inc or form.inc or patient.inc. I was thinking of starting a lab.inc.

Thoughts…

sunsetsystems wrote on Thursday, April 14, 2016:

I’d like to see a PHP object model for the various logical data constructs in OpenEMR. In the case of labs you might have different classes defined for compendium items, connections, orders, reports, result items etc. It would take some thought, and discussion among the developers, to settle on a good plan that everyone is comfortable with using.

This can be done independently of any framework and would create a good foundation for expanding to other platforms.

Rod
http://www.sunsetsystems.com/

juggernautsei wrote on Thursday, April 14, 2016:

It looks like Ken has started the object model in the library classes ClinicalTypes folder. Found the LabResult.php where he has LabResult extends ClinicalType.

bradymiller wrote on Friday, April 15, 2016:

Hi,

Although useful, the class structure would take time to sort out.

Also do feel free to create a lab.inc.php file if you have functions or sql queries that you want to modularize for your work and place them there. It would be at least a starting point in modularizing the procedure code a bit.

-brady
OpenEMR

juggernautsei wrote on Wednesday, April 20, 2016:

Brady,

Posted a pull request for a lab requisition form.
This post also includes the start of the lab.inc library file to get us going in modularizing the lab work done by the others.

teryhill wrote on Wednesday, April 20, 2016:

Sherwin the php-barcode.php is already in /library/classes. I used it for the barcode stuff I did.

Terry

juggernautsei wrote on Tuesday, May 03, 2016:

Terry,
this is a different class than what is in the library file. Because I had difficulties using what was in the library because of the requirements to build requisition form. I had to use a simpler bar code that was not a PDF image but real lines on the screen of the HTML file.
Because if you notice that the current library, It only generates the barcode when you go to print. The barcode the I am using is there before the print function is envoked. If the other one did that as well. I had a difficult time getting it to work in the enviroment that I was building.

arnabnaha wrote on Tuesday, May 03, 2016:

When I try your form in my test environment, I get the following error inthe php error log

[04-May-2016 01:55:52 Asia/Kolkata] PHP Fatal error: Call to undefined function getAllinsurances() in C:\xampp\htdocs\openemrtest\interface\forms\requisition\new.php on line 60

arnabnaha wrote on Tuesday, May 03, 2016:

After I comment out the line no 60 in the above file, I can see the requisition. Its looking great…The barcode is displaying fine but the only issue while printing is - it also prints the top bar containing the ros of button on the encounter page. hope with subsequent polishing you will be able to remove all those and give a nice looking professional print out.

juggernautsei wrote on Wednesday, May 04, 2016:

/library/patient.inc
/interface/patient_file/encounter/new_form.php

The patient.inc file has been updated to include function to get all insurances for the form.

The new_form.php is updated to hide the menu from the print function.

Thanks for testing!

I’ll go ahead and fix the lab company name to pull from database instead of being static text.

arnabnaha wrote on Wednesday, May 04, 2016:

Hi Sherwin,

It works fine now…No more errors andtheprint out looks great too. One issue is that the patient ID, name, DOb etc donot remain side to side, it comes one below the other. Please see the attachment.

Thanks
Dr. Arnab Naha

juggernautsei wrote on Wednesday, May 04, 2016:

Remember to uncomment line 60

juggernautsei wrote on Wednesday, May 04, 2016:

Ok, I’ll look at that its a css issue, which browser are you using?
I have attached one of latest

arnabnaha wrote on Wednesday, May 04, 2016:

I have it uncommented…

arnabnaha wrote on Wednesday, May 04, 2016:

I am using chrome…but i checked in firefox too…its the same…

juggernautsei wrote on Wednesday, May 04, 2016:

What about the insurance info?
I use chrome also. Is your OS linux?

arnabnaha wrote on Wednesday, May 04, 2016:

Insurance info is showing nicely…here is the attachment

arnabnaha wrote on Wednesday, May 04, 2016:

My OS is windows 10

juggernautsei wrote on Wednesday, May 04, 2016:

Please, when you get a moment. Right click on the DOB date where I have the circle then click on inspect. Please send me a screenshot of the inspect window

arnabnaha wrote on Wednesday, May 04, 2016:

Here it is -