Adding Patient Portal Document Templates to OpenEMR Patient Documents

Currently patient can’t upload files or add attachments in portal. Templates are done in portal dashboard.

1 Like

@sjpadgett
I am having a hard time getting {HIS:usertext11} to work within my template.
It is the past medical history list from the history section from the layout lists.

Are there any LBV sample forms that are already created? I have already tried to follow the wiki.

Secondly, I am having problems with the formatting. Does it not use HTML? I am getting this huge space between a heading and a table.:

Please help… TIA

You can mix html/text or use pure text with <pre></pre> tags or pure html w/BS styling. Its just as if you are writing between a div tag. Don’t add doctype or body etc pseudo code for display is:

<html>
<body>
<div>@Template inserted</div>
</body>
</html>

Here is a quick mod’ed insurance template showing mixed format in 5.0.2(haven’t tested v6 in awhile):

<h4 class="text-center"><em>{PatientName} INSURANCE INFORMATION</em></h4>
<pre style="font-size:14px">
{CheckMark}Medicare# {TextInput}     {CheckMark}Medicaid# {TextInput}
{CheckMark}Workers Compensation(job injury) to whom is bill to be sent? {TextInput}
{CheckMark}Other Medical Insurance:	Group#{TextInput}   ID#{TextInput}
Name/Address 2nd Insurance: Name{TextInput} Relationship{TextInput}
Address {TextInput}
State {TextInput} Zip {TextInput}

Are you personally responsible for the payment of your fees? {ynRadioGroup}
If not, who is? Name:{TextInput}    Relationship:{TextInput}    DOB:{TextInput}

Who to notify in emergency (nearest relative or friend)?
Name{TextInput} Relationship{TextInput}
Address {TextInput}
State {TextInput} Zip {TextInput}
Work Phone {TextInput} Home Phone {TextInput}
</pre>
<h4 class="text-center">Medical History</h4>
<pre style="font-size:14px">
Risk Factors: {HIS:usertext11}
Exams/Tests: {HIS:exams}
Family Father: {HIS:history_father}
</pre>

1 Like

@sjpadgett
Is this insurance information supposed to populate the patient insurance in the demographics? It would be nice if it did!

Looks like my problem has to do with my newlines. It was my formatting. I had this:

<table>
<tr>
<td>{PatientName}</td>
<td>{PatientDOB}</td>
<td>{DOS}</td>
</tr>
</table>
<font size="4"><b><br></b></font></p><p align="CENTER"><font size="4"><b>Chronic Pain 
Medical History</b></font></p>
<p></p><pre style="font-size:14px">What are your symptoms?&nbsp;{TextInput} 
<p></p>
<p style="margin-bottom: 0in">Where is your pain?</p>
<table>
 <tr>
  <td><p style="margin-bottom: 0in">{CheckMark}Face</p></td>
  <td><p style="margin-bottom: 0in">{CheckMark}Shoulder: R</p></td>
<td><p style="margin-bottom: 0in">{CheckMark}Mid back</p></td>
<td><p style="margin-bottom: 0in">{CheckMark}Knee: R</p></td>
</tr>
<tr>
 <td><p style="margin-bottom: 0in">{CheckMark}Head</p></td>
 <td><p style="margin-bottom: 0in">{CheckMark}Shoulder: L</p></td>
 <td><p style="margin-bottom: 0in">{CheckMark}Low back</p></td>  
 <td><p style="margin-bottom: 0in">{CheckMark}Knee L</p></td>
  </tr>
  <tr>  
   <td><p style="margin-bottom: 0in">{CheckMark}Neck</p></td>
   <td><p style="margin-bottom: 0in">{CheckMark}Arm: R</p></td>
   <td><p style="margin-bottom: 0in">{CheckMark}Hip: R</p></td>
<td><p style="margin-bottom: 0in">{CheckMark}Leg: R</p></td>
</tr>
<tr> 
<td><p style="margin-bottom: 0in">	</p></td>
<td><p style="margin-bottom: 0in">{CheckMark}Arm: L</p></td>
<td><p style="margin-bottom: 0in">{CheckMark}Hip: L</p></td>
<td><p style="margin-bottom: 0in">{CheckMark}Leg: L</p></td>
</tr>
<tr> 
<td><p style="margin-bottom: 0in">	</p></td>
 <td><p style="margin-bottom: 0in">{CheckMark}Forearm: R</p></td>
<td><p style="margin-bottom: 0in">{CheckMark}Thigh: R</p></td>
 <td><p style="margin-bottom: 0in">	</p></td>
</tr>

but it works if I have this:

<table><tr><td>{PatientName}</td><td>{PatientDOB}</td><td>{DOS}</td></tr></table></p>
<h4 class="text-center"><em> Chronic Pain Medical History</em></h4>
<pre></p>What are your symptoms?&nbsp;{TextInput} </p>
<p></p>
<p>Where is your pain?</p>
<table><tr><td><p>{CheckMark}Face</p></td><td><p>{CheckMark}Shoulder: R</p></td><td><p> 
{CheckMark}Mid back</p></td><td><p>{CheckMark}Knee: R</p></td></tr>
<tr><td><p>{CheckMark}Head</p></td><td><p>{CheckMark}Shoulder: L</p></td><td><p>CheckMark}Low back</p></td><td><p>{CheckMark}Knee L</p></td></tr>
 <tr><td><p>{CheckMark}Neck</p></td><td><p>{CheckMark}Arm: R</p></td><td><p>CheckMark}Hip: R</p></td><td><p>{CheckMark}Leg: R</p></td></tr>
 <tr><td><p></p></td><td><p>{CheckMark}Arm: L</p></td><td><p>{CheckMark}Hip: L</p></td> 
<td><p>{CheckMark}Leg: L</p></td></tr>
<tr><td><p></p></td><td><p>{CheckMark}Forearm: R</p></td><td><p>{CheckMark}Thigh: R</p> 
</td><td><p></p></td></tr>
<tr><td><p></p></td><td><p>{CheckMark}Forearm: L</p></td><td><p>{CheckMark}Thigh: L</p> 
</td><td><p></p></td></tr></table><p></p>

Regarding this, I believe it is related to me using PHP version 7.4, I will wait to go back to version 7.3

I can see that one may render fields such from a variety of sources, such as:

  • {LBFxxx:fieldid} (data from the specified field of a LBF instance)
  • {DEM:fieldid} (data from the specified field of patient demographics)
  • {HIS:fieldid} (data from the specified field of patient history)

How does one create a form for the patient portal, such as a medical history, that ties responses back to the patient record rather than being read-only, or simply a value that exists only in the context of the form?

For instance, given the Layout “History”, my requirement is to create an array of checkboxes or dropdown lists for the portal user to select that will be populated by the list of risk factors from {usertext11}. The ideal outcome is that the user responds to each question, and once they have completed the form and it has been charted, medical history automatically updates each list item within risk factors i.e. {usertext11} to reflect their answers.

1 Like

This is a great feature. I appreciate the work you have put into it. I am attempting to do something that is not in the forum from what I can see, but it seems like it should be easier than I am making it. I want to add a dropdown box with options to be select rather that have then typed in each time. Here is the code:

< div class=“input-group mb-3” >
< div class=“input-group-prepend” >
< label class=“input-group-text” for=“inputGroupSelect01”>Dimension:< /label>
< /div>
< select class=“custom-select” id=“inputGroupSelect01”>
< option selected="">Choose…< /option>
< option value=“1”>Acute Intoxication and/or Withdrawl potential< /option>
< option value=“2”>Biomedical Conditions and Complications< /option>
< option value=“3”>Emotional, Behavioral, Cognative (EBC) Conditions and Complications < /option>
< option value=“4”>Readiness to Change< /option>
< option value=“5”>Relapse, Continued Use, or Continued Problem Potential< /option>
< option value=“6”>Recovery Environment< /option>

I can select, but it is not sticking on the save. Any ideas? (I had to add a space after the <'s to show the code)

1 Like

@sjpadgett I would also like to know this, is it possible to have the field so the patient can enter data into it rather then it just pulling what is already in the database?

1 Like

Check out this as something new I added for patch(5)(I gave a pre-patch in thread) Implementation of LBF visit forms in Onsite Portal

And also check out the Portal Dashboard Template Management for some examples of default canned forms for portal.

Is there going to be the ability for patients to send in documents via the portal? Have you planned out how that might work? Will we be able to make forms with a directive in the future with a file attach/upload open?

How do I access the signature module? I do not have the “app:” option in my openemr loging screen.

I am having problems with the patient signature saving. I keep getting image

So I’ve looked everywhere (or missed it)

SETUP:
Creating HTML based Privacy Policy in Portal Dashboard Templates.
Document uses google chart API to produce a QRcode with patient ID on document, using this code:
<img alt="" src="https://chart.apis.google.com/chart?cht=qr&amp;chs=100x100&amp;chl={PatientID}" style="margin: 5px; width: 100px; height: 100px;" />

However when document is loaded in dashboard the {PatientID} is not being replaced with appropriate variable.

Directive is use else where in document (displaying as text) and works properly.

Please advise if their is a workaround or a possible patch.

Screenshots Attached:
chrome_jxPrE0VZ5t

Hi @Jmiller Glad you’re interested in this feature.
I’ll have to take a look and if there is a bug I’ll help get a fix to you.
I’ll PM you email if you could send me the template to test with.

@Jmiller
As I did some fixes recently that will be in next patch looks like they fix your issue.

Pdf after review:
Privacypolicy_4.pdf (96.3 KB)

I spoke to soon. The barcode image is missed in PDF. I should have gotten by purifier.

When you check you will have to make sure the image encodes with the correct ID. I use a barcode scanner on my phoen to check. Otherwise it will just be the {PatientID} in the QRCODE

oh okay. Guess I missed the point.

I’ve been working on this in secret with @Jmiller :wink: Really by DM.
I had to parse out style tag and content then readd after document was purified so we have that capability.
Also changed rendering to allow URL HTTPS requests for QR codes and base64 image data.

I’ve posted a fix here and will add to patch 3.
Files go into directory portal/lib

download_template.php (25.6 KB)
doc_lib.php (6.4 KB)

PDF from Dashboard(I added the red color style to test the style tag)
Privacypolicy_2.pdf (97.2 KB)

I can verify it works!
Thanks so much!

1 Like

#Suggestion
I see there is a way to downloads the files as PDF’s, and I know some PDF generation libraries have ways to implement forced page breaks.

It’s not super important, but could be beneficial for document control.