diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/AGENTS.md b/AGENTS.md old mode 100644 new mode 100755 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/TODO.md b/TODO.md old mode 100644 new mode 100755 diff --git a/app/.htaccess b/app/.htaccess old mode 100644 new mode 100755 diff --git a/app/Common.php b/app/Common.php old mode 100644 new mode 100755 diff --git a/app/Config/App.php b/app/Config/App.php old mode 100644 new mode 100755 diff --git a/app/Config/Autoload.php b/app/Config/Autoload.php old mode 100644 new mode 100755 diff --git a/app/Config/Boot/development.php b/app/Config/Boot/development.php old mode 100644 new mode 100755 diff --git a/app/Config/Boot/production.php b/app/Config/Boot/production.php old mode 100644 new mode 100755 diff --git a/app/Config/Boot/testing.php b/app/Config/Boot/testing.php old mode 100644 new mode 100755 diff --git a/app/Config/CURLRequest.php b/app/Config/CURLRequest.php old mode 100644 new mode 100755 diff --git a/app/Config/Cache.php b/app/Config/Cache.php old mode 100644 new mode 100755 diff --git a/app/Config/Constants.php b/app/Config/Constants.php old mode 100644 new mode 100755 diff --git a/app/Config/ContentSecurityPolicy.php b/app/Config/ContentSecurityPolicy.php old mode 100644 new mode 100755 diff --git a/app/Config/Cookie.php b/app/Config/Cookie.php old mode 100644 new mode 100755 diff --git a/app/Config/Cors.php b/app/Config/Cors.php old mode 100644 new mode 100755 diff --git a/app/Config/Database.php b/app/Config/Database.php old mode 100644 new mode 100755 diff --git a/app/Config/DocTypes.php b/app/Config/DocTypes.php old mode 100644 new mode 100755 diff --git a/app/Config/Email.php b/app/Config/Email.php old mode 100644 new mode 100755 diff --git a/app/Config/Encryption.php b/app/Config/Encryption.php old mode 100644 new mode 100755 diff --git a/app/Config/Events.php b/app/Config/Events.php old mode 100644 new mode 100755 diff --git a/app/Config/Exceptions.php b/app/Config/Exceptions.php old mode 100644 new mode 100755 diff --git a/app/Config/Feature.php b/app/Config/Feature.php old mode 100644 new mode 100755 diff --git a/app/Config/Filters.php b/app/Config/Filters.php old mode 100644 new mode 100755 diff --git a/app/Config/ForeignCharacters.php b/app/Config/ForeignCharacters.php old mode 100644 new mode 100755 diff --git a/app/Config/Format.php b/app/Config/Format.php old mode 100644 new mode 100755 diff --git a/app/Config/Generators.php b/app/Config/Generators.php old mode 100644 new mode 100755 diff --git a/app/Config/Honeypot.php b/app/Config/Honeypot.php old mode 100644 new mode 100755 diff --git a/app/Config/Images.php b/app/Config/Images.php old mode 100644 new mode 100755 diff --git a/app/Config/Kint.php b/app/Config/Kint.php old mode 100644 new mode 100755 diff --git a/app/Config/Logger.php b/app/Config/Logger.php old mode 100644 new mode 100755 diff --git a/app/Config/Migrations.php b/app/Config/Migrations.php old mode 100644 new mode 100755 diff --git a/app/Config/Mimes.php b/app/Config/Mimes.php old mode 100644 new mode 100755 diff --git a/app/Config/Modules.php b/app/Config/Modules.php old mode 100644 new mode 100755 diff --git a/app/Config/Optimize.php b/app/Config/Optimize.php old mode 100644 new mode 100755 diff --git a/app/Config/Pager.php b/app/Config/Pager.php old mode 100644 new mode 100755 diff --git a/app/Config/Paths.php b/app/Config/Paths.php old mode 100644 new mode 100755 diff --git a/app/Config/Publisher.php b/app/Config/Publisher.php old mode 100644 new mode 100755 diff --git a/app/Config/Routes.php b/app/Config/Routes.php old mode 100644 new mode 100755 index dd391df..73f716d --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -220,23 +220,23 @@ $routes->group('api', function ($routes) { $routes->delete('/', 'Organization\WorkstationController::delete'); }); - // HostApp - $routes->group('hostapp', function ($routes) { - $routes->get('/', 'Organization\HostAppController::index'); - $routes->get('(:any)', 'Organization\HostAppController::show/$1'); - $routes->post('/', 'Organization\HostAppController::create'); - $routes->patch('(:any)', 'Organization\HostAppController::update/$1'); - $routes->delete('/', 'Organization\HostAppController::delete'); - }); + // HostApp + $routes->group('hostapp', function ($routes) { + $routes->get('/', 'Organization\HostAppController::index'); + $routes->get('(:num)', 'Organization\HostAppController::show/$1'); + $routes->post('/', 'Organization\HostAppController::create'); + $routes->patch('(:num)', 'Organization\HostAppController::update/$1'); + $routes->delete('/', 'Organization\HostAppController::delete'); + }); - // HostComPara - $routes->group('hostcompara', function ($routes) { - $routes->get('/', 'Organization\HostComParaController::index'); - $routes->get('(:any)', 'Organization\HostComParaController::show/$1'); - $routes->post('/', 'Organization\HostComParaController::create'); - $routes->patch('(:any)', 'Organization\HostComParaController::update/$1'); - $routes->delete('/', 'Organization\HostComParaController::delete'); - }); + // HostComPara + $routes->group('hostcompara', function ($routes) { + $routes->get('/', 'Organization\HostComParaController::index'); + $routes->get('(:num)', 'Organization\HostComParaController::show/$1'); + $routes->post('/', 'Organization\HostComParaController::create'); + $routes->patch('(:num)', 'Organization\HostComParaController::update/$1'); + $routes->delete('/', 'Organization\HostComParaController::delete'); + }); // CodingSys $routes->group('codingsys', function ($routes) { diff --git a/app/Config/Routing.php b/app/Config/Routing.php old mode 100644 new mode 100755 diff --git a/app/Config/Security.php b/app/Config/Security.php old mode 100644 new mode 100755 diff --git a/app/Config/Services.php b/app/Config/Services.php old mode 100644 new mode 100755 diff --git a/app/Config/Session.php b/app/Config/Session.php old mode 100644 new mode 100755 diff --git a/app/Config/Toolbar.php b/app/Config/Toolbar.php old mode 100644 new mode 100755 diff --git a/app/Config/UserAgents.php b/app/Config/UserAgents.php old mode 100644 new mode 100755 diff --git a/app/Config/Validation.php b/app/Config/Validation.php old mode 100644 new mode 100755 diff --git a/app/Config/View.php b/app/Config/View.php old mode 100644 new mode 100755 diff --git a/app/Controllers/AreaGeoController.php b/app/Controllers/AreaGeoController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/Audit/AuditLogController.php b/app/Controllers/Audit/AuditLogController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/AuthController.php b/app/Controllers/AuthController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/AuthV2Controller.php b/app/Controllers/AuthV2Controller.php old mode 100644 new mode 100755 diff --git a/app/Controllers/BaseController.php b/app/Controllers/BaseController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/CalculatorController.php b/app/Controllers/CalculatorController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/Contact/ContactController.php b/app/Controllers/Contact/ContactController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/Contact/MedicalSpecialtyController.php b/app/Controllers/Contact/MedicalSpecialtyController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/Contact/OccupationController.php b/app/Controllers/Contact/OccupationController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/CounterController.php b/app/Controllers/CounterController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/DashboardController.php b/app/Controllers/DashboardController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/EdgeController.php b/app/Controllers/EdgeController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/HomeController.php b/app/Controllers/HomeController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/Infrastructure/EquipmentListController.php b/app/Controllers/Infrastructure/EquipmentListController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/LocationController.php b/app/Controllers/LocationController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/OrderTestController.php b/app/Controllers/OrderTestController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/Organization/AccountController.php b/app/Controllers/Organization/AccountController.php old mode 100644 new mode 100755 index 0b03672..3ea634f --- a/app/Controllers/Organization/AccountController.php +++ b/app/Controllers/Organization/AccountController.php @@ -45,27 +45,40 @@ class AccountController extends BaseController { return $this->respond([ 'status' => 'success', 'message'=> "fetch success", 'data' => $row ], 200); } - public function delete() { - try { - $input = $this->request->getJSON(true); - $id = $input["AccountID"]; - if (!$id) { return $this->failValidationErrors('ID is required.'); } - $this->model->delete($id); - return $this->respondDeleted([ 'status' => 'success', 'message' => "{$id} deleted successfully."]); - } catch (\Throwable $e) { - return $this->failServerError('Something went wrong: ' . $e->getMessage()); - } - } + public function delete() { + try { + $input = $this->request->getJSON(true); + $id = $this->requirePatchId($input['AccountID'] ?? null, 'AccountID'); + if ($id === null) { + return; + } + $this->model->delete($id); + return $this->respondDeleted([ 'status' => 'success', 'message' => "{$id} deleted successfully."]); + } catch (\Throwable $e) { + return $this->failServerError('Something went wrong: ' . $e->getMessage()); + } + } - public function create() { - $input = $this->request->getJSON(true); - try { - $id = $this->model->insert($input,true); - return $this->respondCreated([ 'status' => 'success', 'message' => 'data created successfully', 'data' => $id ], 201); - } catch (\Throwable $e) { - return $this->failServerError('Something went wrong: ' . $e->getMessage()); - } - } + public function create() { + $input = $this->request->getJSON(true); + + $validation = service('validation'); + $validation->setRules([ + 'AccountName' => 'required|string|max_length[255]', + 'Parent' => 'permit_empty|integer', + ]); + + if (!$validation->run($input)) { + return $this->failValidationErrors($validation->getErrors()); + } + + try { + $id = $this->model->insert($input,true); + return $this->respondCreated([ 'status' => 'success', 'message' => 'data created successfully', 'data' => $id ], 201); + } catch (\Throwable $e) { + return $this->failServerError('Something went wrong: ' . $e->getMessage()); + } + } public function update($AccountID = null) { $input = $this->requirePatchPayload($this->request->getJSON(true)); @@ -83,6 +96,16 @@ class AccountController extends BaseController { return $this->respond([ 'status' => 'failed', 'message' => 'Account not found', 'data' => [] ], 404); } + $validation = service('validation'); + $validation->setRules([ + 'AccountName' => 'permit_empty|string|max_length[255]', + 'Parent' => 'permit_empty|integer', + ]); + + if (!$validation->run($input)) { + return $this->failValidationErrors($validation->getErrors()); + } + $input['AccountID'] = $id; try { $this->model->update($id, $input); diff --git a/app/Controllers/Organization/CodingSysController.php b/app/Controllers/Organization/CodingSysController.php old mode 100644 new mode 100755 index c5ee62e..74b2e44 --- a/app/Controllers/Organization/CodingSysController.php +++ b/app/Controllers/Organization/CodingSysController.php @@ -104,7 +104,7 @@ class CodingSysController extends BaseController { try { $this->model->update($id, $input); - return $this->respond(['status' => 'success', 'message' => 'data updated successfully', 'data' => $id], 200); + return $this->respondCreated(['status' => 'success', 'message' => 'data updated successfully', 'data' => $id], 201); } catch (\Throwable $e) { return $this->failServerError('Something went wrong: ' . $e->getMessage()); } diff --git a/app/Controllers/Organization/DepartmentController.php b/app/Controllers/Organization/DepartmentController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/Organization/DisciplineController.php b/app/Controllers/Organization/DisciplineController.php old mode 100644 new mode 100755 index 2798b17..f15d7f6 --- a/app/Controllers/Organization/DisciplineController.php +++ b/app/Controllers/Organization/DisciplineController.php @@ -43,27 +43,43 @@ class DisciplineController extends BaseController { return $this->respond([ 'status' => 'success', 'message'=> "fetch success", 'data' => $row ], 200); } - public function delete() { - try { - $input = $this->request->getJSON(true); - $id = $input["DisciplineID"]; - if (!$id) { return $this->failValidationErrors('ID is required.'); } - $this->model->delete($id); - return $this->respondDeleted([ 'status' => 'success', 'message' => "{$id} deleted successfully."]); - } catch (\Throwable $e) { - return $this->failServerError('Something went wrong: ' . $e->getMessage()); - } - } + public function delete() { + try { + $input = $this->request->getJSON(true); + $id = $this->requirePatchId($input['DisciplineID'] ?? null, 'DisciplineID'); + if ($id === null) { + return; + } + $this->model->delete($id); + return $this->respondDeleted([ 'status' => 'success', 'message' => "{$id} deleted successfully."]); + } catch (\Throwable $e) { + return $this->failServerError('Something went wrong: ' . $e->getMessage()); + } + } - public function create() { - $input = $this->request->getJSON(true); - try { - $id = $this->model->insert($input,true); - return $this->respondCreated([ 'status' => 'success', 'message' => 'data created successfully', 'data' => $id ], 201); - } catch (\Throwable $e) { - return $this->failServerError('Something went wrong: ' . $e->getMessage()); - } - } + public function create() { + $input = $this->request->getJSON(true); + + $validation = service('validation'); + $validation->setRules([ + 'DisciplineCode' => 'required|string|max_length[50]', + 'DisciplineName' => 'required|string|max_length[255]', + 'Parent' => 'permit_empty|integer', + 'SeqScr' => 'permit_empty|integer', + 'SeqRpt' => 'permit_empty|integer', + ]); + + if (!$validation->run($input)) { + return $this->failValidationErrors($validation->getErrors()); + } + + try { + $id = $this->model->insert($input,true); + return $this->respondCreated([ 'status' => 'success', 'message' => 'data created successfully', 'data' => $id ], 201); + } catch (\Throwable $e) { + return $this->failServerError('Something went wrong: ' . $e->getMessage()); + } + } public function update($DisciplineID = null) { $input = $this->requirePatchPayload($this->request->getJSON(true)); @@ -81,9 +97,26 @@ class DisciplineController extends BaseController { return $this->respond([ 'status' => 'failed', 'message' => 'Discipline not found', 'data' => [] ], 404); } + $validation = service('validation'); + $validation->setRules([ + 'DisciplineCode' => 'permit_empty|string|max_length[50]', + 'DisciplineName' => 'permit_empty|string|max_length[255]', + 'Parent' => 'permit_empty|integer', + 'SeqScr' => 'permit_empty|integer', + 'SeqRpt' => 'permit_empty|integer', + ]); + + if (!$validation->run($input)) { + return $this->failValidationErrors($validation->getErrors()); + } + $input['DisciplineID'] = $id; - $this->model->update($id, $input); - return $this->respond([ 'status' => 'success', 'message' => 'data updated successfully', 'data' => $id ], 200); + try { + $this->model->update($id, $input); + return $this->respond([ 'status' => 'success', 'message' => 'data updated successfully', 'data' => $id ], 200); + } catch (\Throwable $e) { + return $this->failServerError('Something went wrong: ' . $e->getMessage()); + } /* try { $id = $input['DisciplineID']; diff --git a/app/Controllers/Organization/HostAppController.php b/app/Controllers/Organization/HostAppController.php old mode 100644 new mode 100755 index d467edd..4a077a7 --- a/app/Controllers/Organization/HostAppController.php +++ b/app/Controllers/Organization/HostAppController.php @@ -29,7 +29,10 @@ class HostAppController extends BaseController { ->join('site', 'site.SiteID = hostapp.SiteID', 'left'); if (!empty($filter['HostAppID'])) { - $builder->like('hostapp.HostAppID', $filter['HostAppID'], 'both'); + if (!ctype_digit((string) $filter['HostAppID'])) { + return $this->failValidationErrors('HostAppID filter must be a valid integer.'); + } + $builder->where('hostapp.HostAppID', (int) $filter['HostAppID']); } if (!empty($filter['HostAppName'])) { $builder->like('hostapp.HostAppName', $filter['HostAppName'], 'both'); @@ -45,9 +48,14 @@ class HostAppController extends BaseController { } public function show($HostAppID = null) { + $id = $this->requirePatchId($HostAppID, 'HostAppID'); + if ($id === null) { + return; + } + $row = $this->model->select('hostapp.*, site.SiteName') ->join('site', 'site.SiteID = hostapp.SiteID', 'left') - ->where('hostapp.HostAppID', $HostAppID) + ->where('hostapp.HostAppID', $id) ->first(); if (empty($row)) { @@ -60,10 +68,9 @@ class HostAppController extends BaseController { public function delete() { try { $input = $this->request->getJSON(true); - $id = $input['HostAppID'] ?? null; - - if (!$id) { - return $this->failValidationErrors('HostAppID is required.'); + $id = $this->requirePatchId($input['HostAppID'] ?? null, 'HostAppID'); + if ($id === null) { + return; } $this->model->delete($id); @@ -77,6 +84,7 @@ class HostAppController extends BaseController { $input = $this->request->getJSON(true); try { + unset($input['HostAppID']); $id = $this->model->insert($input, true); return $this->respondCreated(['status' => 'success', 'message' => 'data created successfully', 'data' => $id], 201); } catch (\Throwable $e) { @@ -100,11 +108,12 @@ class HostAppController extends BaseController { return $this->respond(['status' => 'failed', 'message' => 'HostApp not found', 'data' => []], 404); } - if (isset($input['HostAppID']) && (string) $input['HostAppID'] !== (string) $id) { - return $this->failValidationErrors('HostAppID in URL does not match body.'); + if (isset($input['HostAppID'])) { + if ((string) $input['HostAppID'] !== (string) $id) { + return $this->failValidationErrors('HostAppID in URL does not match body.'); + } + unset($input['HostAppID']); } - - $input['HostAppID'] = $id; try { $this->model->update($id, $input); return $this->respond(['status' => 'success', 'message' => 'data updated successfully', 'data' => $id], 200); diff --git a/app/Controllers/Organization/HostComParaController.php b/app/Controllers/Organization/HostComParaController.php old mode 100644 new mode 100755 index c7a72c6..e453070 --- a/app/Controllers/Organization/HostComParaController.php +++ b/app/Controllers/Organization/HostComParaController.php @@ -29,7 +29,10 @@ class HostComParaController extends BaseController { ->join('hostapp', 'hostapp.HostAppID = hostcompara.HostAppID', 'left'); if (!empty($filter['HostAppID'])) { - $builder->where('hostcompara.HostAppID', $filter['HostAppID']); + if (!ctype_digit((string) $filter['HostAppID'])) { + return $this->failValidationErrors('HostAppID filter must be a valid integer.'); + } + $builder->where('hostcompara.HostAppID', (int) $filter['HostAppID']); } if (!empty($filter['HostIP'])) { $builder->like('hostcompara.HostIP', $filter['HostIP'], 'both'); @@ -45,9 +48,14 @@ class HostComParaController extends BaseController { } public function show($HostAppID = null) { + $id = $this->requirePatchId($HostAppID, 'HostAppID'); + if ($id === null) { + return; + } + $row = $this->model->select('hostcompara.*, hostapp.HostAppName') ->join('hostapp', 'hostapp.HostAppID = hostcompara.HostAppID', 'left') - ->where('hostcompara.HostAppID', $HostAppID) + ->where('hostcompara.HostAppID', $id) ->first(); if (empty($row)) { @@ -60,10 +68,9 @@ class HostComParaController extends BaseController { public function delete() { try { $input = $this->request->getJSON(true); - $id = $input['HostAppID'] ?? null; - - if (!$id) { - return $this->failValidationErrors('HostAppID is required.'); + $id = $this->requirePatchId($input['HostAppID'] ?? null, 'HostAppID'); + if ($id === null) { + return; } $this->model->delete($id); @@ -77,6 +84,17 @@ class HostComParaController extends BaseController { $input = $this->request->getJSON(true); try { + $hostAppId = $input['HostAppID'] ?? null; + if ($hostAppId === null) { + return $this->failValidationErrors('HostAppID is required.'); + } + + if (!ctype_digit((string) $hostAppId)) { + return $this->failValidationErrors('HostAppID must be a valid integer.'); + } + + $input['HostAppID'] = (int) $hostAppId; + $id = $this->model->insert($input, true); return $this->respondCreated(['status' => 'success', 'message' => 'data created successfully', 'data' => $id], 201); } catch (\Throwable $e) { @@ -100,12 +118,13 @@ class HostComParaController extends BaseController { return $this->respond(['status' => 'failed', 'message' => 'HostComPara not found', 'data' => []], 404); } - if (isset($input['HostAppID']) && (string) $input['HostAppID'] !== (string) $id) { - return $this->failValidationErrors('HostAppID in URL does not match body.'); + if (isset($input['HostAppID'])) { + if ((string) $input['HostAppID'] !== (string) $id) { + return $this->failValidationErrors('HostAppID in URL does not match body.'); + } + unset($input['HostAppID']); } - $input['HostAppID'] = $id; - try { $this->model->update($id, $input); return $this->respond(['status' => 'success', 'message' => 'data updated successfully', 'data' => $id], 200); diff --git a/app/Controllers/Organization/SiteController.php b/app/Controllers/Organization/SiteController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/Organization/WorkstationController.php b/app/Controllers/Organization/WorkstationController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/PagesController.php b/app/Controllers/PagesController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/PatVisitController.php b/app/Controllers/PatVisitController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/Patient/PatientController.php b/app/Controllers/Patient/PatientController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/ReportController.php b/app/Controllers/ReportController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/Result/ResultValueSetController.php b/app/Controllers/Result/ResultValueSetController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/ResultController.php b/app/Controllers/ResultController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/Rule/RuleController.php b/app/Controllers/Rule/RuleController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/SampleController.php b/app/Controllers/SampleController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/Specimen/ContainerDefController.php b/app/Controllers/Specimen/ContainerDefController.php old mode 100644 new mode 100755 index 64e3962..c100082 --- a/app/Controllers/Specimen/ContainerDefController.php +++ b/app/Controllers/Specimen/ContainerDefController.php @@ -104,7 +104,7 @@ class ContainerDefController extends BaseController { $input['ConDefID'] = $id; try { $this->model->update($id, $input); - return $this->respond([ 'status' => 'success', 'message' => 'data updated successfully', 'data' => $id ], 200); + return $this->respondCreated([ 'status' => 'success', 'message' => 'data updated successfully', 'data' => $id ], 201); } catch (\Exception $e) { return $this->failServerError('Something went wrong: ' . $e->getMessage()); } diff --git a/app/Controllers/Specimen/SpecimenCollectionController.php b/app/Controllers/Specimen/SpecimenCollectionController.php old mode 100644 new mode 100755 index 6e97c5c..994447b --- a/app/Controllers/Specimen/SpecimenCollectionController.php +++ b/app/Controllers/Specimen/SpecimenCollectionController.php @@ -85,10 +85,12 @@ class SpecimenCollectionController extends BaseController { } $input['SpcColID'] = $id; - if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors($this->validator->getErrors()); } + if ($this->rules !== [] && !$this->validateData($input, $this->rules)) { + return $this->failValidationErrors($this->validator->getErrors()); + } try { $this->model->update($id, $input); - return $this->respond([ 'status' => 'success', 'message' => 'data updated successfully', 'data' => $id ], 200); + return $this->respondCreated([ 'status' => 'success', 'message' => 'data updated successfully', 'data' => $id ], 201); } catch (\Exception $e) { return $this->failServerError('Something went wrong: ' . $e->getMessage()); } diff --git a/app/Controllers/Specimen/SpecimenController.php b/app/Controllers/Specimen/SpecimenController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/Specimen/SpecimenPrepController.php b/app/Controllers/Specimen/SpecimenPrepController.php old mode 100644 new mode 100755 index 6151eb3..e954b3c --- a/app/Controllers/Specimen/SpecimenPrepController.php +++ b/app/Controllers/Specimen/SpecimenPrepController.php @@ -70,10 +70,12 @@ class SpecimenPrepController extends BaseController { } $input['SpcPrpID'] = $id; - if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors($this->validator->getErrors()); } + if ($this->rules !== [] && !$this->validateData($input, $this->rules)) { + return $this->failValidationErrors($this->validator->getErrors()); + } try { $this->model->update($id, $input); - return $this->respond([ 'status' => 'success', 'message' => 'data updated successfully', 'data' => $id ], 200); + return $this->respondCreated([ 'status' => 'success', 'message' => 'data updated successfully', 'data' => $id ], 201); } catch (\Exception $e) { return $this->failServerError('Something went wrong: ' . $e->getMessage()); } diff --git a/app/Controllers/Specimen/SpecimenStatusController.php b/app/Controllers/Specimen/SpecimenStatusController.php old mode 100644 new mode 100755 index cbf2d97..ebde49e --- a/app/Controllers/Specimen/SpecimenStatusController.php +++ b/app/Controllers/Specimen/SpecimenStatusController.php @@ -83,10 +83,12 @@ class SpecimenStatusController extends BaseController { } $input['SpcStaID'] = $id; - if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors($this->validator->getErrors()); } + if ($this->rules !== [] && !$this->validateData($input, $this->rules)) { + return $this->failValidationErrors($this->validator->getErrors()); + } try { $this->model->update($id, $input); - return $this->respond([ 'status' => 'success', 'message' => 'data updated successfully', 'data' => $id ], 200); + return $this->respondCreated([ 'status' => 'success', 'message' => 'data updated successfully', 'data' => $id ], 201); } catch (\Exception $e) { return $this->failServerError('Something went wrong: ' . $e->getMessage()); } diff --git a/app/Controllers/Test/DemoOrderController.php b/app/Controllers/Test/DemoOrderController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/Test/TestMapController.php b/app/Controllers/Test/TestMapController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/Test/TestMapDetailController.php b/app/Controllers/Test/TestMapDetailController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/Test/TestsController.php b/app/Controllers/Test/TestsController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/User/UserController.php b/app/Controllers/User/UserController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/ValueSetController.php b/app/Controllers/ValueSetController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/ValueSetDefController.php b/app/Controllers/ValueSetDefController.php old mode 100644 new mode 100755 diff --git a/app/Controllers/ZonesController.php b/app/Controllers/ZonesController.php old mode 100644 new mode 100755 diff --git a/app/Database/Migrations/.gitkeep b/app/Database/Migrations/.gitkeep old mode 100644 new mode 100755 diff --git a/app/Database/Migrations/2026-01-01-000001_CreateValueSet.php b/app/Database/Migrations/2026-01-01-000001_CreateValueSet.php old mode 100644 new mode 100755 diff --git a/app/Database/Migrations/2026-01-01-000002_CreateOrganization.php b/app/Database/Migrations/2026-01-01-000002_CreateOrganization.php old mode 100644 new mode 100755 diff --git a/app/Database/Migrations/2026-01-01-000003_CreateUsers.php b/app/Database/Migrations/2026-01-01-000003_CreateUsers.php old mode 100644 new mode 100755 diff --git a/app/Database/Migrations/2026-01-01-000004_CreateTestDefinitions.php b/app/Database/Migrations/2026-01-01-000004_CreateTestDefinitions.php old mode 100644 new mode 100755 diff --git a/app/Database/Migrations/2026-01-01-000005_CreateLabInfrastructure.php b/app/Database/Migrations/2026-01-01-000005_CreateLabInfrastructure.php old mode 100644 new mode 100755 diff --git a/app/Database/Migrations/2026-01-01-000006_CreateSpecimens.php b/app/Database/Migrations/2026-01-01-000006_CreateSpecimens.php old mode 100644 new mode 100755 index 9384100..f1a4879 --- a/app/Database/Migrations/2026-01-01-000006_CreateSpecimens.php +++ b/app/Database/Migrations/2026-01-01-000006_CreateSpecimens.php @@ -31,7 +31,7 @@ class CreateSpecimens extends Migration { 'OrderID' => ['type' => 'int', 'null' => false], 'SpcAct' => ['type' => 'varchar', 'constraint' => 15, 'null' => true], 'ActRes' => ['type' => 'INT', 'null' => true], - 'SpcStatus' => ['type' => 'VARCHAR', 'constraint' => 10, 'null' => true], + 'SpcStatus' => ['type' => 'VARCHAR', 'constraint' => 50, 'null' => true], 'Qty' => ['type' => 'INT', 'null' => true], 'Unit' => ['type' => 'INT', 'null' => true], 'SpcCon' => ['type' => 'INT', 'null' => true], diff --git a/app/Database/Migrations/2026-01-01-000011_CreatePatientCore.php b/app/Database/Migrations/2026-01-01-000011_CreatePatientCore.php old mode 100644 new mode 100755 diff --git a/app/Database/Migrations/2026-01-01-000012_CreatePatientVisits.php b/app/Database/Migrations/2026-01-01-000012_CreatePatientVisits.php old mode 100644 new mode 100755 diff --git a/app/Database/Migrations/2026-01-01-000021_CreateOrders.php b/app/Database/Migrations/2026-01-01-000021_CreateOrders.php old mode 100644 new mode 100755 diff --git a/app/Database/Migrations/2026-01-01-000022_CreateResults.php b/app/Database/Migrations/2026-01-01-000022_CreateResults.php old mode 100644 new mode 100755 diff --git a/app/Database/Migrations/2026-02-27-001500_CreateHostAppAndCodingSys.php b/app/Database/Migrations/2026-02-27-001500_CreateHostAppAndCodingSys.php old mode 100644 new mode 100755 index c52a00a..366dd99 --- a/app/Database/Migrations/2026-02-27-001500_CreateHostAppAndCodingSys.php +++ b/app/Database/Migrations/2026-02-27-001500_CreateHostAppAndCodingSys.php @@ -8,7 +8,7 @@ class CreateHostAppAndCodingSys extends Migration { public function up() { // Table: hostapp $this->forge->addField([ - 'HostAppID' => ['type' => 'VARCHAR', 'constraint' => 5, 'null' => false], + 'HostAppID' => ['type' => 'INT', 'unsigned' => true, 'auto_increment' => true], 'HostAppName' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => false], 'SiteID' => ['type' => 'INT', 'unsigned' => true, 'null' => true], 'CreateDate' => ['type' => 'DATETIME', 'null' => true], @@ -19,7 +19,7 @@ class CreateHostAppAndCodingSys extends Migration { // Table: hostcompara $this->forge->addField([ - 'HostAppID' => ['type' => 'VARCHAR', 'constraint' => 5, 'null' => false], + 'HostAppID' => ['type' => 'INT', 'unsigned' => true, 'auto_increment' => true], 'HostIP' => ['type' => 'VARCHAR', 'constraint' => 15, 'null' => true], 'HostPort' => ['type' => 'VARCHAR', 'constraint' => 6, 'null' => true], 'HostPwd' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], diff --git a/app/Database/Migrations/2026-03-12-000040_CreateTestRules.php b/app/Database/Migrations/2026-03-12-000040_CreateTestRules.php old mode 100644 new mode 100755 diff --git a/app/Database/Migrations/2026-03-25-000050_CreateAuditLogs.php b/app/Database/Migrations/2026-03-25-000050_CreateAuditLogs.php old mode 100644 new mode 100755 diff --git a/app/Database/Seeds/.gitkeep b/app/Database/Seeds/.gitkeep old mode 100644 new mode 100755 diff --git a/app/Database/Seeds/AreaGeoSeeder.php b/app/Database/Seeds/AreaGeoSeeder.php old mode 100644 new mode 100755 diff --git a/app/Database/Seeds/ClearOrderDataSeeder.php b/app/Database/Seeds/ClearOrderDataSeeder.php old mode 100644 new mode 100755 diff --git a/app/Database/Seeds/ContactSeeder.php b/app/Database/Seeds/ContactSeeder.php old mode 100644 new mode 100755 diff --git a/app/Database/Seeds/CounterSeeder.php b/app/Database/Seeds/CounterSeeder.php old mode 100644 new mode 100755 diff --git a/app/Database/Seeds/DBSeeder.php b/app/Database/Seeds/DBSeeder.php old mode 100644 new mode 100755 diff --git a/app/Database/Seeds/DummySeeder.php b/app/Database/Seeds/DummySeeder.php old mode 100644 new mode 100755 diff --git a/app/Database/Seeds/HostAppCodingSysSeeder.php b/app/Database/Seeds/HostAppCodingSysSeeder.php old mode 100644 new mode 100755 index fcd3407..67d8d5c --- a/app/Database/Seeds/HostAppCodingSysSeeder.php +++ b/app/Database/Seeds/HostAppCodingSysSeeder.php @@ -18,49 +18,49 @@ class HostAppCodingSysSeeder extends Seeder // HostApp - Host Applications $hostAppData = [ [ - 'HostAppID' => 'LIS01', + 'HostAppID' => 1, 'HostAppName' => 'Laboratory Information System Main', 'SiteID' => 1, 'CreateDate' => $now, 'EndDate' => null ], [ - 'HostAppID' => 'LIS02', + 'HostAppID' => 2, 'HostAppName' => 'Laboratory Information System Backup', 'SiteID' => 1, 'CreateDate' => $now, 'EndDate' => null ], [ - 'HostAppID' => 'EMR01', + 'HostAppID' => 3, 'HostAppName' => 'Electronic Medical Record System', 'SiteID' => 1, 'CreateDate' => $now, 'EndDate' => null ], [ - 'HostAppID' => 'PACS01', + 'HostAppID' => 4, 'HostAppName' => 'Picture Archiving System', 'SiteID' => 1, 'CreateDate' => $now, 'EndDate' => null ], [ - 'HostAppID' => 'BILL01', + 'HostAppID' => 5, 'HostAppName' => 'Billing System', 'SiteID' => 1, 'CreateDate' => $now, 'EndDate' => null ], [ - 'HostAppID' => 'INS01', + 'HostAppID' => 6, 'HostAppName' => 'Insurance System Integration', 'SiteID' => 1, 'CreateDate' => $now, 'EndDate' => null ], [ - 'HostAppID' => 'OLD01', + 'HostAppID' => 7, 'HostAppName' => 'Legacy Laboratory System', 'SiteID' => 1, 'CreateDate' => $now, @@ -72,7 +72,7 @@ class HostAppCodingSysSeeder extends Seeder // HostComPara - Host Communication Parameters $hostComParaData = [ [ - 'HostAppID' => 'LIS01', + 'HostAppID' => 1, 'HostIP' => '192.168.1.10', 'HostPort' => '8080', 'HostPwd' => 'lis_main_pass_2024', @@ -80,7 +80,7 @@ class HostAppCodingSysSeeder extends Seeder 'EndDate' => null ], [ - 'HostAppID' => 'LIS02', + 'HostAppID' => 2, 'HostIP' => '192.168.1.11', 'HostPort' => '8081', 'HostPwd' => 'lis_backup_pass_2024', @@ -88,7 +88,7 @@ class HostAppCodingSysSeeder extends Seeder 'EndDate' => null ], [ - 'HostAppID' => 'EMR01', + 'HostAppID' => 3, 'HostIP' => '192.168.1.20', 'HostPort' => '443', 'HostPwd' => 'emr_secure_2024', @@ -96,7 +96,7 @@ class HostAppCodingSysSeeder extends Seeder 'EndDate' => null ], [ - 'HostAppID' => 'PACS01', + 'HostAppID' => 4, 'HostIP' => '192.168.1.30', 'HostPort' => '8042', 'HostPwd' => 'pacs_dicom_2024', @@ -104,7 +104,7 @@ class HostAppCodingSysSeeder extends Seeder 'EndDate' => null ], [ - 'HostAppID' => 'BILL01', + 'HostAppID' => 5, 'HostIP' => '192.168.1.40', 'HostPort' => '8443', 'HostPwd' => 'bill_payment_2024', @@ -112,7 +112,7 @@ class HostAppCodingSysSeeder extends Seeder 'EndDate' => null ], [ - 'HostAppID' => 'INS01', + 'HostAppID' => 6, 'HostIP' => '192.168.1.50', 'HostPort' => '443', 'HostPwd' => 'ins_claim_2024', @@ -120,7 +120,7 @@ class HostAppCodingSysSeeder extends Seeder 'EndDate' => null ], [ - 'HostAppID' => 'OLD01', + 'HostAppID' => 7, 'HostIP' => '192.168.1.99', 'HostPort' => '8080', 'HostPwd' => 'old_legacy_pass', diff --git a/app/Database/Seeds/LocationSeeder.php b/app/Database/Seeds/LocationSeeder.php old mode 100644 new mode 100755 diff --git a/app/Database/Seeds/OrderSeeder.php b/app/Database/Seeds/OrderSeeder.php old mode 100644 new mode 100755 diff --git a/app/Database/Seeds/OrganizationSeeder.php b/app/Database/Seeds/OrganizationSeeder.php old mode 100644 new mode 100755 diff --git a/app/Database/Seeds/PatientSeeder.php b/app/Database/Seeds/PatientSeeder.php old mode 100644 new mode 100755 diff --git a/app/Database/Seeds/SpecimenSeeder.php b/app/Database/Seeds/SpecimenSeeder.php old mode 100644 new mode 100755 diff --git a/app/Database/Seeds/TestSeeder.php b/app/Database/Seeds/TestSeeder.php old mode 100644 new mode 100755 diff --git a/app/Filters/.gitkeep b/app/Filters/.gitkeep old mode 100644 new mode 100755 diff --git a/app/Filters/AuthFilter.php b/app/Filters/AuthFilter.php old mode 100644 new mode 100755 diff --git a/app/Filters/Cors.php b/app/Filters/Cors.php old mode 100644 new mode 100755 diff --git a/app/Helpers/.gitkeep b/app/Helpers/.gitkeep old mode 100644 new mode 100755 diff --git a/app/Helpers/json_helper.php b/app/Helpers/json_helper.php old mode 100644 new mode 100755 diff --git a/app/Helpers/utc_helper.php b/app/Helpers/utc_helper.php old mode 100644 new mode 100755 diff --git a/app/Language/.gitkeep b/app/Language/.gitkeep old mode 100644 new mode 100755 diff --git a/app/Language/en/Validation.php b/app/Language/en/Validation.php old mode 100644 new mode 100755 diff --git a/app/Libraries/.gitkeep b/app/Libraries/.gitkeep old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/_meta.json b/app/Libraries/Data/_meta.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/activity_result.json b/app/Libraries/Data/activity_result.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/additive.json b/app/Libraries/Data/additive.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/adt_event.json b/app/Libraries/Data/adt_event.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/area_class.json b/app/Libraries/Data/area_class.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/body_site.json b/app/Libraries/Data/body_site.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/collection_method.json b/app/Libraries/Data/collection_method.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/container_cap_color.json b/app/Libraries/Data/container_cap_color.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/container_class.json b/app/Libraries/Data/container_class.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/container_size.json b/app/Libraries/Data/container_size.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/country.json b/app/Libraries/Data/country.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/death_indicator.json b/app/Libraries/Data/death_indicator.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/did_type.json b/app/Libraries/Data/did_type.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/enable_disable.json b/app/Libraries/Data/enable_disable.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/entity_type.json b/app/Libraries/Data/entity_type.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/ethnic.json b/app/Libraries/Data/ethnic.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/event_id.json b/app/Libraries/Data/event_id.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/fasting_status.json b/app/Libraries/Data/fasting_status.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/formula_language.json b/app/Libraries/Data/formula_language.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/generate_by.json b/app/Libraries/Data/generate_by.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/identifier_type.json b/app/Libraries/Data/identifier_type.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/location_type.json b/app/Libraries/Data/location_type.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/marital_status.json b/app/Libraries/Data/marital_status.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/math_sign.json b/app/Libraries/Data/math_sign.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/numeric_ref_type.json b/app/Libraries/Data/numeric_ref_type.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/operation.json b/app/Libraries/Data/operation.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/order_priority.json b/app/Libraries/Data/order_priority.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/order_status.json b/app/Libraries/Data/order_status.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/priority.json b/app/Libraries/Data/priority.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/race.json b/app/Libraries/Data/race.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/range_type.json b/app/Libraries/Data/range_type.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/reference_type.json b/app/Libraries/Data/reference_type.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/religion.json b/app/Libraries/Data/religion.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/request_status.json b/app/Libraries/Data/request_status.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/requested_entity.json b/app/Libraries/Data/requested_entity.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/result_status.json b/app/Libraries/Data/result_status.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/result_type.json b/app/Libraries/Data/result_type.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/result_unit.json b/app/Libraries/Data/result_unit.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/sex.json b/app/Libraries/Data/sex.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/site_class.json b/app/Libraries/Data/site_class.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/site_type.json b/app/Libraries/Data/site_type.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/specimen_activity.json b/app/Libraries/Data/specimen_activity.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/specimen_condition.json b/app/Libraries/Data/specimen_condition.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/specimen_role.json b/app/Libraries/Data/specimen_role.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/specimen_status.json b/app/Libraries/Data/specimen_status.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/specimen_type.json b/app/Libraries/Data/specimen_type.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/test_activity.json b/app/Libraries/Data/test_activity.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/test_status.json b/app/Libraries/Data/test_status.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/test_type.json b/app/Libraries/Data/test_type.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/text_ref_type.json b/app/Libraries/Data/text_ref_type.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/unit.json b/app/Libraries/Data/unit.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/v_category.json b/app/Libraries/Data/v_category.json old mode 100644 new mode 100755 diff --git a/app/Libraries/Data/ws_type.json b/app/Libraries/Data/ws_type.json old mode 100644 new mode 100755 diff --git a/app/Libraries/TestValidationService.php b/app/Libraries/TestValidationService.php old mode 100644 new mode 100755 diff --git a/app/Libraries/ValueSet.php b/app/Libraries/ValueSet.php old mode 100644 new mode 100755 diff --git a/app/Models/.gitkeep b/app/Models/.gitkeep old mode 100644 new mode 100755 diff --git a/app/Models/AreaGeoModel.php b/app/Models/AreaGeoModel.php old mode 100644 new mode 100755 diff --git a/app/Models/BaseModel.php b/app/Models/BaseModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Contact/ContactDetailModel.php b/app/Models/Contact/ContactDetailModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Contact/ContactModel.php b/app/Models/Contact/ContactModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Contact/MedicalSpecialtyModel.php b/app/Models/Contact/MedicalSpecialtyModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Contact/OccupationModel.php b/app/Models/Contact/OccupationModel.php old mode 100644 new mode 100755 diff --git a/app/Models/CounterModel.php b/app/Models/CounterModel.php old mode 100644 new mode 100755 diff --git a/app/Models/EdgeResModel.php b/app/Models/EdgeResModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Infrastructure/EquipmentListModel.php b/app/Models/Infrastructure/EquipmentListModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Location/LocationAddressModel.php b/app/Models/Location/LocationAddressModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Location/LocationModel.php b/app/Models/Location/LocationModel.php old mode 100644 new mode 100755 diff --git a/app/Models/OrderTest/OrderTestModel.php b/app/Models/OrderTest/OrderTestModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Organization/AccountModel.php b/app/Models/Organization/AccountModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Organization/CodingSysModel.php b/app/Models/Organization/CodingSysModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Organization/DepartmentModel.php b/app/Models/Organization/DepartmentModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Organization/DisciplineModel.php b/app/Models/Organization/DisciplineModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Organization/HostAppModel.php b/app/Models/Organization/HostAppModel.php old mode 100644 new mode 100755 index f014b5f..7f1f608 --- a/app/Models/Organization/HostAppModel.php +++ b/app/Models/Organization/HostAppModel.php @@ -7,7 +7,7 @@ use App\Models\BaseModel; class HostAppModel extends BaseModel { protected $table = 'hostapp'; protected $primaryKey = 'HostAppID'; - protected $allowedFields = ['HostAppID', 'HostAppName', 'SiteID', 'CreateDate', 'EndDate']; + protected $allowedFields = ['HostAppName', 'SiteID', 'CreateDate', 'EndDate']; protected $useTimestamps = true; protected $createdField = 'CreateDate'; diff --git a/app/Models/Organization/HostComParaModel.php b/app/Models/Organization/HostComParaModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Organization/SiteModel.php b/app/Models/Organization/SiteModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Organization/WorkstationModel.php b/app/Models/Organization/WorkstationModel.php old mode 100644 new mode 100755 diff --git a/app/Models/PatResultModel.php b/app/Models/PatResultModel.php old mode 100644 new mode 100755 diff --git a/app/Models/PatVisit/PatDiagModel.php b/app/Models/PatVisit/PatDiagModel.php old mode 100644 new mode 100755 diff --git a/app/Models/PatVisit/PatVisitADTModel.php b/app/Models/PatVisit/PatVisitADTModel.php old mode 100644 new mode 100755 diff --git a/app/Models/PatVisit/PatVisitModel.php b/app/Models/PatVisit/PatVisitModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Patient/PatAttModel.php b/app/Models/Patient/PatAttModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Patient/PatComModel.php b/app/Models/Patient/PatComModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Patient/PatIdtModel.php b/app/Models/Patient/PatIdtModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Patient/PatientModel.php b/app/Models/Patient/PatientModel.php old mode 100644 new mode 100755 diff --git a/app/Models/RefRange/RefNumModel.php b/app/Models/RefRange/RefNumModel.php old mode 100644 new mode 100755 diff --git a/app/Models/RefRange/RefTxtModel.php b/app/Models/RefRange/RefTxtModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Rule/RuleDefModel.php b/app/Models/Rule/RuleDefModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Rule/TestRuleModel.php b/app/Models/Rule/TestRuleModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Specimen/ContainerDefModel.php b/app/Models/Specimen/ContainerDefModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Specimen/SpecimenCollectionModel.php b/app/Models/Specimen/SpecimenCollectionModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Specimen/SpecimenLogModel.php b/app/Models/Specimen/SpecimenLogModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Specimen/SpecimenModel.php b/app/Models/Specimen/SpecimenModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Specimen/SpecimenPrepModel.php b/app/Models/Specimen/SpecimenPrepModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Specimen/SpecimenStatusModel.php b/app/Models/Specimen/SpecimenStatusModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Test/TestDefCalModel.php b/app/Models/Test/TestDefCalModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Test/TestDefGrpModel.php b/app/Models/Test/TestDefGrpModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Test/TestDefSiteModel.php b/app/Models/Test/TestDefSiteModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Test/TestMapDetailModel.php b/app/Models/Test/TestMapDetailModel.php old mode 100644 new mode 100755 diff --git a/app/Models/Test/TestMapModel.php b/app/Models/Test/TestMapModel.php old mode 100644 new mode 100755 diff --git a/app/Models/User/UserModel.php b/app/Models/User/UserModel.php old mode 100644 new mode 100755 diff --git a/app/Models/ValueSet/ValueSetDefModel.php b/app/Models/ValueSet/ValueSetDefModel.php old mode 100644 new mode 100755 diff --git a/app/Models/ValueSet/ValueSetModel.php b/app/Models/ValueSet/ValueSetModel.php old mode 100644 new mode 100755 diff --git a/app/Models/ZonesModel.php b/app/Models/ZonesModel.php old mode 100644 new mode 100755 diff --git a/app/Services/AuditLogService.php b/app/Services/AuditLogService.php old mode 100644 new mode 100755 diff --git a/app/Services/AuditService.php b/app/Services/AuditService.php old mode 100644 new mode 100755 diff --git a/app/Services/CalculatorService.php b/app/Services/CalculatorService.php old mode 100644 new mode 100755 diff --git a/app/Services/RuleEngineService.php b/app/Services/RuleEngineService.php old mode 100644 new mode 100755 diff --git a/app/Services/RuleExpressionService.php b/app/Services/RuleExpressionService.php old mode 100644 new mode 100755 diff --git a/app/ThirdParty/.gitkeep b/app/ThirdParty/.gitkeep old mode 100644 new mode 100755 diff --git a/app/Traits/PatchValidationTrait.php b/app/Traits/PatchValidationTrait.php old mode 100644 new mode 100755 diff --git a/app/Traits/ResponseTrait.php b/app/Traits/ResponseTrait.php old mode 100644 new mode 100755 diff --git a/app/Views/errors/cli/error_404.php b/app/Views/errors/cli/error_404.php old mode 100644 new mode 100755 diff --git a/app/Views/errors/cli/error_exception.php b/app/Views/errors/cli/error_exception.php old mode 100644 new mode 100755 diff --git a/app/Views/errors/cli/production.php b/app/Views/errors/cli/production.php old mode 100644 new mode 100755 diff --git a/app/Views/errors/html/debug.css b/app/Views/errors/html/debug.css old mode 100644 new mode 100755 diff --git a/app/Views/errors/html/debug.js b/app/Views/errors/html/debug.js old mode 100644 new mode 100755 diff --git a/app/Views/errors/html/error_400.php b/app/Views/errors/html/error_400.php old mode 100644 new mode 100755 diff --git a/app/Views/errors/html/error_404.php b/app/Views/errors/html/error_404.php old mode 100644 new mode 100755 diff --git a/app/Views/errors/html/error_exception.php b/app/Views/errors/html/error_exception.php old mode 100644 new mode 100755 diff --git a/app/Views/errors/html/production.php b/app/Views/errors/html/production.php old mode 100644 new mode 100755 diff --git a/app/Views/reports/lab_report.php b/app/Views/reports/lab_report.php old mode 100644 new mode 100755 diff --git a/app/index.html b/app/index.html old mode 100644 new mode 100755 diff --git a/builds b/builds old mode 100644 new mode 100755 diff --git a/composer.json b/composer.json old mode 100644 new mode 100755 index db3e6c2..85cbbab --- a/composer.json +++ b/composer.json @@ -12,8 +12,8 @@ "require": { "php": "^8.1", "codeigniter4/framework": "^4.0", - "firebase/php-jwt": "^6.11", - "symfony/expression-language": "^7.0" + "firebase/php-jwt": "^7.0", + "symfony/expression-language": "^7.0" }, "require-dev": { "fakerphp/faker": "^1.24", diff --git a/composer.lock b/composer.lock old mode 100644 new mode 100755 index 5f3848f..ddabbb6 --- a/composer.lock +++ b/composer.lock @@ -4,40 +4,41 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ad96435c829500be9b0bb553558894ea", + "content-hash": "aad9684d9c8b6bf3e5f25f4dae93b4af", "packages": [ { "name": "codeigniter4/framework", - "version": "v4.6.1", + "version": "v4.7.2", "source": { "type": "git", "url": "https://github.com/codeigniter4/framework.git", - "reference": "d021b04fdf23afc85d8a8b9b541be9a0a9ccdb5f" + "reference": "b3359be849be29394660c3aed909aa32b6c45cf6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/codeigniter4/framework/zipball/d021b04fdf23afc85d8a8b9b541be9a0a9ccdb5f", - "reference": "d021b04fdf23afc85d8a8b9b541be9a0a9ccdb5f", + "url": "https://api.github.com/repos/codeigniter4/framework/zipball/b3359be849be29394660c3aed909aa32b6c45cf6", + "reference": "b3359be849be29394660c3aed909aa32b6c45cf6", "shasum": "" }, "require": { "ext-intl": "*", "ext-mbstring": "*", - "laminas/laminas-escaper": "^2.14", - "php": "^8.1", + "laminas/laminas-escaper": "^2.18", + "php": "^8.2", "psr/log": "^3.0" }, "require-dev": { "codeigniter/coding-standard": "^1.7", "fakerphp/faker": "^1.24", "friendsofphp/php-cs-fixer": "^3.47.1", - "kint-php/kint": "^6.0", + "kint-php/kint": "^6.1", "mikey179/vfsstream": "^1.6.12", "nexusphp/cs-config": "^3.6", "phpunit/phpunit": "^10.5.16 || ^11.2", - "predis/predis": "^1.1 || ^2.3" + "predis/predis": "^3.0" }, "suggest": { + "ext-apcu": "If you use Cache class ApcuHandler", "ext-curl": "If you use CURLRequest class", "ext-dom": "If you use TestResponse", "ext-exif": "If you run Image class tests", @@ -49,7 +50,9 @@ "ext-memcached": "If you use Cache class MemcachedHandler with Memcached", "ext-mysqli": "If you use MySQL", "ext-oci8": "If you use Oracle Database", + "ext-pcntl": "If you use Signals", "ext-pgsql": "If you use PostgreSQL", + "ext-posix": "If you use Signals", "ext-readline": "Improves CLI::input() usability", "ext-redis": "If you use Cache class RedisHandler", "ext-simplexml": "If you format XML", @@ -78,20 +81,20 @@ "slack": "https://codeigniterchat.slack.com", "source": "https://github.com/codeigniter4/CodeIgniter4" }, - "time": "2025-05-02T16:00:55+00:00" + "time": "2026-03-24T18:26:09+00:00" }, { "name": "firebase/php-jwt", - "version": "v6.11.1", + "version": "v7.0.5", "source": { "type": "git", "url": "https://github.com/firebase/php-jwt.git", - "reference": "d1e91ecf8c598d073d0995afa8cd5c75c6e19e66" + "reference": "47ad26bab5e7c70ae8a6f08ed25ff83631121380" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/d1e91ecf8c598d073d0995afa8cd5c75c6e19e66", - "reference": "d1e91ecf8c598d073d0995afa8cd5c75c6e19e66", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/47ad26bab5e7c70ae8a6f08ed25ff83631121380", + "reference": "47ad26bab5e7c70ae8a6f08ed25ff83631121380", "shasum": "" }, "require": { @@ -99,6 +102,7 @@ }, "require-dev": { "guzzlehttp/guzzle": "^7.4", + "phpfastcache/phpfastcache": "^9.2", "phpspec/prophecy-phpunit": "^2.0", "phpunit/phpunit": "^9.5", "psr/cache": "^2.0||^3.0", @@ -139,38 +143,38 @@ ], "support": { "issues": "https://github.com/firebase/php-jwt/issues", - "source": "https://github.com/firebase/php-jwt/tree/v6.11.1" + "source": "https://github.com/firebase/php-jwt/tree/v7.0.5" }, - "time": "2025-04-09T20:32:01+00:00" + "time": "2026-04-01T20:38:03+00:00" }, { "name": "laminas/laminas-escaper", - "version": "2.17.0", + "version": "2.18.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-escaper.git", - "reference": "df1ef9503299a8e3920079a16263b578eaf7c3ba" + "reference": "06f211dfffff18d91844c1f55250d5d13c007e18" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/df1ef9503299a8e3920079a16263b578eaf7c3ba", - "reference": "df1ef9503299a8e3920079a16263b578eaf7c3ba", + "url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/06f211dfffff18d91844c1f55250d5d13c007e18", + "reference": "06f211dfffff18d91844c1f55250d5d13c007e18", "shasum": "" }, "require": { "ext-ctype": "*", "ext-mbstring": "*", - "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0" + "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0" }, "conflict": { "zendframework/zend-escaper": "*" }, "require-dev": { - "infection/infection": "^0.29.8", - "laminas/laminas-coding-standard": "~3.0.1", - "phpunit/phpunit": "^10.5.45", - "psalm/plugin-phpunit": "^0.19.2", - "vimeo/psalm": "^6.6.2" + "infection/infection": "^0.31.0", + "laminas/laminas-coding-standard": "~3.1.0", + "phpunit/phpunit": "^11.5.42", + "psalm/plugin-phpunit": "^0.19.5", + "vimeo/psalm": "^6.13.1" }, "type": "library", "autoload": { @@ -202,7 +206,7 @@ "type": "community_bridge" } ], - "time": "2025-05-06T19:29:36+00:00" + "time": "2025-10-14T18:31:13+00:00" }, { "name": "psr/cache", @@ -358,34 +362,30 @@ }, { "name": "symfony/cache", - "version": "v7.4.7", + "version": "v8.0.8", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "665522ec357540e66c294c08583b40ee576574f0" + "reference": "8abf3ccbeae9d3071b81a3ae7ee11b209f9e1e78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/665522ec357540e66c294c08583b40ee576574f0", - "reference": "665522ec357540e66c294c08583b40ee576574f0", + "url": "https://api.github.com/repos/symfony/cache/zipball/8abf3ccbeae9d3071b81a3ae7ee11b209f9e1e78", + "reference": "8abf3ccbeae9d3071b81a3ae7ee11b209f9e1e78", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.4", "psr/cache": "^2.0|^3.0", "psr/log": "^1.1|^2|^3", "symfony/cache-contracts": "^3.6", - "symfony/deprecation-contracts": "^2.5|^3", "symfony/service-contracts": "^2.5|^3", - "symfony/var-exporter": "^6.4|^7.0|^8.0" + "symfony/var-exporter": "^7.4|^8.0" }, "conflict": { - "doctrine/dbal": "<3.6", + "doctrine/dbal": "<4.3", "ext-redis": "<6.1", - "ext-relay": "<0.12.1", - "symfony/dependency-injection": "<6.4", - "symfony/http-kernel": "<6.4", - "symfony/var-dumper": "<6.4" + "ext-relay": "<0.12.1" }, "provide": { "psr/cache-implementation": "2.0|3.0", @@ -394,16 +394,16 @@ }, "require-dev": { "cache/integration-tests": "dev-master", - "doctrine/dbal": "^3.6|^4", + "doctrine/dbal": "^4.3", "predis/predis": "^1.1|^2.0", "psr/simple-cache": "^1.0|^2.0|^3.0", - "symfony/clock": "^6.4|^7.0|^8.0", - "symfony/config": "^6.4|^7.0|^8.0", - "symfony/dependency-injection": "^6.4|^7.0|^8.0", - "symfony/filesystem": "^6.4|^7.0|^8.0", - "symfony/http-kernel": "^6.4|^7.0|^8.0", - "symfony/messenger": "^6.4|^7.0|^8.0", - "symfony/var-dumper": "^6.4|^7.0|^8.0" + "symfony/clock": "^7.4|^8.0", + "symfony/config": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/filesystem": "^7.4|^8.0", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/messenger": "^7.4|^8.0", + "symfony/var-dumper": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -438,7 +438,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v7.4.7" + "source": "https://github.com/symfony/cache/tree/v8.0.8" }, "funding": [ { @@ -458,7 +458,7 @@ "type": "tidelift" } ], - "time": "2026-03-06T08:14:57+00:00" + "time": "2026-03-30T15:18:51+00:00" }, { "name": "symfony/cache-contracts", @@ -605,16 +605,16 @@ }, { "name": "symfony/expression-language", - "version": "v7.4.4", + "version": "v7.4.8", "source": { "type": "git", "url": "https://github.com/symfony/expression-language.git", - "reference": "f3a6497eb6573e185f2ec41cd3b3f0cd68ddf667" + "reference": "87ff95687748f4af65e4d5a6e917d448ec52aa83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/expression-language/zipball/f3a6497eb6573e185f2ec41cd3b3f0cd68ddf667", - "reference": "f3a6497eb6573e185f2ec41cd3b3f0cd68ddf667", + "url": "https://api.github.com/repos/symfony/expression-language/zipball/87ff95687748f4af65e4d5a6e917d448ec52aa83", + "reference": "87ff95687748f4af65e4d5a6e917d448ec52aa83", "shasum": "" }, "require": { @@ -649,7 +649,7 @@ "description": "Provides an engine that can compile and evaluate expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/expression-language/tree/v7.4.4" + "source": "https://github.com/symfony/expression-language/tree/v7.4.8" }, "funding": [ { @@ -669,7 +669,7 @@ "type": "tidelift" } ], - "time": "2026-01-05T08:47:25+00:00" + "time": "2026-03-24T13:12:05+00:00" }, { "name": "symfony/service-contracts", @@ -760,26 +760,25 @@ }, { "name": "symfony/var-exporter", - "version": "v7.4.0", + "version": "v8.0.8", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "03a60f169c79a28513a78c967316fbc8bf17816f" + "reference": "15776bb07a91b089037da89f8832fa41d5fa6ec6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/03a60f169c79a28513a78c967316fbc8bf17816f", - "reference": "03a60f169c79a28513a78c967316fbc8bf17816f", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/15776bb07a91b089037da89f8832fa41d5fa6ec6", + "reference": "15776bb07a91b089037da89f8832fa41d5fa6ec6", "shasum": "" }, "require": { - "php": ">=8.2", - "symfony/deprecation-contracts": "^2.5|^3" + "php": ">=8.4" }, "require-dev": { - "symfony/property-access": "^6.4|^7.0|^8.0", - "symfony/serializer": "^6.4|^7.0|^8.0", - "symfony/var-dumper": "^6.4|^7.0|^8.0" + "symfony/property-access": "^7.4|^8.0", + "symfony/serializer": "^7.4|^8.0", + "symfony/var-dumper": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -817,7 +816,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v7.4.0" + "source": "https://github.com/symfony/var-exporter/tree/v8.0.8" }, "funding": [ { @@ -837,7 +836,7 @@ "type": "tidelift" } ], - "time": "2025-09-11T10:15:23+00:00" + "time": "2026-03-30T15:14:47+00:00" } ], "packages-dev": [ @@ -958,16 +957,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.13.1", + "version": "1.13.4", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c" + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/1720ddd719e16cf0db4eb1c6eca108031636d46c", - "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a", "shasum": "" }, "require": { @@ -1006,7 +1005,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.13.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.4" }, "funding": [ { @@ -1014,20 +1013,20 @@ "type": "tidelift" } ], - "time": "2025-04-29T12:36:36+00:00" + "time": "2025-08-01T08:46:24+00:00" }, { "name": "nikic/php-parser", - "version": "v5.5.0", + "version": "v5.7.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "ae59794362fe85e051a58ad36b289443f57be7a9" + "reference": "dca41cd15c2ac9d055ad70dbfd011130757d1f82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/ae59794362fe85e051a58ad36b289443f57be7a9", - "reference": "ae59794362fe85e051a58ad36b289443f57be7a9", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/dca41cd15c2ac9d055ad70dbfd011130757d1f82", + "reference": "dca41cd15c2ac9d055ad70dbfd011130757d1f82", "shasum": "" }, "require": { @@ -1046,7 +1045,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.x-dev" } }, "autoload": { @@ -1070,9 +1069,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.5.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.7.0" }, - "time": "2025-05-31T08:24:38+00:00" + "time": "2025-12-06T11:56:16+00:00" }, { "name": "phar-io/manifest", @@ -1515,16 +1514,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.5.47", + "version": "10.5.63", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "3637b3e50d32ab3a0d1a33b3b6177169ec3d95a3" + "reference": "33198268dad71e926626b618f3ec3966661e4d90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3637b3e50d32ab3a0d1a33b3b6177169ec3d95a3", - "reference": "3637b3e50d32ab3a0d1a33b3b6177169ec3d95a3", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/33198268dad71e926626b618f3ec3966661e4d90", + "reference": "33198268dad71e926626b618f3ec3966661e4d90", "shasum": "" }, "require": { @@ -1534,7 +1533,7 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.13.1", + "myclabs/deep-copy": "^1.13.4", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=8.1", @@ -1545,13 +1544,13 @@ "phpunit/php-timer": "^6.0.0", "sebastian/cli-parser": "^2.0.1", "sebastian/code-unit": "^2.0.0", - "sebastian/comparator": "^5.0.3", + "sebastian/comparator": "^5.0.5", "sebastian/diff": "^5.1.1", "sebastian/environment": "^6.1.0", - "sebastian/exporter": "^5.1.2", + "sebastian/exporter": "^5.1.4", "sebastian/global-state": "^6.0.2", "sebastian/object-enumerator": "^5.0.0", - "sebastian/recursion-context": "^5.0.0", + "sebastian/recursion-context": "^5.0.1", "sebastian/type": "^4.0.0", "sebastian/version": "^4.0.1" }, @@ -1596,7 +1595,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.47" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.63" }, "funding": [ { @@ -1620,7 +1619,7 @@ "type": "tidelift" } ], - "time": "2025-06-20T11:29:11+00:00" + "time": "2026-01-27T05:48:37+00:00" }, { "name": "sebastian/cli-parser", @@ -1792,16 +1791,16 @@ }, { "name": "sebastian/comparator", - "version": "5.0.3", + "version": "5.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "a18251eb0b7a2dcd2f7aa3d6078b18545ef0558e" + "reference": "55dfef806eb7dfeb6e7a6935601fef866f8ca48d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/a18251eb0b7a2dcd2f7aa3d6078b18545ef0558e", - "reference": "a18251eb0b7a2dcd2f7aa3d6078b18545ef0558e", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55dfef806eb7dfeb6e7a6935601fef866f8ca48d", + "reference": "55dfef806eb7dfeb6e7a6935601fef866f8ca48d", "shasum": "" }, "require": { @@ -1857,15 +1856,27 @@ "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", "security": "https://github.com/sebastianbergmann/comparator/security/policy", - "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.3" + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.5" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/comparator", + "type": "tidelift" } ], - "time": "2024-10-18T14:56:07+00:00" + "time": "2026-01-24T09:25:16+00:00" }, { "name": "sebastian/complexity", @@ -2058,16 +2069,16 @@ }, { "name": "sebastian/exporter", - "version": "5.1.2", + "version": "5.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "955288482d97c19a372d3f31006ab3f37da47adf" + "reference": "0735b90f4da94969541dac1da743446e276defa6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/955288482d97c19a372d3f31006ab3f37da47adf", - "reference": "955288482d97c19a372d3f31006ab3f37da47adf", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/0735b90f4da94969541dac1da743446e276defa6", + "reference": "0735b90f4da94969541dac1da743446e276defa6", "shasum": "" }, "require": { @@ -2076,7 +2087,7 @@ "sebastian/recursion-context": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^10.5" }, "type": "library", "extra": { @@ -2124,15 +2135,27 @@ "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", "security": "https://github.com/sebastianbergmann/exporter/security/policy", - "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.2" + "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.4" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/exporter", + "type": "tidelift" } ], - "time": "2024-03-02T07:17:12+00:00" + "time": "2025-09-24T06:09:11+00:00" }, { "name": "sebastian/global-state", @@ -2368,23 +2391,23 @@ }, { "name": "sebastian/recursion-context", - "version": "5.0.0", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "05909fb5bc7df4c52992396d0116aed689f93712" + "reference": "47e34210757a2f37a97dcd207d032e1b01e64c7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712", - "reference": "05909fb5bc7df4c52992396d0116aed689f93712", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/47e34210757a2f37a97dcd207d032e1b01e64c7a", + "reference": "47e34210757a2f37a97dcd207d032e1b01e64c7a", "shasum": "" }, "require": { "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^10.5" }, "type": "library", "extra": { @@ -2419,15 +2442,28 @@ "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.0" + "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context", + "type": "tidelift" } ], - "time": "2023-02-03T07:05:40+00:00" + "time": "2025-08-10T07:50:56+00:00" }, { "name": "sebastian/type", @@ -2540,16 +2576,16 @@ }, { "name": "theseer/tokenizer", - "version": "1.2.3", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", - "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b7489ce515e168639d17feec34b8847c326b0b3c", + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c", "shasum": "" }, "require": { @@ -2578,7 +2614,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.3" + "source": "https://github.com/theseer/tokenizer/tree/1.3.1" }, "funding": [ { @@ -2586,7 +2622,7 @@ "type": "github" } ], - "time": "2024-03-03T12:36:25+00:00" + "time": "2025-11-17T20:03:58+00:00" } ], "aliases": [], @@ -2598,5 +2634,5 @@ "php": "^8.1" }, "platform-dev": {}, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.9.0" } diff --git a/composer.phar b/composer.phar old mode 100644 new mode 100755 diff --git a/env b/env old mode 100644 new mode 100755 diff --git a/package-lock.json b/package-lock.json old mode 100644 new mode 100755 diff --git a/phpunit.xml.dist b/phpunit.xml.dist old mode 100644 new mode 100755 index 7489eac..c8d761d --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,8 +1,8 @@ - - + + @@ -56,9 +56,9 @@ - + - + diff --git a/preload.php b/preload.php old mode 100644 new mode 100755 diff --git a/public/api-docs.bundled.yaml b/public/api-docs.bundled.yaml old mode 100644 new mode 100755 index 1df05f9..5921bfd --- a/public/api-docs.bundled.yaml +++ b/public/api-docs.bundled.yaml @@ -1501,6 +1501,51 @@ paths: type: string data: $ref: '#/components/schemas/OrderTest' + /api/organization/account: + get: + tags: + - Organization + summary: List accounts + security: + - bearerAuth: [] + responses: + '200': + description: List of accounts + post: + tags: + - Organization + summary: Create account + security: + - bearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Account' + responses: + '201': + description: Account created + delete: + tags: + - Organization + summary: Delete account + security: + - bearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - AccountID + properties: + AccountID: + type: integer + responses: + '200': + description: Account deleted /api/organization/account/{id}: get: tags: @@ -1521,6 +1566,32 @@ paths: application/json: schema: $ref: '#/components/schemas/Account' + patch: + tags: + - Organization + summary: Update account + security: + - bearerAuth: [] + parameters: + - name: id + in: path + required: true + schema: + type: integer + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + AccountName: + type: string + Parent: + type: integer + responses: + '200': + description: Account updated /api/organization/site: get: tags: diff --git a/public/api-docs.yaml b/public/api-docs.yaml old mode 100644 new mode 100755 diff --git a/public/bundle-api-docs.js b/public/bundle-api-docs.js old mode 100644 new mode 100755 diff --git a/public/components/schemas/audit-logs.yaml b/public/components/schemas/audit-logs.yaml old mode 100644 new mode 100755 diff --git a/public/components/schemas/authentication.yaml b/public/components/schemas/authentication.yaml old mode 100644 new mode 100755 diff --git a/public/components/schemas/common.yaml b/public/components/schemas/common.yaml old mode 100644 new mode 100755 diff --git a/public/components/schemas/edge-api.yaml b/public/components/schemas/edge-api.yaml old mode 100644 new mode 100755 diff --git a/public/components/schemas/equipmentlist.yaml b/public/components/schemas/equipmentlist.yaml old mode 100644 new mode 100755 diff --git a/public/components/schemas/master-data.yaml b/public/components/schemas/master-data.yaml old mode 100644 new mode 100755 diff --git a/public/components/schemas/orders.yaml b/public/components/schemas/orders.yaml old mode 100644 new mode 100755 diff --git a/public/components/schemas/organization.yaml b/public/components/schemas/organization.yaml old mode 100644 new mode 100755 diff --git a/public/components/schemas/patient-visit.yaml b/public/components/schemas/patient-visit.yaml old mode 100644 new mode 100755 diff --git a/public/components/schemas/patient.yaml b/public/components/schemas/patient.yaml old mode 100644 new mode 100755 diff --git a/public/components/schemas/rules.yaml b/public/components/schemas/rules.yaml old mode 100644 new mode 100755 diff --git a/public/components/schemas/securitySchemes.yaml b/public/components/schemas/securitySchemes.yaml old mode 100644 new mode 100755 diff --git a/public/components/schemas/specimen.yaml b/public/components/schemas/specimen.yaml old mode 100644 new mode 100755 diff --git a/public/components/schemas/tests.yaml b/public/components/schemas/tests.yaml old mode 100644 new mode 100755 diff --git a/public/components/schemas/user.yaml b/public/components/schemas/user.yaml old mode 100644 new mode 100755 diff --git a/public/components/schemas/valuesets.yaml b/public/components/schemas/valuesets.yaml old mode 100644 new mode 100755 diff --git a/public/favicon.ico b/public/favicon.ico old mode 100644 new mode 100755 diff --git a/public/htaccess b/public/htaccess old mode 100644 new mode 100755 diff --git a/public/index.php b/public/index.php old mode 100644 new mode 100755 diff --git a/public/paths/audit-logs.yaml b/public/paths/audit-logs.yaml old mode 100644 new mode 100755 diff --git a/public/paths/authentication.yaml b/public/paths/authentication.yaml old mode 100644 new mode 100755 diff --git a/public/paths/calc.yaml b/public/paths/calc.yaml old mode 100644 new mode 100755 diff --git a/public/paths/contact.yaml b/public/paths/contact.yaml old mode 100644 new mode 100755 diff --git a/public/paths/demo.yaml b/public/paths/demo.yaml old mode 100644 new mode 100755 diff --git a/public/paths/edge-api.yaml b/public/paths/edge-api.yaml old mode 100644 new mode 100755 diff --git a/public/paths/equipmentlist.yaml b/public/paths/equipmentlist.yaml old mode 100644 new mode 100755 diff --git a/public/paths/locations.yaml b/public/paths/locations.yaml old mode 100644 new mode 100755 diff --git a/public/paths/orders.yaml b/public/paths/orders.yaml old mode 100644 new mode 100755 diff --git a/public/paths/organization.yaml b/public/paths/organization.yaml old mode 100644 new mode 100755 index fdddcfc..bf4ddef --- a/public/paths/organization.yaml +++ b/public/paths/organization.yaml @@ -1,22 +1,93 @@ -/api/organization/account/{id}: - get: - tags: [Organization] - summary: Get account by ID - security: - - bearerAuth: [] - parameters: - - name: id - in: path - required: true - schema: - type: integer - responses: - '200': - description: Account details - content: - application/json: - schema: - $ref: '../components/schemas/organization.yaml#/Account' +/api/organization/account: + get: + tags: [Organization] + summary: List accounts + security: + - bearerAuth: [] + responses: + '200': + description: List of accounts + + post: + tags: [Organization] + summary: Create account + security: + - bearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '../components/schemas/organization.yaml#/Account' + responses: + '201': + description: Account created + + delete: + tags: [Organization] + summary: Delete account + security: + - bearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - AccountID + properties: + AccountID: + type: integer + responses: + '200': + description: Account deleted + +/api/organization/account/{id}: + get: + tags: [Organization] + summary: Get account by ID + security: + - bearerAuth: [] + parameters: + - name: id + in: path + required: true + schema: + type: integer + responses: + '200': + description: Account details + content: + application/json: + schema: + $ref: '../components/schemas/organization.yaml#/Account' + + patch: + tags: [Organization] + summary: Update account + security: + - bearerAuth: [] + parameters: + - name: id + in: path + required: true + schema: + type: integer + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + AccountName: + type: string + Parent: + type: integer + responses: + '200': + description: Account updated /api/organization/site: get: diff --git a/public/paths/patient-visits.yaml b/public/paths/patient-visits.yaml old mode 100644 new mode 100755 diff --git a/public/paths/patients.yaml b/public/paths/patients.yaml old mode 100644 new mode 100755 diff --git a/public/paths/reports.yaml b/public/paths/reports.yaml old mode 100644 new mode 100755 diff --git a/public/paths/results.yaml b/public/paths/results.yaml old mode 100644 new mode 100755 diff --git a/public/paths/rules.yaml b/public/paths/rules.yaml old mode 100644 new mode 100755 diff --git a/public/paths/specimen.yaml b/public/paths/specimen.yaml old mode 100644 new mode 100755 diff --git a/public/paths/testmap.yaml b/public/paths/testmap.yaml old mode 100644 new mode 100755 diff --git a/public/paths/tests.yaml b/public/paths/tests.yaml old mode 100644 new mode 100755 diff --git a/public/paths/users.yaml b/public/paths/users.yaml old mode 100644 new mode 100755 diff --git a/public/paths/valuesets.yaml b/public/paths/valuesets.yaml old mode 100644 new mode 100755 diff --git a/public/robots.txt b/public/robots.txt old mode 100644 new mode 100755 diff --git a/public/swagger/index.html b/public/swagger/index.html old mode 100644 new mode 100755 diff --git a/spark b/spark old mode 100644 new mode 100755 diff --git a/tests/.htaccess b/tests/.htaccess old mode 100644 new mode 100755 diff --git a/tests/README.md b/tests/README.md old mode 100644 new mode 100755 diff --git a/tests/UniformShowTest_README.md b/tests/UniformShowTest_README.md old mode 100644 new mode 100755 diff --git a/tests/_support/Database/Seeds/ExampleSeeder.php b/tests/_support/Database/Seeds/ExampleSeeder.php old mode 100644 new mode 100755 diff --git a/tests/_support/Libraries/ConfigReader.php b/tests/_support/Libraries/ConfigReader.php old mode 100644 new mode 100755 diff --git a/tests/_support/Models/ExampleModel.php b/tests/_support/Models/ExampleModel.php old mode 100644 new mode 100755 diff --git a/tests/_support/Traits/CreatesPatients.php b/tests/_support/Traits/CreatesPatients.php old mode 100644 new mode 100755 diff --git a/tests/feature/Audit/AuditLogTest.php b/tests/feature/Audit/AuditLogTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/Contact/ContactPatchTest.php b/tests/feature/Contact/ContactPatchTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/ContactControllerTest.php b/tests/feature/ContactControllerTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/Location/LocationPatchTest.php b/tests/feature/Location/LocationPatchTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/OrderTest/OrderTestPatchTest.php b/tests/feature/OrderTest/OrderTestPatchTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/Organization/AccountPatchTest.php b/tests/feature/Organization/AccountPatchTest.php new file mode 100644 index 0000000..7c998c5 --- /dev/null +++ b/tests/feature/Organization/AccountPatchTest.php @@ -0,0 +1,121 @@ + 'localhost', + 'aud' => 'localhost', + 'iat' => time(), + 'nbf' => time(), + 'exp' => time() + 3600, + 'uid' => 1, + 'email' => 'admin@admin.com', + ]; + $this->token = JWT::encode($payload, $key, 'HS256'); + } + + private function authHeaders(): array + { + return ['Cookie' => 'token=' . $this->token]; + } + + private function createAccount(array $data = []): int + { + $payload = array_merge([ + 'AccountName' => 'Account ' . uniqid(), + ], $data); + + $response = $this->withHeaders($this->authHeaders()) + ->withBodyFormat('json') + ->call('post', $this->endpoint, $payload); + + $response->assertStatus(201); + $decoded = json_decode($response->getJSON(), true); + + return $decoded['data']; + } + + private function fetchAccount(int $id): array + { + $response = $this->withHeaders($this->authHeaders())->call('get', "{$this->endpoint}/{$id}"); + $response->assertStatus(200); + + $decoded = json_decode($response->getJSON(), true); + + return $decoded['data'] ?? []; + } + + public function testPartialUpdateAccountSuccess() + { + $id = $this->createAccount(); + + $patch = $this->withHeaders($this->authHeaders()) + ->withBodyFormat('json') + ->call('patch', "{$this->endpoint}/{$id}", ['AccountName' => 'Updated Account']); + + $patch->assertStatus(200); + $this->assertSame('success', json_decode($patch->getJSON(), true)['status']); + + $account = $this->fetchAccount($id); + $this->assertEquals('Updated Account', $account['AccountName']); + $this->assertEquals($id, $account['AccountID']); + } + + public function testPartialUpdateAccountNotFound() + { + $patch = $this->withHeaders($this->authHeaders()) + ->withBodyFormat('json') + ->call('patch', "{$this->endpoint}/999999", ['AccountName' => 'Does not matter']); + + $patch->assertStatus(404); + } + + public function testPartialUpdateAccountInvalidId() + { + $patch = $this->withHeaders($this->authHeaders()) + ->withBodyFormat('json') + ->call('patch', "{$this->endpoint}/invalid", ['AccountName' => 'Bad']); + + $patch->assertStatus(400); + } + + public function testPartialUpdateAccountEmptyPayload() + { + $id = $this->createAccount(); + + $patch = $this->withHeaders($this->authHeaders()) + ->withBodyFormat('json') + ->call('patch', "{$this->endpoint}/{$id}", []); + + $patch->assertStatus(400); + } + + public function testPartialUpdateAccountSingleField() + { + $id = $this->createAccount(['AccountName' => 'Original Name']); + + $patch = $this->withHeaders($this->authHeaders()) + ->withBodyFormat('json') + ->call('patch', "{$this->endpoint}/{$id}", ['AccountName' => 'New Name']); + + $patch->assertStatus(200); + $account = $this->fetchAccount($id); + + $this->assertEquals('New Name', $account['AccountName']); + } +} diff --git a/tests/feature/Organization/CodingSysControllerTest.php b/tests/feature/Organization/CodingSysControllerTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/Organization/DepartmentPatchTest.php b/tests/feature/Organization/DepartmentPatchTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/Organization/DisciplinePatchTest.php b/tests/feature/Organization/DisciplinePatchTest.php new file mode 100644 index 0000000..9ffdfd0 --- /dev/null +++ b/tests/feature/Organization/DisciplinePatchTest.php @@ -0,0 +1,121 @@ + 'localhost', + 'aud' => 'localhost', + 'iat' => time(), + 'nbf' => time(), + 'exp' => time() + 3600, + 'uid' => 1, + 'email' => 'admin@admin.com', + ]; + $this->token = JWT::encode($payload, $key, 'HS256'); + } + + private function authHeaders(): array + { + return ['Cookie' => 'token=' . $this->token]; + } + + private function createDiscipline(array $data = []): int + { + $payload = array_merge([ + 'DisciplineCode' => 'D' . strtoupper(bin2hex(random_bytes(1))), + 'DisciplineName' => 'Discipline ' . uniqid(), + ], $data); + + $response = $this->withHeaders($this->authHeaders()) + ->withBodyFormat('json') + ->call('post', $this->endpoint, $payload); + + $response->assertStatus(201); + $decoded = json_decode($response->getJSON(), true); + + return $decoded['data']; + } + + private function fetchDiscipline(int $id): array + { + $response = $this->withHeaders($this->authHeaders())->call('get', "{$this->endpoint}/{$id}"); + $response->assertStatus(200); + $decoded = json_decode($response->getJSON(), true); + + return $decoded['data'] ?? []; + } + + public function testPartialUpdateDisciplineSuccess() + { + $id = $this->createDiscipline(); + + $patch = $this->withHeaders($this->authHeaders()) + ->withBodyFormat('json') + ->call('patch', "{$this->endpoint}/{$id}", ['DisciplineName' => 'Updated Discipline']); + + $patch->assertStatus(200); + $this->assertSame('success', json_decode($patch->getJSON(), true)['status']); + + $discipline = $this->fetchDiscipline($id); + $this->assertEquals('Updated Discipline', $discipline['DisciplineName']); + $this->assertEquals($id, $discipline['DisciplineID']); + } + + public function testPartialUpdateDisciplineNotFound() + { + $patch = $this->withHeaders($this->authHeaders()) + ->withBodyFormat('json') + ->call('patch', "{$this->endpoint}/999999", ['DisciplineName' => 'Does not matter']); + + $patch->assertStatus(404); + } + + public function testPartialUpdateDisciplineInvalidId() + { + $patch = $this->withHeaders($this->authHeaders()) + ->withBodyFormat('json') + ->call('patch', "{$this->endpoint}/invalid", ['DisciplineName' => 'Bad']); + + $patch->assertStatus(400); + } + + public function testPartialUpdateDisciplineEmptyPayload() + { + $id = $this->createDiscipline(); + + $patch = $this->withHeaders($this->authHeaders()) + ->withBodyFormat('json') + ->call('patch', "{$this->endpoint}/{$id}", []); + + $patch->assertStatus(400); + } + + public function testPartialUpdateDisciplineSingleField() + { + $id = $this->createDiscipline(['DisciplineName' => 'Original Name']); + + $patch = $this->withHeaders($this->authHeaders()) + ->withBodyFormat('json') + ->call('patch', "{$this->endpoint}/{$id}", ['DisciplineName' => 'New Name']); + + $patch->assertStatus(200); + $discipline = $this->fetchDiscipline($id); + + $this->assertEquals('New Name', $discipline['DisciplineName']); + } +} diff --git a/tests/feature/Organization/HostAppControllerTest.php b/tests/feature/Organization/HostAppControllerTest.php old mode 100644 new mode 100755 index 90fe07e..9a5c00b --- a/tests/feature/Organization/HostAppControllerTest.php +++ b/tests/feature/Organization/HostAppControllerTest.php @@ -25,7 +25,6 @@ class HostAppControllerTest extends CIUnitTestCase public function testCreateHostApp() { $payload = [ - 'HostAppID' => 'TEST1', 'HostAppName' => 'Test Host Application', 'SiteID' => null ]; diff --git a/tests/feature/Organization/HostAppPatchTest.php b/tests/feature/Organization/HostAppPatchTest.php old mode 100644 new mode 100755 index 81106e8..b813364 --- a/tests/feature/Organization/HostAppPatchTest.php +++ b/tests/feature/Organization/HostAppPatchTest.php @@ -37,8 +37,8 @@ class HostAppPatchTest extends CIUnitTestCase private function createHostApp(array $data = []): array { $payload = array_merge([ - 'HostAppCode' => 'HA_' . uniqid(), 'HostAppName' => 'Test HostApp ' . uniqid(), + 'SiteID' => null, ], $data); $response = $this->withHeaders($this->authHeaders()) @@ -69,7 +69,7 @@ class HostAppPatchTest extends CIUnitTestCase $showData = json_decode($show->getJSON(), true)['data']; $this->assertEquals('Updated HostApp', $showData['HostAppName']); - $this->assertEquals($app['HostAppCode'], $showData['HostAppCode']); + $this->assertEquals($app['SiteID'], $showData['SiteID']); } public function testPartialUpdateHostAppNotFound() @@ -109,14 +109,14 @@ class HostAppPatchTest extends CIUnitTestCase $patch = $this->withHeaders($this->authHeaders()) ->withBodyFormat('json') - ->call('patch', "{$this->endpoint}/{$id}", ['HostAppCode' => 'NEW_' . uniqid()]); + ->call('patch', "{$this->endpoint}/{$id}", ['SiteID' => 5]); $patch->assertStatus(200); $showData = json_decode($this->withHeaders($this->authHeaders()) ->call('get', "{$this->endpoint}/{$id}") ->getJSON(), true)['data']; - $this->assertNotEquals($app['HostAppCode'], $showData['HostAppCode']); + $this->assertNotEquals($app['SiteID'], $showData['SiteID']); $this->assertEquals($app['HostAppName'], $showData['HostAppName']); } } diff --git a/tests/feature/Organization/HostComParaPatchTest.php b/tests/feature/Organization/HostComParaPatchTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/Organization/SitePatchTest.php b/tests/feature/Organization/SitePatchTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/Organization/WorkstationPatchTest.php b/tests/feature/Organization/WorkstationPatchTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/OrganizationControllerTest.php b/tests/feature/OrganizationControllerTest.php old mode 100644 new mode 100755 index 269dc15..bfeef85 --- a/tests/feature/OrganizationControllerTest.php +++ b/tests/feature/OrganizationControllerTest.php @@ -149,7 +149,7 @@ class OrganizationControllerTest extends CIUnitTestCase ->withBodyFormat('json') ->call('patch', 'api/organization/site/' . $siteId, ['SiteName' => 'Patched Site']); - $updateResponse->assertStatus(201); + $updateResponse->assertStatus(200); $decoded = json_decode($updateResponse->getJSON(), true); $this->assertEquals('success', $decoded['status']); diff --git a/tests/feature/PatVisit/PatVisitADTPatchTest.php b/tests/feature/PatVisit/PatVisitADTPatchTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/PatVisit/PatVisitByPatientTest.php b/tests/feature/PatVisit/PatVisitByPatientTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/PatVisit/PatVisitCreateTest.php b/tests/feature/PatVisit/PatVisitCreateTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/PatVisit/PatVisitDeleteTest.php b/tests/feature/PatVisit/PatVisitDeleteTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/PatVisit/PatVisitShowTest.php b/tests/feature/PatVisit/PatVisitShowTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/PatVisit/PatVisitUpdateTest.php b/tests/feature/PatVisit/PatVisitUpdateTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/Patients/PatientCheckTest.php b/tests/feature/Patients/PatientCheckTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/Patients/PatientCreateTest.php b/tests/feature/Patients/PatientCreateTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/Patients/PatientDeleteTest.php b/tests/feature/Patients/PatientDeleteTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/Patients/PatientIndexTest.php b/tests/feature/Patients/PatientIndexTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/Patients/PatientShowTest.php b/tests/feature/Patients/PatientShowTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/Patients/PatientUpdateTest.php b/tests/feature/Patients/PatientUpdateTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/Result/ResultPatchTest.php b/tests/feature/Result/ResultPatchTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/Rule/RulePatchTest.php b/tests/feature/Rule/RulePatchTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/Specimen/CollectionPatchTest.php b/tests/feature/Specimen/CollectionPatchTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/Specimen/ContainerPatchTest.php b/tests/feature/Specimen/ContainerPatchTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/Specimen/PrepPatchTest.php b/tests/feature/Specimen/PrepPatchTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/Specimen/SpecimenPatchTest.php b/tests/feature/Specimen/SpecimenPatchTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/Specimen/StatusPatchTest.php b/tests/feature/Specimen/StatusPatchTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/Test/TestCreateVariantsTest.php b/tests/feature/Test/TestCreateVariantsTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/Test/TestMapDetailPatchTest.php b/tests/feature/Test/TestMapDetailPatchTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/Test/TestMapPatchTest.php b/tests/feature/Test/TestMapPatchTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/Test/TestShowResponseTest.php b/tests/feature/Test/TestShowResponseTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/Test/TestsPatchTest.php b/tests/feature/Test/TestsPatchTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/User/UserPatchTest.php b/tests/feature/User/UserPatchTest.php old mode 100644 new mode 100755 diff --git a/tests/feature/ValueSet/ValueSetControllerTest.php b/tests/feature/ValueSet/ValueSetControllerTest.php old mode 100644 new mode 100755 diff --git a/tests/index.html b/tests/index.html old mode 100644 new mode 100755 diff --git a/tests/phpunit-bootstrap.php b/tests/phpunit-bootstrap.php old mode 100644 new mode 100755 diff --git a/tests/unit/HealthTest.php b/tests/unit/HealthTest.php old mode 100644 new mode 100755 diff --git a/tests/unit/Patient/PatientModelTest.php b/tests/unit/Patient/PatientModelTest.php old mode 100644 new mode 100755 diff --git a/tests/unit/ValueSet/ValueSetTest.php b/tests/unit/ValueSet/ValueSetTest.php old mode 100644 new mode 100755 diff --git a/writable/.htaccess b/writable/.htaccess old mode 100644 new mode 100755 diff --git a/writable/cache/index.html b/writable/cache/index.html old mode 100644 new mode 100755 diff --git a/writable/index.html b/writable/index.html old mode 100644 new mode 100755 diff --git a/writable/logs/index.html b/writable/logs/index.html old mode 100644 new mode 100755 diff --git a/writable/session/index.html b/writable/session/index.html old mode 100644 new mode 100755 diff --git a/writable/uploads/index.html b/writable/uploads/index.html old mode 100644 new mode 100755