Adding Patient Portal Document Templates to OpenEMR Patient Documents

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.

Is there a reason the print button in the clinician view is hidden?

We have some document we would like to generate, that require a wet signature legally, and would like to print them direct not download and print.

Downloading of documents on the clinician side should be discouraged, as this can be a HIPAA violation in some instances. (PDF of a patient document on a computer)

@sjpadgett After the new update the styles are showing on the screen, but when you hit the download button on the clinician side it strips them again…

Can be done in documents. I assumed there’d be no reason for admin to print but I’ll take a look to see if I can turn on.
If I had time I’d redevelop the config/setup page for portal and add more ability for users to turn stuff like this on and off.

Looking into the style stuff

1 Like

@Jmiller
I thought the style tag wasn’t working for you for some reason so I’ve retested and is working okay.

As for the Print i’m going to turn that on for users to print from dashboard audit;

Double check the style tagging when you download the PDF from the clinician dashboard. They are rendering on screen, but when it goes thru the PDF library.

In Chrome:

Downloaded PDF:

Okay. I added a Print button to dashboard but noticed the Admin Signature is not being saved!

Your quote so thought you verified this working!

Oh no not admin aide I get why there is no print there. But when you go to a patients documents (clinician view) and fetch a document all it gives is a download option, when you click download the print button shows then hides again.

Use case 1: if a patient denies electric signature we should be able to print for wet signature.

Use case 2: downloading documents in some settings can be a HIPPA violation. Even if a user deletes after download and use, that file can be recovered if you know what to do. Additionally, many users are not the most technically inclined when it comes to security tech.
So from a security approach in my mind, downloading a file is a potential security breach. By not giving a clinician a direct print option at least the risk is higher.

Agree and have implemented.

Yes and no! However with the print button implemented then there is not a need for a PDF.
Furthermore one could create a PDF from a print dialog in many browsers i.e Microsoft print to pdf e.t.c

So for the security gods I’ll get rid of Download. Cool?

lol, your not wrong about the save to pdf from a print dialog, hadn’t thought that far!
kinda makes that use case a moot point.

Yeah so I’ll create a patch for you guys and post here most likely or send to you to test.
You and I should have a phone call for discuss the other topic from D.M

This is turning into way more time than I’d expect to add the Print to dashboard.
I also don’t like how I flatten document before sending to Dashboard. I did this on purpose but doing so does not allow edits by administrator. My though at the time was they shouldn’t be allowed.

I have to move on so I’ll do Print and follow up later with perhaps creating a PDF then showing in the browser window print instead of download. This way I can purify and give browser a non html mime.

no worries! It’s not a crucial fix.

Next question:
When you download a document, a checkmark displays a blank checkmark, but the yes no radio group shows nothing, and as there is no way to force an answer on a yes no group in the document this looks a bit weird on download.
PDF:
chrome_aohqdexDxo
Screen:
chrome_u5lpK9kTPK

@Jmiller
You want to test this print button. It’s for dashboard where I removed download and added print as pdf.
pdf_print.zip (27.7 KB)

PR here Portal document delete exception and New Print button by sjpadgett · Pull Request #6064 · openemr/openemr · GitHub