clqms-be/check_db.php
mahdahar 118d490bbd refactor: update TestSeeder to use dynamic ValueSet lookups
- Implemented dynamic VID retrieval from ValueSetModel for all test definitions
- Aligned ResultType, RefType, and SpcType with the valueset table
- Updated sample data for Hematology, Chemistry, and Urinalysis tests
- Ensured consistency between ValueSetSeeder and TestSeeder data
2025-12-29 12:55:31 +07:00

19 lines
742 B
PHP

<?php
// Simple DB check script
define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR);
require 'vendor/codeigniter4/framework/system/Test/bootstrap.php';
$db = \Config\Database::connect();
$tables = ['location', 'site', 'account', 'patient', 'patvisit', 'valueset', 'contact'];
foreach ($tables as $table) {
try {
$count = $db->table($table)->countAllResults();
echo "$table count: $count\n";
if ($count > 0) {
$row = $db->table($table)->get(1)->getRow();
echo "$table first row ID: " . (isset($row->{$table.'ID'}) ? $row->{$table.'ID'} : 'unknown') . "\n";
}
} catch (\Exception $e) {
echo "$table error: " . $e->getMessage() . "\n";
}
}