New feature to support word processing documents as templates

bradymiller wrote on Friday, April 04, 2014:

Hi Pimm,

Note that when it’s not translated (ie. no dummy) there are two possibilities:

  1. The code is using xl() or a derivative of it, but the constant has not yet been placed in the translation spreadsheet (the process of placing new constants in the spreadsheet is done via several perl scripts that takes about 4 hours to do, so I only do this several times a year)
  2. The code is not translated (only are rare instances of this likely left in the codebase).

A grep command can be used to check. For example if I do following on linux command line:
grep -R “Document Templates” /var/www/openemr/

I then get following output:
/var/www/openemr/interface/main/left_nav.php: <?php if (acl_check('patients','docs')) genMiscLink('RTop','adm','0',xl('Document Templates'),'super/manage_document_templates.php'); ?>
/var/www/openemr/interface/main/left_nav.php: <?php if (acl_check('patients','docs')) genMiscLink('RTop','adm','0',xl('Document Templates'),'super/manage_document_templates.php'); ?>

Note it states the file the constant is in and shows the line (note it has a xl() around it)

-brady
OpenEMR

blankev wrote on Friday, April 04, 2014:

Now do the same for Browse in the Google translation tabel and Browse is translated into “Doorzoeken” in Nederlands, but it shows as browse in the Document Templates frame…

Please explain?

bradymiller wrote on Friday, April 04, 2014:

grep -R “Source File Path” /var/www/openemr/

/var/www/openemr/templates/documents/general_upload.html:    <p><span>{xl t="Source File Path"}:</span> <input type="file" name="file[]" id="source-name" multiple="true"/>&nbsp;(<font size="1">{xl t="Multiple files can be uploaded at one time by selecting them using CTRL+Click or SHIFT+Click."}</font>)</p>

Note that the Browse… button (to the right of Source File Path) isn’t created by OpenEMR, but is created by the browser (since it’s leveraging a file input type http://www.w3schools.com/tags/att_input_type.asp). So, if the user was using a browser with another language it will show in that language.

-brady
OpenEMR

blankev wrote on Friday, April 04, 2014:

Sorry for my repeat question, please ignore the BUTTON question in Github.

blankev wrote on Thursday, April 10, 2014:

As might have been noticed before: I created a HIPPA Document template (needs some corrections), a Donations Document template and want to make another general document with all options available as default by Rod’s Document Templates.

If accepted, can these OpenOffice files be included in the New Installs of OpenEMR, and where should I include these documents in the Github repositories, for evaluation?

Motivation:
Every opportunity to have someone donate for OpenEMR development, should be in the priority list of OpenEMR.
Every opportunity to make life easier for the User or the Client should be an opportunity to include some redundant extra if it does not create an obstacle.

  1. Nothing more inviting than a personal note where you can read what to support and how.
  2. The rules for HIPAA state that every client should give consent for EMR registration etc. also a nice thing if the Client reads his/her own name in print to accept or reject the HIPAA rules and why.
  3. Adding some Document Templates is an invitation to experiment. Hitting the inbuilt DELETE button is faster than the restore, so it is no extra burden for the Newbies if they have enough experience and want to get rid of any created document.

Please advise, tnx in advance.

sunsetsystems wrote on Thursday, April 10, 2014:

To make a default template for new installations, put it in the sites/default/documents/doctemplates/ directory. That directory does not exist yet so you’ll need to create it also.

Rod
http://www.sunsetsystems.com/

almondjpeg wrote on Saturday, May 28, 2016:

I have tried to fetch the template as described here: http://www.open-emr.org/wiki/index.php/Templates_for_Patient_Documents

The result looks very strange (s. screenshot). Can someone please explain what have I done wrong?

sunsetsystems wrote on Sunday, May 29, 2016:

It appears your browser is not recognizing the document type. With (for example) Firefox you can right-click on the frame, click “this frame” and then “view frame info”. This will tell you the MIME type. Then in the browser settings for applications, set the desired application as the handler for that type.

Rod
http://www.sunsetsystems.com/

almondjpeg wrote on Wednesday, June 08, 2016:

Thanks for your help Rod! Where can I see MIME type of this screenshot?

sunsetsystems wrote on Wednesday, June 08, 2016:

That’s the “text/html”. Which would explain why the browser is not opening another app to handle it. Might help if you tell us in detail what you did to create the template. Preserving the original filename suffix (e.g. “.odt”) might be the key, but that’s just a guess at this point.

Rod
http://www.sunsetsystems.com/

k2c-supp wrote on Friday, February 17, 2017:

This is a question about creating new fields for the Document Template Manager. I am putting it here and reviving this thread instead of starting a new one because I got a lot of help from the thread and links above. If I should start another thread I’ll do that.

I find the document templates to be very helpful for simple templates like referral requests where all you need is a patients name and DOB. I would really like to pull data from layout based forms to populate a report.
I am not a coder but am dangerous enough to look through the code to follow how it works … and then can copy and paste as well as anyone. I have added a couple new keywords by duplicating some of the code in “download_template.php” (around line 200) and modifying slightly like this:

else if (keySearch($s, ‘{DiagnosisCodes}’)) {
$s = keyReplace($s, dataFixup($ptrow[‘diag_codes’], xl(‘diag_codes’)));
}

This gives a new keyword, {DiagnosisCodes}, to pull ICD10 codes (diag_codes) out of the “Patient_Data” table which holds demographics info. But, this only works for getting data from the this table. I would like to get “organization” and “fax” data from another table, the “Users” table, and would especially like “field_value” data from the “lbf_data” table to pull into a report.

If this makes sense, is there a concise bit of code I can add to these few lines to point to say the “Users” table? Or, does anyone have a recommendation for a useful resource I could consult to get some help?

epsdky wrote on Friday, February 17, 2017:

Hello Joel,

It appears the code to include field data for LBF encounter forms is already present…

{LBFxxx:fieldid}

epsdky wrote on Saturday, February 18, 2017:

Using {LBFxxx:fieldid} when there are multiple instances of a single LBF form seems to be a problem.