fix: check for empty array before looking for offsite document (#7391)
* fix: check for empty array before looking for offsite document
* silence php warning
* Changed up event logic,fixed bugs
Instead of having the url splitting and parsing in the document class,
I pass the file path into the PatientRetrieveOffsiteDocument event and
let the module writer be responsible for parsing the url. This ensures
that we handle any kind of url variety that is needed.
Fixed up the event dispatcher throwing an error because it wasn't even
set in the class...
Fixed the setter in the event and exposed the URL property. No idea how
this was even working in the module.
* Bug fix prevent firing events if empty file
Made it so that if the filename is empty that the event will not be
fired.
Changed up the URL so you can get the entire URL schema (which is what I
thought was originally happening but apparently it wasn't). This means
schemas such as s3:// ftp:// webdav:// etc can be handled by the class
properly.
Also changed up the event so you can get the entire saved document as an
object if additional meta information is needed by the offsite document
event handler.
---------
Co-authored-by: Stephen Nielson <snielson@discoverandchange.com>