add codedtxt
This commit is contained in:
parent
e7e9fc1b99
commit
520cc443cc
@ -53,4 +53,16 @@ $routes->get('/api/location', 'Location::index');
|
|||||||
$routes->get('/api/location/(:num)', 'Location::show/$1');
|
$routes->get('/api/location/(:num)', 'Location::show/$1');
|
||||||
$routes->post('/api/location', 'Location::create');
|
$routes->post('/api/location', 'Location::create');
|
||||||
$routes->patch('/api/location/(:num)', 'Location::update/$1');
|
$routes->patch('/api/location/(:num)', 'Location::update/$1');
|
||||||
$routes->delete('/api/location/(:num)', 'Patient::delete/$1');
|
$routes->delete('/api/location/(:num)', 'Patient::delete/$1');
|
||||||
|
|
||||||
|
$routes->get('/api/codedtext', 'CodedText::index');
|
||||||
|
$routes->get('/api/codedtext/(:num)', 'CodedText::show/$1');
|
||||||
|
$routes->post('/api/codedtext', 'CodedText::create');
|
||||||
|
$routes->patch('/api/codedtext/(:num)', 'CodedText::update/$1');
|
||||||
|
$routes->delete('/api/codedtext/(:num)', 'CodedText::delete/$1');
|
||||||
|
|
||||||
|
$routes->get('/api/codedtextfield/', 'CodedTextField::index');
|
||||||
|
$routes->get('/api/codedtextfield/(:num)', 'CodedTextField::show/$1');
|
||||||
|
$routes->post('/api/codedtextfield', 'CodedTextField::create');
|
||||||
|
$routes->patch('/api/codedtextfield/(:num)', 'CodedTextField::update/$1');
|
||||||
|
$routes->delete('/api/codedtextfield/(:num)', 'CodedTextField::delete/$1');
|
||||||
188
app/Controllers/CodedText.php
Normal file
188
app/Controllers/CodedText.php
Normal file
@ -0,0 +1,188 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Controllers;
|
||||||
|
|
||||||
|
use CodeIgniter\API\ResponseTrait;
|
||||||
|
use CodeIgniter\Controller;
|
||||||
|
use CodeIgniter\Database\RawSql;
|
||||||
|
|
||||||
|
class CodedText extends Controller {
|
||||||
|
use ResponseTrait;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->db = \Config\Database::connect();
|
||||||
|
$this->now = date('Y-m-d H:i:s');
|
||||||
|
$this->rules = [
|
||||||
|
'CTGroup' => 'required',
|
||||||
|
'CT' => 'required',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index() {
|
||||||
|
$rows = $this->db->table('codedtxt')
|
||||||
|
->select("*")
|
||||||
|
->get()->getResultArray();
|
||||||
|
|
||||||
|
if (empty($rows)) {
|
||||||
|
return $this->respond([
|
||||||
|
'status' => 'success',
|
||||||
|
'message' => "no Data.",
|
||||||
|
'data' => [],
|
||||||
|
], 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->respond([
|
||||||
|
'status' => 'success',
|
||||||
|
'message'=> "Code Text fetched successfully",
|
||||||
|
'data' => $rows,
|
||||||
|
], 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($CTID = null) {
|
||||||
|
$rows = $this->db->table('codedtxt')
|
||||||
|
->select("*")
|
||||||
|
->where('CTID', (int) $CTID)
|
||||||
|
->get()->getResultArray();
|
||||||
|
|
||||||
|
if (empty($rows)) {
|
||||||
|
return $this->respond([
|
||||||
|
'status' => 'success',
|
||||||
|
'message' => "CodeText with ID $CTID not found.",
|
||||||
|
'data' => [],
|
||||||
|
], 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->respond([
|
||||||
|
'status' => 'success',
|
||||||
|
'message'=> "CodeText fetched successfully",
|
||||||
|
'data' => $rows,
|
||||||
|
], 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create() {
|
||||||
|
try {
|
||||||
|
$input = $this->request->getJSON(true);
|
||||||
|
$now = date('Y-m-d H:i:s');
|
||||||
|
|
||||||
|
// Prepare data
|
||||||
|
$data = $this->prepareData($input, $now, 'create');
|
||||||
|
|
||||||
|
if (!$this->validateData($data, $this->rules())) {
|
||||||
|
return $this->failValidationErrors($this->validator->getErrors());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start transaction
|
||||||
|
$this->db->transStart();
|
||||||
|
|
||||||
|
// Insert
|
||||||
|
$this->db->table('codedtxt')->insert($data);
|
||||||
|
|
||||||
|
// Complete transaction
|
||||||
|
$this->db->transComplete();
|
||||||
|
|
||||||
|
if ($this->db->transStatus() === false) {
|
||||||
|
$dbError = $this->db->error();
|
||||||
|
return $this->failServerError(
|
||||||
|
'Failed to create data (transaction rolled back): ' . ($dbError['message'] ?? 'Unknown database error')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->respondCreated([
|
||||||
|
'status' => 'success',
|
||||||
|
'message' => 'Data created successfully',
|
||||||
|
'data' => $data,
|
||||||
|
], 201);
|
||||||
|
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
// Ensure rollback if something goes wrong
|
||||||
|
if ($this->db->transStatus() !== false) {
|
||||||
|
$this->db->transRollback();
|
||||||
|
}
|
||||||
|
return $this->failServerError('Something went wrong: ' . $e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update($CTID = null) {
|
||||||
|
try {
|
||||||
|
$input = $this->request->getJSON(true);
|
||||||
|
$now = $this->now;
|
||||||
|
|
||||||
|
$data = $this->prepareData($input, $now, 'update');
|
||||||
|
|
||||||
|
if (!$this->validateData($data, $rules)) {
|
||||||
|
return $this->failValidationErrors( $this->validator->getErrors());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start transaction
|
||||||
|
$this->db->transStart();
|
||||||
|
|
||||||
|
// Insert location
|
||||||
|
$this->db->table('codedtxt')->where('CTID', $CTID)->update($data);
|
||||||
|
|
||||||
|
// Complete transaction
|
||||||
|
$this->db->transComplete();
|
||||||
|
|
||||||
|
if ($this->db->transStatus() === false) {
|
||||||
|
$dbError = $this->db->error();
|
||||||
|
return $this->failServerError(
|
||||||
|
'Failed to update data (transaction rolled back): ' . ($dbError['message'] ?? 'Unknown database error')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->respondCreated([
|
||||||
|
'status' => 'success',
|
||||||
|
'message' => 'Data updated successfully',
|
||||||
|
'data' => $data,
|
||||||
|
], 201);
|
||||||
|
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
// Ensure rollback if something goes wrong
|
||||||
|
if ($this->db->transStatus() !== false) {
|
||||||
|
$this->db->transRollback();
|
||||||
|
}
|
||||||
|
return $this->failServerError('Something went wrong: ' . $e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function delete($CTID = null) {
|
||||||
|
try {
|
||||||
|
if (!$CTID) {
|
||||||
|
return $this->failValidationErrors('CTID is required.');
|
||||||
|
}
|
||||||
|
|
||||||
|
$codedtxt = $this->db->table('codedtxt')->where('CTID', $CTID)->get()->getRow();
|
||||||
|
if (!$codedtxt) {
|
||||||
|
return $this->failNotFound("CTID with {$CTID} not found.");
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->table('codedtxt')->where('CTID', $CTID)->update(['DelDate' => $this->now()]);
|
||||||
|
|
||||||
|
return $this->respondDeleted([
|
||||||
|
'status' => 'success',
|
||||||
|
'message' => "CodedTxt with {$CTID} deleted successfully."
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
// Ensure rollback if something goes wrong
|
||||||
|
if ($this->db->transStatus() !== false) {
|
||||||
|
$this->db->transRollback();
|
||||||
|
}
|
||||||
|
return $this->failServerError('Something went wrong: ' . $e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function prepareData(array $input, string $now, string $mode = 'create'): array {
|
||||||
|
$data = [
|
||||||
|
"CTGroup" => $input['LocCode'] ?? null,
|
||||||
|
"CT" => $input['Parent'] ?? null,
|
||||||
|
"Description" => $input['Description'] ?? null,
|
||||||
|
"FontStyle" => $input['FontStyle'] ?? null,
|
||||||
|
"Category" => $input['Category'] ?? null
|
||||||
|
];
|
||||||
|
|
||||||
|
if ($mode === 'create') {
|
||||||
|
$data["CreateDate"] = $now;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
}
|
||||||
187
app/Controllers/CodedTextField.php
Normal file
187
app/Controllers/CodedTextField.php
Normal file
@ -0,0 +1,187 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Controllers;
|
||||||
|
|
||||||
|
use CodeIgniter\API\ResponseTrait;
|
||||||
|
use CodeIgniter\Controller;
|
||||||
|
use CodeIgniter\Database\RawSql;
|
||||||
|
|
||||||
|
class CodedTextField extends Controller {
|
||||||
|
use ResponseTrait;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->db = \Config\Database::connect();
|
||||||
|
$this->now = date('Y-m-d H:i:s');
|
||||||
|
$this->rules = [
|
||||||
|
'TblName' => 'required',
|
||||||
|
'FldName' => 'required',
|
||||||
|
'CTGroup' => 'required'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index() {
|
||||||
|
$rows = $this->db->table('codedtxtfld')
|
||||||
|
->select("*")
|
||||||
|
->get()->getResultArray();
|
||||||
|
|
||||||
|
if (empty($rows)) {
|
||||||
|
return $this->respond([
|
||||||
|
'status' => 'success',
|
||||||
|
'message' => "no Data.",
|
||||||
|
'data' => [],
|
||||||
|
], 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->respond([
|
||||||
|
'status' => 'success',
|
||||||
|
'message'=> "CTF fetched successfully",
|
||||||
|
'data' => $rows,
|
||||||
|
], 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($CTFldID = null) {
|
||||||
|
$rows = $this->db->table('codedtxtfld')
|
||||||
|
->select("*")
|
||||||
|
->where('CTID', (int) $CTID)
|
||||||
|
->get()->getResultArray();
|
||||||
|
|
||||||
|
if (empty($rows)) {
|
||||||
|
return $this->respond([
|
||||||
|
'status' => 'success',
|
||||||
|
'message' => "CTF with ID $CTID not found.",
|
||||||
|
'data' => [],
|
||||||
|
], 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->respond([
|
||||||
|
'status' => 'success',
|
||||||
|
'message'=> "CodeText fetched successfully",
|
||||||
|
'data' => $rows,
|
||||||
|
], 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create() {
|
||||||
|
try {
|
||||||
|
$input = $this->request->getJSON(true);
|
||||||
|
$now = date('Y-m-d H:i:s');
|
||||||
|
|
||||||
|
$data = $this->prepareData($input, $now, 'create');
|
||||||
|
|
||||||
|
if (!$this->validateData($data, $this->rules())) {
|
||||||
|
return $this->failValidationErrors($this->validator->getErrors());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start transaction
|
||||||
|
$this->db->transStart();
|
||||||
|
|
||||||
|
// Insert
|
||||||
|
$this->db->table('codedtxtfld')->insert($data);
|
||||||
|
|
||||||
|
// Complete transaction
|
||||||
|
$this->db->transComplete();
|
||||||
|
|
||||||
|
if ($this->db->transStatus() === false) {
|
||||||
|
$dbError = $this->db->error();
|
||||||
|
return $this->failServerError(
|
||||||
|
'Failed to create data (transaction rolled back): ' . ($dbError['message'] ?? 'Unknown database error')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->respondCreated([
|
||||||
|
'status' => 'success',
|
||||||
|
'message' => 'Data created successfully',
|
||||||
|
'data' => $data,
|
||||||
|
], 201);
|
||||||
|
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
// Ensure rollback if something goes wrong
|
||||||
|
if ($this->db->transStatus() !== false) {
|
||||||
|
$this->db->transRollback();
|
||||||
|
}
|
||||||
|
return $this->failServerError('Something went wrong: ' . $e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update($CTFldID = null) {
|
||||||
|
try {
|
||||||
|
$input = $this->request->getJSON(true);
|
||||||
|
$now = $this->now;
|
||||||
|
|
||||||
|
$data = $this->prepareData($input, $now, 'update');
|
||||||
|
|
||||||
|
if (!$this->validateData($data, $this->rules())) {
|
||||||
|
return $this->failValidationErrors( $this->validator->getErrors());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start transaction
|
||||||
|
$this->db->transStart();
|
||||||
|
|
||||||
|
// Insert location
|
||||||
|
$this->db->table('codedtxtfld')->where('CTFldID', $CTFldID)->update($data);
|
||||||
|
|
||||||
|
// Complete transaction
|
||||||
|
$this->db->transComplete();
|
||||||
|
|
||||||
|
if ($this->db->transStatus() === false) {
|
||||||
|
$dbError = $this->db->error();
|
||||||
|
return $this->failServerError(
|
||||||
|
'Failed to update data (transaction rolled back): ' . ($dbError['message'] ?? 'Unknown database error')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->respondCreated([
|
||||||
|
'status' => 'success',
|
||||||
|
'message' => 'Data updated successfully',
|
||||||
|
'data' => $data,
|
||||||
|
], 201);
|
||||||
|
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
// Ensure rollback if something goes wrong
|
||||||
|
if ($this->db->transStatus() !== false) {
|
||||||
|
$this->db->transRollback();
|
||||||
|
}
|
||||||
|
return $this->failServerError('Something went wrong: ' . $e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function delete($CTFldID = null) {
|
||||||
|
try {
|
||||||
|
if (!$CTFldID) {
|
||||||
|
return $this->failValidationErrors('CTFldID is required.');
|
||||||
|
}
|
||||||
|
|
||||||
|
$codedtxtfld = $this->db->table('codedtxtfld')->where('CTFldID', $CTFldID)->get()->getRow();
|
||||||
|
if (!$codedtxtfld) {
|
||||||
|
return $this->failNotFound("CTFld with {$CTFldID} not found.");
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->table('codedtxtfld')->where('CTFldID', $CTFldID)->update(['DelDate' => $this->now()]);
|
||||||
|
|
||||||
|
return $this->respondDeleted([
|
||||||
|
'status' => 'success',
|
||||||
|
'message' => "CodedTxtFld with {$CTFldID} deleted successfully."
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
// Ensure rollback if something goes wrong
|
||||||
|
if ($this->db->transStatus() !== false) {
|
||||||
|
$this->db->transRollback();
|
||||||
|
}
|
||||||
|
return $this->failServerError('Something went wrong: ' . $e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function prepareData(array $input, string $now, string $mode = 'create'): array {
|
||||||
|
$data = [
|
||||||
|
"CTGroup" => $input['CTGroup'] ?? null,
|
||||||
|
"FldName" => $input['FldName'] ?? null,
|
||||||
|
"TblName" => $input['TblName'] ?? null
|
||||||
|
];
|
||||||
|
|
||||||
|
if ($mode === 'create') {
|
||||||
|
$data["CreateDate"] = $now;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
41
app/Database/Migrations/2025-09-11-130122_Coded_Text.php
Normal file
41
app/Database/Migrations/2025-09-11-130122_Coded_Text.php
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Database\Migrations;
|
||||||
|
|
||||||
|
use CodeIgniter\Database\Migration;
|
||||||
|
|
||||||
|
class CreateCodedTextTable extends Migration {
|
||||||
|
public function up() {
|
||||||
|
|
||||||
|
$this->forge->addField([
|
||||||
|
'CTID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
|
||||||
|
'SiteID' => ['type' => 'INT', 'null' => true],
|
||||||
|
'CTGroup' => ['type' => 'INT', 'null' => true],
|
||||||
|
'CT' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => false],
|
||||||
|
'Description' => ['type' => 'varchar', 'constraint' => 255, 'null' => true],
|
||||||
|
'FontStyle' => ['type' => 'int', 'null' => true],
|
||||||
|
'Category' => ['type' => 'int', 'null' => true],
|
||||||
|
'CreateDate' => ['type' => 'DATETIME', 'null' => true],
|
||||||
|
'EndDate' => ['type' => 'DATETIME', 'null' => true]
|
||||||
|
]);
|
||||||
|
$this->forge->addKey('CTID', true);
|
||||||
|
$this->forge->createTable('codedtxt');
|
||||||
|
|
||||||
|
$this->forge->addField([
|
||||||
|
'CTFldID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
|
||||||
|
'SiteID' => ['type' => 'INT', 'null' => true],
|
||||||
|
'TblName' => ['type' => 'Varchar', 'constraint' => 255, 'null' => true],
|
||||||
|
'FldName' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => false],
|
||||||
|
'CTGroup' => ['type' => 'INT', 'null' => true],
|
||||||
|
'CreateDate' => ['type' => 'DATETIME', 'null' => true],
|
||||||
|
'EndDate' => ['type' => 'DATETIME', 'null' => true]
|
||||||
|
]);
|
||||||
|
$this->forge->addKey('CTFldID', true);
|
||||||
|
$this->forge->createTable('codedtxtfld');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down() {
|
||||||
|
$this->forge->dropTable('codedtxt');
|
||||||
|
$this->forge->dropTable('codedtxtfld');
|
||||||
|
}
|
||||||
|
}
|
||||||
94
app/Database/Seeds/CodedTxtSeeder.php
Normal file
94
app/Database/Seeds/CodedTxtSeeder.php
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Database\Seeds;
|
||||||
|
|
||||||
|
use CodeIgniter\Database\Seeder;
|
||||||
|
|
||||||
|
class CodedTxtSeeder extends Seeder {
|
||||||
|
public function run() {
|
||||||
|
// codedtxt
|
||||||
|
$data = [
|
||||||
|
['CTID' => 1,'CTGroup' => 1, 'CT' =>'0', 'Description' => 'Primary', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 2,'CTGroup' => 1, 'CT' =>'1', 'Description' => 'Secondary', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 3,'CTGroup' => 2, 'CT' =>'0', 'Description' => 'Disabled', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 4,'CTGroup' => 2, 'CT' =>'1', 'Description' => 'Enabled', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 5,'CTGroup' => 3, 'CT' =>'1', 'Description' => 'Female', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 6,'CTGroup' => 3, 'CT' =>'2', 'Description' => 'Male', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 7,'CTGroup' => 3, 'CT' =>'3', 'Description' => 'Unknown', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 8,'CTGroup' => 4, 'CT' =>'A', 'Description' => 'Separated', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 9,'CTGroup' => 4, 'CT' =>'D', 'Description' => 'Divorced', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 10,'CTGroup' => 4, 'CT' =>'M', 'Description' => 'Married', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 11,'CTGroup' => 4, 'CT' =>'S', 'Description' => 'Single', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 12,'CTGroup' => 4, 'CT' =>'W', 'Description' => 'Widowed', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 13,'CTGroup' => 4, 'CT' =>'B', 'Description' => 'Unmarried', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 14,'CTGroup' => 4, 'CT' =>'U', 'Description' => 'Unknown', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 15,'CTGroup' => 4, 'CT' =>'O', 'Description' => 'Other', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 16,'CTGroup' => 5, 'CT' =>'Y', 'Description' => 'Death', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 17,'CTGroup' => 5, 'CT' =>'N', 'Description' => 'Life', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 18,'CTGroup' => 6, 'CT' =>'KTP', 'Description' => 'Kartu Tanda Penduduk', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 19,'CTGroup' => 6, 'CT' =>'PASS', 'Description' => 'Passport', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 20,'CTGroup' => 6, 'CT' =>'SSN', 'Description' => 'Social Security Number', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 21,'CTGroup' => 6, 'CT' =>'SIM', 'Description' => 'Surat Izin Mengemudi', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 22,'CTGroup' => 6, 'CT' =>'KTAS', 'Description' => 'Kartu Izin Tinggal Terbatas', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 23,'CTGroup' => 7, 'CT' =>'Create', 'Description' => 'create record', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 24,'CTGroup' => 7, 'CT' =>'Read', 'Description' => 'read record/field', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 25,'CTGroup' => 7, 'CT' =>'Update', 'Description' => 'update record/field', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 26,'CTGroup' => 7, 'CT' =>'Delete', 'Description' => 'delete record/field', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 27,'CTGroup' => 8, 'CT' =>'WDID', 'Description' => 'Windows Device ID', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 28,'CTGroup' => 8, 'CT' =>'AAID', 'Description' => 'Android AAID', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 29,'CTGroup' => 8, 'CT' =>'IDFA', 'Description' => 'IOS IDFA', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 30,'CTGroup' => 9, 'CT' =>'PAT', 'Description' => 'Patient', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 31,'CTGroup' => 9, 'CT' =>'ISN', 'Description' => 'Insurance', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 32,'CTGroup' => 9, 'CT' =>'ACC', 'Description' => 'Account', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 33,'CTGroup' => 9, 'CT' =>'DOC', 'Description' => 'Doctor', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 34,'CTGroup' => 10, 'CT' =>'S', 'Description' => 'Stat', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 35,'CTGroup' => 10, 'CT' =>'A', 'Description' => 'ASAP', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 36,'CTGroup' => 10, 'CT' =>'R', 'Description' => 'Routine', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 37,'CTGroup' => 10, 'CT' =>'P', 'Description' => 'Preop', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 38,'CTGroup' => 10, 'CT' =>'C', 'Description' => 'Callback', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 39,'CTGroup' => 10, 'CT' =>'T', 'Description' => 'Timing critical', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 40,'CTGroup' => 10, 'CT' =>'PRN', 'Description' => 'As needed', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 41,'CTGroup' => 11, 'CT' =>'A', 'Description' => 'Some, not all results available', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 42,'CTGroup' => 11, 'CT' =>'CA', 'Description' => 'Order is cancelled', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 43,'CTGroup' => 11, 'CT' =>'CM', 'Description' => 'Order is completed', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 44,'CTGroup' => 11, 'CT' =>'DC', 'Description' => 'Order was discontinued', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 45,'CTGroup' => 11, 'CT' =>'ER', 'Description' => 'Error, order not found', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 46,'CTGroup' => 11, 'CT' =>'HD', 'Description' => 'Order “on hold”', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 47,'CTGroup' => 11, 'CT' =>'IP', 'Description' => 'In process, unspecified', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 48,'CTGroup' => 11, 'CT' =>'RP', 'Description' => 'Order has been replaced', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 49,'CTGroup' => 11, 'CT' =>'SC', 'Description' => 'In process, scheduled', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 50,'CTGroup' => 11, 'CT' =>'CL', 'Description' => 'Closed', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 51,'CTGroup' => 11, 'CT' =>'AC', 'Description' => 'Archived', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 52,'CTGroup' => 11, 'CT' =>'DL', 'Description' => 'Deleted', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 53,'CTGroup' => 12, 'CT' =>'FCLT', 'Description' => 'Facility. Organisasi atau lembaga tempat layanan disediakan, atau gedung tertentu dalam organisasi', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 54,'CTGroup' => 12, 'CT' =>'BLDG', 'Description' => 'Building. Gedung', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 55,'CTGroup' => 12, 'CT' =>'FLOR', 'Description' => 'Floor. Lantai dari gedung', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 56,'CTGroup' => 12, 'CT' =>'POC', 'Description' => 'Point of Care', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 57,'CTGroup' => 12, 'CT' =>'ROOM', 'Description' => 'Room. Ruangan dalam Gedung-lantai', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 58,'CTGroup' => 12, 'CT' =>'BED', 'Description' => 'Bed. Tempat tidur pasien', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 59,'CTGroup' => 12, 'CT' =>'MOBL', 'Description' => 'Mobile. Lokasi bergerak, ditandai dengan koordinat GPS, lokasi sementara, atau deskripsi lokasi unit bergerak saat ini.', 'FontStyle' => '0', 'Category' => '0'],
|
||||||
|
['CTID' => 60,'CTGroup' => 12, 'CT' =>'REMT', 'Description' => 'Remote. Lokasi di luar lokasi utama', 'FontStyle' => '0', 'Category' => '0']
|
||||||
|
];
|
||||||
|
$this->db->table('codedtxt')->insertBatch($data);
|
||||||
|
|
||||||
|
// locationAddress
|
||||||
|
$data = [
|
||||||
|
['CTFldID' => 1,'TblName' =>'workstation', 'FldName' => 'Type', 'CTGroup' => '1'],
|
||||||
|
['CTFldID' => 2,'TblName' =>'workstation', 'FldName' => 'Enable', 'CTGroup' => '2'],
|
||||||
|
['CTFldID' => 3,'TblName' =>'patient', 'FldName' => 'Gender', 'CTGroup' => '3'],
|
||||||
|
['CTFldID' => 4,'TblName' =>'patient', 'FldName' => 'MaritalStatus', 'CTGroup' => '4'],
|
||||||
|
['CTFldID' => 5,'TblName' =>'patient', 'FldName' => 'DeathIndicator', 'CTGroup' => '5'],
|
||||||
|
['CTFldID' => 6,'TblName' =>'patidt', 'FldName' => 'IdentifierType', 'CTGroup' => '6'],
|
||||||
|
['CTFldID' => 7,'TblName' =>'patreglog', 'FldName' => 'Operation', 'CTGroup' => '7'],
|
||||||
|
['CTFldID' => 8,'TblName' =>'patreglog', 'FldName' => 'DIDType', 'CTGroup' => '8'],
|
||||||
|
['CTFldID' => 9,'TblName' =>'patvisitlog', 'FldName' => 'Operation', 'CTGroup' => '7'],
|
||||||
|
['CTFldID' => 10,'TblName' =>'patvisitlog', 'FldName' => 'DIDType', 'CTGroup' => '8'],
|
||||||
|
['CTFldID' => 11,'TblName' =>'order', 'FldName' => 'ReqEntity', 'CTGroup' => '9'],
|
||||||
|
['CTFldID' => 12,'TblName' =>'order', 'FldName' => 'Priority', 'CTGroup' => '10'],
|
||||||
|
['CTFldID' => 13,'TblName' =>'orderststatus', 'FldName' => 'OrderStatus', 'CTGroup' => '11'],
|
||||||
|
['CTFldID' => 14,'TblName' =>'orderlog', 'FldName' => 'Operation', 'CTGroup' => '7'],
|
||||||
|
['CTFldID' => 15,'TblName' =>'location', 'FldName' => 'LocationType', 'CTGroup' => '12'],
|
||||||
|
];
|
||||||
|
$this->db->table('codedtxtfld')->insertBatch($data);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user