diff --git a/.gitignore b/.gitignore index a6c603e..ce06168 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,4 @@ !public/ !cmod.7z !.gitignore -!env -!cmod.bak \ No newline at end of file +!env \ No newline at end of file diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 83febde..bff17e0 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -74,6 +74,9 @@ $routes->POST('api/patients/search/', 'API_HISPatients::search'); $routes->get('api/patients/detail/(:any)', 'API_HISPatients::detail/$1'); $routes->POST('api/patients/save', 'API_HISPatients::save'); +// API - For TM +$routes->get('api/his/dictTests', 'API_HIS::dictTests'); +$routes->get('api/his/results/(:any)', 'API_HIS::results/$1'); // admin $routes->group('admin', ['filter' => 'role:admin'], static function ($routes) { $routes->get('', 'AdminController::index'); diff --git a/app/Controllers/API_HIS.php b/app/Controllers/API_HIS.php new file mode 100644 index 0000000..d5dce6e --- /dev/null +++ b/app/Controllers/API_HIS.php @@ -0,0 +1,35 @@ +query($sql); + $results = $query->getResultArray(); + $data = $results; + return $this->respond($data,200); + } + + public function results($accessnumber) { + $db = \Config\Database::connect(); + $sql = "select HOSTORDERNUMBER as HISNO from SP_REQUESTS where SP_ACCESSNUMBER='$accessnumber'"; + $query = $db->query($sql); + $results = $query->getResultArray(); + $data['LISNO'] = $accessnumber; + $data['HISNO'] = $results[0]['HISNO']; + $sql = "select TESTCODE, TESTORDER, RESTYPE, RESVALUE, RESFLAG, UNIT, REFRANGE, USERVAL, RESDATE + from cmod.dbo.CM_RESULTS r + where ACCESSNUMBER='$accessnumber' + order by TESTORDER"; + $query = $db->query($sql); + $results = $query->getResultArray(); + $data['results'] = $results; + return $this->respond($data,200); + } + +} diff --git a/app/Controllers/SuperuserController.php b/app/Controllers/SuperuserController.php new file mode 100644 index 0000000..e69de29 diff --git a/app/Views/auth_login.php b/app/Views/auth_login.php index de5e8d0..7fc2cef 100644 --- a/app/Views/auth_login.php +++ b/app/Views/auth_login.php @@ -1,61 +1,55 @@ - - - - CMOD - Login - + + + + + + + cmod - + + - - -
-
-
-
- + + + + + \ No newline at end of file