forked from openemr/openemr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Store documents in remote cloud bucket (openemr#7233)
* Store documents in remote cloud bucket * Refactored to remove fiber code * Refactored to rename class to make clear the purpose * Generic message - remote upload completed * Restructured the dispatch and response * PSR Fix * Adding document retrieval from s3 bucket * PSR fix * Fixed datatype * adding attribute * fixing type error * Tested and working * Name changes complete
- Loading branch information
1 parent
7f38fd0
commit d277140
Showing
4 changed files
with
153 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
src/Events/PatientDocuments/PatientDocumentStoreOffsite.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?php | ||
|
||
/** | ||
* PatientDocumentStoreOffsite | ||
* | ||
* @package OpenEMR | ||
* @link http:https://www.open-emr.org | ||
* @author Sherwin Gaddis <[email protected]> | ||
* @copyright Copyright (c) 2024 Sherwin Gaddis <[email protected]> | ||
* @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 | ||
*/ | ||
|
||
namespace OpenEMR\Events\PatientDocuments; | ||
|
||
use Symfony\Contracts\EventDispatcher\Event; | ||
|
||
class PatientDocumentStoreOffsite extends Event | ||
{ | ||
const REMOTE_STORAGE_LOCATION = 'documents.remote.storage.location'; | ||
private mixed $data; | ||
private string $remoteFileName; | ||
private string $mimeType; | ||
private mixed $category; | ||
private mixed $patientId; | ||
|
||
public function __construct($data) | ||
{ | ||
$this->data = $data; | ||
} | ||
public function getData() | ||
{ | ||
return $this->data; | ||
} | ||
|
||
public function setRemoteFileName(string $filename): void | ||
{ | ||
$this->remoteFileName = $filename; | ||
} | ||
|
||
public function getRemoteFileName(): string | ||
{ | ||
return $this->remoteFileName; | ||
} | ||
|
||
public function setRemoteMimeType(string $mimeType): void | ||
{ | ||
$this->mimeType = $mimeType; | ||
} | ||
|
||
public function getRemoteMimeType(): string | ||
{ | ||
return $this->mimeType; | ||
} | ||
public function setRemoteCategory($category): void | ||
{ | ||
$this->category = $category; | ||
} | ||
|
||
public function getRemoteCategory(): mixed | ||
{ | ||
return $this->category; | ||
} | ||
|
||
public function setPatientId(string $patientId): void | ||
{ | ||
$this->patientId = $patientId; | ||
} | ||
public function getPatientId(): mixed | ||
{ | ||
return $this->patientId; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/Events/PatientDocuments/PatientRetrieveOffsiteDocument.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
/** | ||
* PatientRetrieveOffsiteDocument | ||
* | ||
* @package OpenEMR | ||
* @link http:https://www.open-emr.org | ||
* @author Sherwin Gaddis <[email protected]> | ||
* @copyright Copyright (c) 2024 Sherwin Gaddis <[email protected]> | ||
* @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 | ||
*/ | ||
|
||
namespace OpenEMR\Events\PatientDocuments; | ||
|
||
use Symfony\Contracts\EventDispatcher\Event; | ||
|
||
class PatientRetrieveOffsiteDocument extends Event | ||
{ | ||
const REMOTE_DOCUMENT_LOCATION = 'remote.document.retrieve.location'; | ||
private string $url; | ||
private $offsiteurl; | ||
public function __construct($url) | ||
{ | ||
$this->url = $url; | ||
} | ||
|
||
public function setOffsiteUrl(string $offsitedUrl): void | ||
{ | ||
$this->offsiteurl = $offsiteUrl; | ||
} | ||
|
||
public function getOffsiteUrl() | ||
{ | ||
return $this->offsiteurl; | ||
} | ||
} |