Supports edit option S which uses the saved value from the previous encounter as the default value for a field in a layout based form. It’s a few lines of code in options.inc.php as well as a small new file called LBFrecent.php in /library.
This looks like it would be a very useful function. I will have to investigate how to integrate it into the current OpenEMR release. Do you expect that this enhancement would be incorporated into a mainstream OpenEMR release in the near future?
I can think of two useful variations to the function, in addition to the capability you have described.
One option would be to return the first non-null instance of a value over a series of visits. In ophthalmology, at every visit, we must certify that we have lowered the eye pressure of glaucoma patients by at least 15% from their initial pre-treatment levels. To have a field containing the pre-treatment pressure that propagates forward into future records, without having to manually scan through the past notes, would be very useful.
A different useful option would return the maximum value of a field with the date of its occurrence across a series of visits.
Is the Pop-up available for this “S” and is it included in the WIKI page for LBF Forms?
There was/is another Character missing in the Pop-ups for LBF, can’t remember wich one though. And these short Pop-up remarks are just the thing needed when working with the LBF creations.
Please ignore this remark if it is there. I did not check this new S in LBF’s.
Those variations sound quite useful. For me, what it is now is what I need and as a rank amuter coder, to figure out how to code those in would take me another few hours. But feel free to jump in and put that in.
Pieter,
Just added it to the popups. It is not in the wiki yet.
I, too, am a n00b at PHP. Wrote my first code in PL/1 and FORTRAN on punch cards in 1971 on an IBM System 360, and then a DEC PDP 11/45. Got pretty good with Z-80 assembler. Do a little with BASIC and a trace of C these days. PHP is “terra incognita” for me.
When a missing semicolon in PHP brought OpenEMR to its knees, it brought me back to the days of the TDL-Xitan Z-80 assembler on CP/M, when a missing semicolon would do the same thing.
I think my first endeavor will be to make a LBV field that inserts the current clock time when clicked upon. The time of day is clinically significant for intraocular pressure readings. I would like to make it permissive, so if I want to indicate that the reading time was actually a half hour ago, I could overwrite and store the auto generated value.
Then, I want to work on calculated values. I’d like to be able to have code like:
IF InitialPressure > 0 THEN
Percent Reduction = 100 * (InitialPressure - CurrentPressure)/InitialPressure
Yisrael, I am having trouble getting your code to work. I added the lbf.inc file to /library and made the change to options.inc.php. Am I missing something?