fix seeder createdate
This commit is contained in:
parent
8fc9541063
commit
b4fa6c7983
@ -13,7 +13,7 @@ class CreateSpecimenTable extends Migration {
|
||||
'ConCode' => ['type' => 'VARCHAR', 'constraint' => 3, 'null' => false],
|
||||
'ConName' => ['type' => 'varchar', 'constraint' => 50, 'null' => true],
|
||||
'ConDesc' => ['type' => 'varchar', 'constraint' => 50, 'null' => true],
|
||||
'Additive' => ['type' => 'varchar', 'constraint' => 50, 'null' => true],
|
||||
'Additive' => ['type' => 'int', 'null' => true],
|
||||
'ConClass' => ['type' => 'int', 'null' => true],
|
||||
'Color' => ['type' => 'int', 'null' => true],
|
||||
'CreateDate' => ['type' => 'Datetime', 'null' => true],
|
||||
|
||||
@ -6,10 +6,11 @@ use CodeIgniter\Database\Seeder;
|
||||
|
||||
class CounterSeeder extends Seeder {
|
||||
public function run() {
|
||||
$now = date('Y-m-d H:i:s');
|
||||
// counter
|
||||
$data = [
|
||||
['CounterID'=>1, 'CounterValue'=>'1', 'CounterStart'=>'1', 'CounterEnd'=>'99999', 'CounterDesc'=>'Counter for Order#', 'CounterReset'=>'Y' ],
|
||||
['CounterID'=>2, 'CounterValue'=>'1', 'CounterStart'=>'1', 'CounterEnd'=>'9999', 'CounterDesc'=>'Counter for Visit#', 'CounterReset'=>'M' ],
|
||||
['CounterID'=>1, 'CounterValue'=>'1', 'CounterStart'=>'1', 'CounterEnd'=>'99999', 'CounterDesc'=>'Counter for Order#', 'CounterReset'=>'Y', 'CreateDate'=> "$now" ],
|
||||
['CounterID'=>2, 'CounterValue'=>'1', 'CounterStart'=>'1', 'CounterEnd'=>'9999', 'CounterDesc'=>'Counter for Visit#', 'CounterReset'=>'M', 'CreateDate'=> "$now" ]
|
||||
];
|
||||
$this->db->table('counter')->insertBatch($data);
|
||||
}
|
||||
|
||||
@ -7,15 +7,16 @@ use CodeIgniter\Database\Seeder;
|
||||
class DummySeeder extends Seeder {
|
||||
|
||||
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' ],
|
||||
['LocationID'=>2, 'LocCode'=>'DEFLOC', 'LocFull'=>'Default Location', 'LocType'=>'ROOM', 'Description'=>'Default location' ]
|
||||
['LocationID'=>1, 'LocCode'=>'QLOC', 'LocFull'=>'Dummy Location', 'LocType'=>'ROOM', 'Description'=>'Location made for dummy testing', 'CreateDate'=> "$now" ],
|
||||
['LocationID'=>2, 'LocCode'=>'DEFLOC', 'LocFull'=>'Default Location', 'LocType'=>'ROOM', 'Description'=>'Default location', 'CreateDate'=> "$now" ]
|
||||
];
|
||||
$this->db->table('location')->insertBatch($data);
|
||||
$data = [
|
||||
['LocationID'=>1, 'Street1'=>'Jalan Nginden', 'Street2'=>'Intan Raya', 'City'=>'Surabaya', 'Province'=>'East Java', 'PostCode'=>'60222'],
|
||||
['LocationID'=>2, 'Street1'=>'Jalan ', 'Street2'=>'Jalan jalan', 'City'=>'Depok', 'Province'=>'DKI Jakarta', 'PostCode'=>'10123']
|
||||
['LocationID'=>1, 'Street1'=>'Jalan Nginden', 'Street2'=>'Intan Raya', 'City'=>'Surabaya', 'Province'=>'East Java', 'PostCode'=>'60222', 'CreateDate'=> "$now"],
|
||||
['LocationID'=>2, 'Street1'=>'Jalan ', 'Street2'=>'Jalan jalan', 'City'=>'Depok', 'Province'=>'DKI Jakarta', 'PostCode'=>'10123', 'CreateDate'=> "$now"]
|
||||
];
|
||||
$this->db->table('locationaddress')->insertBatch($data);
|
||||
|
||||
@ -29,9 +30,9 @@ class DummySeeder extends Seeder {
|
||||
// contact
|
||||
$data = [
|
||||
['ContactID'=>1, 'NameFirst'=>'Default', 'NameLast'=>'Doctor', 'Title'=>'', 'Initial'=>'DEFDOC',
|
||||
'Birthdate'=>'', 'EmailAddress1'=>'', 'EmailAddress2'=>'', 'Phone'=>'', 'MobilePhone1'=>'', 'MobilePhone2'=>'', 'Specialty'=>'', 'SubSpecialty'=>'' ],
|
||||
'Birthdate'=>'', 'EmailAddress1'=>'', 'EmailAddress2'=>'', 'Phone'=>'', 'MobilePhone1'=>'', 'MobilePhone2'=>'', 'Specialty'=>'', 'SubSpecialty'=>'', 'CreateDate'=> "$now" ],
|
||||
['ContactID'=>2, 'NameFirst'=>'Dummy', 'NameLast'=>'Doctor', 'Title'=>'', 'Initial'=>'QDOC',
|
||||
'Birthdate'=>'', 'EmailAddress1'=>'', 'EmailAddress2'=>'', 'Phone'=>'', 'MobilePhone1'=>'', 'MobilePhone2'=>'', 'Specialty'=>'', 'SubSpecialty'=>'' ]
|
||||
'Birthdate'=>'', 'EmailAddress1'=>'', 'EmailAddress2'=>'', 'Phone'=>'', 'MobilePhone1'=>'', 'MobilePhone2'=>'', 'Specialty'=>'', 'SubSpecialty'=>'', 'CreateDate'=> "$now" ]
|
||||
];
|
||||
$this->db->table('contact')->insertBatch($data);
|
||||
$data = [
|
||||
@ -43,27 +44,46 @@ class DummySeeder extends Seeder {
|
||||
];
|
||||
$this->db->table('contactdetail')->insertBatch($data);
|
||||
$data = [
|
||||
['OccupationID'=>1, 'OccCode'=>'OC001', 'OccText'=>'Medical Doctor', 'Description'=>'Diagnoses and treats, injuries and illnesses' ],
|
||||
['OccupationID'=>2, 'OccCode'=>'OC002', 'OccText'=>'Trainee Medical Technician', 'Description'=>'Performing basic laboratory task' ],
|
||||
['OccupationID'=>3, 'OccCode'=>'OC003', 'OccText'=>'Medical Laboratory Technician', 'Description'=>'Perform routine laboratory tests' ]
|
||||
['OccupationID'=>1, 'OccCode'=>'OC001', 'OccText'=>'Medical Doctor', 'Description'=>'Diagnoses and treats, injuries and illnesses', 'CreateDate'=> "$now" ],
|
||||
['OccupationID'=>2, 'OccCode'=>'OC002', 'OccText'=>'Trainee Medical Technician', 'Description'=>'Performing basic laboratory task', 'CreateDate'=> "$now" ],
|
||||
['OccupationID'=>3, 'OccCode'=>'OC003', 'OccText'=>'Medical Laboratory Technician', 'Description'=>'Perform routine laboratory tests', 'CreateDate'=> "$now" ]
|
||||
];
|
||||
$this->db->table('occupation')->insertBatch($data);
|
||||
|
||||
// patient
|
||||
$data = [
|
||||
[ 'InternalPID'=>1, 'PatientID'=>'SMAJ1', 'NameFirst'=>'Dummy', 'NameLast' => 'Patient M', 'Gender'=>'6', 'BirthDate'=>'1991-09-09', 'Street_1'=>'Makati', 'EmailAddress1'=>'smaj1@5panda.id',
|
||||
'Country'=>'325', 'Race'=>'175', 'Religion'=>'207', 'Ethnic'=>'218', 'DeathIndicator' => '16'],
|
||||
'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',
|
||||
'Country'=>'325', 'Race'=>'176', 'Religion'=>'206', 'Ethnic'=>'219', 'DeathIndicator' => '16'],
|
||||
'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',
|
||||
'Country'=>'325', 'Race'=>'176', 'Religion'=>'206', 'Ethnic'=>'219', 'DeathIndicator' => '16']
|
||||
'Country'=>'325', 'Race'=>'176', 'Religion'=>'206', 'Ethnic'=>'219', 'DeathIndicator' => '16', 'CreateDate'=> "$now"]
|
||||
];
|
||||
$this->db->table('patient')->insertBatch($data);
|
||||
$data = [
|
||||
[ 'InternalPID'=>1, 'IdentifierType'=>'KTP', 'Identifier'=>'9901' ],
|
||||
[ 'InternalPID'=>2, 'IdentifierType'=>'KTP', 'Identifier'=>'9902' ],
|
||||
[ 'InternalPID'=>3, 'IdentifierType'=>'KTP', 'Identifier'=>'9903' ]
|
||||
[ '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);
|
||||
|
||||
// containerdef
|
||||
$data = [
|
||||
['ConCode' => '1','ConName' => 'SST', 'ConDesc' =>'Evacuated blood collection tube, gel separator', 'Additive' => "66", 'ConClass' => '80', 'CreateDate'=> "$now"],
|
||||
['ConCode' => '11','ConName' => 'Plain', 'ConDesc' =>'Evacuated blood collection tube, no additive/metal-free', 'Additive' => "67", 'ConClass' => '80', 'CreateDate'=> "$now"],
|
||||
['ConCode' => '12','ConName' => '2Hr PP', 'ConDesc' =>'Evacuated blood collection tube, untuk Glukosa 2 Jam PP', 'Additive' => "68", 'ConClass' => '80', 'CreateDate'=> "$now"],
|
||||
['ConCode' => '13','ConName' => 'Glukosa Sewaktu', 'ConDesc' =>'Evacuated blood collection tube, untuk Glukosa Sewaktu', 'Additive' => "69", 'ConClass' => '80', 'CreateDate'=> "$now"],
|
||||
['ConCode' => '14','ConName' => 'GTT 30 menit', 'ConDesc' =>'Evacuated blood collection tube, untuk GTT 30 menit', 'Additive' => "71", 'ConClass' => '80', 'CreateDate'=> "$now"],
|
||||
['ConCode' => '15','ConName' => 'GTT 60 menit', 'ConDesc' =>'Evacuated blood collection tube, untuk GTT 60 menit', 'Additive' => "71", 'ConClass' => '80', 'CreateDate'=> "$now"],
|
||||
['ConCode' => '16','ConName' => 'GTT 120 menit', 'ConDesc' =>'Evacuated blood collection tube, untuk GTT 90 menit', 'Additive' => "71", 'ConClass' => '80', 'CreateDate'=> "$now"],
|
||||
['ConCode' => '20','ConName' => 'RST', 'ConDesc' =>'Evacuated blood collection tube, thrombin/clot activator/gel separator', 'Additive' => "71", 'ConClass' => '80', 'CreateDate'=> "$now"],
|
||||
['ConCode' => '101','ConName' => 'EDTA - Hematologi', 'ConDesc' =>'Evacuated blood collection tube, K2EDTA/aprotinin', 'Additive' => "71", 'ConClass' => '80', 'CreateDate'=> "$now"],
|
||||
['ConCode' => '150','ConName' => 'Citrate - Koagulasi', 'ConDesc' =>'Evacuated blood collection tube, untuk koagulasi', 'Additive' => "71", 'ConClass' => '80', 'CreateDate'=> "$now"],
|
||||
['ConCode' => '200','ConName' => 'Aliquot', 'ConDesc' =>'General specimen container, no additive, non-sterile. Untuk aliquot', 'Additive' => "71", 'ConClass' => '80', 'CreateDate'=> "$now"],
|
||||
['ConCode' => '290','ConName' => 'Pot Urin', 'ConDesc' =>'Non-sterile urine specimen container IVD', 'Additive' => "71", 'ConClass' => '80', 'CreateDate'=> "$now"],
|
||||
['ConCode' => '295','ConName' => 'Urine Container', 'ConDesc' =>'Urine specimen container', 'Additive' => "71", 'ConClass' => '80', 'CreateDate'=> "$now"],
|
||||
['ConCode' => '900','ConName' => 'Packing Pengiriman', 'ConDesc' =>'Specimen Transport Packaging', 'Additive' => "71", 'ConClass' => '81', 'CreateDate'=> "$now"],
|
||||
];
|
||||
$this->db->table('containerdef')->insertBatch($data);
|
||||
}
|
||||
}
|
||||
@ -1,32 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Seeds;
|
||||
|
||||
use CodeIgniter\Database\Seeder;
|
||||
|
||||
class SpecimenSeeder extends Seeder {
|
||||
|
||||
public function run() {
|
||||
// containerdef
|
||||
$data = [
|
||||
['ConCode' => '1','ConName' => 'SST', 'ConDesc' =>'Evacuated blood collection tube, gel separator', 'Additive' => "Gel", 'ConClass' => '1'],
|
||||
['ConCode' => '11','ConName' => 'Plain', 'ConDesc' =>'Evacuated blood collection tube, no additive/metal-free', 'Additive' => null, 'ConClass' => '1'],
|
||||
['ConCode' => '12','ConName' => '2Hr PP', 'ConDesc' =>'Evacuated blood collection tube, untuk Glukosa 2 Jam PP', 'Additive' => "Sodium Fluoride", 'ConClass' => '1'],
|
||||
['ConCode' => '13','ConName' => 'Glukosa Sewaktu', 'ConDesc' =>'Evacuated blood collection tube, untuk Glukosa Sewaktu', 'Additive' => "Sodium Fluoride", 'ConClass' => '1'],
|
||||
['ConCode' => '14','ConName' => 'GTT 30 menit', 'ConDesc' =>'Evacuated blood collection tube, untuk GTT 30 menit', 'Additive' => "Sodium Fluoride", 'ConClass' => '1'],
|
||||
['ConCode' => '15','ConName' => 'GTT 60 menit', 'ConDesc' =>'Evacuated blood collection tube, untuk GTT 60 menit', 'Additive' => "Sodium Fluoride", 'ConClass' => '1'],
|
||||
['ConCode' => '16','ConName' => 'GTT 120 menit', 'ConDesc' =>'Evacuated blood collection tube, untuk GTT 90 menit', 'Additive' => "Sodium Fluoride", 'ConClass' => '1'],
|
||||
['ConCode' => '20','ConName' => 'RST', 'ConDesc' =>'Evacuated blood collection tube, thrombin/clot activator/gel separator', 'Additive' => "Clot activator", 'ConClass' => '1'],
|
||||
['ConCode' => '101','ConName' => 'EDTA - Hematologi', 'ConDesc' =>'Evacuated blood collection tube, K2EDTA/aprotinin', 'Additive' => "K2EDTA", 'ConClass' => '1'],
|
||||
['ConCode' => '150','ConName' => 'Citrate - Koagulasi', 'ConDesc' =>'Evacuated blood collection tube, untuk koagulasi', 'Additive' => "Sodium citrate (substance)", 'ConClass' => '1'],
|
||||
['ConCode' => '200','ConName' => 'Aliquot', 'ConDesc' =>'General specimen container, no additive, non-sterile. Untuk aliquot', 'Additive' => null, 'ConClass' => '1'],
|
||||
['ConCode' => '290','ConName' => 'Pot Urin', 'ConDesc' =>'Non-sterile urine specimen container IVD', 'Additive' => null, 'ConClass' => '1'],
|
||||
['ConCode' => '295','ConName' => 'Urine Container', 'ConDesc' =>'Urine specimen container', 'Additive' => null, 'ConClass' => '1'],
|
||||
['ConCode' => '900','ConName' => 'Packing Pengiriman', 'ConDesc' =>'Specimen Transport Packaging', 'Additive' => null, 'ConClass' => '2']
|
||||
];
|
||||
$this->db->table('containerdef')->insertBatch($data);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -6,5 +6,5 @@ use App\Models\BaseModel;
|
||||
class OccupationModel extends BaseModel {
|
||||
protected $table = 'occupation';
|
||||
protected $primaryKey = 'OccupationID';
|
||||
protected $allowedFields = ['OccCode', 'OccText', 'Description'];
|
||||
protected $allowedFields = ['OccCode', 'OccText', 'Description', 'CreateDate'];
|
||||
}
|
||||
|
||||
@ -5,7 +5,12 @@ namespace App\Models;
|
||||
class CounterModel extends BaseModel {
|
||||
protected $table = 'counter';
|
||||
protected $primaryKey = 'CounterID';
|
||||
protected $allowedFields = ['CounterValue', 'CounterStart', 'CounterEnd', 'CounterReset'];
|
||||
protected $allowedFields = ['CounterValue', 'CounterStart', 'CounterEnd', 'CounterReset', 'CreateDate', 'EndDate'];
|
||||
|
||||
protected $useTimestamps = true;
|
||||
protected $createdField = "CreateDate";
|
||||
protected $updatedField = "";
|
||||
protected $useSoftDeletes = "EndDate";
|
||||
|
||||
public function use($CounterID) {
|
||||
$row = $this->where('CounterID',$CounterID)->get()->getResultArray();
|
||||
|
||||
@ -21,8 +21,10 @@ class ContainerDefModel extends BaseModel {
|
||||
protected $afterUpdate = ['convertDatesToUTCISO'];
|
||||
|
||||
public function getContainer($ConDefID) {
|
||||
$rows = $this->select('containerdef.*, valueset.VValue as ColorTxt')
|
||||
->join('valueset', 'valueset.VID=containerdef.Color', 'left')
|
||||
$rows = $this->select('containerdef.*, vscol.VValue as ColorTxt, vscla.VValue as ConClassTxt, vsadd.VValue as AdditiveTxt')
|
||||
->join('valueset vscol', 'vscol.VID=containerdef.Color', 'left')
|
||||
->join('valueset vscla', 'vscla.VID=containerdef.ConClass', 'left')
|
||||
->join('valueset vsadd', 'vsadd.VID=containerdef.Additive', 'left')
|
||||
->where('ConDefID', $ConDefID)->get()->getResultArray();
|
||||
return $rows;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user