Openemr fix #5220 direct send attachment (#5226)
commit0cf4ce14e9fec4908f5da7b7a4470badc7e7d9c0
authorStephen Nielson <stephen@nielson.org>
Sat, 23 Apr 2022 14:57:50 +0000 (23 08:57 -0600)
committerGitHub <noreply@github.com>
Sat, 23 Apr 2022 14:57:50 +0000 (23 08:57 -0600)
tree4dbcfe76f3897dc9310a76de9b12fe4bf3ce056e
parent1c53ada9be8ef78933ff439a459b5f89e8b71c0b
Openemr fix #5220 direct send attachment (#5226)

* Fixes #5220 Send Trusted Direct Message

Implemented the ability to send messages w/o attachments via the EMR
Direct service over the Direct protocol.

Built the ability to select a document that has been uploaded to the
system and send it via EMRDirect.

Built a document finder dialog window so that you can select a patient
or non-patient document using the finder.  It checks against the current
user's ACLs and the document category's acos to determine if the user
can see the document.  It only shows 25 results at a time and requires
the user to be more specific in their search if they want to see more.
By default it displays the most recent documents uploaded.

* Direct pdf attachment send.

Made it so we can send a pdf attachment via direct.

Validated the mime types and reject any document that can't be sent via
Direct.  Interestingly direct supports sending HTML but our default
OpenEMR whitelist doesn't allow it.

* Fix styles

* Fix case where document is empty.

Changing up the ACL validation broke the functionality for sending a
single message w/o an attached document.

* Hide alerts before each message send.

If the same message error comes back for each message send it appears
like the direct message never sent.  Hiding the alerts each time when
the send button is pushed is a better UX experience.

* Implemented Document File Preview for messages.

Messages was throwing a javascript error if you didn't assign a patient
for a document.  However, often the document is what contains the
information about what patient the file should belong to.  I made it so
that if there is no assigned patient you can at least view the document
in the Miscellaneous -> New Documents screen.

This also facilitates testing with ONC as we have to demonstrate that
the Direct file was successfully decrypted and viewable.

* Fix code review issues.
ccr/transmitCCD.php
interface/main/finder/document_select.php [new file with mode: 0644]
interface/main/messages/js/trusted-messages.js [new file with mode: 0644]
interface/main/messages/messages.php
interface/main/messages/trusted-messages-ajax.php [new file with mode: 0644]
interface/main/messages/trusted-messages.php [new file with mode: 0644]
src/Services/DocumentService.php