Insert Matrix into Form

bob-arctor wrote on Monday, July 22, 2013:

Hello all, I’m currently exploring the possibility of implementing OpenEMR at a non-profit eye hospital in rural India. The administrator has asked me to duplicate some of their exam forms within the system–so far LBV has served me well but I’ve come up against an issue that’s stumped me.

I’d like to be able to insert a matrix of fields into an Encounter form. By matrix I really mean table in the traditional sense of the word–I use matrix here to distinguish from database tables, an issue that’s been confounding my googling of this problem. To make things slightly more complicated I’d also like to have some “nesting” within the tables. This is essentially what I need to duplicate, with the user being able to input data into each cell: http://help.adobe.com/en_US/livecycle/9.0/designerHelp/index.htm?content=000245.html

So far I’ve been unable to figure out a way to get LBV to generate a matrix of fields, let alone a nested one. I’m not afraid to stray from LBV and get my hands dirty with some code, but unfortunately I am very much a novice when it comes to PHP.

Currently this hospital is doing all of its record-keeping by hand and has extremely limited funds for implementing an EMR, so I’d appreciate any help you folks could provide. Thanks!

fsgl wrote on Monday, July 22, 2013:

Hello, Bob.

OpenEMR would be a very good choice for rural India. Electricity is probably unreliable or next to non-existent there and the hospital must have its own generators or solar panels. OpenEMR can be used as a desktop application. There is a Hindustani English version, but it is only 1.93% translated while the Hindi version is 3.48% translated.

Look->Administration->Layouts->Demographics in the Demo. There are two orders of bifurcation or nesting. It should be possible that further bifurcations can be achieved by adding a subsection within the Field plus the same capabilities to modify it as for the Field and Group.

Almost all Histories and Physical Exams can be recorded with two orders of bifurcation. What are the special needs of the hospital that require further nesting? If the form is a wonder to behold but too complicated for the physicians to use, it would be frustrating for all concerned. Rather than additional nesting, it may be more helpful to have a Layout Based Visit form for each of the departments in the hospital.

bob-arctor wrote on Tuesday, July 23, 2013:

Thanks for the response, fsgl. It sounds like you’re referring to the Group function of Layout Based Forms, which is a great feature that I’ve been making use of but unfortunately doesn’t meet the needs of this particular form. I took a picture of a portion of the actual to give you all a better idea of what we’re trying to accomplish:

Sorry, I don’t know if it’s been a long day but for the life of me I can’t get the image to display in the post, so please follow this link: http://i1286.photobucket.com/albums/a613/mckinnoj/eye_exam_zps06503409.jpg
(note that this information is filled in during an eye exam).

I’m not a physician myself, so I’m not sure what all of the abbreviations mean, but you can see how it would be nice to just have a table in OpenEMR and allow the user to input data into each cell. Otherwise we’re stuck with a separate field for each cell, which would be a mess of things like RE:DV:DSPH followed by RE:DV:DCYL and so on ad nauseum.

I really like the workflow of creating a new Encounter for a patient and then selecting the appropriate LBV for the visit, but as of yet I haven’t figured out a way to insert such a table. Thanks again for reading!

fsgl wrote on Tuesday, July 23, 2013:

Bob, it is my great pleasure to be of assistance.

It is very difficult for most physicians to understand Ophthalmic notes, let alone all the symbols of a refraction (testing for glasses). It is rare that drops have to be instilled before testing for glasses (cycloplegic refraction) except in children with crossed eyes, but maybe it is done routinely in rural India.

Who is requesting the form and in what context? I presume the Refractionist, not the Ophthalmologist, is performing the refractions and that glasses are being dispensed as well. At least that is how I remembered it, at the Aravind Eye Hospital in Tamil Nadu.

Take a look at this Wiki article and the first attachment. Ask the Refractionist whether this form can be the starting point.

View also the Zenni Optical website and the second attachment. I presume the Refractionist is very busy, therefore drop down menus would be welcomed.

I have one more Ophthalmic form to complete for my colleagues who are not typists. Once done I will insert the lbv.sql file into the Wiki article and then it is up to you folks to figure out how to import it.

In case you are not aware, forms for other specialties are available as explained in Contributed Forms.

fsgl wrote on Tuesday, July 23, 2013:

Took another look at your paper form.

The upper right hand corner has a space for thumbprints. You must be in the boonies!

There is also a space for color, or “colour”, vision. Ask them if they use the Ishihara charts or just hold up a bottle cap that is either red or green.

It is important to know the order of each step of the refraction (everyone goes about it in a slightly different manner) and if glasses are dispensed as well.

All of this stuff will fit very nicely on a single Layout Based Visit Form with two orders of bifurcation, including the thumbprints if they want them in the body of the clinical note, assuming that the hospital has a scanner (or digital camera). It would make more sense to have the thumbprints in the Patient Summary->Documents->Patient Information.

bob-arctor wrote on Friday, July 26, 2013:

You are indeed correct about being out in the boonies! You’ve got some good questions regarding the order of the steps involved in the refraction–I’m working on arranging a day of shadowing the Optometrist here so I can get a better sense of the workflow.

In the meantime, that form on the Zenni Optical website looks great! Do you know if it’s possible to duplicate that layout using LBVs in OpenEMR, or does that require some more involved coding? The main thing I don’t know how to accomplish in LBV is having different columns for Sphere, Cylinder, etc.

fsgl wrote on Friday, July 26, 2013:

If the Optometrist lists each exam item in order, I can help with the general layout of the form, for example: 1) distance vision without glasses, right eye 2) distance vision without glasses, right eye with pinhole, 3) distance vision, without glasses, left eye 4) distance vision, left eye with pinhole, etc. The list will save you the time of following him about for the entire day. It is more efficient for him to do the list instead of him explaining to you his workflow because he can easily do it in 15 minutes.

Ask him what goes into the 4 quadrants under Dry Refraction and Cycloplegic Refraction. Are they funduscopic findings in each quadrant for each eye? The Layout Based Visit Form is so versatile that the drop down menus can be accomplished with Listboxes/add and Lists for Spheres, Cylinders, Axis and Add. The Dioptric range at Zenni is more than adequate. No additional coding is necessary. Nice, huh? The LBV form will hold only 4 columns maximally.