add temporary patdata

This commit is contained in:
mahdahar 2025-07-18 14:38:32 +07:00
parent 6cc8ca9224
commit f7e2d89555
4 changed files with 1323 additions and 1 deletions

View File

@ -16,4 +16,8 @@ $routes->post('/auth/register/', 'Auth::register');
$routes->get('/patient', 'Patient::index');
$routes->post('/patient', 'Patient::create');
$routes->patch('/patient/(:num)', 'Patient::update/$1');
$routes->patch('/patient/(:num)', 'Patient::update/$1');
$routes->get('/patient/race', 'PatientRace::index');
$routes->get('/patient/country', 'PatientCountry::index');
$routes->get('/patient/religion', 'PatientReligion::index');

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,27 @@
<?php
namespace App\Controllers;
use CodeIgniter\API\ResponseTrait;
use CodeIgniter\Controller;
use CodeIgniter\Database\RawSql;
class PatientRace extends Controller {
use ResponseTrait;
public function index() {
$data = [
[ 'patraceid'=>'1', 'patracecode'=> 'ASIA', 'full_text'=>'Asian' ],
[ 'patraceid'=>'2', 'patracecode'=> 'AMERICA', 'full_text'=>'American Indian or Alaska Native' ],
[ 'patraceid'=>'3', 'patracecode'=> 'AFRICA', 'full_text'=>'Black or African-American' ],
[ 'patraceid'=>'4', 'patracecode'=> 'LATIN', 'full_text'=>'Hispanic or Latino' ],
[ 'patraceid'=>'5', 'patracecode'=> 'HAWAI', 'full_text'=>'Native Hawaiian or Pacific Islander' ],
[ 'patraceid'=>'6', 'patracecode'=> 'WHITE', 'full_text'=>'White' ],
[ 'patraceid'=>'7', 'patracecode'=> 'UK', 'full_text'=>'Unknown' ]
];
return $this->respond([
'status' => 'success',
'data' => $data,
]);
}
}

View File

@ -0,0 +1,26 @@
<?php
namespace App\Controllers;
use CodeIgniter\API\ResponseTrait;
use CodeIgniter\Controller;
use CodeIgniter\Database\RawSql;
class PatientReligion extends Controller {
use ResponseTrait;
public function index() {
$data = [
[ 'patreliid'=>'1', 'patrelicode'=> 'ISL', 'full_text'=>'Islam' ],
[ 'patreliid'=>'2', 'patrelicode'=> 'KAT', 'full_text'=>'Katolik' ],
[ 'patreliid'=>'3', 'patrelicode'=> 'PRO', 'full_text'=>'Protestan' ],
[ 'patreliid'=>'4', 'patrelicode'=> 'BUD', 'full_text'=>'Buddha' ],
[ 'patreliid'=>'5', 'patrelicode'=> 'HIN', 'full_text'=>'Hindu' ],
[ 'patreliid'=>'6', 'patrelicode'=> 'KON', 'full_text'=>'Kong Hu Chu' ],
];
return $this->respond([
'status' => 'success',
'data' => $data,
]);
}
}