Commit Graph

143 Commits

Author SHA1 Message Date
7d92e542ba feat(abdm): auto-link care contexts on print and record save without modal 2026-10-08 10:20:30 +05:30
5130c6b18a fix(abdm): sanitize care context display, fix discharge care_context_reference and bundle generation, fix taskboard sync patientId 2026-10-07 17:59:14 +05:30
61206784f3 feat(abdm): implement care-context linking cooling window and timer reset on record modification
- Add cooling period configuration (60 min for OPD/Lab/Radiology/others, 24 hr for IPD Discharge) in AbdmConnector
- Add calculateCooling() logic in AbdmTaskBoardSyncService and skip automated linking during cooling window
- Touch and refresh work task timestamps on prescription save and IPD discharge summary save/print
- Update opd_fhir_documents on prescription edit rather than inserting duplicate bundles
- Enrich ABDM Task Board table and OPD consult list with active cooling badges, remaining minutes, and auto-link schedule
- Preserve manual 'Link Context' action on task board to allow immediate override anytime
- Update CLI commands (abdm:taskboard-sync, abdm:push-sync) with cooling counters and status logging
2026-09-28 18:29:50 +05:30
0397071be4 fix(opd): reorder prescription directions to Frequency | Relation to Food | Dose | Duration | Remarks and add legacy data safeguards 2026-09-27 09:02:03 +05:30
9b3e734ead fix(ipd_discharge): prevent duplicate surgery additions and fix procedure table dynamic updates 2026-09-25 07:41:10 +05:30
ccb05389e1 Prevent duplicate course/treatment submissions and add edit/update capability in IPD discharge 2026-09-23 08:32:36 +05:30
da82ec84d1 Prevent duplicate final diagnosis submissions and add edit/update capability in IPD discharge 2026-09-23 08:28:02 +05:30
341c09d9c7 feat(ipd): enable autosearch and row-level update on discharge complaint table 2026-09-22 20:20:11 +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
f3faa9c96e feat(abdm): integrate Online/ABDM discharge template with PDF attachment in FHIR bundle
- Dynamically resolve and generate PDF using designated Online/ABDM template (is_abdm=1) from ipd_discharge_templates
- Unify mPDF rendering logic between show_discharge and generateDischargeSummaryPdfBinary for exact byte-for-byte consistency
- Attach generated PDF as DocumentReference under SNOMED 373942005 (Discharge summary) in NRCES FHIR DocumentBundle
- Add quick-set actions and AJAX endpoints for Default and ABDM template selection in discharge template list UI
- Update unit tests covering DocumentReference generation and template resolution
2026-09-06 17:55:15 +05:30
9b3d9ef6ee fix(abdm): align IPD discharge summary FHIR bundle with NRCES standards and eliminate NA values in PHR 2026-09-06 08:09:11 +05:30
52f8d9691b feat(abdm): enhance IPD discharge FHIR generator with NRCES v6.5.0 single-coding and structured dosage instructions 2026-09-05 15:29:11 +05:30
c238fcfc40 fix(abdm): resolve correct column names for dose master tables in discharge fhir 2026-09-04 06:05:57 +05:30
6566ec0b77 fix(abdm): handle missing optional params, catch location query exceptions, and safely boot billing controller in IPD discharge preview 2026-09-04 05:51:12 +05:30
5714f9f755 feat(abdm): add Encounter period admission/discharge times and location ward/bed mapping 2026-09-04 05:44:37 +05:30
4776bfb37b Enhance IPD discharge summary FHIR bundle: dual admission/discharge vitals, full medication dosage directions, dietary/discharge advice care plans, and IPD invoice PDF attachment 2026-09-04 05:39:45 +05:30
625c642b02 Fix patient age calculation in IPD discharge search ajax by querying DOB and using get_age_1 helper 2026-09-02 03:51:52 +05:30
2fcfbd922a Enhance IPD discharge summary: OPD-style Prescribed Medicines table for B&W printing, auto generic lookup, and suppress empty discharge summary heading 2026-09-02 02:53:17 +05:30
73780ac7dd fix: IPD discharge RxGroup add - fix UI not updating after apply_rx_group, and Remove All not deleting from DB
- discharge_create.php (JS): Fixed AJAX done handler to JSON.parse the
  raw string response (jQuery with dataType:'html' does not auto-parse
  JSON), then re-render #discharge_medicine_tbody from result.drugRows.
  Also fixed Remove All (#btn_discharge_med_reset) to send AJAX POST
  with action=remove_all_drugs so records are deleted from DB, not just
  cleared from the DOM.

- Ipd_discharge.php (Controller): In the AJAX JSON response block,
  resolve dosage/dosage_when/dosage_freq IDs to human-readable labels
  using getDoseMasterRows() before returning drugRows, so the table
  displays 'BD / After Food' instead of raw numeric IDs. Added new
  remove_all_drugs action that deletes all medicine rows for the IPD
  from both legacy (ipd_discharge_prescrption_prescribed) and classic
  (ipd_discharge_drug) tables. Added remove_all_drugs to both
  lightweight-action whitelists to skip the expensive getIpdPanelInfo()
  join.
2026-09-01 20:24:14 +05:30
b786fe7a08 fix(ipd_discharge): add query error catching and logging to add_drug controller action 2026-09-01 18:28:53 +05:30
144f0a20d5 fix(ipd_discharge): sync full medicine list on main form submit to replace stale DB entries 2026-09-01 18:15:46 +05:30
3fddb3ca26 fix(ipd_discharge): enable dual-source medicine loading and full form submit medicine sync 2026-09-01 18:07:18 +05:30
fe26588dca fix(ipd_discharge): instant DOM row removal on medicine delete & delete from all drug tables 2026-09-01 17:47:05 +05:30
bfe14048bc fix(ipd_discharge): resolve status 0 network error on medicine add and sync remove_drug via AJAX 2026-09-01 17:38:09 +05:30
69f0e1fa45 feat(nursing): add Nursing Station Master, ABDM credentials to Nurse Master, and Visual Bed Grid at /ipd/patient 2026-08-28 02:43:37 +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
9e35fe41fc Add discharge template CKEditor and watermarks 2026-08-18 17:50:51 +05:30
3b200e0290 Fail open when caching discharge PDF 2026-08-18 17:35:30 +05:30
306f8ef1c4 Refresh mPDF debug snapshot on build 2026-08-18 17:32:24 +05:30
16de9b0c0c Force discharge header onto first PDF page 2026-08-18 17:26:43 +05:30
f5743be68a Prevent duplicate discharge template content 2026-08-18 17:04:38 +05:30
4d5155a2f8 Avoid @page overriding discharge headers 2026-08-18 17:01:11 +05:30
0dbe4c6f64 Register discharge headers before first page 2026-08-18 16:50:42 +05:30
8a6319ac13 Render discharge template header with mPDF API 2026-08-18 16:46:09 +05:30
8cf0e42765 Activate discharge header with mPDF runtime API 2026-08-18 16:41:46 +05:30
28109df663 Build mPDF debug input on demand 2026-08-18 16:36:53 +05:30
53b79b5297 Add raw mPDF input debugger 2026-08-18 16:33:24 +05:30
ebf23b93e8 Use exact OPD header rendering pattern for discharge 2026-08-18 16:29:43 +05:30
94bcf4d37c Force discharge header on first page 2026-08-18 16:20:04 +05:30
b068fc3be2 Fix @page header activation for body-only template CSS 2026-08-18 16:13:53 +05:30
0ea3fc099a Use correct mPDF CSS-first structure for discharge 2026-08-18 15:59:23 +05:30
4835d34e0e Add Debug HTML button to discharge template editor 2026-08-18 15:55:09 +05:30
e353e5afdc Simplify discharge PDF to plain mPDF fragment 2026-08-18 15:42:01 +05:30
f69d10b417 Move discharge template CSS into PDF head 2026-08-18 15:40:22 +05:30
f9b1e02af8 Fix @page placement for mPDF discharge header 2026-08-18 15:37:22 +05:30
42abe7ed9b Use mPDF htmlpageheader for discharge header 2026-08-18 15:29:13 +05:30
1fec6c8677 Add IPD discharge template builder 2026-08-18 15:18:13 +05:30
e1de6e3215 Apply discharge header margin setting 2026-08-18 14:50:56 +05:30
c26589fa22 Render discharge header in PDF body 2026-08-18 14:48:23 +05:30