forked from openemr/openemr
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixes openemr#6720 appointment dialog hooks Made it so we can launch a smart app with a specific appointment context as well as hook into the appointment close dialog. Also added in an ehr-launch-client.php file so we can quickly do an ehr initiated app launch. * Add copyright headers * Fix styles
- Loading branch information
Showing
6 changed files
with
200 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
/** | ||
* ehr-launch-client.php Main entry point for the OpenEMR OAUTH2 / SMART client in ehr launch | ||
* Allows a smart app to launch into the OpenEMR EHR in a seamless interaction | ||
* @package openemr | ||
* @link http://www.open-emr.org | ||
* @author Stephen Nielson <[email protected]> | ||
* @copyright Copyright (c) 2023 Discover and Change, Inc. <[email protected]> | ||
* @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 | ||
*/ | ||
|
||
require_once("../globals.php"); | ||
|
||
$controller = new \OpenEMR\FHIR\SMART\SmartLaunchController(); | ||
|
||
$intentData = []; | ||
try { | ||
$intentData['appointment_id'] = $_REQUEST['appointment_id'] ?? null; | ||
$controller->redirectAndLaunchSmartApp( | ||
$_REQUEST['intent'] ?? null, | ||
$_REQUEST['client_id'] ?? null, | ||
$_REQUEST['csrf_token'] ?? null, | ||
$intentData | ||
); | ||
} catch (CsrfInvalidException $exception) { | ||
CsrfUtils::csrfNotVerified(); | ||
} catch (AccessDeniedException $exception) { | ||
(new SystemLogger())->critical($exception->getMessage(), ["trace" => $exception->getTraceAsString()]); | ||
die(); | ||
} catch (Exception $exception) { | ||
(new SystemLogger())->error($exception->getMessage(), ["trace" => $exception->getTraceAsString()]); | ||
die("Unknown system error occurred"); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
/** | ||
* AppointmentDialogCloseEvent fires when the appointment dialog screen (add_edit_event.php) is triggered to be closed | ||
* This event is fired before the server sends the instructions to the client to close the dialog, and allows a plugin | ||
* to perform any actions before the dialog is closed (such as preventing the closure, or by performing some action) | ||
* | ||
* @package openemr | ||
* @link http://www.open-emr.org | ||
* @author Stephen Nielson <[email protected]> | ||
* @copyright Copyright (c) 2023 Discover and Change, Inc. <[email protected]> | ||
* @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 | ||
*/ | ||
|
||
namespace OpenEMR\Events\Appointments; | ||
|
||
use Symfony\Contracts\EventDispatcher\Event; | ||
|
||
class AppointmentDialogCloseEvent extends Event | ||
{ | ||
const EVENT_NAME = 'openemr.appointment.add_edit_event.close.before'; | ||
|
||
private $pc_eid; | ||
private $dialog_action; | ||
|
||
public function __construct() | ||
{ | ||
} | ||
|
||
public function setAppointmentId($pc_eid) | ||
{ | ||
$this->pc_eid = $pc_eid; | ||
} | ||
public function getAppointmentId() | ||
{ | ||
return $this->pc_eid; | ||
} | ||
|
||
public function getDialogAction() | ||
{ | ||
return $this->dialog_action; | ||
} | ||
|
||
public function setDialogAction($dialog_action) | ||
{ | ||
$this->dialog_action = $dialog_action; | ||
} | ||
} |
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