From 2580d64d9e412c2edaa9cdef801e4cfb8229da06 Mon Sep 17 00:00:00 2001 From: mahdahar <89adham@gmail.com> Date: Thu, 11 Dec 2025 16:43:19 +0700 Subject: [PATCH] prework --- ...g.php => 2025-09-02-070826_PatientReg.php} | 0 ...sit.php => 2025-09-09-155526_PatVisit.php} | 0 ...st.php => 2025-10-11-100001_OrderTest.php} | 2 +- ...nge.php => 2025-10-12-100001_RefRange.php} | 0 ...=> 2025-10-23-100001_CRMOrganizations.php} | 0 .../Migrations/2025-12-11-100002_PatRes.php | 92 +++++++++++++++++++ 6 files changed, 93 insertions(+), 1 deletion(-) rename app/Database/Migrations/{2025-09-02-070826_Patient_Reg.php => 2025-09-02-070826_PatientReg.php} (100%) rename app/Database/Migrations/{2025-09-09-155526_Pat_Visit.php => 2025-09-09-155526_PatVisit.php} (100%) rename app/Database/Migrations/{2025-10-11-100001_Order_Test.php => 2025-10-11-100001_OrderTest.php} (97%) rename app/Database/Migrations/{2025-10-12-100001_Ref_Range.php => 2025-10-12-100001_RefRange.php} (100%) rename app/Database/Migrations/{2025-10-23-100001_CRM_Organizations.php => 2025-10-23-100001_CRMOrganizations.php} (100%) create mode 100644 app/Database/Migrations/2025-12-11-100002_PatRes.php diff --git a/app/Database/Migrations/2025-09-02-070826_Patient_Reg.php b/app/Database/Migrations/2025-09-02-070826_PatientReg.php similarity index 100% rename from app/Database/Migrations/2025-09-02-070826_Patient_Reg.php rename to app/Database/Migrations/2025-09-02-070826_PatientReg.php diff --git a/app/Database/Migrations/2025-09-09-155526_Pat_Visit.php b/app/Database/Migrations/2025-09-09-155526_PatVisit.php similarity index 100% rename from app/Database/Migrations/2025-09-09-155526_Pat_Visit.php rename to app/Database/Migrations/2025-09-09-155526_PatVisit.php diff --git a/app/Database/Migrations/2025-10-11-100001_Order_Test.php b/app/Database/Migrations/2025-10-11-100001_OrderTest.php similarity index 97% rename from app/Database/Migrations/2025-10-11-100001_Order_Test.php rename to app/Database/Migrations/2025-10-11-100001_OrderTest.php index 3dec2a4..cd74209 100644 --- a/app/Database/Migrations/2025-10-11-100001_Order_Test.php +++ b/app/Database/Migrations/2025-10-11-100001_OrderTest.php @@ -53,7 +53,7 @@ class CreateOrdersTable extends Migration { $this->forge->addField([ 'OrderStatID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true], 'InternalOID' => ['type' => 'INT', 'null' => false], - 'OrderStatus' => ['type' => 'varchar', 'constraint'=>2, 'null' => false], + 'OrderStatus' => ['type' => 'INT', 'null' => false], 'CreateDate' => ['type' => 'Datetime', 'null' => true], 'EndDate' => ['type' => 'Datetime', 'null' => true], 'ArchiveDate' => ['type' => 'Datetime', 'null' => true], diff --git a/app/Database/Migrations/2025-10-12-100001_Ref_Range.php b/app/Database/Migrations/2025-10-12-100001_RefRange.php similarity index 100% rename from app/Database/Migrations/2025-10-12-100001_Ref_Range.php rename to app/Database/Migrations/2025-10-12-100001_RefRange.php diff --git a/app/Database/Migrations/2025-10-23-100001_CRM_Organizations.php b/app/Database/Migrations/2025-10-23-100001_CRMOrganizations.php similarity index 100% rename from app/Database/Migrations/2025-10-23-100001_CRM_Organizations.php rename to app/Database/Migrations/2025-10-23-100001_CRMOrganizations.php diff --git a/app/Database/Migrations/2025-12-11-100002_PatRes.php b/app/Database/Migrations/2025-12-11-100002_PatRes.php new file mode 100644 index 0000000..728bfd0 --- /dev/null +++ b/app/Database/Migrations/2025-12-11-100002_PatRes.php @@ -0,0 +1,92 @@ +forge->addField([ + 'ResultID' => ['type' => 'INT', 'auto_increment' => true], + 'SiteID' => ['type' => 'INT', 'null' => true], + 'OrderID' => ['type' => 'INT', 'null' => true], + 'InternalSID' => ['type' => 'INT', 'null' => true], + 'SID' => ['type' => 'varchar', 'constraint' => 30], + 'SampleID' => ['type' => 'varchar', 'constraint' => 30], + 'TestSiteID' => ['type' => 'INT', 'null' => true], + 'TestSiteCode' => ['type' => 'CHAR', 'constraint' => 6, 'null' => true], + 'AspCnt' => ['type' => 'INT', 'default' => 1, 'null' => true], + 'Result' => ['type' => 'varchar', 'constraint' => 255, 'null' => true], + 'SampleType' => ['type' => 'varchar', 'constraint' => 50, 'null' => true], + 'ResultDateTime' => ['type' => 'DATETIME'], + 'WorkstationID' => ['type' => 'INT', 'null' => true], + 'EquipmentID' => ['type' => 'INT', 'null' => true], + 'RefNumID' => ['type' => 'INT', 'null' => true], + 'RefTHoldID' => ['type' => 'INT', 'null' => true], + 'RefVSetID' => ['type' => 'INT', 'null' => true], + 'RefTxtID' => ['type' => 'INT', 'null' => true], + 'CreateDate' => ['type' => 'DATETIME', 'null' => true], + 'EndDate' => ['type' => 'DATETIME', 'null' => true], + 'ArchiveDate' => ['type' => 'DATETIME', 'null' => true], + 'DelDate' => ['type' => 'DATETIME', 'null' => true], + ]); + $this->forge->addPrimaryKey('ResultID'); + $this->forge->createTable('patres'); + + $this->forge->addField([ + 'ResFlagID' => ['type' => 'INT', 'auto_increment' => true], + 'ResultID' => ['type' => 'INT', 'null' => false], + 'Flag' => ['type' => 'varchar', 'constraint' => 50, 'null' => true], + 'CreateDate' => ['type' => 'DATETIME', 'null' => true], + 'EndDate' => ['type' => 'DATETIME', 'null' => true], + 'ArchiveDate' => ['type' => 'DATETIME', 'null' => true], + 'DelDate' => ['type' => 'DATETIME', 'null' => true], + ]); + $this->forge->addPrimaryKey('ResFlagID'); + $this->forge->createTable('patresflag'); + + $this->forge->addField([ + 'ResStatusID' => ['type' => 'INT', 'auto_increment' => true], + 'ResultID' => ['type' => 'INT', 'null' => false], + 'SID' => ['type' => 'varchar', 'constraint' => 30], + 'TestAct' => ['type' => 'varchar', 'constraint' => 255], + 'ActRes' => ['type' => 'INT', 'null' => true], + 'TestStatus' => ['type' => 'INT', 'null' => true], + 'CurrSiteID' => ['type' => 'INT', 'null' => true], + 'CurrLocID' => ['type' => 'INT', 'null' => true], + 'Origin' => ['type' => 'varchar', 'constraint' => 255, 'null' => true], + 'GeoLocationSystem' => ['type' => 'varchar', 'constraint' => 255, 'null' => true], + 'GeoLocationData' => ['type' => 'TEXT', 'null' => true], + 'DIDType' => ['type' => 'varchar', 'constraint' => 255, 'null' => true], + 'DID' => ['type' => 'varchar', 'constraint' => 255, 'null' => true], + 'UserID' => ['type' => 'varchar', 'constraint' => 255, 'null' => true], + 'LogDate' => ['type' => 'DATETIME', 'null' => true], + 'EndDate' => ['type' => 'DATETIME', 'null' => true], + 'ArchiveDate' => ['type' => 'DATETIME', 'null' => true], + ]); + $this->forge->addPrimaryKey('ResStatusID'); + $this->forge->createTable('patrestatus'); + + $this->forge->addField([ + 'FlagDefID' => ['type' => 'INT', 'auto_increment' => true], + 'InstrumentName' => ['type' => 'varchar', 'constraint' => 100, 'null' => true], + 'Flag' => ['type' => 'varchar', 'constraint' => 50, 'null' => true], + 'FlagText' => ['type' => 'varchar', 'constraint' => 100, 'null' => true], + 'FlagDesc' => ['type' => 'varchar', 'constraint' => 255, 'null' => true], + 'OnScreen' => ['type' => 'int', 'null' => true], + 'OnResult' => ['type' => 'int', 'null' => true], + 'CreateDate' => ['type' => 'DATETIME', 'null' => true], + 'EndDate' => ['type' => 'DATETIME', 'null' => true], + ]); + $this->forge->addPrimaryKey('FlagDefID'); + $this->forge->createTable('flagdef'); + } + + public function down() { + $this->forge->dropTable('flagdef', true); + $this->forge->dropTable('patrestatus', true); + $this->forge->dropTable('patrestech', true); + $this->forge->dropTable('patresflag', true); + $this->forge->dropTable('patres', true); + } +} \ No newline at end of file