2025-10-07 16:18:37 +07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Database\Migrations;
|
|
|
|
|
|
|
|
|
|
use CodeIgniter\Database\Migration;
|
|
|
|
|
|
refactor: consolidate migrations and reorganize valueset data structure
Major refactoring to clean up database migrations and reorganize static lookup data:
- Consolidated 13 old migrations (2025) into 10 new numbered migrations (2026-01-01)
- Deleted redundant migrations: Location, Users, Contact, ValueSet, Counter, RefRange,
CRMOrganizations, Organization, AreaGeo, DeviceLogin, EdgeRes
- New consolidated migrations:
- 2026-01-01-000001_CreateLookups: valueset, counter, containerdef, occupation, specialty
- 2026-01-01-000002_CreateOrganization: account, site, location, discipline, department
- 2026-01-01-000003_CreatePatientCore: patient, patidentifier, pataddress, patcontact
- 2026-01-01-000004_CreateSecurity: contact, contactdetail, userdevices, loginattempts
- 2026-01-01-000005_CreatePatientVisits: patvisit, patinsurance
- 2026-01-01-000006_CreateOrders: porder, orderitem
- 2026-01-01-000007_CreateSpecimens: specimen, specmenactivity, containerdef
- 2026-01-01-000008_CreateTestDefinitions: testdefinition, testactivity, refnum, reftxt
- 2026-01-01-000009_CreateResults: patresult, patresultdetail, patresultcomment
- 2026-01-01-000010_CreateLabInfrastructure: edgeres, edgestatus, edgeack, workstation
- Moved 44 JSON files from valuesets/ subdirectory to app/Libraries/Data/ root
- Added new country.json lookup
- Added _meta.json for valueset metadata
- Deleted old valuesets/_meta.json
- Renamed gender.json to sex.json for consistency with patient.Sex column
- Removed duplicate country.json from valuesets/
- AGENTS.md: Updated Lookups library documentation with new methods
- README.md: Complete rewrite of lookup/valueset documentation
- Renamed MVP_TODO.md to TODO.md
- Added VUE_SPA_IMPLEMENTATION_PLAN.md
- Removed deprecated prj_clinical laboratory quality management system_3a.docx
- ValueSet.php: Enhanced with caching and new lookup methods
- Lookups.php: Removed (functionality merged into ValueSet)
Impact: Prepares codebase for 2026 with cleaner migration history and improved
lookup data organization for the name-based valueset system.
2026-01-13 07:22:25 +07:00
|
|
|
class CreateSpecimens extends Migration {
|
2025-10-07 16:18:37 +07:00
|
|
|
public function up() {
|
|
|
|
|
$this->forge->addField([
|
|
|
|
|
'InternalSID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
|
|
|
|
|
'SID' => ['type' => 'VARCHAR', 'constraint' => 30, 'null' => false],
|
|
|
|
|
'SiteID' => ['type' => 'INT', 'null' => true],
|
|
|
|
|
'OrderID' => ['type' => 'INT', 'null' => true],
|
|
|
|
|
'ConDefID' => ['type' => 'INT', 'null' => true],
|
2025-11-10 16:02:52 +07:00
|
|
|
'Parent' => ['type' => 'varchar', 'constraint' => 30, 'null' => true],
|
2025-10-07 16:18:37 +07:00
|
|
|
'Qty' => ['type' => 'INT', 'null' => true],
|
|
|
|
|
'Unit' => ['type' => 'varchar', 'constraint'=> 30, 'null' => true],
|
refactor: consolidate migrations and reorganize valueset data structure
Major refactoring to clean up database migrations and reorganize static lookup data:
- Consolidated 13 old migrations (2025) into 10 new numbered migrations (2026-01-01)
- Deleted redundant migrations: Location, Users, Contact, ValueSet, Counter, RefRange,
CRMOrganizations, Organization, AreaGeo, DeviceLogin, EdgeRes
- New consolidated migrations:
- 2026-01-01-000001_CreateLookups: valueset, counter, containerdef, occupation, specialty
- 2026-01-01-000002_CreateOrganization: account, site, location, discipline, department
- 2026-01-01-000003_CreatePatientCore: patient, patidentifier, pataddress, patcontact
- 2026-01-01-000004_CreateSecurity: contact, contactdetail, userdevices, loginattempts
- 2026-01-01-000005_CreatePatientVisits: patvisit, patinsurance
- 2026-01-01-000006_CreateOrders: porder, orderitem
- 2026-01-01-000007_CreateSpecimens: specimen, specmenactivity, containerdef
- 2026-01-01-000008_CreateTestDefinitions: testdefinition, testactivity, refnum, reftxt
- 2026-01-01-000009_CreateResults: patresult, patresultdetail, patresultcomment
- 2026-01-01-000010_CreateLabInfrastructure: edgeres, edgestatus, edgeack, workstation
- Moved 44 JSON files from valuesets/ subdirectory to app/Libraries/Data/ root
- Added new country.json lookup
- Added _meta.json for valueset metadata
- Deleted old valuesets/_meta.json
- Renamed gender.json to sex.json for consistency with patient.Sex column
- Removed duplicate country.json from valuesets/
- AGENTS.md: Updated Lookups library documentation with new methods
- README.md: Complete rewrite of lookup/valueset documentation
- Renamed MVP_TODO.md to TODO.md
- Added VUE_SPA_IMPLEMENTATION_PLAN.md
- Removed deprecated prj_clinical laboratory quality management system_3a.docx
- ValueSet.php: Enhanced with caching and new lookup methods
- Lookups.php: Removed (functionality merged into ValueSet)
Impact: Prepares codebase for 2026 with cleaner migration history and improved
lookup data organization for the name-based valueset system.
2026-01-13 07:22:25 +07:00
|
|
|
'GenerateBy' => ['type' => 'VARCHAR', 'constraint' => 10, 'null' => true],
|
2025-10-07 16:18:37 +07:00
|
|
|
'SchDateTime' => ['type' => 'datetime', 'null' => true],
|
2025-10-10 16:47:39 +07:00
|
|
|
'CreateDate' => ['type' => 'Datetime', 'null' => true],
|
2025-10-07 16:18:37 +07:00
|
|
|
'EndDate' => ['type' => 'DATETIME', 'null' => true],
|
|
|
|
|
'ArchiveDate' => ['type' => 'DATETIME', 'null' => true]
|
|
|
|
|
]);
|
|
|
|
|
$this->forge->addKey('InternalSID', true);
|
refactor: consolidate migrations and reorganize valueset data structure
Major refactoring to clean up database migrations and reorganize static lookup data:
- Consolidated 13 old migrations (2025) into 10 new numbered migrations (2026-01-01)
- Deleted redundant migrations: Location, Users, Contact, ValueSet, Counter, RefRange,
CRMOrganizations, Organization, AreaGeo, DeviceLogin, EdgeRes
- New consolidated migrations:
- 2026-01-01-000001_CreateLookups: valueset, counter, containerdef, occupation, specialty
- 2026-01-01-000002_CreateOrganization: account, site, location, discipline, department
- 2026-01-01-000003_CreatePatientCore: patient, patidentifier, pataddress, patcontact
- 2026-01-01-000004_CreateSecurity: contact, contactdetail, userdevices, loginattempts
- 2026-01-01-000005_CreatePatientVisits: patvisit, patinsurance
- 2026-01-01-000006_CreateOrders: porder, orderitem
- 2026-01-01-000007_CreateSpecimens: specimen, specmenactivity, containerdef
- 2026-01-01-000008_CreateTestDefinitions: testdefinition, testactivity, refnum, reftxt
- 2026-01-01-000009_CreateResults: patresult, patresultdetail, patresultcomment
- 2026-01-01-000010_CreateLabInfrastructure: edgeres, edgestatus, edgeack, workstation
- Moved 44 JSON files from valuesets/ subdirectory to app/Libraries/Data/ root
- Added new country.json lookup
- Added _meta.json for valueset metadata
- Deleted old valuesets/_meta.json
- Renamed gender.json to sex.json for consistency with patient.Sex column
- Removed duplicate country.json from valuesets/
- AGENTS.md: Updated Lookups library documentation with new methods
- README.md: Complete rewrite of lookup/valueset documentation
- Renamed MVP_TODO.md to TODO.md
- Added VUE_SPA_IMPLEMENTATION_PLAN.md
- Removed deprecated prj_clinical laboratory quality management system_3a.docx
- ValueSet.php: Enhanced with caching and new lookup methods
- Lookups.php: Removed (functionality merged into ValueSet)
Impact: Prepares codebase for 2026 with cleaner migration history and improved
lookup data organization for the name-based valueset system.
2026-01-13 07:22:25 +07:00
|
|
|
$this->forge->addUniqueKey('SID');
|
2025-11-10 16:02:52 +07:00
|
|
|
$this->forge->createTable('specimen');
|
2025-10-07 16:18:37 +07:00
|
|
|
|
|
|
|
|
$this->forge->addField([
|
|
|
|
|
'SpcStaID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
|
|
|
|
|
'SID' => ['type' => 'VARCHAR', 'constraint' => 30, 'null' => false],
|
2025-11-10 16:02:52 +07:00
|
|
|
'OrderID' => ['type' => 'int', 'null' => false],
|
2025-10-07 16:18:37 +07:00
|
|
|
'SpcAct' => ['type' => 'varchar', 'constraint' => 15, 'null' => true],
|
|
|
|
|
'ActRes' => ['type' => 'INT', 'null' => true],
|
refactor: consolidate migrations and reorganize valueset data structure
Major refactoring to clean up database migrations and reorganize static lookup data:
- Consolidated 13 old migrations (2025) into 10 new numbered migrations (2026-01-01)
- Deleted redundant migrations: Location, Users, Contact, ValueSet, Counter, RefRange,
CRMOrganizations, Organization, AreaGeo, DeviceLogin, EdgeRes
- New consolidated migrations:
- 2026-01-01-000001_CreateLookups: valueset, counter, containerdef, occupation, specialty
- 2026-01-01-000002_CreateOrganization: account, site, location, discipline, department
- 2026-01-01-000003_CreatePatientCore: patient, patidentifier, pataddress, patcontact
- 2026-01-01-000004_CreateSecurity: contact, contactdetail, userdevices, loginattempts
- 2026-01-01-000005_CreatePatientVisits: patvisit, patinsurance
- 2026-01-01-000006_CreateOrders: porder, orderitem
- 2026-01-01-000007_CreateSpecimens: specimen, specmenactivity, containerdef
- 2026-01-01-000008_CreateTestDefinitions: testdefinition, testactivity, refnum, reftxt
- 2026-01-01-000009_CreateResults: patresult, patresultdetail, patresultcomment
- 2026-01-01-000010_CreateLabInfrastructure: edgeres, edgestatus, edgeack, workstation
- Moved 44 JSON files from valuesets/ subdirectory to app/Libraries/Data/ root
- Added new country.json lookup
- Added _meta.json for valueset metadata
- Deleted old valuesets/_meta.json
- Renamed gender.json to sex.json for consistency with patient.Sex column
- Removed duplicate country.json from valuesets/
- AGENTS.md: Updated Lookups library documentation with new methods
- README.md: Complete rewrite of lookup/valueset documentation
- Renamed MVP_TODO.md to TODO.md
- Added VUE_SPA_IMPLEMENTATION_PLAN.md
- Removed deprecated prj_clinical laboratory quality management system_3a.docx
- ValueSet.php: Enhanced with caching and new lookup methods
- Lookups.php: Removed (functionality merged into ValueSet)
Impact: Prepares codebase for 2026 with cleaner migration history and improved
lookup data organization for the name-based valueset system.
2026-01-13 07:22:25 +07:00
|
|
|
'SpcStatus' => ['type' => 'VARCHAR', 'constraint' => 10, 'null' => true],
|
2025-10-07 16:18:37 +07:00
|
|
|
'Qty' => ['type' => 'INT', 'null' => true],
|
refactor: consolidate migrations and reorganize valueset data structure
Major refactoring to clean up database migrations and reorganize static lookup data:
- Consolidated 13 old migrations (2025) into 10 new numbered migrations (2026-01-01)
- Deleted redundant migrations: Location, Users, Contact, ValueSet, Counter, RefRange,
CRMOrganizations, Organization, AreaGeo, DeviceLogin, EdgeRes
- New consolidated migrations:
- 2026-01-01-000001_CreateLookups: valueset, counter, containerdef, occupation, specialty
- 2026-01-01-000002_CreateOrganization: account, site, location, discipline, department
- 2026-01-01-000003_CreatePatientCore: patient, patidentifier, pataddress, patcontact
- 2026-01-01-000004_CreateSecurity: contact, contactdetail, userdevices, loginattempts
- 2026-01-01-000005_CreatePatientVisits: patvisit, patinsurance
- 2026-01-01-000006_CreateOrders: porder, orderitem
- 2026-01-01-000007_CreateSpecimens: specimen, specmenactivity, containerdef
- 2026-01-01-000008_CreateTestDefinitions: testdefinition, testactivity, refnum, reftxt
- 2026-01-01-000009_CreateResults: patresult, patresultdetail, patresultcomment
- 2026-01-01-000010_CreateLabInfrastructure: edgeres, edgestatus, edgeack, workstation
- Moved 44 JSON files from valuesets/ subdirectory to app/Libraries/Data/ root
- Added new country.json lookup
- Added _meta.json for valueset metadata
- Deleted old valuesets/_meta.json
- Renamed gender.json to sex.json for consistency with patient.Sex column
- Removed duplicate country.json from valuesets/
- AGENTS.md: Updated Lookups library documentation with new methods
- README.md: Complete rewrite of lookup/valueset documentation
- Renamed MVP_TODO.md to TODO.md
- Added VUE_SPA_IMPLEMENTATION_PLAN.md
- Removed deprecated prj_clinical laboratory quality management system_3a.docx
- ValueSet.php: Enhanced with caching and new lookup methods
- Lookups.php: Removed (functionality merged into ValueSet)
Impact: Prepares codebase for 2026 with cleaner migration history and improved
lookup data organization for the name-based valueset system.
2026-01-13 07:22:25 +07:00
|
|
|
'Unit' => ['type' => 'INT', 'null' => true],
|
|
|
|
|
'SpcCon' => ['type' => 'INT', 'null' => true],
|
2025-10-07 16:18:37 +07:00
|
|
|
'Comment' => ['type' => 'varchar', 'constraint'=>150, 'null' => true],
|
|
|
|
|
'CurrSiteID' => ['type' => 'int', 'null' => true ],
|
|
|
|
|
'CurrLocID' => ['type' => 'int', 'null' => true ],
|
|
|
|
|
'Origin' => ['type' => 'varchar', 'constraint'=>50, 'null' => true ],
|
|
|
|
|
'GeoLocationSystem' => ['type' => 'varchar', 'constraint'=>10, 'null' => true ],
|
|
|
|
|
'GeoLocationData' => ['type' => 'varchar', 'constraint'=>10, 'null' => true ],
|
|
|
|
|
'DIDType' => ['type' => 'varchar', 'constraint'=>10, 'null' => true ],
|
|
|
|
|
'DID' => ['type' => 'varchar', 'constraint'=>10, 'null' => true ],
|
2025-11-10 16:02:52 +07:00
|
|
|
'UserID' => ['type' => 'int', 'null' => true ],
|
2025-10-10 16:47:39 +07:00
|
|
|
'CreateDate' => ['type' => 'Datetime', 'null' => true],
|
2025-10-07 16:18:37 +07:00
|
|
|
'EndDate' => ['type' => 'DATETIME', 'null' => true],
|
|
|
|
|
'ArchiveDate' => ['type' => 'DATETIME', 'null' => true]
|
|
|
|
|
]);
|
2025-10-09 13:04:05 +07:00
|
|
|
$this->forge->addKey('SpcStaID', true);
|
2025-10-07 16:18:37 +07:00
|
|
|
$this->forge->createTable('specimenstatus');
|
|
|
|
|
|
|
|
|
|
$this->forge->addField([
|
|
|
|
|
'SpcColID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
|
|
|
|
|
'SpcStaID' => ['type' => 'INT', 'unsigned' => true],
|
refactor: consolidate migrations and reorganize valueset data structure
Major refactoring to clean up database migrations and reorganize static lookup data:
- Consolidated 13 old migrations (2025) into 10 new numbered migrations (2026-01-01)
- Deleted redundant migrations: Location, Users, Contact, ValueSet, Counter, RefRange,
CRMOrganizations, Organization, AreaGeo, DeviceLogin, EdgeRes
- New consolidated migrations:
- 2026-01-01-000001_CreateLookups: valueset, counter, containerdef, occupation, specialty
- 2026-01-01-000002_CreateOrganization: account, site, location, discipline, department
- 2026-01-01-000003_CreatePatientCore: patient, patidentifier, pataddress, patcontact
- 2026-01-01-000004_CreateSecurity: contact, contactdetail, userdevices, loginattempts
- 2026-01-01-000005_CreatePatientVisits: patvisit, patinsurance
- 2026-01-01-000006_CreateOrders: porder, orderitem
- 2026-01-01-000007_CreateSpecimens: specimen, specmenactivity, containerdef
- 2026-01-01-000008_CreateTestDefinitions: testdefinition, testactivity, refnum, reftxt
- 2026-01-01-000009_CreateResults: patresult, patresultdetail, patresultcomment
- 2026-01-01-000010_CreateLabInfrastructure: edgeres, edgestatus, edgeack, workstation
- Moved 44 JSON files from valuesets/ subdirectory to app/Libraries/Data/ root
- Added new country.json lookup
- Added _meta.json for valueset metadata
- Deleted old valuesets/_meta.json
- Renamed gender.json to sex.json for consistency with patient.Sex column
- Removed duplicate country.json from valuesets/
- AGENTS.md: Updated Lookups library documentation with new methods
- README.md: Complete rewrite of lookup/valueset documentation
- Renamed MVP_TODO.md to TODO.md
- Added VUE_SPA_IMPLEMENTATION_PLAN.md
- Removed deprecated prj_clinical laboratory quality management system_3a.docx
- ValueSet.php: Enhanced with caching and new lookup methods
- Lookups.php: Removed (functionality merged into ValueSet)
Impact: Prepares codebase for 2026 with cleaner migration history and improved
lookup data organization for the name-based valueset system.
2026-01-13 07:22:25 +07:00
|
|
|
'SpcRole' => ['type' => 'VARCHAR', 'constraint' => 10, 'null' => true],
|
|
|
|
|
'ColMethod' => ['type' => 'VARCHAR', 'constraint' => 10, 'null' => true],
|
|
|
|
|
'BodySite' => ['type' => 'VARCHAR', 'constraint' => 10, 'null' => true],
|
|
|
|
|
'CntSize' => ['type' => 'VARCHAR', 'constraint' => 10, 'null' => true],
|
2025-10-07 16:18:37 +07:00
|
|
|
'FastingVolume' => ['type' => 'varchar', 'constraint'=> 2, 'null' => true],
|
|
|
|
|
'ColStart' => ['type' => 'datetime', 'null' => true],
|
|
|
|
|
'ColEnd' => ['type' => 'datetime', 'null' => true],
|
2025-10-10 16:47:39 +07:00
|
|
|
'CreateDate' => ['type' => 'Datetime', 'null' => true],
|
2025-10-07 16:18:37 +07:00
|
|
|
'EndDate' => ['type' => 'DATETIME', 'null' => true],
|
|
|
|
|
'ArchiveDate' => ['type' => 'DATETIME', 'null' => true]
|
|
|
|
|
]);
|
|
|
|
|
$this->forge->addKey('SpcColID', true);
|
|
|
|
|
$this->forge->createTable('specimencollection');
|
|
|
|
|
|
|
|
|
|
$this->forge->addField([
|
|
|
|
|
'SpcPrpID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
|
|
|
|
|
'SpcStaID' => ['type' => 'INT', 'unsigned' => true],
|
|
|
|
|
'Description' => ['type' => 'varchar', 'constraint' => 150, 'null' => true],
|
refactor: consolidate migrations and reorganize valueset data structure
Major refactoring to clean up database migrations and reorganize static lookup data:
- Consolidated 13 old migrations (2025) into 10 new numbered migrations (2026-01-01)
- Deleted redundant migrations: Location, Users, Contact, ValueSet, Counter, RefRange,
CRMOrganizations, Organization, AreaGeo, DeviceLogin, EdgeRes
- New consolidated migrations:
- 2026-01-01-000001_CreateLookups: valueset, counter, containerdef, occupation, specialty
- 2026-01-01-000002_CreateOrganization: account, site, location, discipline, department
- 2026-01-01-000003_CreatePatientCore: patient, patidentifier, pataddress, patcontact
- 2026-01-01-000004_CreateSecurity: contact, contactdetail, userdevices, loginattempts
- 2026-01-01-000005_CreatePatientVisits: patvisit, patinsurance
- 2026-01-01-000006_CreateOrders: porder, orderitem
- 2026-01-01-000007_CreateSpecimens: specimen, specmenactivity, containerdef
- 2026-01-01-000008_CreateTestDefinitions: testdefinition, testactivity, refnum, reftxt
- 2026-01-01-000009_CreateResults: patresult, patresultdetail, patresultcomment
- 2026-01-01-000010_CreateLabInfrastructure: edgeres, edgestatus, edgeack, workstation
- Moved 44 JSON files from valuesets/ subdirectory to app/Libraries/Data/ root
- Added new country.json lookup
- Added _meta.json for valueset metadata
- Deleted old valuesets/_meta.json
- Renamed gender.json to sex.json for consistency with patient.Sex column
- Removed duplicate country.json from valuesets/
- AGENTS.md: Updated Lookups library documentation with new methods
- README.md: Complete rewrite of lookup/valueset documentation
- Renamed MVP_TODO.md to TODO.md
- Added VUE_SPA_IMPLEMENTATION_PLAN.md
- Removed deprecated prj_clinical laboratory quality management system_3a.docx
- ValueSet.php: Enhanced with caching and new lookup methods
- Lookups.php: Removed (functionality merged into ValueSet)
Impact: Prepares codebase for 2026 with cleaner migration history and improved
lookup data organization for the name-based valueset system.
2026-01-13 07:22:25 +07:00
|
|
|
'Method' => ['type' => 'VARCHAR', 'constraint' => 10, 'null' => true],
|
|
|
|
|
'Additive' => ['type' => 'VARCHAR', 'constraint' => 10, 'null' => true],
|
2025-10-07 16:18:37 +07:00
|
|
|
'AddQty' => ['type' => 'float', 'null' => true],
|
refactor: consolidate migrations and reorganize valueset data structure
Major refactoring to clean up database migrations and reorganize static lookup data:
- Consolidated 13 old migrations (2025) into 10 new numbered migrations (2026-01-01)
- Deleted redundant migrations: Location, Users, Contact, ValueSet, Counter, RefRange,
CRMOrganizations, Organization, AreaGeo, DeviceLogin, EdgeRes
- New consolidated migrations:
- 2026-01-01-000001_CreateLookups: valueset, counter, containerdef, occupation, specialty
- 2026-01-01-000002_CreateOrganization: account, site, location, discipline, department
- 2026-01-01-000003_CreatePatientCore: patient, patidentifier, pataddress, patcontact
- 2026-01-01-000004_CreateSecurity: contact, contactdetail, userdevices, loginattempts
- 2026-01-01-000005_CreatePatientVisits: patvisit, patinsurance
- 2026-01-01-000006_CreateOrders: porder, orderitem
- 2026-01-01-000007_CreateSpecimens: specimen, specmenactivity, containerdef
- 2026-01-01-000008_CreateTestDefinitions: testdefinition, testactivity, refnum, reftxt
- 2026-01-01-000009_CreateResults: patresult, patresultdetail, patresultcomment
- 2026-01-01-000010_CreateLabInfrastructure: edgeres, edgestatus, edgeack, workstation
- Moved 44 JSON files from valuesets/ subdirectory to app/Libraries/Data/ root
- Added new country.json lookup
- Added _meta.json for valueset metadata
- Deleted old valuesets/_meta.json
- Renamed gender.json to sex.json for consistency with patient.Sex column
- Removed duplicate country.json from valuesets/
- AGENTS.md: Updated Lookups library documentation with new methods
- README.md: Complete rewrite of lookup/valueset documentation
- Renamed MVP_TODO.md to TODO.md
- Added VUE_SPA_IMPLEMENTATION_PLAN.md
- Removed deprecated prj_clinical laboratory quality management system_3a.docx
- ValueSet.php: Enhanced with caching and new lookup methods
- Lookups.php: Removed (functionality merged into ValueSet)
Impact: Prepares codebase for 2026 with cleaner migration history and improved
lookup data organization for the name-based valueset system.
2026-01-13 07:22:25 +07:00
|
|
|
'AddUnit' => ['type' => 'VARCHAR', 'constraint' => 10, 'null' => true],
|
2025-10-07 16:18:37 +07:00
|
|
|
'PrepStart' => ['type' => 'datetime', 'null' => true],
|
|
|
|
|
'PrepEnd' => ['type' => 'datetime', 'null' => true],
|
2025-10-10 16:47:39 +07:00
|
|
|
'CreateDate' => ['type' => 'Datetime', 'null' => true],
|
2025-10-07 16:18:37 +07:00
|
|
|
'EndDate' => ['type' => 'DATETIME', 'null' => true],
|
|
|
|
|
'ArchiveDate' => ['type' => 'DATETIME', 'null' => true]
|
|
|
|
|
]);
|
|
|
|
|
$this->forge->addKey('SpcPrpID', true);
|
|
|
|
|
$this->forge->createTable('specimenprep');
|
|
|
|
|
|
|
|
|
|
$this->forge->addField([
|
|
|
|
|
'SpcLogID'=> ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true],
|
|
|
|
|
'TblName' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
|
|
|
|
'RecID' => ['type' => 'INT', 'constraint' => 11, 'null' => true],
|
|
|
|
|
'FldName' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
|
|
|
|
'FldValuePrev'=> ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
|
|
|
|
'UserID' => ['type' => 'INT', 'constraint' => 11, 'null' => true],
|
|
|
|
|
'SiteID' => ['type' => 'INT', 'constraint' => 11, 'null' => true],
|
|
|
|
|
'DIDType' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
|
|
|
|
'DID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
|
|
|
|
'MachineID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
|
|
|
|
'SessionID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
|
|
|
|
'AppID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
|
|
|
|
'ProcessID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
|
|
|
|
'WebPageID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
|
|
|
|
'EventID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
|
|
|
|
'ActivityID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
|
|
|
|
'Reason' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
2025-10-10 16:47:39 +07:00
|
|
|
'LogDate' => ['type' => 'Datetime', 'null' => true],
|
2025-10-07 16:18:37 +07:00
|
|
|
]);
|
|
|
|
|
$this->forge->addKey('SpcLogID', true);
|
|
|
|
|
$this->forge->createTable('specimenlog');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function down() {
|
|
|
|
|
$this->forge->dropTable('specimenlog');
|
refactor: consolidate migrations and reorganize valueset data structure
Major refactoring to clean up database migrations and reorganize static lookup data:
- Consolidated 13 old migrations (2025) into 10 new numbered migrations (2026-01-01)
- Deleted redundant migrations: Location, Users, Contact, ValueSet, Counter, RefRange,
CRMOrganizations, Organization, AreaGeo, DeviceLogin, EdgeRes
- New consolidated migrations:
- 2026-01-01-000001_CreateLookups: valueset, counter, containerdef, occupation, specialty
- 2026-01-01-000002_CreateOrganization: account, site, location, discipline, department
- 2026-01-01-000003_CreatePatientCore: patient, patidentifier, pataddress, patcontact
- 2026-01-01-000004_CreateSecurity: contact, contactdetail, userdevices, loginattempts
- 2026-01-01-000005_CreatePatientVisits: patvisit, patinsurance
- 2026-01-01-000006_CreateOrders: porder, orderitem
- 2026-01-01-000007_CreateSpecimens: specimen, specmenactivity, containerdef
- 2026-01-01-000008_CreateTestDefinitions: testdefinition, testactivity, refnum, reftxt
- 2026-01-01-000009_CreateResults: patresult, patresultdetail, patresultcomment
- 2026-01-01-000010_CreateLabInfrastructure: edgeres, edgestatus, edgeack, workstation
- Moved 44 JSON files from valuesets/ subdirectory to app/Libraries/Data/ root
- Added new country.json lookup
- Added _meta.json for valueset metadata
- Deleted old valuesets/_meta.json
- Renamed gender.json to sex.json for consistency with patient.Sex column
- Removed duplicate country.json from valuesets/
- AGENTS.md: Updated Lookups library documentation with new methods
- README.md: Complete rewrite of lookup/valueset documentation
- Renamed MVP_TODO.md to TODO.md
- Added VUE_SPA_IMPLEMENTATION_PLAN.md
- Removed deprecated prj_clinical laboratory quality management system_3a.docx
- ValueSet.php: Enhanced with caching and new lookup methods
- Lookups.php: Removed (functionality merged into ValueSet)
Impact: Prepares codebase for 2026 with cleaner migration history and improved
lookup data organization for the name-based valueset system.
2026-01-13 07:22:25 +07:00
|
|
|
$this->forge->dropTable('specimenprep');
|
|
|
|
|
$this->forge->dropTable('specimencollection');
|
|
|
|
|
$this->forge->dropTable('specimenstatus');
|
|
|
|
|
$this->forge->dropTable('specimen');
|
2025-10-07 16:18:37 +07:00
|
|
|
}
|
refactor: consolidate migrations and reorganize valueset data structure
Major refactoring to clean up database migrations and reorganize static lookup data:
- Consolidated 13 old migrations (2025) into 10 new numbered migrations (2026-01-01)
- Deleted redundant migrations: Location, Users, Contact, ValueSet, Counter, RefRange,
CRMOrganizations, Organization, AreaGeo, DeviceLogin, EdgeRes
- New consolidated migrations:
- 2026-01-01-000001_CreateLookups: valueset, counter, containerdef, occupation, specialty
- 2026-01-01-000002_CreateOrganization: account, site, location, discipline, department
- 2026-01-01-000003_CreatePatientCore: patient, patidentifier, pataddress, patcontact
- 2026-01-01-000004_CreateSecurity: contact, contactdetail, userdevices, loginattempts
- 2026-01-01-000005_CreatePatientVisits: patvisit, patinsurance
- 2026-01-01-000006_CreateOrders: porder, orderitem
- 2026-01-01-000007_CreateSpecimens: specimen, specmenactivity, containerdef
- 2026-01-01-000008_CreateTestDefinitions: testdefinition, testactivity, refnum, reftxt
- 2026-01-01-000009_CreateResults: patresult, patresultdetail, patresultcomment
- 2026-01-01-000010_CreateLabInfrastructure: edgeres, edgestatus, edgeack, workstation
- Moved 44 JSON files from valuesets/ subdirectory to app/Libraries/Data/ root
- Added new country.json lookup
- Added _meta.json for valueset metadata
- Deleted old valuesets/_meta.json
- Renamed gender.json to sex.json for consistency with patient.Sex column
- Removed duplicate country.json from valuesets/
- AGENTS.md: Updated Lookups library documentation with new methods
- README.md: Complete rewrite of lookup/valueset documentation
- Renamed MVP_TODO.md to TODO.md
- Added VUE_SPA_IMPLEMENTATION_PLAN.md
- Removed deprecated prj_clinical laboratory quality management system_3a.docx
- ValueSet.php: Enhanced with caching and new lookup methods
- Lookups.php: Removed (functionality merged into ValueSet)
Impact: Prepares codebase for 2026 with cleaner migration history and improved
lookup data organization for the name-based valueset system.
2026-01-13 07:22:25 +07:00
|
|
|
}
|