Adding a time to the date stamp in form_encounter table

robert20122013 wrote on Saturday, June 29, 2013:

Hi Team,
I am new to php but not to web development. I want to use openEMR for a team of volunteer doctors who visit India once or twice a year. The data we gather will be much more useful if we can record the time that consultations take. I noticed that the date in the form_encounter table is a datetime, so all that would need to be done is to add the time to the date on the new encounter form which appears when you click ‘create visit’. I would also need to add an ‘end visit’ button in the top frame, and endvisit datetime into form_encounter, and possibly a bit of code to end the visit when you create a visit for a new patient. This should not be difficult, but it turns out that it is difficult. I am finding the code very difficult to read mainly because most of the php instructions are stored in functions that are not easy to locate.

For example the left_nav.php calls the new.php when you click create visit, which then calls common.php, which seems to handle the actually form display. However I cannot find an sql insert query for the form_encounter table, only select queries. So where does the insertion of a new visit into the table happen? The saveClicked function in common.php causes f.submit() to be executed where f=document.forms[0]; but where is that submit code?

Sorry if this is a bit too noob for this forum,

Thanks for any responses.

mdsupport wrote on Saturday, June 29, 2013:

Robert,
Suggest you use ‘forms’ table which already records the date and time for all forms related to that encounter. By following ‘forms’ records you can find the sequence of actions.

Regarding the end time, standard way is to record the appointment status as check-out when the patient actually leaves the clinic. Think it gets recorded in the events record.

If that does not work for you, you may find it more flexible to add a quick LBF to mark end of the visit. Then you will have end time as a record in forms as well.

yehster wrote on Saturday, June 29, 2013:

robert20122013 wrote on Sunday, June 30, 2013:

Thanks!

robert20122013 wrote on Sunday, June 30, 2013:

robert20122013 wrote on Sunday, June 30, 2013:

Thanks for the ideas. I found that the forms table does not automatically record times - all the times show as 00:00:00. I’m reluctant to create LBFs because the doctors have something like 3000 patients to see in a weekend. Waiting for another form to load would be time consuming. I did find the log. I’ll have to think about whether that’s the answer!

tmccormi wrote on Thursday, July 11, 2013:

see: https://sourceforge.net/p/openemr/discussion/202506/thread/7dd324ae/?limit=25#852c

–Tony