Commit Graph

80 Commits

Author SHA1 Message Date
a3c544a53c feat(user-management): enhance user management, permission handling, and charges invoice workflows
- Add UserProfileModel and migration for user profile data
- Enhance User Management views, controller, and doctor/nurse search integration
- Refactor handleAuthError to separate 401 session expiry from 403 access restriction
- Apply granular permission checks to sidebar navigation links
- Open Bed Status view for all authenticated users
- Support GET and POST on charges item routes and exempt billing charges from CSRF desync
2026-10-14 20:08:10 +05:30
2f6b346e25 fix(abdm): add concurrency lock, optimize hiu-poll query, and add composite indexes 2026-09-24 08:03:57 +05:30
3f1e89d4be Fix IPD patient admit search error, add admission type filters to IPD patient list, remove redundant sidebar links, and add OPD Day Care template support 2026-09-23 10:12:42 +05:30
6e78e6010e feat: add Day Care & Emergency admission module with IPD conversion and clean patient names
- Add Day Care (<24h) and Emergency (Casualty) admission pathways with prefixes DC- and ER-
- Add dedicated physical wards, ESI 5-level triage, MLC tracking, and PADSS day care discharge
- Implement audited 'Convert to IPD' workflow with SBAR handover and automated bed transfer
- Support unified IPD billing with dedicated group headers for Day Care and Emergency charges
- Redesign Hospital Admission Desk with executive card layout and modern triage controls
- Add comprehensive user documentation and SVG flowchart in public/help.html
- Completely remove legacy patient_master.p_lname column from database and application code
2026-09-21 23:41:24 +05:30
6ce81eedd8 feat(medical-store): auto-convert draft bills to invoice on checkout and reduce pending draft list 2026-09-18 05:49:20 +05:30
e4e89fb34a feat(database): add migration for credit accounts, credit ledger, draft bills, and store user permissions 2026-09-18 05:17:22 +05:30
5187fcf3ed feat(tax): standardize current GST slabs (0%, 5%, 18%, 40%, legacy 12%, 28%) across HMS and Medical Store 2026-09-10 07:13:04 +05:30
59514cd061 feat(medical-store): pharma stock entry with progressive disclosure, challan import, and history 2026-09-10 06:35:05 +05:30
e635e823e5 feat(medical-store): add supplier ledger, payment tracking, short items book, and purchase orders 2026-09-10 04:49:00 +05:30
62397c5a98 feat(medical-store): inward purchase medicine auto-search and shared pharmacy master integration 2026-09-10 04:23:09 +05:30
9176877d07 feat(abdm): implement M1 find ABHA by mobile flow & M2 user-initiated linking
- M1: Update Find ABHA via Mobile to compliance flow: Mobile Number -> Profiles -> OTP -> Complete Profile Fetched
- M2: Support walk-in non-ABHA patient discovery via demographic matching (verified mobile, gender, year of birth, name)
- M2: Implement care context linking endpoints (/records/link/init and /records/link/confirm) with OTP verification
- Add abdm_link_transactions database migration
- Support Bearer token and HMAC signature authentication for bridge callbacks over VPN
2026-09-09 17:52:20 +05:30
c82892f3d2 fix(medical-store): add complete base schema migration and devices table for remote server 2026-09-08 05:19:19 +05:30
d2f069e3c8 feat(medical-store): add B2C sales returns, same-invoice exchanges, and DB migrations
- Add B2C same-invoice exchange and pure refund workflows (Marg ERP standard)
- Support returning excess/unused medicines with proportional unit pricing on original invoice
- Auto-net return credits against new medicines in POS cart with refund outflow handling
- Implement stock replenishment for restocked batches with audit trail in mst_stock_audit
- Generate sequential GST Credit Notes in mst_sale_returns and mst_sale_return_items
- Update Thermal 80mm, A5, and A4 print templates with separated dispensed vs returned items
- Add CI4 migration 2026-09-08-000001_CreateMedicalStoreReturnsAndExchanges.php for remote execution
- Add standalone SQL script scripts/sql/2026-09-08_medical_store_b2c_returns_and_exchanges.sql
2026-09-08 05:07:45 +05:30
7c04828e99 feat(ipd): align IPD Discharge prescribed medicine form design and autotext with OPD Consult 2026-08-27 04:33:10 +05:30
7ec5149ccf feat(ipd): manage admission examination fields
Add an Admin CRUD master for IPD admission examination fields with enabled state, display order, field types, and select options.
2026-08-24 00:53:01 +05:30
225721ae02 feat(report): add IPD surgery export report
Add a permissioned IPD surgery report combining discharge surgery, patient, diagnosis, OT, and matched billing details.
2026-08-24 00:01:58 +05:30
83fce47ee1 feat(report): add searchable permissioned IPD census hub
Organize the report hub into permission-filtered searchable panels and add a protected IPD census and discharge report.
2026-08-23 20:36:09 +05:30
2d13ba567e Store Aadhaar encrypted with masked display and hash-based search 2026-08-15 03:16:40 +05:30
b4714270a9 Add combined ABDM log prune command and api log index 2026-08-14 13:14:13 +05:30
d85b3f5998 Add 2-day retention pruning for abdm_hiu_workflows 2026-08-14 11:52:49 +05:30
73ad7ef11f Store ABHA card and improve patient comparison 2026-08-13 11:30:02 +05:30
d289bb5be1 feat: add OT workflow and allow zero payments 2026-08-12 13:38:25 +05:30
4ca463cc1e feat: add payment editing and fix discharge templates 2026-08-10 14:48:33 +05:30
711b093487 feat: add IPD nursing and discharge permissions 2026-08-10 00:55:18 +05:30
c263b9e4ac feat: add role and session access controls
Add configurable role management, expanded project permission coverage, secured module routes, and single-active-session enforcement with online user administration.
2026-08-09 23:21:16 +05:30
4f906424a6 Add migration for refer master address fields 2026-08-07 12:36:02 +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
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
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
2b53c05a68 Add ABDM documents and patient profile sync UI 2026-07-16 18:23:40 +05:30
acabc6abdd ABDM HIU callback hardening, OPD ABHA optional confirm, and AJAX memory cleanup 2026-07-10 00:09:35 +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
ed48a447e5 ABDM M2: add push-sync outbox, worker, and FHIR generators 2026-06-27 01:53:44 +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
96c030b72d chore: checkpoint before discharge history panel refactor 2026-06-22 02:05:24 +05:30
ecb55e7329 Add page settings and header footer support to discharge templates 2026-06-05 06:22:13 +05:30
c692340bb2 Store ABDM bundles in health records 2026-06-03 11:05:40 +05:30
45abd3ca76 Store ABHA ID and ABHA address separately 2026-06-02 06:00:35 +05:30
78c23af7e5 Checkpoint: pathology panel modal workflow, gateway component search, and ABDM-style component/print editors 2026-05-30 06:32:30 +05:30
4ed366ccb2 feat: commit all pending page and ABDM gateway updates 2026-05-26 06:04:34 +05:30
0558ac5a2e Pharmacy: add ABDM drug terminology autocomplete + canonical mapping 2026-05-25 13:57:56 +05:30
23cca1f9ba feat(abdm): proper FHIR bundles for lab reports and IPD discharge
- FhirR4Builder: rewrite buildLabReportBundle() with DiagnosticReportLab
  profile, structured Observation valueQuantity/valueString, reference
  ranges, interpretation codes, Binary+DocumentReference for HTML report,
  Encounter resource, HFR-based bundle identifier system

- FhirR4Builder: rewrite buildDischargeSummaryBundle() with optional
  Practitioner/Organization params, structured ABDM sections (chief
  complaints 422843007, medical history 1003642006, investigations
  721981007, procedures 1003640003, medications 721912009, follow-up
  736271009), HFR-based bundle identifier system

- AbdmGateway: shareIpdDischargeBundle() now builds a real
  DischargeSummaryRecord FHIR bundle and posts via pushRecord()
  (POST /v3/records/push) instead of the stale shareIpdDischargeBundle()

- AbdmGateway: shareDiagnosisReportBundle() now builds a real
  DiagnosticReportRecord FHIR bundle and posts via pushRecord()
  instead of the stale shareDiagnosisReportBundle()

- AbdmGateway: add getHospitalProfileForFhir() and mapLabTypeToTitle()
  helpers; fix pre-existing undefined \ bug in
  getActiveConsentRecord()

- Add ABDM_FHIR reference package, AbdmBridgeLog controller/view,
  bridge record migration, debug scripts and misc UI/settings updates
2026-05-23 04:41:59 +05:30
32c1dc20e1 feat: Clinical Master workspace — Complaints + Diagnosis edit with SNOMED CT search 2026-05-20 01:25:01 +05:30
a56e8a5776 feat: SNOMED background coding pipeline + ABDM Coding Panel
- Add opd_coding_queue + opd_snomed_suggestions migrations
- Add ProcessSnomedCoding spark command (cron: snomed:process-coding)
  Extracts clinical phrases, matches local SNOMED FULLTEXT, saves suggestions
- Add AbdmCodingPanel controller: index/review/confirm/reject/correct/mark_fhir_ready/tip_check
- Add coding_panel + coding_panel_review views (Bootstrap 5, AJAX actions)
- Inject queue trigger in opd_prescription_save (fail-open, ON DUPLICATE KEY)
- Add consult form tip badge: polls tip_check 4s after save, shows review link
- Add AbdmCodingPanel routes behind abdm permission filter
- Various ABDM gateway, FHIR, ABHA, SNOMED library updates
2026-05-19 20:40:27 +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
7ab37ad80d Finance: separate OPD Consult and Doctor Charges payout screens; compact dashboard cards; add IPD payout tracking migration 2026-05-01 21:02:57 +05:30
36d3fa843b Implement medical store credit payout workflow and optimize payout pool DataTable grouping 2026-04-30 01:42:03 +05:30