Commit Graph

787 Commits

Author SHA1 Message Date
016c0fdf2f Fix duplicate ABDM document rows: dedup on bundle_id + care_context_reference, not transaction_id/consent_ref
Confirmed empirically: the SAME clinical document (identical FHIR Bundle.id) gets re-delivered by the bridge under a DIFFERENT transaction_id/consent_ref every time it is re-fetched (e.g. via the by-ABHA-address historical fetch, which returns every past consent session for the patient). The old dedup hash included transaction_id+consent_ref, so every re-fetch created a brand-new duplicate row instead of updating the existing one -- observed as literal duplicate rows in the OPD ABDM Fetched Data list (same date/title appearing 2-3x). bundle_id is set once by the HIP and is stable across re-fetches/consents, so pair it with care_context_reference to uniquely identify a document instead.
2026-07-29 02:44:14 +05:30
ad98afbe57 Add Method 1 (fetch by request_id) for self/current-session data + fix latest-consent-anchor drift bug
- M3HiuWorkflowService: data_fetch now supports fetch_by_request_id=1, sending request_id (not consent_id) per bridge Method 1 -- targets the current/self consent request's own session, distinct from Method 2 (consent_id, which can resolve to a stale session sharing the same artifact).
- Patient::abdm_content_fetch_only(): tries Method 2 (consent_id) -> Method 1 (request_id, self data) -> Method 3 (abha_address, historical fallback) in order, stopping as soon as real documents are found.
- Fixed a real pre-existing bug this surfaced: getLatestAbdmSyncSnapshot() used the same flawed 'status=SUCCESS implies COMPLETED' check (without requiring workflow_state=DATA_RECEIVED) already fixed elsewhere in computeConsentSessionDetail(). This let broad/historical data_fetch rows (status=success, but decrypted_data=[]) hijack priority-500 'best' selection and silently drift the resolved 'latest granted consent' to an unrelated historical consent_id after Method 3 fallback ran. Now requires workflow_state=DATA_RECEIVED, matching the earlier fix.
2026-07-29 02:31:29 +05:30
c87928c2bc Support Method 3 (fetch by abha_address) as fallback to surface historical ABDM records
Per bridge gateway team guidance, GET /v1/hiu/data/fetch?abha_address=... returns ALL historical decrypted records across every past consent for a patient, unlike the consent/request-scoped Methods 1/2 previously used exclusively. Added M3HiuWorkflowService support for a fetch_by_abha_address flag on the data_fetch operation, and wired abdm_content_fetch_only() to automatically fall back to this broader lookup when the consent-scoped fetch finds nothing new -- this surfaced 14 previously-invisible historical documents (consultation reports, pathology/cytology) for the test patient that were never being fetched before.
2026-07-29 02:19:56 +05:30
690dbf9572 Fix misleading 'fetched successfully' message on Fetch Records when no documents were actually saved
abdm_content_fetch_only() always returned phase=COMPLETED and 'Records fetched successfully' whenever the data_fetch API call itself succeeded (fetchResult.ok===1), even when documents_persisted+documents_updated was 0 (bridge/HIP hasn't actually delivered any records yet -- decrypted_data still empty, session status 'requested'). Now check documents_persisted+documents_updated: if 0, report phase=GRANTED with a clear 'not sent any records yet' message instead of falsely claiming success.
2026-07-29 02:08:25 +05:30
afd1de04bf Fix ABDM consent status showing COMPLETED before data actually arrived
computeConsentSessionDetail() treated any data_fetch/hi_data_push_callback row with status=success as proof the session reached COMPLETED. But the DB 'status' column only reflects whether the underlying API call/poll succeeded (no HTTP/transport error) -- NOT whether data was actually received; that's tracked separately via workflow_state (DATA_PENDING vs DATA_RECEIVED). A data_fetch poll that succeeds at the HTTP level but returns decrypted_data=[] (bridge still processing) was incorrectly marked COMPLETED instead of staying at GRANTED. Now also require workflow_state === DATA_RECEIVED for the COMPLETED phase.
2026-07-29 01:55:15 +05:30
67daaf8894 Fix ABDM consent modal showing all HI types as DENIED when granted via async data push
When a consent session's overall phase resolves to GRANTED/COMPLETED via a data_fetch or hi_data_push_callback row (proof data was actually fetched), but no consent_reconcile/consent_status row in that session ever recorded which hi_types were granted (e.g. data arrives via async push before any reconcile poll runs), grantedHiTypes stayed empty and every requested HI type was incorrectly marked DENIED. Fall back to treating the full requested set as granted when we have positive proof of GRANTED/COMPLETED but no negative evidence of per-type denial.
2026-07-29 01:44:17 +05:30
0a19ccb425 Fix ABDM Consent Request History UI showing blank/orphaned COMPLETED row: fetchAbdmWorkflowRows() now always includes every consent_request anchor row for the ABHA (merged with recent-200 window), so heavy per-artifact data_fetch polling volume can no longer push a session's CONSENT_REQUEST row out of range and break groupWorkflowRowsIntoSessions() 2026-07-29 01:21:54 +05:30
5cdf367f94 Fix stale dateRange.to in M3 consent_request: always refresh to current time at actual dispatch (was only clamping if in the future, so a retried/reused payload with a stale-past cutoff silently excluded newer records forever) 2026-07-29 00:27:46 +05:30
e803809506 M3 HIU: track every discovered consent artifact id per consent_request in new abdm_hiu_consent_artifacts registry, and re-poll each individually every cycle (merged fetch-by-request-id alone does not keep returning already-established artifact sessions) 2026-07-28 23:47:19 +05:30
e783a57c4d Fix M3 multi-artifact polling: pollNatGateway now passes consent_request_id (not single resolved artifact id) to data_fetch, so the bridge returns merged sessions across ALL linked HIP facilities in one poll 2026-07-28 23:37:31 +05:30
9f2460fed9 Remove obsolete one-off M3/M2 diagnostic scripts (root cause resolved) 2026-07-28 23:35:01 +05:30
fd0d571f9b Add diagnostic spark command abdm:hiu-reconcile-by-request to test consent_reconcile by consent_request_id 2026-07-28 23:14:20 +05:30
d2c25b9e38 Add spark command abdm:hiu-fetch-by-consent for manual data_fetch of a specific consent artifact id 2026-07-28 22:57:57 +05:30
1439ce0fcc Fix invalid ABDM HIType codes (HealthDocument->HealthDocumentRecord, Wellness->WellnessRecord) causing consent_request 400; fix extractErrorText for array-shaped bridge error responses 2026-07-28 22:16:22 +05:30
5fb87ea4b4 Extract and display ABDM DocumentReference/Binary attachments (images/PDFs/documents) in fetched record detail view 2026-07-28 17:52:43 +05:30
9536cd2990 Replace ABDM HIU M3 sidebar console with global ABHA Patient Request List (Phase 3 across all patients) 2026-07-28 17:06:41 +05:30
dec025d6bf ABDM Custom Request: default Expiry Date uses exact +1 year instead of +365 days 2026-07-28 16:57:34 +05:30
7256858562 ABDM Custom Request modal: Purpose as fixed dropdown + add Expiry Date field 2026-07-28 16:54:00 +05:30
25db2e5ddc ABDM OPD tab: replace flow buttons with per-patient Consent Request History list (Phase 3) 2026-07-28 16:42:20 +05:30
48d19f0ff7 ABDM: add manual Consent Request form with editable HI types + date range (Phase 2)
- New Patient::abdm_content_request_custom(int \) endpoint builds a custom
  consent{} block (purpose, hiTypes, permission.dateRange, dataEraseAt) from
  user-submitted hi_types[]/date_from/date_to/purpose form fields, instead of
  always using M3HiuWorkflowService::buildDefaultConsent()'s hardcoded
  OPConsultation+DiagnosticReport / 365-day defaults. Reuses the existing
  requester/hiu-id resolution and hiTypes normalization already built into
  preparePayloadForOperation() for the consent_request operation, so no
  M3HiuWorkflowService changes were needed.
- New route (POST) patient/abdm_content_request_custom/(:num).
- New 'Custom Request' button + '#abdmCustomConsentModal' form
  (Patient_Profile_Opd_V.php) with HI type checkboxes (OPConsultation,
  DiagnosticReport, Prescription, DischargeSummary, HealthDocument,
  ImmunizationRecord, Wellness, Invoice), Valid From/To date inputs
  (defaulted to today-365d..today), and a Purpose text field. On submit,
  reuses the existing auto-flow polling loop (runAutoFlowStep) with the
  returned request_id to track status through to data fetch.
- Live-verified end-to-end on patient 11 (Devender Singh): submitted a
  request for OPConsultation + DiagnosticReport + Prescription; sandbox
  granted only OPConsultation/DiagnosticReport, and the Phase 1 consent
  detail modal correctly showed Prescription as DENIED alongside the two
  GRANTED types, confirming the partial-grant per-HI-type breakdown works
  correctly end-to-end.
2026-07-28 16:23:47 +05:30
7f47045c55 ABDM: add per-HI-type Consent Detail view (Phase 1)
- New Patient::getAbdmConsentArtifactDetail() helper builds a requested-vs-granted
  HI type breakdown for a patient's current ABDM consent artifact, using the
  bridge-team-confirmed 'Option A' model: overall status is single-valued
  (GRANTED/REVOKED/EXPIRED/DENIED), per-type status is derived by comparing the
  requested hiTypes (from the saved consent_request request_json) against the
  granted hi_types array (already flattened onto responses by
  M3HiuGatewayClient). No bridge changes or DB migrations required.
- New Patient::abdm_consent_detail(int \) JSON endpoint + route
  patient/abdm_consent_detail/(:num).
- New 'View Consent' link + Bootstrap modal on the OPD ABDM tab
  (Patient_Profile_Opd_V.php) rendering a lifecycle stepper, consent metadata
  (Consent ID, Purpose, Valid From/To, Erase Date), and a per-HI-type table
  (Document Type / Permission / Status / Timestamp).
- Fixed a bug found during live testing: once a consent reaches COMPLETED
  (after a successful data_fetch), the highest-priority workflow row has no
  hi_types field (it's a FHIR data bundle), which was causing all granted
  types to show as DENIED. Now searches workflow history for the most recent
  row that actually carries the granted hi_types payload.
- Live-verified against patient 15 (Meera Bisht): both requested HI types
  (OPConsultation, DiagnosticReport) correctly show GRANTED with timestamps.
2026-07-28 16:17:10 +05:30
37c3592f69 ABDM: auto-expire stale pending consent requests after 1 hour
Previously, clicking 'Fetch ABDM Records' when a prior consent request was
stuck in REQUESTED/PENDING (no GRANTED/DENIED callback ever received from
the ABDM bridge/PHR - e.g. patient never opened/approved it in their PHR
app) would just resume/re-poll that same dead request indefinitely, since
getLatestAbdmSyncSnapshot() always prioritized the existing REQUESTED
request over starting a new one.

Now:
- getLatestAbdmSyncSnapshot() computes the age of a REQUESTED/PENDING
  snapshot's updated_at and marks restart_required = true once it has
  been pending for more than ABDM_PENDING_STALE_SECONDS (1 hour).
- abdm_content_auto_flow() honors this flag: when the last sync is stale,
  it no longer resumes the old request_id and instead falls through to
  create a brand-new consent_request against the bridge.

Verified locally: a 6h-old stale REQUESTED request for a test ABHA was
correctly abandoned and a fresh consent_request was created and granted
on the next 'Fetch ABDM Records' click, instead of re-polling the dead
request.
2026-07-28 14:36:15 +05:30
becff35929 ABDM OPD tab: fix duplicate fetched-document rows + add dedicated Fetch Records action
- 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.
2026-07-28 04:34:08 +05:30
a5219bca2d ABDM Gateway settings: add admin UI toggle for SSL certificate verification
Adds a 'Verify SSL Certificate' switch on Admin -> ABDM Gateway page,
persisted as hospital_setting.ABDM_BRIDGE_SSL_VERIFY (default ON/secure).
Wired into M3HiuGatewayClient, EAtriaBridgeConnector, and the settings
page's own Test Connection check. Per-machine ABDM_BRIDGE_SSL_VERIFY env
var still overrides this DB setting for deployments needing a quick
local-only workaround. Verification stays on by default everywhere;
disabling it is an explicit, visible opt-in with an on-page warning.
2026-07-28 03:47:06 +05:30
b26920c6f4 ABDM bridge: allow opt-in SSL verify bypass via ABDM_BRIDGE_SSL_VERIFY env for envs with stale local CA bundles
Some local WAMP/XAMPP/Laragon PHP installs ship an outdated cacert.pem,
causing outbound HTTPS calls to the bridge to fail with cURL error 60
(SSL certificate problem). Rather than globally disabling certificate
verification (as bridge support suggested), verification stays ON by
default and can only be disabled per-deployment by explicitly setting
ABDM_BRIDGE_SSL_VERIFY=false in that machine's .env. The real fix on
affected machines is updating curl.cainfo in php.ini.
2026-07-28 03:37:23 +05:30
a1127522ef ABDM M3: flatten nested consent.status from bridge (root cause fix) and redesign OPD Fetch ABDM Records UI 2026-07-28 02:48:02 +05:30
716ad04d13 Fix duplicate ABDM consent requests: only treat consent_request submission failure as terminal FAILED 2026-07-28 02:36:27 +05:30
acc4e5c287 Prefer recent granted/completed over pending 404 snapshot 2026-07-28 02:28:57 +05:30
5c15424280 Promote granted consent status in snapshot ranking 2026-07-28 02:26:19 +05:30
98b25914d7 Include callback operations in ABDM sync snapshot 2026-07-28 02:15:34 +05:30
71e0c7cf24 Treat transient consent 404 as pending 2026-07-28 02:07:50 +05:30
c2a3e3054f Resolve fallback consent status in OPD flow 2026-07-28 01:53:44 +05:30
05d35f6021 Make OPD ABDM flow wait for first request 2026-07-28 01:46:36 +05:30
49969cb9be Simplify ABDM request flow for users 2026-07-28 01:28:08 +05:30
a15f5a0785 Handle failed ABDM consent reset and add status help 2026-07-28 01:05:25 +05:30
646347534d Harden consent date range across bridge and HIU paths 2026-07-28 00:46:47 +05:30
9a7bd9ed3a Clamp HIU consent dateRange.to to current UTC 2026-07-28 00:32:39 +05:30
90831d4b39 Harden ABDM bridge auth flow and sync handling 2026-07-28 00:14:49 +05:30
bf6090cfd5 Route consent status through flexible handler 2026-07-27 15:35:43 +05:30
3b6ed76a3c Reset stale ABDM request flow after bridge 404 2026-07-27 15:21:42 +05:30
0048cb1eff Resume granted consent flow on reconcile 404 and attempt direct fetch 2026-07-27 15:01:36 +05:30
698b9cd520 Prefer granted/completed ABDM state over latest 404 reconcile rows 2026-07-27 14:40:39 +05:30
c77201ec96 Persist and resume ABDM sync state on profile reload 2026-07-27 14:32:47 +05:30
8086bfbeb6 Stop ABDM auto-sync polling on reconcile 404 2026-07-27 14:28:42 +05:30
49698a72d7 Handle ABDM reconcile not-found as pending state 2026-07-27 14:18:07 +05:30
92a954a4cd Fix ABDM HIU auto-flow duplicate consent handling 2026-07-27 14:12:56 +05:30
9730f9a450 Update ABHA card branding assets 2026-07-25 22:26:28 +05:30
83c9a9f015 Show actual ABDM bridge messages in ABHA OTP flows 2026-07-25 22:25:31 +05:30
9a3f29660b Add modal preview for OPD history scans 2026-07-25 21:41:58 +05:30
f90bb94063 Enlarge OPD scan preview modal 2026-07-25 21:31:30 +05:30
39b5fc7c3e Use opd_no on OPD history header 2026-07-25 21:20:10 +05:30
4e060b9b98 Add patient details to OPD history header 2026-07-25 21:03:06 +05:30
f2e79a27a7 ABHA card: use official NHA/ABDM logo in header 2026-07-23 16:30:23 +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
3bda6f5291 ABDM M2 care-context outbound sync and server cron automation 2026-07-23 15:12:46 +05:30
0176079e7d Pharmacy product edit: debounce and cancel drug autocomplete requests 2026-07-23 12:11:28 +05:30
c84ea383e4 ABDM records/push: treat 201/409 as submitted, persist record IDs, and update OPD UI state 2026-07-21 01:32:30 +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
2bd52532a0 Add ABDM M3 fetch option to Ayushman claim sheet 2026-07-19 01:19:56 +05:30
7a547eb443 Add E-Atria immunization master sync 2026-07-19 01:00:43 +05:30
82fd31d105 Add patient immunization module 2026-07-19 00:41:12 +05:30
629590d9ab ABDM: separate course section and include doctor in discharge FHIR 2026-07-17 18:40:19 +05:30
ca025a088e ABDM: hide empty investigations and standardize discharge headings 2026-07-17 18:33:43 +05:30
d7fe05e6b0 ABDM: enrich discharge FHIR with observations advice and risks 2026-07-17 17:59:54 +05:30
2335006c30 ABDM: enrich IPD discharge FHIR preview with clinical content 2026-07-17 17:48:41 +05:30
3b3e71341d ABDM: persist IPD discharge FHIR to sync outbox 2026-07-17 17:42:17 +05:30
e9b31e8475 Remove duplicate complaint subheading in print output 2026-07-17 17:32:47 +05:30
d6caf13be9 Ensure complaint narrative appears in discharge print output 2026-07-17 17:30:02 +05:30
7c76973ca3 Fix IPD discharge complaint live add/remove and section refresh sync 2026-07-17 17:23:43 +05:30
c4533b0294 Fix discharge print complaints section fallback 2026-07-17 16:42:08 +05:30
2b53c05a68 Add ABDM documents and patient profile sync UI 2026-07-16 18:23:40 +05:30
0e8e164335 Preserve repaired discharge HTML sections in mPDF
Serialize the full repaired body instead of only the temporary wrapper contents so DOMDocument recovery does not drop later discharge sections before mPDF rendering.
2026-07-15 21:16:25 +05:30
8270c8a049 Fix discharge mPDF rendering for malformed HTML
Normalize malformed discharge summary HTML before passing it to mPDF so browser-tolerated markup does not break PDF output.
2026-07-15 21:11:53 +05:30
bdae843f0a Fix duplicate OPD invoice payment redirect handling 2026-07-10 22:52:33 +05:30
02bfc02e39 Fix duplicate load_form execution and undefined OPD navigation 2026-07-10 22:46:49 +05:30
c5236ea2eb Fix duplicate OPD prescription print tab opening 2026-07-10 18:19:10 +05:30
3801610cdf Add mbstring-safe fallbacks in OPD prescription save 2026-07-10 01:18:34 +05:30
bb5f570ead Return JSON error response for OPD autosave exceptions 2026-07-10 01:11:49 +05:30
6767fce287 Fix OPD prescription autosave 500 on non-string payload values 2026-07-10 01:07:27 +05:30
5de65a73f1 Handle no-records cleanly without DataTable warning in Invoice lists 2026-07-10 00:45:07 +05:30
644449b3de Add safe load_form fallback and resilient invoice navigation 2026-07-10 00:39:58 +05:30
60d708c7b8 Fix Orgcase table 500 and prevent duplicate DataTable init 2026-07-10 00:34:49 +05:30
fb696863d4 Fix DataTables reinit and duplicate handlers in Invoice views 2026-07-10 00:25:00 +05:30
acabc6abdd ABDM HIU callback hardening, OPD ABHA optional confirm, and AJAX memory cleanup 2026-07-10 00:09:35 +05:30
658e67ad3b OPD: fix Select2 transport error and stale investigation results 2026-07-09 16:55:06 +05:30
2b32dfe5da OPD: reduce consult search min chars and wildcard threshold 2026-07-09 16:11:53 +05:30
e625233d96 Improve OPD history scan viewer with responsive sizing and modal zoom/pan 2026-07-08 15:35:01 +05:30
540de8c76e Enhance camera capture/edit permissions and fix OPD AdviceBlock rendering 2026-07-08 15:24:39 +05:30
fd8e96747d OPD consult: add floating draggable section bookmarks with persistent position 2026-07-07 15:17:58 +05:30
6407db9dbc Update HIU workflow, patient view, and related assets 2026-07-07 01:13:28 +05:30
f243aeeb04 Preserve OPD textarea newlines in print and refine IPD date filter layout 2026-07-06 18:49:10 +05:30
43f465e261 Fix OPD advice label and Hindi rendering in template output 2026-07-04 14:53:13 +05:30
fb460e02e8 Fix OPD AdviceBlock label rendering 2026-07-04 14:31:55 +05:30
068cbe8ccd Medical GST: persist item tax breakup and add backfill 2026-07-02 22:35:34 +05:30
ce15a42239 Medical reports: derive GST in sale summary 2026-07-02 21:13:53 +05:30
c2f1f76dcb IPD discharge: add edit action for prescribed medicines 2026-07-02 20:26:47 +05:30
c22c21d36c OPD template: keep {{investigation}} print order by sequence 2026-07-02 19:34:41 +05:30
681bb947b3 Investigation master: add category autofill action and rules 2026-07-02 19:05:33 +05:30
c930a54155 Investigations: use order_id sequence for profile apply and list order 2026-07-02 18:57:08 +05:30
c148b01466 OPD consult profiles: apply saved investigation order 2026-07-02 18:52:11 +05:30
0c85dddd43 Investigation profile: preserve select2 item order in edit panel 2026-07-02 18:43:34 +05:30
0a48fa6d2c OPD investigation list: order by id instead of name 2026-07-02 18:24:33 +05:30
6288c626fc mPDF: normalize numeric font-weights across template PDF renderers 2026-07-02 10:27:46 +05:30
1abf572a14 OPD letter: add HTML debug endpoint and placeholder style controls 2026-07-02 10:09:45 +05:30
71abebb3d4 OPD template builder: show opd fee amount/desc in usage panel 2026-07-02 09:47:09 +05:30
e85bfd85e1 OPD template: split opd fee into amount and description placeholders 2026-07-02 09:40:25 +05:30
0f8bd43e72 Fix ABDM M3 HIU ID mapping, polling guards, and migration compatibility 2026-07-02 00:55:05 +05:30
3d40642116 Add ABDM M3 HIU workflows, routes, UI, and runbook docs 2026-07-01 17:37:53 +05:30
14a9d851ad ABDM: force gateway push from OPD modal and treat timeout as queued when bridge already succeeded 2026-06-30 19:15:29 +05:30
c310221961 ABDM: use configured HFR for EAtria connector and avoid submit timeout HTML 500 2026-06-30 18:49:37 +05:30
3072639cd5 Revert "ABDM: fix local submit fallback, HFR runtime usage, status sync, and link-token retry"
This reverts commit e08c18f5b2.
2026-06-30 18:11:34 +05:30
e08c18f5b2 ABDM: fix local submit fallback, HFR runtime usage, status sync, and link-token retry 2026-06-30 18:09:55 +05:30
7a38c3e55d ABDM task board: show submit action for FHIR-ready OPD rows 2026-06-28 02:17:41 +05:30
ed48a447e5 ABDM M2: add push-sync outbox, worker, and FHIR generators 2026-06-27 01:53:44 +05:30
e651b18a01 ABDM: guard repeat OPD submits and dedupe health records 2026-06-27 00:32:14 +05:30
9b00974e4e ABDM task board: add OPD gateway retry action 2026-06-27 00:22:17 +05:30
db7ba044b1 ABDM task board: show OPD record lifecycle status 2026-06-27 00:21:02 +05:30
c7c18adae2 Fix closure capture for M2 log mode flag 2026-06-26 23:58:00 +05:30
8c46a155ac M2 logs: remove misleading consent warning in local mode 2026-06-26 23:57:44 +05:30
ea3d88ce46 M2 local mode: treat consent-missing as pending info log 2026-06-26 23:54:31 +05:30
617cecdcbf Fix push_to_gateway variable scope in fhir submit flow 2026-06-26 23:49:51 +05:30
a797b7d096 Fix fhir_bundle_submit undefined push_to_gateway variable 2026-06-26 23:49:32 +05:30
d4595fa028 M2 flow: default OPD submit to HMS source care-context mode 2026-06-26 23:41:58 +05:30
4c4b742df9 Billing patient: fix shared csrfToken helper scope 2026-06-26 19:28:50 +05:30
239f0ad374 EAtria auth debug: include full token sha256 in bridge logs 2026-06-26 18:06:00 +05:30
5e3d657a01 EAtria auth debug: enforce DB token source and log token fingerprint 2026-06-26 17:57:46 +05:30
51e5ab026c ABDM M2 compliance: strict EAtria auth/HFR and callback replay guards 2026-06-26 17:52:21 +05:30
03638979f0 EAtria settings: use newest hospital_setting row for token/hfr values 2026-06-26 17:21:12 +05:30
0c0dbf78b4 EAtria pushRecord: fallback to /v1/bridge dispatcher on auth-scoped 403 2026-06-26 17:16:36 +05:30
bf3345b2ce EAtria auth: include bridge hospital id in header and records.push body 2026-06-26 16:59:40 +05:30
c632f28482 EAtria connector: retry alternate DB token keys on 401/403 and log token source 2026-06-26 16:55:07 +05:30
ab564c77f8 ABDM OPD share: fix null-consent crash in care-context fallback 2026-06-26 16:46:10 +05:30
5d1d7ea552 ABDM OPD share: allow care-context push without active consent and log to bridge log 2026-06-26 16:43:19 +05:30
e7e5cf88e7 ABDM submit: release session lock before internal handoff and extend client timeout 2026-06-26 16:39:53 +05:30
a23d1f215a ABDM submit: prevent indefinite loading with fetch timeout and safer response handling 2026-06-26 16:35:36 +05:30
428dcd2aa9 ABDM: treat transient handoff timeout as queued when recent OPD record exists 2026-06-26 16:30:52 +05:30
fbaa985857 feat(abdm): implement M2 gateway contract endpoints and live test tooling 2026-06-24 04:50:03 +05:30
985d476bc1 ABDM: finalize ABHA verify persistence, M2 routes/workflows, and location masters seeding 2026-06-24 03:15:22 +05:30
75e71c2343 Fix new patient create 500 from undefined ABHA lock flag 2026-06-22 08:30:36 +05:30
386055a0cd fix(discharge): unify history panel behavior and form nav sync 2026-06-22 02:40:50 +05:30
a602bf555d feat(discharge): unify history sections into single risk profile panel 2026-06-22 02:07:49 +05:30
96c030b72d chore: checkpoint before discharge history panel refactor 2026-06-22 02:05:24 +05:30
8fc60e893e Fix pharmacy stock sync for invoice, purchase edit, challan and return flows 2026-06-20 11:25:40 +05:30
fe2fabc5b8 Make OPD placeholder headings consistently bold 2026-06-19 13:20:29 +05:30
b19d1d40c2 Fix OPD PDF overflow and compact consult placeholders 2026-06-19 13:12:34 +05:30
1bac1f6e04 feat: update storestock flow and ABDM bridge handling 2026-06-18 17:38:20 +05:30
1790be3fca ABDM M2: records push, discover/fetch, non-ABHA local storage, consent table compat
- EAtriaBridgeConnector: fix OPConsultRecord hi_type normalization (was wrongly
  mapping to PrescriptionRecord); allow push with either abha_address or abha_id;
  add careContextId alias for care_context_reference in pushRecord payload

- AbdmGateway: migrate OPD share to records/push semantics with unique
  care_context_reference, ABHA id/address resolution, bridge_record_id capture,
  and 409 DUPLICATE_RECORD non-fatal handling

- AbdmGateway: add non-ABHA local-only storage path for OPD/IPD/Lab share
  (push_status=local_only, no bridge call, audit logged)

- AbdmGateway: add POST /records/discover endpoint with ABHA-first + fallback
  matching by mobile, hospital ID, patient UHID+birthYear (PHR-compatible)

- AbdmGateway: add GET /records/fetch/{careContextId} endpoint returning
  decrypted FHIR payload from health_records

- AbdmGateway: dual-write consent artefacts to abdm_consent_records AND
  consents table when both present; getActiveConsentRecord falls back to
  consents table when abdm_consent_records is absent

- AbdmAuditService: write to audit_logs (generic schema) when present,
  fallback to abdm_audit_logs; field-aware insert supports both schemas

- Routes: register /records/discover and /records/fetch/(:any)

- Webhook signature validator: check EKA_WEBHOOK_SECRET then HMS_WEBHOOK_SECRET
  for gateway compatibility
2026-06-17 20:07:39 +05:30
5a1a87ebe1 Adjust IPD bill print signature spacing 2026-06-14 14:38:59 +05:30
d4b4c95cbc Fix IPD discharge and bill print issues 2026-06-14 14:34:33 +05:30