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.
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.
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.
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.
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.
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
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.
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.
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