This commit is contained in:
mikael-zakaria 2025-11-13 15:05:49 +07:00
commit 49a4d5b11f
27 changed files with 780 additions and 73 deletions

View File

@ -126,6 +126,65 @@ $routes->post('/api/organization/workstation', 'Organization\Workstation::create
$routes->patch('/api/organization/workstation', 'Organization\Workstation::update');
$routes->delete('/api/organization/workstation', 'Organization\Workstation::delete');
$routes->group('api/specimen', function($routes) {
$routes->get('/containerdef/(:num)', 'Specimen\ContainerDef::show/$1');
$routes->post('/containerdef', 'Specimen\ContainerDef::create');
$routes->patch('/containerdef', 'Specimen\ContainerDef::update');
$routes->get('/containerdef', 'Specimen\ContainerDef::index');
$routes->get('/prep/(:num)', 'Specimen\Prep::show/$1');
$routes->post('/prep', 'Specimen\Prep::create');
$routes->patch('/prep', 'Specimen\Prep::update');
$routes->get('/prep', 'Specimen\Prep::index');
$routes->get('/status/(:num)', 'Specimen\Status::show/$1');
$routes->post('/status', 'Specimen\Status::create');
$routes->patch('/status', 'Specimen\Status::update');
$routes->get('/status', 'Specimen\Status::index');
$routes->get('/collection/(:num)', 'Specimen\Collection::show/$1');
$routes->post('/collection', 'Specimen\Collection::create');
$routes->patch('/collection', 'Specimen\Collection::update');
$routes->get('/collection', 'Specimen\Collection::index');
$routes->get('(:num)', 'Specimen\Specimen::show/$1');
$routes->post('', 'Specimen\Specimen::create');
$routes->patch('', 'Specimen\Specimen::update');
$routes->get('', 'Specimen\Specimen::index');
});
$routes->group('api/test', function($routes) {
$routes->get('testdeftech/(:num)', 'Test\TestDefTech::show/$1');
$routes->post('testdeftech', 'Test\TestDefTech::create');
$routes->patch('testdeftech', 'Test\TestDefTech::update');
$routes->get('testdeftech/', 'Test\TestDefTech::index');
$routes->get('testdefcal/(:num)', 'Test\TestDefCal::show/$1');
$routes->post('testdefcal', 'Test\TestDefCal::create');
$routes->patch('testdefcal', 'Test\TestDefCal::update');
$routes->get('testdefcal/', 'Test\TestDefCal::index');
$routes->get('testgrp/(:num)', 'Test\TestGrp::show/$1');
$routes->post('testgrp', 'Test\TestGrp::create');
$routes->patch('testgrp', 'Test\TestGrp::update');
$routes->get('testgrp/', 'Test\TestGrp::index');
$routes->get('testdefsite/(:num)', 'Test\TestDefSite::show/$1');
$routes->post('testdefsite', 'Test\TestDefSite::create');
$routes->patch('testdefsite', 'Test\TestDefSite::update');
$routes->get('testdefsite/', 'Test\TestDefSite::index');
$routes->get('testmap/(:num)', 'Test\TestMap::show/$1');
$routes->post('testmap', 'Test\TestMap::create');
$routes->patch('testmap', 'Test\TestMap::update');
$routes->get('testmap/', 'Test\TestMap::index');
$routes->get('testdef/(:num)', 'Test\TestDef::show/$1');
$routes->post('testdef', 'Test\TestDef::create');
$routes->patch('testdef', 'Test\TestDef::update');
$routes->get('testdef', 'Test\TestDef::index');
});
// Khusus
$routes->get('/api/zones', 'Zones::index');
$routes->get('/api/zones/synchronize', 'Zones::synchronize');

View File

@ -0,0 +1,62 @@
<?php
namespace App\Controllers\Specimen;
use CodeIgniter\API\ResponseTrait;
use App\Controllers\BaseController;
use App\Models\Specimen\SpecimenModel;
class Specimen extends BaseController {
use ResponseTrait;
protected $db;
protected $model;
protected $rules;
public function __construct() {
$this->db = \Config\Database::connect();
$this->model = new SpecimenModel();
$this->rules = [];
}
public function index() {
try {
$rows = $this->model->findAll();
return $this->respond([ 'status' => 'success', 'message'=> "data fetched successfully", 'data' => $rows ], 200);
} catch (\Exception $e) {
return $this->failServerError('Exception : '.$e->getMessage());
}
}
public function show($id) {
try {
$rows = $this->model->where('SID',$id)->findAll();
return $this->respond([ 'status' => 'success', 'message'=> "data fetched successfully", 'data' => $rows ], 200);
} catch (\Exception $e) {
return $this->failServerError('Exception : '.$e->getMessage());
}
}
public function create() {
$input = $this->request->getJSON(true);
if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors($this->validator->getErrors()); }
try {
$id = $this->model->insert($input);
return $this->respondCreated([ 'status' => 'success', 'message' => "data $id created successfully" ]);
} catch (\Exception $e) {
return $this->failServerError('Something went wrong: ' . $e->getMessage());
}
}
public function update() {
$input = $this->request->getJSON(true);
if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors($this->validator->getErrors()); }
try {
$id = $this->model->update($input['SID'], $input);
return $this->respondCreated([ 'status' => 'success', 'message' => "data $id updated successfully" ]);
} catch (\Exception $e) {
return $this->failServerError('Something went wrong: ' . $e->getMessage());
}
}
}

View File

@ -0,0 +1,62 @@
<?php
namespace App\Controllers\Specimen;
use CodeIgniter\API\ResponseTrait;
use App\Controllers\BaseController;
use App\Models\Specimen\SpecimenCollectionModel;
class SpecimenCollection extends BaseController {
use ResponseTrait;
protected $db;
protected $model;
protected $rules;
public function __construct() {
$this->db = \Config\Database::connect();
$this->model = new SpecimenCollectionModel();
$this->rules = [];
}
public function index() {
try {
$rows = $this->model->findAll();
return $this->respond([ 'status' => 'success', 'message'=> "data fetched successfully", 'data' => $rows ], 200);
} catch (\Exception $e) {
return $this->failServerError('Exception : '.$e->getMessage());
}
}
public function show($id) {
try {
$rows = $this->model->where('SpcColID', $id)->findAll();
return $this->respond([ 'status' => 'success', 'message'=> "data fetched successfully", 'data' => $rows ], 200);
} catch (\Exception $e) {
return $this->failServerError('Exception : '.$e->getMessage());
}
}
public function create() {
$input = $this->request->getJSON(true);
if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors($this->validator->getErrors()); }
try {
$id = $this->model->insert($input);
return $this->respondCreated([ 'status' => 'success', 'message' => "data $id created successfully" ]);
} catch (\Exception $e) {
return $this->failServerError('Something went wrong: ' . $e->getMessage());
}
}
public function update() {
$input = $this->request->getJSON(true);
if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors($this->validator->getErrors()); }
try {
$id = $this->model->update($input['SpcColID'], $input);
return $this->respondCreated([ 'status' => 'success', 'message' => "data $id updated successfully" ]);
} catch (\Exception $e) {
return $this->failServerError('Something went wrong: ' . $e->getMessage());
}
}
}

View File

@ -0,0 +1,62 @@
<?php
namespace App\Controllers\Specimen;
use CodeIgniter\API\ResponseTrait;
use App\Controllers\BaseController;
use App\Models\Specimen\SpecimenPrepModel;
class SpecimenPrep extends BaseController {
use ResponseTrait;
protected $db;
protected $model;
protected $rules;
public function __construct() {
$this->db = \Config\Database::connect();
$this->model = new SpecimenPrepModel();
$this->rules = [];
}
public function index() {
try {
$rows = $this->model->findAll();
return $this->respond([ 'status' => 'success', 'message'=> "data fetched successfully", 'data' => $rows ], 200);
} catch (\Exception $e) {
return $this->failServerError('Exception : '.$e->getMessage());
}
}
public function show($id) {
try {
$rows = $this->model->where('SpcPrpID', $id)->findAll();
return $this->respond([ 'status' => 'success', 'message'=> "data fetched successfully", 'data' => $rows ], 200);
} catch (\Exception $e) {
return $this->failServerError('Exception : '.$e->getMessage());
}
}
public function create() {
$input = $this->request->getJSON(true);
if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors($this->validator->getErrors()); }
try {
$id = $this->model->insert($input);
return $this->respondCreated([ 'status' => 'success', 'message' => "data $id created successfully" ]);
} catch (\Exception $e) {
return $this->failServerError('Something went wrong: ' . $e->getMessage());
}
}
public function update() {
$input = $this->request->getJSON(true);
if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors($this->validator->getErrors()); }
try {
$id = $this->model->update($input['SpcPrpID'], $input);
return $this->respondCreated([ 'status' => 'success', 'message' => "data $id updated successfully" ]);
} catch (\Exception $e) {
return $this->failServerError('Something went wrong: ' . $e->getMessage());
}
}
}

View File

@ -0,0 +1,62 @@
<?php
namespace App\Controllers\Specimen;
use CodeIgniter\API\ResponseTrait;
use App\Controllers\BaseController;
use App\Models\Specimen\SpecimenStatusModel;
class ContainerDef extends BaseController {
use ResponseTrait;
protected $db;
protected $model;
protected $rules;
public function __construct() {
$this->db = \Config\Database::connect();
$this->model = new SpecimenStatusModel();
$this->rules = [];
}
public function index() {
try {
$rows = $this->model->findAll();
return $this->respond([ 'status' => 'success', 'message'=> "data fetched successfully", 'data' => $rows ], 200);
} catch (\Exception $e) {
return $this->failServerError('Exception : '.$e->getMessage());
}
}
public function show($id) {
try {
$rows = $this->model->where('SpcStaID', $id)->findAll();
return $this->respond([ 'status' => 'success', 'message'=> "data fetched successfully", 'data' => $rows ], 200);
} catch (\Exception $e) {
return $this->failServerError('Exception : '.$e->getMessage());
}
}
public function create() {
$input = $this->request->getJSON(true);
if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors($this->validator->getErrors()); }
try {
$id = $this->model->insert($input);
return $this->respondCreated([ 'status' => 'success', 'message' => "data $id created successfully" ]);
} catch (\Exception $e) {
return $this->failServerError('Something went wrong: ' . $e->getMessage());
}
}
public function update() {
$input = $this->request->getJSON(true);
if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors($this->validator->getErrors()); }
try {
$id = $this->model->update($input['SpcStaID'], $input);
return $this->respondCreated([ 'status' => 'success', 'message' => "data $id updated successfully" ]);
} catch (\Exception $e) {
return $this->failServerError('Something went wrong: ' . $e->getMessage());
}
}
}

View File

@ -1,5 +1,5 @@
<?php
namespace App\Controllers\ValueSet;
namespace App\Controllers\Test;
use CodeIgniter\API\ResponseTrait;
use App\Controllers\BaseController;
@ -18,14 +18,13 @@ class TestDef extends BaseController {
}
public function index() {
$param = $this->request->getVar('param');
$rows = $this->model->getValueSetDefs($param);
$rows = $this->model->findAll();
if (empty($rows)) { return $this->respond([ 'status' => 'success', 'message' => "no Data.", 'data' => [] ], 200); }
return $this->respond([ 'status' => 'success', 'message'=> "Data fetched successfully", 'data' => $rows ], 200);
}
public function show($VSetID = null) {
$rows = $this->model->find($VSetID);
public function show($id = null) {
$rows = $this->model->where('TestID',$id)->findAll();
if (empty($rows)) { return $this->respond([ 'status' => 'success', 'message' => "no Data.", 'data' => [] ], 200); }
return $this->respond([ 'status' => 'success', 'message'=> "Data fetched successfully", 'data' => $rows ], 200);
}
@ -34,8 +33,8 @@ class TestDef extends BaseController {
$input = $this->request->getJSON(true);
if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors($this->validator->getErrors()); }
try {
$VSetID = $this->model->insert($input);
return $this->respondCreated([ 'status' => 'success', 'message' => "data $VSetID created successfully" ]);
$id = $this->model->insert($input);
return $this->respondCreated([ 'status' => 'success', 'message' => "data $id created successfully" ]);
} catch (\Exception $e) {
return $this->failServerError('Something went wrong: ' . $e->getMessage());
}
@ -43,27 +42,15 @@ class TestDef extends BaseController {
public function update() {
$input = $this->request->getJSON(true);
$VSetID = $input["VID"];
if (!$VSetID) { return $this->failValidationErrors('VSetID is required.'); }
$id = $input["TestID"];
if (!$id) { return $this->failValidationErrors('TestID is required.'); }
if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors( $this->validator->getErrors() ); }
try {
$this->model->update($VSetID,$input);
return $this->respondCreated([ 'status' => 'success', 'message' => "data $VSetID updated successfully" ]);
$this->model->update($id,$input);
return $this->respondCreated([ 'status' => 'success', 'message' => "data $id updated successfully" ]);
} catch (\Exception $e) {
return $this->failServerError('Something went wrong: ' . $e->getMessage());
}
}
public function delete() {
$input = $this->request->getJSON(true);
$VSetID = $input['VSetID'];
if (!$VSetID) { return $this->failValidationErrors('VSetID is required.'); }
try {
$this->model->delete($VSetID);
return $this->respondDeleted(['status' => 'success', 'message' => "Data $VSetID deleted successfully."]);
} catch (\Throwable $e) {
return $this->failServerError('Something went wrong: ' . $e->getMessage());
}
}
}

View File

@ -0,0 +1,56 @@
<?php
namespace App\Controllers\Test;
use CodeIgniter\API\ResponseTrait;
use App\Controllers\BaseController;
use App\Models\Test\TestDefCalModel;
class TestDefCal extends BaseController {
use ResponseTrait;
protected $db;
protected $rules;
protected $model;
public function __construct() {
$this->db = \Config\Database::connect();
$this->model = new TestDefCalModel;
}
public function index() {
$rows = $this->model->findAll();
if (empty($rows)) { return $this->respond([ 'status' => 'success', 'message' => "no Data.", 'data' => [] ], 200); }
return $this->respond([ 'status' => 'success', 'message'=> "Data fetched successfully", 'data' => $rows ], 200);
}
public function show($id = null) {
$rows = $this->model->where('TestCalID',$id)->findAll();
if (empty($rows)) { return $this->respond([ 'status' => 'success', 'message' => "no Data.", 'data' => [] ], 200); }
return $this->respond([ 'status' => 'success', 'message'=> "Data fetched successfully", 'data' => $rows ], 200);
}
public function create() {
$input = $this->request->getJSON(true);
if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors($this->validator->getErrors()); }
try {
$id = $this->model->insert($input);
return $this->respondCreated([ 'status' => 'success', 'message' => "data $id created successfully" ]);
} catch (\Exception $e) {
return $this->failServerError('Something went wrong: ' . $e->getMessage());
}
}
public function update() {
$input = $this->request->getJSON(true);
$id = $input["TestCalID"];
if (!$id) { return $this->failValidationErrors('TestCalID is required.'); }
if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors( $this->validator->getErrors() ); }
try {
$this->model->update($id,$input);
return $this->respondCreated([ 'status' => 'success', 'message' => "data $id updated successfully" ]);
} catch (\Exception $e) {
return $this->failServerError('Something went wrong: ' . $e->getMessage());
}
}
}

View File

@ -0,0 +1,56 @@
<?php
namespace App\Controllers\Test;
use CodeIgniter\API\ResponseTrait;
use App\Controllers\BaseController;
use App\Models\Test\TestDefSiteModel;
class TestDefSite extends BaseController {
use ResponseTrait;
protected $db;
protected $rules;
protected $model;
public function __construct() {
$this->db = \Config\Database::connect();
$this->model = new TestDefSiteModel;
}
public function index() {
$rows = $this->model->findAll();
if (empty($rows)) { return $this->respond([ 'status' => 'success', 'message' => "no Data.", 'data' => [] ], 200); }
return $this->respond([ 'status' => 'success', 'message'=> "Data fetched successfully", 'data' => $rows ], 200);
}
public function show($id = null) {
$rows = $this->model->where('TestSiteID',$id)->findAll();
if (empty($rows)) { return $this->respond([ 'status' => 'success', 'message' => "no Data.", 'data' => [] ], 200); }
return $this->respond([ 'status' => 'success', 'message'=> "Data fetched successfully", 'data' => $rows ], 200);
}
public function create() {
$input = $this->request->getJSON(true);
if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors($this->validator->getErrors()); }
try {
$id = $this->model->insert($input);
return $this->respondCreated([ 'status' => 'success', 'message' => "data $id created successfully" ]);
} catch (\Exception $e) {
return $this->failServerError('Something went wrong: ' . $e->getMessage());
}
}
public function update() {
$input = $this->request->getJSON(true);
$id = $input["TestSiteID"];
if (!$id) { return $this->failValidationErrors('TestSiteID is required.'); }
if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors( $this->validator->getErrors() ); }
try {
$this->model->update($id,$input);
return $this->respondCreated([ 'status' => 'success', 'message' => "data $id updated successfully" ]);
} catch (\Exception $e) {
return $this->failServerError('Something went wrong: ' . $e->getMessage());
}
}
}

View File

@ -0,0 +1,56 @@
<?php
namespace App\Controllers\Test;
use CodeIgniter\API\ResponseTrait;
use App\Controllers\BaseController;
use App\Models\Test\TestDefTechModel;
class TestDefTech extends BaseController {
use ResponseTrait;
protected $db;
protected $rules;
protected $model;
public function __construct() {
$this->db = \Config\Database::connect();
$this->model = new TestDefTechModel;
}
public function index() {
$rows = $this->model->findAll();
if (empty($rows)) { return $this->respond([ 'status' => 'success', 'message' => "no Data.", 'data' => [] ], 200); }
return $this->respond([ 'status' => 'success', 'message'=> "Data fetched successfully", 'data' => $rows ], 200);
}
public function show($id = null) {
$rows = $this->model->where('TestTechID',$id)->findAll();
if (empty($rows)) { return $this->respond([ 'status' => 'success', 'message' => "no Data.", 'data' => [] ], 200); }
return $this->respond([ 'status' => 'success', 'message'=> "Data fetched successfully", 'data' => $rows ], 200);
}
public function create() {
$input = $this->request->getJSON(true);
if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors($this->validator->getErrors()); }
try {
$id = $this->model->insert($input);
return $this->respondCreated([ 'status' => 'success', 'message' => "data $id created successfully" ]);
} catch (\Exception $e) {
return $this->failServerError('Something went wrong: ' . $e->getMessage());
}
}
public function update() {
$input = $this->request->getJSON(true);
$id = $input["TestTechID"];
if (!$id) { return $this->failValidationErrors('TestTechID is required.'); }
if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors( $this->validator->getErrors() ); }
try {
$this->model->update($id,$input);
return $this->respondCreated([ 'status' => 'success', 'message' => "data $id updated successfully" ]);
} catch (\Exception $e) {
return $this->failServerError('Something went wrong: ' . $e->getMessage());
}
}
}

View File

@ -0,0 +1,56 @@
<?php
namespace App\Controllers\Test;
use CodeIgniter\API\ResponseTrait;
use App\Controllers\BaseController;
use App\Models\Test\TestGrpModel;
class TestGrp extends BaseController {
use ResponseTrait;
protected $db;
protected $rules;
protected $model;
public function __construct() {
$this->db = \Config\Database::connect();
$this->model = new TestGrpModel;
}
public function index() {
$rows = $this->model->findAll();
if (empty($rows)) { return $this->respond([ 'status' => 'success', 'message' => "no Data.", 'data' => [] ], 200); }
return $this->respond([ 'status' => 'success', 'message'=> "Data fetched successfully", 'data' => $rows ], 200);
}
public function show($id = null) {
$rows = $this->model->where('TestGrpID',$id)->findAll();
if (empty($rows)) { return $this->respond([ 'status' => 'success', 'message' => "no Data.", 'data' => [] ], 200); }
return $this->respond([ 'status' => 'success', 'message'=> "Data fetched successfully", 'data' => $rows ], 200);
}
public function create() {
$input = $this->request->getJSON(true);
if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors($this->validator->getErrors()); }
try {
$id = $this->model->insert($input);
return $this->respondCreated([ 'status' => 'success', 'message' => "data $id created successfully" ]);
} catch (\Exception $e) {
return $this->failServerError('Something went wrong: ' . $e->getMessage());
}
}
public function update() {
$input = $this->request->getJSON(true);
$id = $input["TestGrpID"];
if (!$id) { return $this->failValidationErrors('TestGrpID is required.'); }
if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors( $this->validator->getErrors() ); }
try {
$this->model->update($id,$input);
return $this->respondCreated([ 'status' => 'success', 'message' => "data $id updated successfully" ]);
} catch (\Exception $e) {
return $this->failServerError('Something went wrong: ' . $e->getMessage());
}
}
}

View File

@ -0,0 +1,56 @@
<?php
namespace App\Controllers\Test;
use CodeIgniter\API\ResponseTrait;
use App\Controllers\BaseController;
use App\Models\Test\TestMapModel;
class TestMap extends BaseController {
use ResponseTrait;
protected $db;
protected $rules;
protected $model;
public function __construct() {
$this->db = \Config\Database::connect();
$this->model = new TestMapModel;
}
public function index() {
$rows = $this->model->findAll();
if (empty($rows)) { return $this->respond([ 'status' => 'success', 'message' => "no Data.", 'data' => [] ], 200); }
return $this->respond([ 'status' => 'success', 'message'=> "Data fetched successfully", 'data' => $rows ], 200);
}
public function show($id = null) {
$rows = $this->model->where('TestMapID',$id)->findAll();
if (empty($rows)) { return $this->respond([ 'status' => 'success', 'message' => "no Data.", 'data' => [] ], 200); }
return $this->respond([ 'status' => 'success', 'message'=> "Data fetched successfully", 'data' => $rows ], 200);
}
public function create() {
$input = $this->request->getJSON(true);
if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors($this->validator->getErrors()); }
try {
$id = $this->model->insert($input);
return $this->respondCreated([ 'status' => 'success', 'message' => "data $id created successfully" ]);
} catch (\Exception $e) {
return $this->failServerError('Something went wrong: ' . $e->getMessage());
}
}
public function update() {
$input = $this->request->getJSON(true);
$id = $input["TestMapID"];
if (!$id) { return $this->failValidationErrors('TestMapID is required.'); }
if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors( $this->validator->getErrors() ); }
try {
$this->model->update($id,$input);
return $this->respondCreated([ 'status' => 'success', 'message' => "data $id updated successfully" ]);
} catch (\Exception $e) {
return $this->failServerError('Something went wrong: ' . $e->getMessage());
}
}
}

View File

@ -39,18 +39,19 @@ class CreatePVTables extends Migration {
// patvisitadt
$this->forge->addField([
'PVADTID' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true],
'InternalPVID'=> ['type' => 'INT', 'constraint' => 11, 'null' => true],
'ADTCode' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
'LocationID' => ['type' => 'INT', 'constraint' => 11, 'null' => true],
'AttDoc' => ['type' => 'INT', 'constraint' => 11, 'null' => true],
'RefDoc' => ['type' => 'INT', 'constraint' => 11, 'null' => true],
'AdmDoc' => ['type' => 'INT', 'constraint' => 11, 'null' => true],
'CnsDoc' => ['type' => 'INT', 'constraint' => 11, 'null' => true],
'PVADTID' => ['type' => 'INT', 'unsigned' => true, 'auto_increment' => true],
'InternalPVID'=> ['type' => 'INT', 'null' => true],
'Sequence' => ['type' => 'INT', 'null' => true],
'ADTCode' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
'LocationID' => ['type' => 'INT', 'constraint' => 11, 'null' => true],
'AttDoc' => ['type' => 'INT', 'constraint' => 11, 'null' => true],
'RefDoc' => ['type' => 'INT', 'constraint' => 11, 'null' => true],
'AdmDoc' => ['type' => 'INT', 'constraint' => 11, 'null' => true],
'CnsDoc' => ['type' => 'INT', 'constraint' => 11, 'null' => true],
'CreateDate' => ['type' => 'DATETIME', 'null' => true],
'EndDate' => ['type' => 'DATETIME', 'null' => true],
'EndDate' => ['type' => 'DATETIME', 'null' => true],
'ArchivedDate'=> ['type' => 'DATETIME', 'null' => true],
'DelDate' => ['type' => 'DATETIME', 'null' => true],
'DelDate' => ['type' => 'DATETIME', 'null' => true],
]);
$this->forge->addKey('PVADTID', true);
$this->forge->createTable('patvisitadt');

View File

@ -29,7 +29,7 @@ class CreateSpecimenTable extends Migration {
'SiteID' => ['type' => 'INT', 'null' => true],
'OrderID' => ['type' => 'INT', 'null' => true],
'ConDefID' => ['type' => 'INT', 'null' => true],
'Parent' => ['type' => 'int', 'null' => true],
'Parent' => ['type' => 'varchar', 'constraint' => 30, 'null' => true],
'Qty' => ['type' => 'INT', 'null' => true],
'Unit' => ['type' => 'varchar', 'constraint'=> 30, 'null' => true],
'GenerateBy' => ['type' => 'int', 'null' => true],
@ -40,11 +40,12 @@ class CreateSpecimenTable extends Migration {
]);
$this->forge->addKey('InternalSID', true);
$this->forge->addUniqueKey('SID');
$this->forge->createTable('specimens');
$this->forge->createTable('specimen');
$this->forge->addField([
'SpcStaID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
'SID' => ['type' => 'VARCHAR', 'constraint' => 30, 'null' => false],
'OrderID' => ['type' => 'int', 'null' => false],
'SpcAct' => ['type' => 'varchar', 'constraint' => 15, 'null' => true],
'ActRes' => ['type' => 'INT', 'null' => true],
'SpcStatus' => ['type' => 'int', 'null' => true],
@ -59,6 +60,7 @@ class CreateSpecimenTable extends Migration {
'GeoLocationData' => ['type' => 'varchar', 'constraint'=>10, 'null' => true ],
'DIDType' => ['type' => 'varchar', 'constraint'=>10, 'null' => true ],
'DID' => ['type' => 'varchar', 'constraint'=>10, 'null' => true ],
'UserID' => ['type' => 'int', 'null' => true ],
'CreateDate' => ['type' => 'Datetime', 'null' => true],
'EndDate' => ['type' => 'DATETIME', 'null' => true],
'ArchiveDate' => ['type' => 'DATETIME', 'null' => true]
@ -69,9 +71,9 @@ class CreateSpecimenTable extends Migration {
$this->forge->addField([
'SpcColID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
'SpcStaID' => ['type' => 'INT', 'unsigned' => true],
'SpcRole' => ['type' => 'varchar', 'constraint' => 15, 'null' => true],
'ColMethod' => ['type' => 'varchar', 'constraint' => 15, 'null' => true],
'BodySite' => ['type' => 'varchar', 'constraint' => 15, 'null' => true],
'SpcRole' => ['type' => 'int', 'null' => true],
'ColMethod' => ['type' => 'int', 'null' => true],
'BodySite' => ['type' => 'int', 'null' => true],
'CntSize' => ['type' => 'INT', 'null' => true],
'FastingVolume' => ['type' => 'varchar', 'constraint'=> 2, 'null' => true],
'ColStart' => ['type' => 'datetime', 'null' => true],
@ -87,10 +89,10 @@ class CreateSpecimenTable extends Migration {
'SpcPrpID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
'SpcStaID' => ['type' => 'INT', 'unsigned' => true],
'Description' => ['type' => 'varchar', 'constraint' => 150, 'null' => true],
'Method' => ['type' => 'varchar', 'constraint' => 15, 'null' => true],
'Additive' => ['type' => 'varchar', 'constraint' => 15, 'null' => true],
'Method' => ['type' => 'int', 'null' => true],
'Additive' => ['type' => 'int', 'null' => true],
'AddQty' => ['type' => 'float', 'null' => true],
'AddUnit' => ['type' => 'varchar', 'constraint'=> 15, 'null' => true],
'AddUnit' => ['type' => 'int', 'null' => true],
'PrepStart' => ['type' => 'datetime', 'null' => true],
'PrepEnd' => ['type' => 'datetime', 'null' => true],
'CreateDate' => ['type' => 'Datetime', 'null' => true],

View File

@ -8,7 +8,7 @@ class CreateTestsTable extends Migration {
public function up() {
$this->forge->addField([
'TestID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
'ParentTest' => ['type' => 'INT', 'null' => true],
'Parent' => ['type' => 'INT', 'null' => true],
'TestCode' => ['type' => 'VARCHAR', 'constraint'=> 6, 'null' => false],
'TestName' => ['type' => 'varchar', 'constraint'=> 50, 'null' => false],
'Description' => ['type' => 'VARCHAR', 'constraint'=> 150, 'null' => false],
@ -27,7 +27,7 @@ class CreateTestsTable extends Migration {
'SiteID' => ['type' => 'INT', 'null' => false],
'TestSiteCode' => ['type' => 'varchar', 'constraint'=> 6, 'null' => false],
'TestSiteName' => ['type' => 'varchar', 'constraint'=> 50, 'null' => false],
'Type' => ['type' => 'int', 'null' => false],
'Type' => ['type' => 'int', 'null' => false],
'Description' => ['type' => 'varchar', 'constraint'=> 150, 'null' => true],
'SeqScr' => ['type' => 'int', 'null' => false],
'SeqRpt' => ['type' => 'int', 'null' => false],
@ -57,11 +57,7 @@ class CreateTestsTable extends Migration {
'Factor' => ['type' => 'int', 'null' => true],
'Unit2' => ['type' => 'varchar', 'constraint'=>20, 'null' => true],
'Decimal' => ['type' => 'int', 'null' => true],
'Collreq' => ['type' => 'varchar', 'constraint'=>50, 'null' => true],
'ConDefID' => ['type' => 'int', 'null' => true],
'TestTechCode' => ['type' => 'varchar', 'constraint'=>6, 'null' => true],
'TestTechAbb' => ['type' => 'varchar', 'constraint'=>50, 'null' => true],
'TestTechName' => ['type' => 'varchar', 'constraint'=>150, 'null' => true],
'CollReq' => ['type' => 'varchar', 'constraint'=>50, 'null' => true],
'Method' => ['type' => 'varchar', 'constraint'=>50, 'null' => true],
'ExpectedTAT' => ['type' => 'INT', 'null' => true],
'CreateDate' => ['type' => 'Datetime', 'null' => true],
@ -74,8 +70,9 @@ class CreateTestsTable extends Migration {
'TestCalID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
'SiteID' => ['type' => 'INT', 'null' => true],
'TestSiteID' => ['type' => 'INT', 'null' => true],
'DisciplineID' => ['type' => 'INT', 'null' => true],
'DepartmentID' => ['type' => 'INT', 'null' => true],
'FormulaCode' => ['type' => 'varchar', 'constraint'=>150, 'null' => true],
'FormulaLang' => ['type' => 'varchar', 'constraint'=>20, 'null' => true],
'FormulaInput' => ['type' => 'varchar', 'constraint'=>20, 'null' => true],
'Unit1' => ['type' => 'varchar', 'constraint'=>20, 'null' => true],
'Factor' => ['type' => 'int', 'null' => true],
@ -98,6 +95,22 @@ class CreateTestsTable extends Migration {
$this->forge->addKey('TestGrpID', true);
$this->forge->createTable('testgrp');
$this->forge->addField([
'TestMapID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
'HostType' => ['type' => 'int', 'null' => true],
'HostID' => ['type' => 'int', 'null' => true],
'HostDataSource' => ['type' => 'varchar', 'constraint'=>50, 'null' => true],
'HostTestCode' => ['type' => 'varchar', 'constraint'=>10, 'null' => true],
'HostTestName' => ['type' => 'varchar', 'constraint'=>50, 'null' => true],
'ClientType' => ['type' => 'int', 'null' => true],
'ClientID' => ['type' => 'int', 'null' => true],
'ClientTestCode' => ['type' => 'varchar', 'constraint'=>10, 'null' => true],
'ClientTestName' => ['type' => 'varchar', 'constraint'=>50, 'null' => true],
'CreateDate' => ['type' => 'Datetime', 'null' => true],
'EndDate' => ['type' => 'Datetime', 'null' => true]
]);
$this->forge->addKey('TestMapID', true);
$this->forge->createTable('testmap');
}
public function down() {
@ -106,5 +119,6 @@ class CreateTestsTable extends Migration {
$this->forge->dropTable('testdeftech');
$this->forge->dropTable('testdefcal');
$this->forge->dropTable('testgrp');
$this->forge->dropTable('testmap');
}
}

View File

@ -6,8 +6,11 @@ use CodeIgniter\Database\Seeder;
class DummySeeder extends Seeder {
protected array $map = [];
public function run() {
$now = date('Y-m-d H:i:s');
// location
$data = [
['LocationID'=>1, 'LocCode'=>'QLOC', 'LocFull'=>'Dummy Location', 'LocType'=>'ROOM', 'Description'=>'Location made for dummy testing', 'CreateDate'=> "$now" ],
@ -52,17 +55,13 @@ class DummySeeder extends Seeder {
// patient
$data = [
[ 'InternalPID'=>1, 'PatientID'=>'SMAJ1', 'NameFirst'=>'Dummy', 'NameLast' => 'Patient M', 'Gender'=>'6', 'BirthDate'=>'1991-09-09', 'Street_1'=>'Makati', 'EmailAddress1'=>'smaj1@5panda.id',
'Province'=>'1', 'City'=>'37', 'Country'=>'325', 'Race'=>'175', 'Religion'=>'207', 'Ethnic'=>'218', 'DeathIndicator' => '16', 'CreateDate'=> "$now"],
[ 'InternalPID'=>2, 'PatientID'=>'SMAJ2', 'NameFirst'=>'Dummy', 'NameLast' => 'Patient F', 'Gender'=>'6', 'BirthDate'=>'1997-02-02', 'Street_1'=>'Manila', 'EmailAddress1'=>'smaj2@5panda.id',
'Province'=>'2', 'City'=>'60', 'Country'=>'325', 'Race'=>'176', 'Religion'=>'206', 'Ethnic'=>'219', 'DeathIndicator' => '16', 'CreateDate'=> "$now"],
[ 'InternalPID'=>3, 'PatientID'=>'SMAJ3', 'NameFirst'=>'Dummy', 'NameLast' => 'Patient L', 'Gender'=>'6', 'BirthDate'=>'1997-02-02', 'Street_1'=>'Manila', 'EmailAddress1'=>'smaj3@5panda.id',
'Province'=>'3', 'City'=>'103', 'Country'=>'325', 'Race'=>'176', 'Religion'=>'206', 'Ethnic'=>'219', 'DeathIndicator' => '16', 'CreateDate'=> "$now"]
[ 'InternalPID'=>1, 'PatientID'=>'SMAJ1', 'NameFirst'=>'Dummy', 'NameLast' => 'Patient M', 'BirthDate'=>'1991-09-09', 'Street_1'=>'Makati', 'EmailAddress1'=>'smaj1@5panda.id', 'CreateDate'=> "$now"],
[ 'InternalPID'=>2, 'PatientID'=>'SMAJ2', 'NameFirst'=>'Dummy', 'NameLast' => 'Patient F', 'BirthDate'=>'1997-02-02', 'Street_1'=>'Manila', 'EmailAddress1'=>'smaj2@5panda.id', 'CreateDate'=> "$now"],
[ 'InternalPID'=>3, 'PatientID'=>'SMAJ3', 'NameFirst'=>'Dummy', 'NameLast' => 'Patient L', 'BirthDate'=>'1997-02-02', 'Street_1'=>'Manila', 'EmailAddress1'=>'smaj3@5panda.id', 'CreateDate'=> "$now"]
];
$this->db->table('patient')->insertBatch($data);
$data = [
[ 'InternalPID'=>1, 'IdentifierType'=>'KTP', 'Identifier'=>'9901', 'CreateDate'=> "$now" ],
// [ 'InternalPID'=>2, 'IdentifierType'=>'KTP', 'Identifier'=>'9902', 'CreateDate'=> "$now" ],
[ 'InternalPID'=>3, 'IdentifierType'=>'KTP', 'Identifier'=>'9903', 'CreateDate'=> "$now" ]
];
$this->db->table('patidt')->insertBatch($data);
@ -76,13 +75,30 @@ class DummySeeder extends Seeder {
];
$this->db->table('patatt')->insertBatch($data);
// patvisit
$data = [
['InternalPVID'=>1, "PVID"=>"XLAB0001", "InternalPID"=>1, "EpisodeID"=>1, "CreateDate"=>"$now"],
['InternalPVID'=>2, "PVID"=>"XLAB0002", "InternalPID"=>1, "EpisodeID"=>1, "CreateDate"=>"$now"],
];
$this->db->table('patvisit')->insertBatch($data);
$data = [
['InternalPVID'=>1, "Sequence"=>1, "ADTCode"=>"X01", "LocationID"=>1, "AttDoc"=>null, "CreateDate"=>"$now"],
['InternalPVID'=>1, "Sequence"=>2, "ADTCode"=>"X02", "LocationID"=>null, "AttDoc"=>1, "CreateDate"=>"$now"],
['InternalPVID'=>1, "Sequence"=>3, "ADTCode"=>"X01", "LocationID"=>2, "AttDoc"=>null, "CreateDate"=>"$now"],
['InternalPVID'=>1, "Sequence"=>4, "ADTCode"=>"X02", "LocationID"=>null, "AttDoc"=>2, "CreateDate"=>"$now"],
['InternalPVID'=>2, "Sequence"=>1, "ADTCode"=>"X01", "LocationID"=>1, "AttDoc"=>null, "CreateDate"=>"$now"],
['InternalPVID'=>2, "Sequence"=>2, "ADTCode"=>"X02", "LocationID"=>null, "AttDoc"=>1, "CreateDate"=>"$now"],
['InternalPVID'=>2, "Sequence"=>3, "ADTCode"=>"X01", "LocationID"=>2, "AttDoc"=>null, "CreateDate"=>"$now"],
['InternalPVID'=>2, "Sequence"=>4, "ADTCode"=>"X02", "LocationID"=>null, "AttDoc"=>2, "CreateDate"=>"$now"],
];
$this->db->table('patvisitadt')->insertBatch($data);
// Organization
$data = [
[ 'AccountID' => 1, 'Parent' => null, 'AccountName' => 'Dummy Account', 'Initial'=>'QAC', 'Street_1'=>'Dummy Address', 'City'=>'194', 'Province'=>'11', 'ZIP'=>'505', 'Country'=>'325', 'AreaCode'=>'', 'EmailAddress1'=>'dummy@summit.co.id', 'Phone'=>'092029', 'Fax'=>'092029', 'CreateDate' => "$now" ],
[ 'AccountID' => 2, 'Parent' => null, 'AccountName' => 'Dummy Account', 'Initial'=>'QAC', 'Street_1'=>'Dummy Address', 'City'=>'189', 'Province'=>'11', 'ZIP'=>'505', 'Country'=>'325', 'AreaCode'=>'', 'EmailAddress1'=>'dummy@summit.co.id', 'Phone'=>'092029', 'Fax'=>'092029', 'CreateDate' => "$now" ],
[ 'AccountID' => 3, 'Parent' => null, 'AccountName' => 'Dummy Account', 'Initial'=>'QAC', 'Street_1'=>'Dummy Address', 'City'=>'194', 'Province'=>'11', 'ZIP'=>'505', 'Country'=>'325', 'AreaCode'=>'', 'EmailAddress1'=>'dummy@summit.co.id', 'Phone'=>'092029', 'Fax'=>'092029', 'CreateDate' => "$now" ]
[ 'AccountID' => 1, 'Parent' => null, 'AccountName' => 'Dummy Account', 'Initial'=>'QAC', 'Street_1'=>'Dummy Address', 'EmailAddress1'=>'dummy@summit.co.id', 'Phone'=>'092029', 'Fax'=>'092029', 'CreateDate' => "$now" ],
[ 'AccountID' => 2, 'Parent' => null, 'AccountName' => 'Dummy Account', 'Initial'=>'QAC', 'Street_1'=>'Dummy Address', 'EmailAddress1'=>'dummy@summit.co.id', 'Phone'=>'092029', 'Fax'=>'092029', 'CreateDate' => "$now" ],
[ 'AccountID' => 3, 'Parent' => null, 'AccountName' => 'Dummy Account', 'Initial'=>'QAC', 'Street_1'=>'Dummy Address', 'EmailAddress1'=>'dummy@summit.co.id', 'Phone'=>'092029', 'Fax'=>'092029', 'CreateDate' => "$now" ]
];
$this->db->table('account')->insertBatch($data);

View File

@ -6,7 +6,7 @@ use App\Models\BaseModel;
class PatVisitADTModel extends BaseModel {
protected $table = 'patvisitadt';
protected $primaryKey = 'PVADTID';
protected $allowedFields = ['InternalPVID', 'ADTCode', 'LocationID', 'AttDoc', 'RefDoc', 'AdmDoc', 'CnsDoc',
protected $allowedFields = ['InternalPVID', 'Sequence', 'ADTCode', 'LocationID', 'AttDoc', 'RefDoc', 'AdmDoc', 'CnsDoc',
'CreateDate', 'EndDate', 'ArchivedDate', 'DelDate'];
protected $visnum_prefix;

View File

@ -20,7 +20,7 @@ class PatVisitModel extends BaseModel {
protected $visnum_prefix = "DV";
public function show($PVID) {
$rows = $this->select("*, patvisit.CreateDate as PVCreateDate, patdiag.CreateDate as PDCreateDate, patvisitadt.CreateDate as PVACreateDate")
$rows = $this->select("*, patvisit.InternalPID, patvisit.CreateDate as PVCreateDate, patdiag.CreateDate as PDCreateDate, patvisitadt.CreateDate as PVACreateDate")
->join('patdiag', 'patdiag.InternalPVID=patvisit.InternalPVID and patdiag.DelDate is null', 'left')
->join('patvisitadt', 'patvisitadt.InternalPVID=patvisit.InternalPVID', 'left')
->where('patvisit.PVID',$PVID)->findAll();
@ -28,7 +28,7 @@ class PatVisitModel extends BaseModel {
}
public function showByPatient($InternalPID) {
$rows = $this->select("*, patvisit.CreateDate as PVCreateDate, patdiag.CreateDate as PDCreateDate, patvisitadt.CreateDate as PVACreateDate")
$rows = $this->select("*, patvisit.InternalPID, patvisit.CreateDate as PVCreateDate, patdiag.CreateDate as PDCreateDate, patvisitadt.CreateDate as PVACreateDate")
->join('patdiag', 'patdiag.InternalPVID=patvisit.InternalPVID and patdiag.DelDate is null', 'left')
->join('(SELECT a1.*
FROM patvisitadt a1
@ -108,7 +108,7 @@ class PatVisitModel extends BaseModel {
$tmp = $modelPD->insert($input['PatDiag']);
}
}
if ($tmp === false) {
if (isset($tmp) && $tmp === false) {
$error = $db->error();
throw new \Exception("Failed to update PatDiag record. ". $error['message']);
}

View File

@ -14,11 +14,6 @@ class ContainerDefModel extends BaseModel {
protected $useSoftDeletes = true;
protected $deletedField = 'EndDate';
protected $beforeInsert = ['normalizeDatesToUTC'];
protected $beforeUpdate = ['normalizeDatesToUTC'];
protected $afterFind = ['convertDatesToUTCISO'];
protected $afterInsert = ['convertDatesToUTCISO'];
protected $afterUpdate = ['convertDatesToUTCISO'];
public function getContainer($ConDefID) {
$rows = $this->select('containerdef.*, vscol.VValue as ColorTxt, vscla.VValue as ConClassTxt, vsadd.VValue as AdditiveTxt')

View File

@ -0,0 +1,18 @@
<?php
namespace App\Models\Specimen;
use App\Models\BaseModel;
class SpecimenCollectionModel extends BaseModel {
protected $table = 'specimencollection';
protected $primaryKey = 'SpcColID';
protected $allowedFields = ['SpcColID', 'SpcStaID', 'SpRole', 'ColMethod', 'BodySite', 'CntSize', 'FastingVolume',
'ColStart', 'ColEnd', 'CreateDate', 'EndDate', 'ArchiveDate'];
protected $useTimestamps = true;
protected $createdField = 'CreateDate';
protected $updatedField = '';
protected $useSoftDeletes = true;
protected $deletedField = 'EndDate';
}

View File

@ -0,0 +1,16 @@
<?php
namespace App\Models\Specimen;
use App\Models\BaseModel;
class SpecimenPrepModel extends BaseModel {
protected $table = 'specimenprep';
protected $primaryKey = 'SpcPrpID';
protected $allowedFields = ['SpcStaID', 'Description', 'Method', 'Additive', 'AddQty', 'AddUnit', 'PrepStart', 'PrepEnd', 'CreateDate', 'EndDate', 'ArchiveDate'];
protected $useTimestamps = true;
protected $createdField = 'CreateDate';
protected $updatedField = '';
protected $useSoftDeletes = true;
protected $deletedField = 'EndDate';
}

View File

@ -0,0 +1,18 @@
<?php
namespace App\Models\Specimen;
use App\Models\BaseModel;
class SpecimenModel extends BaseModel {
protected $table = 'specimen';
protected $primaryKey = 'InternalSID';
protected $allowedFields = ['SID', 'SiteID', 'OrderID', 'ConDefID', 'Parent', 'Qty', 'Unit', 'GenerateBy',
'SchDateTime','CreateDate', 'EndDate', 'ArchiveDate'];
protected $useTimestamps = true;
protected $createdField = 'CreateDate';
protected $updatedField = '';
protected $useSoftDeletes = true;
protected $deletedField = 'EndDate';
}

View File

@ -0,0 +1,17 @@
<?php
namespace App\Models\Specimen;
use App\Models\BaseModel;
class SpecimenPrepModel extends BaseModel {
protected $table = 'specimenprep';
protected $primaryKey = 'SpcPrpID';
protected $allowedFields = ['SpcStaID', 'Description', 'Method', 'Additive', 'AddQty', 'AddUnit', 'PrepStart', 'PrepEnd', 'CreateDate', 'EndDate', 'ArchiveDate'];
protected $useTimestamps = true;
protected $createdField = 'CreateDate';
protected $updatedField = '';
protected $useSoftDeletes = true;
protected $deletedField = 'EndDate';
}

View File

@ -0,0 +1,18 @@
<?php
namespace App\Models\Specimen;
use App\Models\BaseModel;
class SpecimenStatusModel extends BaseModel {
protected $table = 'specimenstatus';
protected $primaryKey = 'SpcStaID';
protected $allowedFields = ['SID', 'OrderID', 'SpcAct', 'ActRes', 'SpcStatus', 'Qty', 'Unit', 'SpcCon', 'Comment', 'CurrSiteID', 'CurrLocID', 'Origin',
'GeoLocationSystem', 'GeoLocationData', 'DIDType', 'DID', 'UserID', 'CreateDate', 'EndDate', 'ArchiveDate'];
protected $useTimestamps = true;
protected $createdField = 'CreateDate';
protected $updatedField = '';
protected $useSoftDeletes = true;
protected $deletedField = 'EndDate';
}

View File

@ -7,7 +7,7 @@ use App\Models\BaseModel;
class TestDefCalModel extends BaseModel {
protected $table = 'testdefcal';
protected $primaryKey = 'TestCalID';
protected $allowedFields = ['SiteID', 'TestSiteID', 'FormulaCode', 'FormulaLang', 'FormulaInput',
protected $allowedFields = ['SiteID', 'TestSiteID', 'DisciplineID', 'DepartmentID','FormulaCode', 'FormulaLang', 'FormulaInput',
'Unit1', 'Factor', 'Unit2', 'Decimal' ,'CreateDate', 'EndDate'];
protected $useTimestamps = true;

View File

@ -7,7 +7,7 @@ use App\Models\BaseModel;
class TestDefModel extends BaseModel {
protected $table = 'testdef';
protected $primaryKey = 'TestID';
protected $allowedFields = ['ParentTest', 'TestCode', 'TestName', 'Description', 'DisciplineID',
protected $allowedFields = ['Parent', 'TestCode', 'TestName', 'Description', 'DisciplineID',
'Method', 'Seq', 'CountStat', 'CreateDate', 'EndDate'];
protected $useTimestamps = true;

View File

@ -8,8 +8,7 @@ class TestDefTechModel extends BaseModel {
protected $table = 'testdeftech';
protected $primaryKey = 'TestTechID';
protected $allowedFields = ['SiteID', 'TestSiteID', 'DisciplineID', 'DepartmentID', 'WorkstationID', 'EquipmentID', 'VSet', 'SpcType',
'ReqQty', 'ReqQtyUnit', 'Unit1', 'Factor', 'Unit2', 'Decimal', 'CollReq', 'ConDefID', 'TestTechCode', 'TestTechAbb', 'TestTechName',
'Method', 'ExpectedTAT', 'CreateDate', 'EndDate'];
'ReqQty', 'ReqQtyUnit', 'Unit1', 'Factor', 'Unit2', 'Decimal', 'CollReq', 'Method', 'ExpectedTAT', 'CreateDate', 'EndDate'];
protected $useTimestamps = true;
protected $createdField = 'CreateDate';

View File

@ -0,0 +1,19 @@
<?php
namespace App\Models\Test;
use App\Models\BaseModel;
class TestMapModel extends BaseModel {
protected $table = 'testmap';
protected $primaryKey = 'TestMapID';
protected $allowedFields = ['HostType', 'HostID', 'HostDataSource', 'HostTestCode', 'HostTestName',
'ClientType', 'ClientID', 'ClientTestCode', 'ClientTestName', 'CreateDate', 'EndDate' ];
protected $useTimestamps = true;
protected $createdField = 'CreateDate';
protected $updatedField = '';
protected $useSoftDeletes = true;
protected $deletedField = "EndDate";
}