- Corrected ASCII row formatting in logs to ensure proper line breaks. - Resolved issue causing empty result outbox during HL7 result simulation. - Ensured messages are correctly processed and translation errors are handled.
108 lines
5.2 KiB
PHP
108 lines
5.2 KiB
PHP
<?php
|
|
|
|
namespace App\Database\Migrations;
|
|
|
|
use CodeIgniter\Database\Migration;
|
|
|
|
class CreateTestsTable extends Migration {
|
|
public function up() {
|
|
$this->forge->addField([
|
|
'TestSiteID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
|
|
'SiteID' => ['type' => 'INT', 'null' => false],
|
|
'TestSiteCode' => ['type' => 'varchar', 'constraint'=> 6, 'null' => false],
|
|
'TestSiteName' => ['type' => 'varchar', 'constraint'=> 50, 'null' => false],
|
|
'TestType' => ['type' => 'int', 'null' => false],
|
|
'Description' => ['type' => 'varchar', 'constraint'=> 150, 'null' => true],
|
|
'SeqScr' => ['type' => 'int', 'null' => true],
|
|
'SeqRpt' => ['type' => 'int', 'null' => true],
|
|
'IndentLeft' => ['type' => 'int', 'null' => true],
|
|
'VisibleScr' => ['type' => 'int', 'null' => true],
|
|
'VisibleRpt' => ['type' => 'int', 'null' => true],
|
|
'CountStat' => ['type' => 'int', 'null' => true],
|
|
'CreateDate' => ['type' => 'Datetime', 'null' => true],
|
|
'StartDate' => ['type' => 'Datetime', 'null' => true],
|
|
'EndDate' => ['type' => 'Datetime', 'null' => true],
|
|
]);
|
|
$this->forge->addKey('TestSiteID', true);
|
|
$this->forge->createTable('testdefsite');
|
|
|
|
$this->forge->addField([
|
|
'TestTechID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
|
|
'TestSiteID' => ['type' => 'INT', 'null' => false],
|
|
'DisciplineID' => ['type' => 'int', 'null' => true],
|
|
'DepartmentID' => ['type' => 'int', 'null' => true],
|
|
'ResultType' => ['type' => 'int', 'null' => true],
|
|
'RefType' => ['type' => 'int', 'null' => true],
|
|
'VSet' => ['type' => 'int', 'null' => true],
|
|
'SpcType' => ['type' => 'int', 'null' => true],
|
|
'ReqQty' => ['type' => 'int', 'null' => true],
|
|
'ReqQtyUnit' => ['type' => 'varchar', 'constraint'=>20, 'null' => true],
|
|
'Unit1' => ['type' => 'varchar', 'constraint'=>20, 'null' => true],
|
|
'Factor' => ['type' => 'int', 'null' => true],
|
|
'Unit2' => ['type' => 'varchar', 'constraint'=>20, 'null' => true],
|
|
'Decimal' => ['type' => 'int', '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],
|
|
'EndDate' => ['type' => 'Datetime', 'null' => true]
|
|
]);
|
|
$this->forge->addKey('TestTechID', true);
|
|
$this->forge->createTable('testdeftech');
|
|
|
|
$this->forge->addField([
|
|
'TestCalID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
|
|
'TestSiteID' => ['type' => 'INT', 'null' => false],
|
|
'DisciplineID' => ['type' => 'INT', 'null' => true],
|
|
'DepartmentID' => ['type' => 'INT', 'null' => true],
|
|
'FormulaInput' => ['type' => 'varchar', 'constraint'=>20, 'null' => true],
|
|
'FormulaCode' => ['type' => 'varchar', 'constraint'=>150, 'null' => true],
|
|
'Unit1' => ['type' => 'varchar', 'constraint'=>20, 'null' => true],
|
|
'Factor' => ['type' => 'int', 'null' => true],
|
|
'Unit2' => ['type' => 'varchar', 'constraint'=>20, 'null' => true],
|
|
'Decimal' => ['type' => 'int', 'null' => true],
|
|
'CreateDate' => ['type' => 'Datetime', 'null' => true],
|
|
'EndDate' => ['type' => 'Datetime', 'null' => true]
|
|
]);
|
|
$this->forge->addKey('TestCalID', true);
|
|
$this->forge->createTable('testdefcal');
|
|
|
|
$this->forge->addField([
|
|
'TestGrpID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
|
|
'TestSiteID' => ['type' => 'INT', 'null' => false],
|
|
'Member' => ['type' => 'INT', 'null' => true],
|
|
'CreateDate' => ['type' => 'Datetime', 'null' => true],
|
|
'EndDate' => ['type' => 'Datetime', 'null' => true]
|
|
]);
|
|
$this->forge->addKey('TestGrpID', true);
|
|
$this->forge->createTable('testdefgrp');
|
|
|
|
$this->forge->addField([
|
|
'TestMapID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
|
|
'TestSiteID' => ['type' => 'INT', 'null' => false],
|
|
'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],
|
|
'ClientDataSource' => ['type' => 'varchar', 'constraint'=>50, 'null' => true],
|
|
'ConDefID' => ['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() {
|
|
$this->forge->dropTable('testdefsite');
|
|
$this->forge->dropTable('testdeftech');
|
|
$this->forge->dropTable('testdefcal');
|
|
$this->forge->dropTable('testdefgrp');
|
|
$this->forge->dropTable('testmap');
|
|
}
|
|
} |