diff --git a/interface/modules/zend_modules/module/Carecoordination/src/Carecoordination/Model/EncounterccdadispatchTable.php b/interface/modules/zend_modules/module/Carecoordination/src/Carecoordination/Model/EncounterccdadispatchTable.php index d9d254ada03..b0c2b335f6b 100644 --- a/interface/modules/zend_modules/module/Carecoordination/src/Carecoordination/Model/EncounterccdadispatchTable.php +++ b/interface/modules/zend_modules/module/Carecoordination/src/Carecoordination/Model/EncounterccdadispatchTable.php @@ -29,6 +29,7 @@ use OpenEMR\Services\CodeTypesService; use OpenEMR\Services\ContactService; use OpenEMR\Services\EncounterService; +use OpenEMR\Services\PatientNameHistoryService; use OpenEMR\Services\PatientService; use OpenEMR\Services\Search\DateSearchField; use OpenEMR\Services\Search\SearchComparator; @@ -204,8 +205,8 @@ public function getPreviousAddresses($pid): array */ public function getPreviousNames($pid): array { - $patientService = new PatientService(); - return $patientService->getPatientNameHistory($pid) ?? []; + $nameService = new PatientNameHistoryService(); + return $nameService->getPatientNameHistory($pid) ?? []; } /* Fetch Patient data from EMR diff --git a/library/ajax/specialty_form_ajax.php b/library/ajax/specialty_form_ajax.php index 9afc63837bf..f6fab5bda2c 100644 --- a/library/ajax/specialty_form_ajax.php +++ b/library/ajax/specialty_form_ajax.php @@ -15,7 +15,7 @@ require_once(__DIR__ . "/../../interface/globals.php"); use OpenEMR\Common\Csrf\CsrfUtils; -use OpenEMR\Services\PatientService; +use OpenEMR\Services\PatientNameHistoryService; if (!CsrfUtils::verifyCsrfToken($_POST["csrf_token_form"])) { CsrfUtils::csrfNotVerified(); @@ -31,8 +31,8 @@ function nameHistoryDelete($id) { - $patientService = new PatientService(); - $is_ok = $patientService->deletePatientNameHistoryById($id); + $patientNameService = new PatientNameHistoryService(); + $is_ok = $patientNameService->deletePatientNameHistoryById($id); $is_ok = empty($is_ok) ? xlt("Success") : xlt("Failed"); echo js_escape($is_ok); exit; @@ -44,9 +44,9 @@ function nameHistorySave($post_items) $date = new DateTime($post_items['previous_name_enddate']); $post_items['previous_name_enddate'] = $date->format('Y-m-d'); } - $patientService = new PatientService('patient_history'); - $is_new = $patientService->createPatientNameHistory($post_items['pid'], $post_items); - $name = $patientService->formatPreviousName($post_items); + $patientNameService = new PatientNameHistoryService(); + $is_new = $patientNameService->createPatientNameHistory($post_items['pid'], $post_items); + $name = $patientNameService->formatPreviousName($post_items); $ret = array(); if (!empty($is_new)) { diff --git a/library/options.inc.php b/library/options.inc.php index e6398a79e2e..c47fc06decb 100644 --- a/library/options.inc.php +++ b/library/options.inc.php @@ -62,6 +62,7 @@ use OpenEMR\Services\EncounterService; use OpenEMR\Services\FacilityService; use OpenEMR\Services\PatientService; +use OpenEMR\Services\PatientNameHistoryService; use OpenEMR\Events\PatientDemographics\RenderPharmacySectionEvent; $facilityService = new FacilityService(); @@ -1626,8 +1627,8 @@ class='form-control{$smallform}' } elseif ($data_type == 52) { global $pid; $pid = ($frow['blank_form'] ?? null) ? null : $pid; - $patientService = new PatientService(); - $res = $patientService->getPatientNameHistory($pid); + $patientNameService = new PatientNameHistoryService(); + $res = $patientNameService->getPatientNameHistory($pid); echo "
"; echo "