Do you use or administer OpenEMR? Take the General Satisfaction Survey to help improve the product

Template document current date and time OpenEMR 6.0.0


we have a need for current date and time fields in document templates, i’d suggest {date} and {time} - time would be hour:min:sec, but could refine by modifying time to indicate if seconds are needed {time:hr-min)

before I implement this in the file interface/patient_file/download_template.php I wondered if anyone else has already done this, to save me the time (no pun intended!!)


Remember if adding replace tags that not only do you need to add in portal/lib/download_template.php but, portal/patient/templates/OnsiteDocumentListView.tpl.php parser as well.

Please don’t name date or time but something more unique as these are functions in language.

thanks jerry, good points. i’ll use {CurrentDate} and {CurrentTime}

That’d be fine but, do you know we have {DOS} for current date available. You could extend that.

yes thanks, i do know about {DOS} - thanks for the pointer though,

Hi Jerry,

the documentation says that {DOS} is 'date of service' - I hadn't

understood what that would generate, The code
(download_template.php) uses ‘service date’ from the patient’s
encounter record, so I assume this is the date of an encounter.

but meanwhile i've implemented two new fields:

{CurrentTime} current time in hh:mm 24 hour clock format

{CurrentDate} current date in ISO format yyyy-mm-dd
with modifiers as follows
{CurrentDate:global} use the format specified in global settings

locale/date display format
{CurrentDate:YYYY-mm-dd} - for completeness as it’s one of the
options in ‘display format’, this is the same as the default
the parameters are all case insensitive, any parameter that is not
recognised is ignored to give the default.

I'd like to contribute this to OpenEMR, and my next task is to read

the documentation to see how to do this.

Does all this look good to you?
thanks for your help
1 Like

Hi @ruth,
Looks great to me. I’m actually doing considerable mods in portal now. Mainly scaling down Profile demographics, refix exclude in portal layout option and work in Secure Messaging. Ya might take a look.

So if you do a Pull Request, you’ll need to resolve some conflicts in patientdata.js if you had to touch that file as i’ll prob bring my PR in tonight or tomorrow.
Otherwise if you’re first, then i’ll review yours and resolve my conflicts no problem.

Or, you can send me files and i’ll get them in my PR for first v6 patch. Up to you and thanks. Not sure why I didn’t include as a base tag! Laziness would be my guess!:slight_smile:

Also soon to come, storing and managing templates by categories and patient thereby alleviating the need to work from default templates and better patient management.

Or something like that!

Oh, and SMS hooks from Dashboard Mail/Secure messaging.

Thanks Jerry

  the only file i've modified is

interface/patient_file/download_template.php - i’ve attached my
version. It’d be great to get it incorporated in this patch, if it’s
not too late,

all the best

download_template.php (17.3 KB)

Ok thanks @ruth, will be in first patch. Also will add to portal templates which is what I thought we were talking about.:slight_smile:

haha!! - thanks Jerry, it’ll be useful there too.

1 Like

Okay done, so thanks for the contribution Ruth. Just added to my PR and will bring in tonight sometime.