chore: add more ABDM diagnostic scripts (multi-patient consent flow comparison)

This commit is contained in:
DevSoftTech Server 2026-07-28 03:11:43 +05:30
parent 768079c970
commit d7dae674cc
6 changed files with 67 additions and 0 deletions

9
check_opd_master.php Normal file
View File

@ -0,0 +1,9 @@
<?php
$db = new mysqli('localhost', 'root', '', 'hms_data_ci4');
$res = $db->query("SHOW COLUMNS FROM opd_master");
$cols = [];
while ($row = $res->fetch_assoc()) { $cols[] = $row['Field']; }
echo implode(', ', $cols) . "\n---\n";
$res2 = $db->query("SELECT opd_id, opd_code, p_id, P_name, opd_book_date, running_opd, running_opd_id, no_visit FROM opd_master WHERE p_id = 11 ORDER BY opd_id DESC LIMIT 5");
while ($row = $res2->fetch_assoc()) { print_r($row); }
$db->close();

8
check_opd_visit_list.php Normal file
View File

@ -0,0 +1,8 @@
<?php
$db = new mysqli('localhost', 'root', '', 'hms_data_ci4');
$res = $db->query("SHOW COLUMNS FROM opd_visit_list");
while ($row = $res->fetch_assoc()) { echo $row['Field'] . "\n"; }
echo "---\n";
$res2 = $db->query("SELECT * FROM opd_visit_list WHERE p_id = 11 ORDER BY id DESC LIMIT 5");
while ($row = $res2->fetch_assoc()) { print_r($row); }
$db->close();

View File

@ -0,0 +1,21 @@
<?php
$db = new mysqli('localhost', 'root', '', 'hms_data_ci4');
echo "=== Patients with non-empty abha_address (excluding the known test patient id=15) ===\n";
$sql = "SELECT id, p_fname, p_lname, abha_address
FROM patient_master
WHERE abha_address IS NOT NULL AND abha_address != '' AND id != 15
ORDER BY id DESC
LIMIT 20";
$res = $db->query($sql);
while ($row = $res->fetch_assoc()) {
print_r($row);
}
echo "\n=== hospital_setting HFR-related keys ===\n";
$res2 = $db->query("SELECT s_name, s_value FROM hospital_setting WHERE s_name LIKE '%HFR%' OR s_name LIKE '%ABDM%'");
while ($row = $res2->fetch_assoc()) {
print_r($row);
}
$db->close();

View File

@ -0,0 +1,9 @@
<?php
$db = new mysqli('localhost', 'root', '', 'hms_data_ci4');
$abha = '91510165305101@sbx';
$res = $db->query("SELECT id, operation, workflow_state, status, http_code, request_id, gateway_request_id, created_at, updated_at, completed_at FROM abdm_hiu_workflows WHERE abha_address = '{$abha}' ORDER BY id ASC");
while ($row = $res->fetch_assoc()) { print_r($row); }
echo "\n=== doc count ===\n";
$res2 = $db->query("SELECT COUNT(*) as c FROM abdm_hiu_documents WHERE abha_address = '{$abha}'");
print_r($res2->fetch_assoc());
$db->close();

View File

@ -0,0 +1,11 @@
<?php
$db = new mysqli('localhost', 'root', '', 'hms_data_ci4');
$abha = 'meerabisht1981@sbx';
echo "=== Distinct operations ever seen for {$abha} ===\n";
$res = $db->query("SELECT operation, COUNT(*) c FROM abdm_hiu_workflows WHERE abha_address = '{$abha}' GROUP BY operation");
while ($row = $res->fetch_assoc()) { print_r($row); }
echo "\n=== Compare: patient 11 ABHA operations (for reference) ===\n";
$res2 = $db->query("SELECT operation, COUNT(*) c FROM abdm_hiu_workflows WHERE abha_address = '91510165305101@sbx' GROUP BY operation");
while ($row = $res2->fetch_assoc()) { print_r($row); }
$db->close();

9
find_opd_tables.php Normal file
View File

@ -0,0 +1,9 @@
<?php
$db = new mysqli('localhost', 'root', '', 'hms_data_ci4');
echo "=== OPD visits for patient_id = 11 ===\n";
$res = $db->query("SHOW TABLES LIKE '%opd%'");
while ($row = $res->fetch_assoc()) {
print_r($row);
}
$db->close();