- M3HiuDocumentRepository::persistFromDataFetch no longer includes the per-call request_id in the document dedup hash. request_id is unique every time data_fetch runs, so it was causing a brand-new duplicate row to be inserted on every re-fetch of the exact same ABDM document. Now dedup key is transaction_id + consent_ref + care_context_reference + bundle_id, which stays stable across repeated fetches -> re-fetches UPDATE the existing row instead of duplicating it. - Added Patient::abdm_content_fetch_only() + route billing/patient/abdm_content_fetch_only/(id): a lightweight action for when consent is already GRANTED/COMPLETED. It calls data_fetch directly using the saved consent reference, skipping consent_request + reconcile polling entirely, avoiding unnecessary bridge calls/noise. - Patient_Profile_Opd_V.php: added a 'Fetch Records' button that only appears once consent phase is GRANTED or COMPLETED, wired to the new endpoint; on success it refreshes the document list in place. The original 'Fetch ABDM Records' button still owns the full consent request -> reconcile -> fetch flow and already stops/re-enables correctly on DENIED/FAILED (verified, no change needed there). - One-time cleanup: deduped existing abdm_hiu_documents rows in dev DB (13 -> 3) and recomputed doc_hash with the new stable key.
23 lines
779 B
PHP
23 lines
779 B
PHP
<?php
|
|
$db = new mysqli('localhost', 'root', '', 'hms_data_ci4');
|
|
$abha = '91510165305101@sbx';
|
|
|
|
echo "=== Columns ===\n";
|
|
$res = $db->query("SHOW COLUMNS FROM abdm_hiu_workflows");
|
|
while ($row = $res->fetch_assoc()) { echo $row['Field'] . " (" . $row['Type'] . ")\n"; }
|
|
|
|
echo "\n=== Latest 20 rows for {$abha} ===\n";
|
|
$res2 = $db->query("SELECT * FROM abdm_hiu_workflows WHERE abha_address = '{$abha}' ORDER BY id DESC LIMIT 20");
|
|
while ($row = $res2->fetch_assoc()) {
|
|
echo "--- id={$row['id']} ---\n";
|
|
foreach ($row as $k => $v) {
|
|
if (in_array($k, ['request_payload', 'response_payload', 'raw_response'])) {
|
|
echo "$k: " . substr((string)$v, 0, 500) . "\n";
|
|
} else {
|
|
echo "$k: $v\n";
|
|
}
|
|
}
|
|
echo "\n";
|
|
}
|
|
$db->close();
|