2025-11-26 16:53:14 +07:00
< ? php
namespace App\Database\Seeds ;
use CodeIgniter\Database\Seeder ;
use App\Models\ValueSet\ValueSetModel ;
class DummyTestSeeder extends Seeder {
protected array $map = [];
public function run () {
$now = date ( 'Y-m-d H:i:s' );
$vsModel = new ValueSetModel ();
$rows = $vsModel -> select ( " VID, VSetID, VValue " ) -> findAll ();
$vs = [];
foreach ( $rows as $row ) {
$vs [ $row [ 'VSetID' ]][ $row [ 'VValue' ]] = $row [ 'VID' ];
}
$data = [ 'SiteID' => '1' , 'TestSiteCode' => 'HB' , 'TestSiteName' => 'Hemoglobin' , 'Type' => $vs [ 27 ][ 'TRang' ], 'Description' => '' , 'SeqScr' => '4' , 'SeqRpt' => '4' , 'VisibleScr' => $vs [ 2 ][ 1 ], 'VisibleRpt' => $vs [ 2 ][ 1 ], 'CountStat' => $vs [ 2 ][ 1 ], 'CreateDate' => " $now " ];
$id = $this -> db -> table ( 'testdefsite' ) -> insert ( $data );
2025-11-27 11:52:39 +07:00
$data = [ 'DisciplineID' => '1' , 'DepartmentID' => '1' , 'VSet' => '' , 'SpcType' => $vs [ 15 ][ 'BLD' ] , 'Unit1' => 'g/dL' , 'Factor' => '' , 'Unit2' => '' , 'Method' => '' , 'CreateDate' => " $now " ];
2025-11-26 16:53:14 +07:00
$data [ 'TestSiteID' ] = $id ;
$this -> db -> table ( 'testdeftech' ) -> insert ( $data );
$data = [ 'SiteID' => '1' , 'TestSiteCode' => 'HCT' , 'TestSiteName' => 'Hematokrit' , 'Type' => $vs [ 27 ][ 'TRang' ], 'Description' => '' , 'SeqScr' => '5' , 'SeqRpt' => '5' , 'VisibleScr' => $vs [ 2 ][ 1 ], 'VisibleRpt' => $vs [ 2 ][ 1 ], 'CountStat' => $vs [ 2 ][ 1 ], 'CreateDate' => " $now " ];
$id = $this -> db -> table ( 'testdefsite' ) -> insert ( $data );
2025-11-27 11:52:39 +07:00
$data = [ 'DisciplineID' => '1' , 'DepartmentID' => '1' , 'VSet' => '' , 'SpcType' => $vs [ 15 ][ 'BLD' ], 'Unit1' => '%' , 'Factor' => '' , 'Unit2' => '' , 'Method' => '' , 'CreateDate' => " $now " ];
2025-11-26 16:53:14 +07:00
$data [ 'TestSiteID' ] = $id ;
$this -> db -> table ( 'testdeftech' ) -> insert ( $data );
$data = [ 'SiteID' => '1' , 'TestSiteCode' => 'ERY' , 'TestSiteName' => 'Eritrosit' , 'Type' => $vs [ 27 ][ 'TRang' ], 'Description' => '' , 'SeqScr' => '6' , 'SeqRpt' => '6' , 'VisibleScr' => $vs [ 2 ][ 1 ], 'VisibleRpt' => $vs [ 2 ][ 1 ], 'CountStat' => $vs [ 2 ][ 1 ], 'CreateDate' => " $now " ];
$id = $this -> db -> table ( 'testdefsite' ) -> insert ( $data );
$data = [ 'DisciplineID' => '1' , 'DepartmentID' => '1' , 'VSet' => '' , 'SpcType' => $vs [ 15 ][ 'BLD' ], 'Unit1' => '10^6/mL' , 'Factor' => '' , 'Unit2' => '' , 'Method' => '' , 'CreateDate' => " $now " ];
$data [ 'TestSiteID' ] = $id ;
$this -> db -> table ( 'testdeftech' ) -> insert ( $data );
$data = [ 'SiteID' => '1' , 'TestSiteCode' => 'MCV' , 'TestSiteName' => 'MCV' , 'Type' => $vs [ 27 ][ 'TRang' ], 'Description' => '' , 'SeqScr' => '8' , 'SeqRpt' => '8' , 'VisibleScr' => $vs [ 2 ][ 1 ], 'VisibleRpt' => $vs [ 2 ][ 1 ], 'CountStat' => $vs [ 2 ][ 1 ], 'CreateDate' => " $now " ];
$this -> db -> table ( 'testdefsite' ) -> insert ( $data );
$data = [ 'SiteID' => '1' , 'TestSiteCode' => 'MCH' , 'TestSiteName' => 'MCH' , 'Type' => $vs [ 27 ][ 'TRang' ], 'Description' => '' , 'SeqScr' => '9' , 'SeqRpt' => '9' , 'VisibleScr' => $vs [ 2 ][ 1 ], 'VisibleRpt' => $vs [ 2 ][ 1 ], 'CountStat' => $vs [ 2 ][ 1 ], 'CreateDate' => " $now " ];
$this -> db -> table ( 'testdefsite' ) -> insert ( $data );
$data = [ 'SiteID' => '1' , 'TestSiteCode' => 'MCHC' , 'TestSiteName' => 'MCHC' , 'Type' => $vs [ 27 ][ 'TRang' ], 'Description' => '' , 'SeqScr' => '10' , 'SeqRpt' => '10' , 'VisibleScr' => $vs [ 2 ][ 1 ], 'VisibleRpt' => $vs [ 2 ][ 1 ], 'CountStat' => $vs [ 2 ][ 1 ], 'CreateDate' => " $now " ];
$this -> db -> table ( 'testdefsite' ) -> insert ( $data );
$data = [ 'SiteID' => '1' , 'TestSiteCode' => 'GLUAR' , 'TestSiteName' => 'Glukosa Sewaktu' , 'Type' => $vs [ 27 ][ 'TThrs' ], 'Description' => '' , 'SeqScr' => '13' , 'SeqRpt' => '13' , 'VisibleScr' => $vs [ 2 ][ 1 ], 'VisibleRpt' => $vs [ 2 ][ 1 ], 'CountStat' => $vs [ 2 ][ 1 ], 'CreateDate' => " $now " ];
$id = $this -> db -> table ( 'testdefsite' ) -> insert ( $data );
$data = [ 'DisciplineID' => '2' , 'DepartmentID' => '3' , 'VSet' => '' , 'SpcType' => $vs [ 15 ][ 'SER' ], 'Unit1' => 'U/L' , 'Factor' => '' , 'Unit2' => '' , 'Method' => 'Hexokinase' , 'CreateDate' => " $now " ];
$data [ 'TestSiteID' ] = $id ;
$this -> db -> table ( 'testdeftech' ) -> insert ( $data );
$data = [ 'SiteID' => '1' , 'TestSiteCode' => 'GLUF' , 'TestSiteName' => 'Glukosa Puasa' , 'Type' => $vs [ 27 ][ 'TThrs' ], 'Description' => '' , 'SeqScr' => '14' , 'SeqRpt' => '14' , 'VisibleScr' => $vs [ 2 ][ 1 ], 'VisibleRpt' => $vs [ 2 ][ 1 ], 'CountStat' => $vs [ 2 ][ 1 ], 'CreateDate' => " $now " ];
$id = $this -> db -> table ( 'testdefsite' ) -> insert ( $data );
$data = [ 'DisciplineID' => '2' , 'DepartmentID' => '3' , 'VSet' => '' , 'SpcType' => $vs [ 15 ][ 'SER' ], 'Unit1' => 'U/L' , 'Factor' => '' , 'Unit2' => '' , 'Method' => 'Hexokinase' , 'CreateDate' => " $now " ];
$data [ 'TestSiteID' ] = $id ;
$this -> db -> table ( 'testdeftech' ) -> insert ( $data );
$data = [ 'SiteID' => '1' , 'TestSiteCode' => 'GLU2HPP' , 'TestSiteName' => 'Glukosa 2 Jam PP' , 'Type' => $vs [ 27 ][ 'TThrs' ], 'Description' => '' , 'SeqScr' => '15' , 'SeqRpt' => '15' , 'VisibleScr' => $vs [ 2 ][ 1 ], 'VisibleRpt' => $vs [ 2 ][ 1 ], 'CountStat' => $vs [ 2 ][ 1 ], 'CreateDate' => " $now " ];
$id = $this -> db -> table ( 'testdefsite' ) -> insert ( $data );
$data = [ 'DisciplineID' => '2' , 'DepartmentID' => '3' , 'VSet' => '' , 'SpcType' => $vs [ 15 ][ 'SER' ], 'Unit1' => 'mg/dL' , 'Factor' => '' , 'Unit2' => '' , 'Method' => 'Hexokinase' , 'CreateDate' => " $now " ];
$data [ 'TestSiteID' ] = $id ;
$this -> db -> table ( 'testdeftech' ) -> insert ( $data );
$data = [ 'SiteID' => '1' , 'TestSiteCode' => 'TC' , 'TestSiteName' => 'Cholesterol Total' , 'Type' => $vs [ 27 ][ 'TThrs' ], 'Description' => '' , 'SeqScr' => '17' , 'SeqRpt' => '17' , 'VisibleScr' => $vs [ 2 ][ 1 ], 'VisibleRpt' => $vs [ 2 ][ 1 ], 'CountStat' => $vs [ 2 ][ 1 ], 'CreateDate' => " $now " ];
$this -> db -> table ( 'testdefsite' ) -> insert ( $data );
$data = [ 'SiteID' => '1' , 'TestSiteCode' => 'LDL' , 'TestSiteName' => 'Cholesterol LDL Direk' , 'Type' => $vs [ 27 ][ 'TThrs' ], 'Description' => '' , 'SeqScr' => '18' , 'SeqRpt' => '18' , 'VisibleScr' => $vs [ 2 ][ 1 ], 'VisibleRpt' => $vs [ 2 ][ 1 ], 'CountStat' => $vs [ 2 ][ 1 ], 'CreateDate' => " $now " ];
$this -> db -> table ( 'testdefsite' ) -> insert ( $data );
$data = [ 'SiteID' => '1' , 'TestSiteCode' => 'HDL' , 'TestSiteName' => 'Cholesterol HDL' , 'Type' => $vs [ 27 ][ 'TThrs' ], 'Description' => '' , 'SeqScr' => '19' , 'SeqRpt' => '19' , 'VisibleScr' => $vs [ 2 ][ 1 ], 'VisibleRpt' => $vs [ 2 ][ 1 ], 'CountStat' => $vs [ 2 ][ 1 ], 'CreateDate' => " $now " ];
$this -> db -> table ( 'testdefsite' ) -> insert ( $data );
$data = [ 'SiteID' => '1' , 'TestSiteCode' => 'TG' , 'TestSiteName' => 'Trigliserida' , 'Type' => $vs [ 27 ][ 'TThrs' ], 'Description' => '' , 'SeqScr' => '20' , 'SeqRpt' => '20' , 'VisibleScr' => $vs [ 2 ][ 1 ], 'VisibleRpt' => $vs [ 2 ][ 1 ], 'CountStat' => $vs [ 2 ][ 1 ], 'CreateDate' => " $now " ];
$this -> db -> table ( 'testdefsite' ) -> insert ( $data );
$data = [ 'SiteID' => '1' , 'TestSiteCode' => 'SGOT' , 'TestSiteName' => 'Aspartate Aminotransferase' , 'Type' => $vs [ 27 ][ 'TThrs' ], 'Description' => '' , 'SeqScr' => '23' , 'SeqRpt' => '23' , 'VisibleScr' => $vs [ 2 ][ 1 ], 'VisibleRpt' => $vs [ 2 ][ 1 ], 'CountStat' => $vs [ 2 ][ 1 ], 'CreateDate' => " $now " ];
$id = $this -> db -> table ( 'testdefsite' ) -> insert ( $data );
2025-11-27 11:52:39 +07:00
$data = [ 'DisciplineID' => '2' , 'DepartmentID' => '3' , 'VSet' => '' , 'SpcType' => $vs [ 15 ][ 'SER' ], 'Unit1' => 'mg/dL' , 'Factor' => '0.017' , 'Unit2' => 'mkat/L' , 'Method' => 'IFCC' , 'CreateDate' => " $now " ];
2025-11-26 16:53:14 +07:00
$data [ 'TestSiteID' ] = $id ;
$this -> db -> table ( 'testdeftech' ) -> insert ( $data );
$data = [ 'SiteID' => '1' , 'TestSiteCode' => 'SGPT' , 'TestSiteName' => 'Alanine Aminotransferase' , 'Type' => $vs [ 27 ][ 'TThrs' ], 'Description' => '' , 'SeqScr' => '24' , 'SeqRpt' => '24' , 'VisibleScr' => $vs [ 2 ][ 1 ], 'VisibleRpt' => $vs [ 2 ][ 1 ], 'CountStat' => $vs [ 2 ][ 1 ], 'CreateDate' => " $now " ];
$id = $this -> db -> table ( 'testdefsite' ) -> insert ( $data );
2025-11-27 11:52:39 +07:00
$data = [ 'DisciplineID' => '2' , 'DepartmentID' => '3' , 'VSet' => '' , 'SpcType' => $vs [ 15 ][ 'SER' ], 'Unit1' => 'mg/dL' , 'Factor' => '' , 'Unit2' => '' , 'Method' => 'IFCC' , 'CreateDate' => " $now " ];
2025-11-26 16:53:14 +07:00
$data [ 'TestSiteID' ] = $id ;
$this -> db -> table ( 'testdeftech' ) -> insert ( $data );
$data = [ 'SiteID' => '1' , 'TestSiteCode' => 'CREA' , 'TestSiteName' => 'Kreatinin' , 'Type' => $vs [ 27 ][ 'TRang' ], 'Description' => '' , 'SeqScr' => '26' , 'SeqRpt' => '26' , 'VisibleScr' => $vs [ 2 ][ 1 ], 'VisibleRpt' => $vs [ 2 ][ 1 ], 'CountStat' => $vs [ 2 ][ 1 ], 'CreateDate' => " $now " ];
$id = $this -> db -> table ( 'testdefsite' ) -> insert ( $data );
2025-11-27 11:52:39 +07:00
$data = [ 'DisciplineID' => '2' , 'DepartmentID' => '3' , 'VSet' => '' , 'SpcType' => $vs [ 15 ][ 'SER' ], 'Unit1' => 'mg/dL' , 'Factor' => '88.4' , 'Unit2' => 'mmol/L' , 'Method' => 'Enzymatic' , 'CreateDate' => " $now " ];
2025-11-26 16:53:14 +07:00
$data [ 'TestSiteID' ] = $id ;
$this -> db -> table ( 'testdeftech' ) -> insert ( $data );
$data = [ 'SiteID' => '1' , 'TestSiteCode' => 'CREAU' , 'TestSiteName' => 'Kreatinin Urin' , 'Type' => $vs [ 27 ][ 'TRang' ], 'Description' => '' , 'SeqScr' => '27' , 'SeqRpt' => '27' , 'VisibleScr' => $vs [ 2 ][ 1 ], 'VisibleRpt' => $vs [ 2 ][ 1 ], 'CountStat' => $vs [ 2 ][ 1 ], 'CreateDate' => " $now " ];
$id = $this -> db -> table ( 'testdefsite' ) -> insert ( $data );
$data = [ 'SiteID' => '1' , 'TestSiteCode' => 'CREAC' , 'TestSiteName' => 'Creatinine Clearance' , 'Type' => $vs [ 27 ][ 'CalN' ], 'Description' => 'Cockcroft-Gault formula' , 'SeqScr' => '28' , 'SeqRpt' => '28' , 'VisibleScr' => $vs [ 2 ][ 1 ], 'VisibleRpt' => $vs [ 2 ][ 1 ], 'CountStat' => $vs [ 2 ][ 0 ], 'CreateDate' => " $now " ];
$id = $this -> db -> table ( 'testdefsite' ) -> insert ( $data );
2025-11-27 11:52:39 +07:00
2025-11-26 16:53:14 +07:00
$data = [ 'SiteID' => '1' , 'TestSiteCode' => 'COLOR' , 'TestSiteName' => 'Warna' , 'Type' => $vs [ 27 ][ 'TVS' ], 'Description' => '' , 'SeqScr' => '30' , 'SeqRpt' => '30' , 'VisibleScr' => $vs [ 2 ][ 1 ], 'VisibleRpt' => $vs [ 2 ][ 1 ], 'CountStat' => $vs [ 2 ][ 1 ], 'CreateDate' => " $now " ];
$id = $this -> db -> table ( 'testdefsite' ) -> insert ( $data );
2025-11-27 11:52:39 +07:00
$data = [ 'DisciplineID' => '4' , 'DepartmentID' => '6' , 'VSet' => '1002' , 'SpcType' => $vs [ 15 ][ 'SER' ], 'Unit1' => '' , 'Factor' => '' , 'Unit2' => '' , 'Method' => '' , 'CreateDate' => " $now " ];
2025-11-26 16:53:14 +07:00
$data [ 'TestSiteID' ] = $id ;
$this -> db -> table ( 'testdeftech' ) -> insert ( $data );
$data = [ 'SiteID' => '1' , 'TestSiteCode' => 'HEIGHT' , 'TestSiteName' => 'Tinggi badan' , 'Type' => $vs [ 27 ][ 'PNum' ], 'Description' => '' , 'SeqScr' => '31' , 'SeqRpt' => '31' , 'VisibleScr' => $vs [ 2 ][ 1 ], 'VisibleRpt' => $vs [ 2 ][ 1 ], 'CountStat' => $vs [ 2 ][ 0 ], 'CreateDate' => " $now " ];
$id = $this -> db -> table ( 'testdefsite' ) -> insert ( $data );
2025-11-27 11:52:39 +07:00
$data = [ 'DisciplineID' => '10' , 'DepartmentID' => '' , 'VSet' => '' , 'SpcType' => '' , 'Unit1' => 'm' , 'Factor' => '' , 'Unit2' => '' , 'Method' => '' , 'CreateDate' => " $now " ];
2025-11-26 16:53:14 +07:00
$data [ 'TestSiteID' ] = $id ;
$this -> db -> table ( 'testdeftech' ) -> insert ( $data );
$data = [ 'SiteID' => '1' , 'TestSiteCode' => 'WEIGHT' , 'TestSiteName' => 'Berat badan' , 'Type' => $vs [ 27 ][ 'PNum' ], 'Description' => '' , 'SeqScr' => '32' , 'SeqRpt' => '32' , 'VisibleScr' => $vs [ 2 ][ 1 ], 'VisibleRpt' => $vs [ 2 ][ 1 ], 'CountStat' => $vs [ 2 ][ 0 ], 'CreateDate' => " $now " ];
$id = $this -> db -> table ( 'testdefsite' ) -> insert ( $data );
2025-11-27 11:52:39 +07:00
$data = [ 'DisciplineID' => '10' , 'DepartmentID' => '' , 'VSet' => '' , 'SpcType' => '' , 'Unit1' => 'Kg' , 'Factor' => '' , 'Unit2' => '' , 'Method' => '' , 'CreateDate' => " $now " ];
2025-11-26 16:53:14 +07:00
$data [ 'TestSiteID' ] = $id ;
$this -> db -> table ( 'testdeftech' ) -> insert ( $data );
$data = [ 'SiteID' => '1' , 'TestSiteCode' => 'WAIST' , 'TestSiteName' => 'Lingkar pinggang' , 'Type' => $vs [ 27 ][ 'PNum' ], 'Description' => '' , 'SeqScr' => '33' , 'SeqRpt' => '33' , 'VisibleScr' => $vs [ 2 ][ 1 ], 'VisibleRpt' => $vs [ 2 ][ 1 ], 'CountStat' => $vs [ 2 ][ 0 ], 'CreateDate' => " $now " ];
$id = $this -> db -> table ( 'testdefsite' ) -> insert ( $data );
$data = [ 'SiteID' => '1' , 'TestSiteCode' => 'AGE' , 'TestSiteName' => 'Usia' , 'Type' => $vs [ 27 ][ 'PNum' ], 'Description' => '' , 'SeqScr' => '34' , 'SeqRpt' => '34' , 'VisibleScr' => $vs [ 2 ][ 1 ], 'VisibleRpt' => '0' , 'CountStat' => $vs [ 2 ][ 0 ], 'CreateDate' => " $now " ];
$id = $this -> db -> table ( 'testdefsite' ) -> insert ( $data );
$data = [ 'SiteID' => '1' , 'TestSiteCode' => 'SISTL' , 'TestSiteName' => 'Sistolik' , 'Type' => $vs [ 27 ][ 'PNum' ], 'Description' => '' , 'SeqScr' => '35' , 'SeqRpt' => '35' , 'VisibleScr' => $vs [ 2 ][ 1 ], 'VisibleRpt' => $vs [ 2 ][ 1 ], 'CountStat' => $vs [ 2 ][ 0 ], 'CreateDate' => " $now " ];
$id = $this -> db -> table ( 'testdefsite' ) -> insert ( $data );
$data = [ 'SiteID' => '1' , 'TestSiteCode' => 'DIASTL' , 'TestSiteName' => 'Diastolik' , 'Type' => $vs [ 27 ][ 'PNum' ], 'Description' => '' , 'SeqScr' => '36' , 'SeqRpt' => '36' , 'VisibleScr' => $vs [ 2 ][ 1 ], 'VisibleRpt' => $vs [ 2 ][ 1 ], 'CountStat' => $vs [ 2 ][ 0 ], 'CreateDate' => " $now " ];
$id = $this -> db -> table ( 'testdefsite' ) -> insert ( $data );
}
}