Commit Graph

19 Commits

Author SHA1 Message Date
d0a0bf984e Fix ABHA card fetch and address suggestions 2026-08-13 17:41:31 +05:30
3e70ff8c4a Redesign ABHA Aadhaar creation flow 2026-08-13 17:11:48 +05:30
73ad7ef11f Store ABHA card and improve patient comparison 2026-08-13 11:30:02 +05:30
6a670d4c48 Refine ABHA patient matching criteria 2026-08-13 11:21:38 +05:30
48d6073a37 Fix false ABHA candidate name matches 2026-08-13 11:15:53 +05:30
fe9f46cb65 Consume enriched ABHA gateway response 2026-08-13 11:03:53 +05:30
c698d5df32 Preserve complete ABHA verification profile 2026-08-13 10:57:38 +05:30
a5447cb83a Complete ABHA account verification flow 2026-08-13 10:36:20 +05:30
ee9bb7b560 Fix ABHA card barcode print rendering 2026-08-01 03:57:43 +05:30
55bcaa7d09 Fix ABDM M3 HIU multi-facility consent session grouping and document display
- Fix groupWorkflowRowsIntoSessions() to correlate workflow rows by stable
  request_id/abdm_consent_request_id instead of chronological proximity to
  the newest CONSENT_REQUEST row. Background polling reconciles all
  historical sessions in one batch, so older sessions' rows previously got
  silently merged into the newest session, causing 'Show Data' to display
  an unrelated older session's single facility instead of all consented
  facilities.
- Skip synthetic orphan sessions (stray rows with no owning CONSENT_REQUEST)
  in getAbdmConsentRequestsList()/getAbdmConsentArtifactDetail() so they
  don't show as phantom history rows or get picked as 'most recent'.
- Fix abdm_documents() consent_request_id filter to match all known sibling
  artifact IDs for a session (via abdm_hiu_consent_artifacts), not just an
  exact single artifact id, so all facilities under one consent request
  appear together.
- Fix CreateAbdmHiuConsentArtifacts migration: reduce VARCHAR(180) to
  VARCHAR(100) on consent_request_id/artifact_id to satisfy MySQL's
  1000-byte composite key length limit (was silently failing to migrate).
- Add fetchAllArtifactsAfterGrant() cascade in M3HiuWorkflowService to fetch
  every known artifact under a granted consent, used by both the cron poll
  and a new abdm_check_live_status() endpoint/button.
- getLatestAbdmSyncSnapshot() session-scoping fix to avoid an older granted
  session masking a newer in-progress one.
- Relabel Dr. Joshi Clinic documents (previously mislabeled 'Test Hospital'
  from the HIP's own FHIR bundle Organization name).
2026-07-30 05:08:44 +05:30
82b7b27273 fix(abha): persist OTP-verified mobile number when bridge response omits it
Abha::verifyOtp() and Abha::verifyCommOtp() were overwriting the
user-typed, OTP-verified mobile number with whatever the ABDM bridge's
verify-otp response echoed back for 'mobile'. Many bridge responses
(especially plain mobile-OTP verification, as opposed to Aadhaar eKYC)
do not echo the mobile at all, so it silently became empty and was
never saved to patient_master.mphone1 during ABHA Register (By ABHA
Number / QR / Facility QR / Mobile OTP) or ABHA Create/Verify.

Fix: fall back to the originally submitted/verified mobile when the
gateway response omits it. Also updated Patient_V.php JS (Verify ABHA
tab, ABHA Register Method 1 and Method 4) to resend the mobile number
along with the verify_comm_otp call so the server has it available.

Address/email are unaffected by this bug: those fields are already
mapped via applyAbhaMetaColumns() when present, but the ABDM mobile-OTP
verification API generally doesn't return KYC demographic data (that
only comes from the Aadhaar-eKYC flow) - so they may legitimately
stay blank for phone-based registration methods.
2026-07-29 13:52:07 +05:30
90831d4b39 Harden ABDM bridge auth flow and sync handling 2026-07-28 00:14:49 +05:30
83c9a9f015 Show actual ABDM bridge messages in ABHA OTP flows 2026-07-25 22:25:31 +05:30
3de17d955d ABHA card: remove official/bridge actions and improve local card data 2026-07-23 16:22:43 +05:30
e89e186281 ABHA: fetch official card via bridge API and print base64 card 2026-07-23 16:10:34 +05:30
5d6acdd480 Implement ABDM bridge health record flows
- add facility QR support and OPD queue bridge fixes
- support care-context push warnings for lab, radiology, IPD and remaining HI types
- improve ABHA patient matching and diagnosis autocomplete performance
- clean up webcam streams on page navigation
2026-07-20 03:02:09 +05:30
985d476bc1 ABDM: finalize ABHA verify persistence, M2 routes/workflows, and location masters seeding 2026-06-24 03:15:22 +05:30
96c030b72d chore: checkpoint before discharge history panel refactor 2026-06-22 02:05:24 +05:30
0628f8f813 feat: ABDM OPD Queue + ABHA Register flow + patient ABHA search fix
ABDM OPD Queue (today):
- New EAtriaBridgeConnector: opdQueueFetch/opdTokenCreate/opdTokenUpdateStatus + patch() helper
- New AbdmOpdQueue controller: index/list/fetchQueue/createToken/updateTokenStatus/processScannedToken
  - fetchQueue syncs gateway tokens into abdm_opd_tokens (local DB) and enriches with HMS patient data
  - processScannedToken auto-finds/creates patient_master record from ABHA scan data, marks token CALLED
- New migration: abdm_opd_tokens table (gateway_token_id, source, status, patient_id, opd_id, processed_at)
- New view: abdm/opd_queue.php - reception screen with auto-refresh 30s, HMS Patient column (green row when OPD registered)
- Sidebar: ABDM OPD Queue nav link added
- Routes: AbdmOpdQueue with abdmPermFilter

ABHA Register tab (earlier this session):
- New Abha controller: initiate/verifyOtp/communication/verifyCommOtp/validateAbha/card + autoCreateOrFindPatient
- New views: abha/card.php, partials/abha_create_panel.php, partials/abha_otp_modal.php
- Patient_V.php: ABHA Register tab with 4-method wizard (ABHA number, QR scan, facility QR, mobile OTP)

Patient ABHA search fix:
- Patient::search() now detects ABHA column (abha_id/abha_no/abha/abha_address) and searches by it

ABDM Bridge infrastructure:
- EAtriaBridgeConnector: new connector for e-atria.in ABDM bridge gateway
- AbdmConnectorFactory/Interface updated
- AbdmGatewaySettings controller + view
- SNOMED/CSNOTK terminology service skeleton
- Finance payout OPD consult views
- Migration: AddAbdmPushFieldsToOpdAndPatient, CreateSnomedCoreTables
- Docs: abdm/ API specs, architecture, gateway guides
2026-05-16 04:21:31 +05:30