Major updates to order system: - Add specimen and test data to order responses (index, show, create, update, status update) - Implement getOrderSpecimens() and getOrderTests() private methods in OrderTestController - Support 'include=details' query parameter for expanded order data - Update OrderTestModel with enhanced query capabilities and transaction handling API documentation: - Update OpenAPI specs for orders, patient-visits, and tests - Add new schemas for order specimens and tests - Regenerate bundled API documentation Database: - Add Requestable field to TestDefSite migration - Create OrderSeeder and ClearOrderDataSeeder for test data - Update DBSeeder to include order seeding Patient visits: - Add filtering by PatientID, PatientName, and date ranges - Include LastLocation in visit queries Testing: - Add OrderCreateTest with comprehensive test coverage Documentation: - Update AGENTS.md with improved controller structure examples
41 lines
1017 B
PHP
41 lines
1017 B
PHP
<?php
|
|
|
|
namespace App\Database\Seeds;
|
|
|
|
use CodeIgniter\Database\Seeder;
|
|
|
|
class ClearOrderDataSeeder extends Seeder
|
|
{
|
|
public function run()
|
|
{
|
|
echo "Clearing order-related tables...\n";
|
|
|
|
// Disable foreign key checks temporarily
|
|
$this->db->query('SET FOREIGN_KEY_CHECKS = 0');
|
|
|
|
// Clear tables in reverse dependency order
|
|
$this->db->table('ordercom')->truncate();
|
|
echo " - ordercom truncated\n";
|
|
|
|
$this->db->table('orderstatus')->truncate();
|
|
echo " - orderstatus truncated\n";
|
|
|
|
$this->db->table('patres')->truncate();
|
|
echo " - patres truncated\n";
|
|
|
|
$this->db->table('specimenstatus')->truncate();
|
|
echo " - specimenstatus truncated\n";
|
|
|
|
$this->db->table('specimen')->truncate();
|
|
echo " - specimen truncated\n";
|
|
|
|
$this->db->table('ordertest')->truncate();
|
|
echo " - ordertest truncated\n";
|
|
|
|
// Re-enable foreign key checks
|
|
$this->db->query('SET FOREIGN_KEY_CHECKS = 1');
|
|
|
|
echo "\nAll order-related tables cleared successfully!\n";
|
|
}
|
|
}
|