Add interactive OPD, IPD, and diagnosis dashboards with historical date ranges, KPI summaries, doctor and department workload, referral breakdowns, and diagnostic workflow statuses.
Add configurable role management, expanded project permission coverage, secured module routes, and single-active-session enforcement with online user administration.
Integrate Final Diagnosis with canonical disease master data and add reusable My/Master template CRUD for discharge narrative sections, including summary investigations, course, other advice, and discharge summary.
Restore surgery and procedure bindings after SPA updates, validate procedure dates without SQL errors, and prevent medicine autocomplete Enter from submitting while preserving layout and autofill.
Load referral master data into patient registration/edit screens, persist patient referby, expose searchable referral inputs in patient and IPD forms, and make referral title editable as free text in referral master CRUD.
- Remove Restart Web, Restart PHP-FPM, Shutdown, Reboot buttons
- Remove runServerAction() library method and action() controller
- Remove /system-ops/action route (no longer needed)
- Parse /proc/mdstat into structured array (name, level, health, drives)
- Show each RAID array as a card with colored drive icons per-slot
- Green drive = healthy, red = failed, blue = spare
- Show rebuild progress bar when array is rebuilding
- Internet status shown as colored badge with wifi icon
- Services shown as colored badges (green=running, grey=other)
- Remove 'Update HMS (Git)' button and related functionality
- Remove runUpdate() method from SystemOperations
- Remove update() controller method
- Remove /setting/admin/system-ops/update route
- Remove setup_git_config.sh (no longer needed)
- Keep 'Deploy from GitHub' button as the only update method
- Rationale: Direct GitHub deployment is more reliable and requires no git config
Result: Single, simpler deployment method that always works
- New 'Deploy from GitHub' button downloads latest code directly
- No git configuration required - more reliable for git-unfriendly servers
- Automatically syncs changed files (skips .git, vendor, writable)
- Both methods available: git pull (if configured) or direct GitHub download
- Each has a clear confirmation dialog explaining the method
- Handles temporary extraction and cleanup automatically
This solves HMS deployment when git is not accessible to PHP process
- Added SystemOps controller with index and panel endpoints for dynamic content refresh
- Created system_ops_panel.php fragment for AJAX-based UI updates (no full page reload)
- Implemented 30-second auto-refresh using AJAX instead of location.reload()
- Fixed health badge contrast by adding explicit dark text color (#1f2937)
- Added jQuery availability checks to prevent script errors on page load
- Included server overview, resource usage, services, events, and update history
- Integrated delegated event handlers for action buttons (Update, Restart, Reboot, Shutdown)
- All buttons are protected with confirmation dialogs
- Layout maintains NiceAdmin card styling and responsive design
Routes added:
- GET /admin/system-ops/panel - returns panel fragment for refresh
- Diagnosis.php: resolve doctor mapping via ABDM Report Doctor Mapping,
compile pathology/diagnosis reports into separate Letter Head and
Plain Paper PDFs, add compiled-pdf-links endpoint
- Routes.php: add diagnosis/compiled-pdf-links route
- pathology_detail.php: render/persist dual compiled PDF buttons
- Setting/Template.php: per-modality Letter Head / Plain Paper template
mapping via hospital_setting keys
- Setting/Template/index.php: fix tile links using load_form (which only
replaces #main) instead of load_form_div, which broke every internal
AJAX reload (template type switch, modality switch, reset) on the
diagnosis/discharge/document print template settings pages
- diagnosis_print_settings.php: fix corrupted watermark_alpha number
input (missing step attribute) that silently blocked form submission
for templates with non-integer-step legacy values
- Patient.php: broaden non-fatal-pending detection in abdm_content_auto_flow() to recognize more bridge error wordings (No HIU sessions found / matching the criteria) and HTTP 400, stopping spurious 'Auto flow failed' toasts.
- Opd_prescription.php: remove dead opd.fhir.generated bridge_sync_queue enqueue in storePrescriptionFhirBundle(). This unprefixed event type routed to the CSNOtk terminology bridge which has no consumer for it, always 404ing. Real ABDM sharing already works via DreamsoftConnector::sharePrescriptionBundle() (abdm.fhir.share.requested).
- 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).
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.
HMS instances behind NAT with no live public IP can hit an expired/unreachable
TLS cert on their own base_url() when doing the internal handoff self-call to
AbdmGateway::share_prescription_bundle, causing 'Gateway handoff failed:
curl error 60: Peer's Certificate has expired'. This call never leaves the
local server, so skip peer verification by default via new
fhirGatewayHandoffSslVerify() helper. Set FHIR_HANDOFF_SSL_VERIFY=true in .env
to re-enable strict verification on deployments with a valid public cert.
Does not affect the actual outbound ABDM bridge submission (EAtriaBridgeConnector),
which keeps its own independent SSL verification/toggle.
Those operations can store the entire decrypted FHIR bundle (incl. base64 scanned-document attachments, sometimes MB per row) in response_json. fetchAbdmWorkflowRows()/getLatestAbdmSyncSnapshot() only ever read small consent-status/hi_types fields out of response_json, which never appear in bulk data_fetch payloads anyway, so cap it at the SQL level instead of buffering it into PHP memory just to build a list view.
- 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.
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.
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.