Adding Patient Portal Document Templates to OpenEMR Patient Documents

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

Hello @Jmiller,

Just for clarification. Are you saying the two files fixed the signature stripping off/removal after downloading the PDF?

Hi, Having an issue with template retention. I am using version 7.0.1 and have uploaded a template for “Sick Leave Medical Certificate for the patient”. The issue i am facing is that after uploading the template through the Portal Dashboard, I am able to use the form only once from the Patient Dashboard - Documents - Patient Information - Patient Document Templaet forms- Open- Select Document.
Once the template has been Saved (Chart to patient Information), I no longer see the form the second time. In case the patient needs the Medical certificate the second time, the workaround is to upload the template again through the Portal dashboard. In this case delete the existing template and reload again.
Is there a way this can be made to upload once and use the template as many times as possible or is this an unintended behaviour?

regards,

Put the template into a profile, assign to a patient group. In the profile set recurring check and schedule 1, 30 etc days.

I think this is also a bug that if a template is not scheduled in profile(General/default cat) it should reappear.
I’m working on portal now and will fix this in next patch.

Thanks Jerry, The recurring option seems to work. But its very tedious to add the patients to the group. I have over 2000 patients. Adding them to the Group took couple of attempts due to the sheer number of patients. The browser was unresponsive for few minutes. The search field inside the Groups does not seems very flexible and relevent.
What about new patients. Should I come back here to add them to the group every time I add new patient?

For a generic template like Medical Sick Leave, it should be accessible to all patients by just adding /uploading the template to a generic group and reusable.