fix patvisit route
This commit is contained in:
parent
d7d90de798
commit
e28b58282e
@ -32,8 +32,8 @@ $routes->get('/api/patient/check', 'Patient\Patient::patientCheck');
|
||||
|
||||
$routes->get('/api/patvisit', 'PatVisit::index');
|
||||
$routes->post('/api/patvisit', 'PatVisit::create');
|
||||
$routes->get('/api/patvisit/(:any)', 'PatVisit::show/$1');
|
||||
$routes->get('/api/patvisit/patient/(:num)', 'PatVisit::showByPatient/$1');
|
||||
$routes->get('/api/patvisit/(:any)', 'PatVisit::show/$1');
|
||||
$routes->delete('/api/patvisit', 'PatVisit::delete');
|
||||
$routes->patch('/api/patvisit', 'PatVisit::update');
|
||||
|
||||
|
||||
@ -29,14 +29,12 @@ class PatVisit extends BaseController {
|
||||
}
|
||||
|
||||
public function showByPatient($InternalPID = null) {
|
||||
echo "dit tolongin dit";
|
||||
try {
|
||||
$row = $this->model->showByPatient($InternalPID);
|
||||
if($row == []) {
|
||||
$message = "data not found";
|
||||
} else {
|
||||
$message = "data found";
|
||||
}
|
||||
return $this->respond(['status' => 'success', 'message'=> $message, 'data' => $row ], 200);
|
||||
$rows = $this->model->showByPatient($InternalPID);
|
||||
if($rows == []) { $message = "data not found"; }
|
||||
else { $message = "data found"; }
|
||||
return $this->respond(['status' => 'success', 'message'=> $message, 'data' => $rows ], 200);
|
||||
} catch (\Exception $e) {
|
||||
return $this->failServerError('Something went wrong '.$e->getMessage());
|
||||
}
|
||||
|
||||
@ -25,10 +25,11 @@ class PatVisitModel extends BaseModel {
|
||||
}
|
||||
|
||||
public function showByPatient($InternalPID) {
|
||||
$rows = $this->join('patdiag pd', 'pd.InternalPVID=patvisit.InternalPVID', 'left')
|
||||
->join('patvisitadt pva', 'pd.InternalPVID=pva.InternalPVID', 'left')
|
||||
->join('location l', 'l.LocationID=pva.LocationID', 'left')
|
||||
->where('patvisit.InternalPID',$InternalPID)->findAll();
|
||||
$rows = $this
|
||||
//->join('patdiag pd', 'pd.InternalPVID=patvisit.InternalPVID', 'left')
|
||||
//->join('patvisitadt pva', 'pd.InternalPVID=pva.InternalPVID', 'left')
|
||||
//->join('location l', 'l.LocationID=pva.LocationID', 'left')
|
||||
->where('InternalPID',$InternalPID)->findAll();
|
||||
return $rows;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user