4 * BeforePatientCreatedAuxEvent
6 * This event is fired before a patient is created so modules can
7 * listen for creation of a patient and perform additional
8 * processing, or modify insert data.
10 * The difference between this event and BeforePatientCreatedEvent
11 * is that, it'll give users who attach different tables to the
12 * without saving in the patient_data table save their records as well.
15 * @link https://www.open-emr.org
16 * @author Kofi Appiah <kkappiah@medsov.com>
17 * @copyright Copyright (c) 2024 Omegasystems Group <info@omegasystemsgroup.com>
18 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
21 namespace OpenEMR\Events\Patient
;
23 use Symfony\Contracts\EventDispatcher\Event
;
25 class PatientBeforeCreatedAuxEvent
extends Event
28 * This event is triggered before a patient has been created, and an assoc
29 * array of new patient data is passed to the event object
31 const EVENT_HANDLE
= 'patient.before-created-aux';
37 * BeforePatientUpdatedEvent constructor takes an array
38 * of key/value pairs that represent fields of the patient_data
41 * @param array $patientData
43 public function __construct($pid, array $patientData)
45 $this->patientData
= $patientData;
52 public function getPatientData()
54 $pid = array('pid' => $this->pid
);
55 $this->patientData
= array_merge($pid, $this->patientData
);
57 return $this->patientData
;
61 * @param mixed $patientData
64 public function setPatientData($pid, array $patientData): void
66 $this->patientData
= $patientData;