Any help with understanding documents

I am having trouble understanding how to upload and retrieve a patients documents.

I would like to know how to upload a template. How to fill in the template or form.
2. How to upload the form and where it is saved to
3. how to retrieve a specific form for a specific client.

Hi Tammy-
OpenEMR has a documentation wiki that seems to be not very well known here on the forum. It’s awkwardly organized, being the product of years of accretions by sundry contributors but it does have a lot of good information in it.
The top level page is:

And the wiki does have a page giving precisely the information you’re looking for:

The gist of the process is that you make a template document similar to an old- school Mail Merge document with keyword fields in it. Then you upload it to the patient’s ‘Documents’ section that you’ll be using it with, from where you’ll access it and print out as needed.

The illustrations in the wiki article are from an old version of OpenEMR with a different theme, so the screen objects appear different in v 5.x but functionally they’re the same.

Come on back and ask any questions that may arise!

  • HT

Thanks. Where are the stored on the server?

Hmm, I am not a dev but one of them should be able to tell you.
Maybe @stephenwaite for example?

hi @htuck, nice explanation, hi @tjbarr, here’s a tree view that shows the sites directory

when you upload a document to a patient’s chart it is stored in a subdirectory to documents named after the patient’s id

I don’t know if many remember but I put in 5.02 a document template feature. Primarily had portal patients in mind but document templates from demographic documents can be any patient.

Template are managed for all patients or individuals from Miscellaneous->Portal Dashboard.

If you want signatures and such then worth a look. Also, easier to manage templates.

1 Like

Thanks so much. I really appreciate the map and the explanation.

if I was looking in my file directory, where would I find the files?
e.g. mysite/emr/


this is verrry cool. From what I can see though, the templates can’t be .doc or .odt files now, just .txt?
Is there any provision for including graphics in a template?

Thanks @htuck.
There are several issues I need to complete to get this feature where it needs to be. It’s been a slow 3 year journey to get this far as not many have shown an interest in this feature so i’ve been putting off but, v5.0.3 will have it completed.

  • Yes, it should handle images and is easy(well somewhat) to implement and is planned.
  • Trying to handle xml doc types(docx) is tricky because of U.I viewing/filling/edit mainly. Doing the tag substitution is easy enough but would need an editor plugin that can handle docx. Haven’t found one yet but if anyone has suggestion then by all means, clue me in.
  • Still, much can be done using flat file of text/html. Especially html as template is processed as a <div></div>
  • Will add a Template management U.I (like current portal) for demographics patient templates to where current document templates are uploaded/managed ie Administration->Documents Document Templates.
  • Add some new replacement tags like comment, links and sub template insert for combining smaller fragments and building forms.
  • Make easier to use like a kiosk.

Probably if i’d document my features better, more would use but, I am lazy don’t we know.:slight_smile:

Thanks for the help. Any documentation would be appreciated. I know it takes time and is voluntary so I understand.

I see that there are form layouts with pre-constructed blocks. Can I make a totally custom form? If I do customize forms will they be overwritten with an update?

Hi Tammy @tjbarr,
Are we talking about patient templates or Layout Based Form?
Once a patient/user saves a filled template, it is saved forever in the last state. Any edits will be against the previously edited template.

You can upload any text/html file as templates. All default template have a chance to be updated in future so it is best, if modified, to archive or rename your version. Otherwise, new templates aren’t touched on upgrades.

I posted a user doc on the new templates in the OpenEMR wiki, at:

Would love to hear if any corrections are needed.

  • HT
1 Like

I’m gonna have to play with the html file as template, looks like I missed that!

Very nice and thank you for doing. It’s a somewhat complicated process to describe but I think you nailed it pretty well.
It could be noted that once a template is saved it is no longer dependent on the master template(may be obvious).
I always thought the capability to send a template(say legal) to an individual patient was pretty neat. Maybe a short blurb of that intent.
Signature is much improved in 5.0.3. So is portal for that matter. Almost all sm device responsive.
Seeing this makes me want to get back on/improve the feature. Your a motivator of men. :slight_smile:

As long as you remember template renders inside a <div></div>, sky’s the limit.

Thanks Jerry for the notes, I’ll get back on the docs and work them in.

  • HT