\Fix {{DISCHARGE_SUMMARY}} placeholder - remove extra information
Problem:
- {{DISCHARGE_SUMMARY}} placeholder was showing:
1. Discharge status header (Discharge Summary/LAMA/etc.)
2. Department information
3. Treating Doctor(s) information
4. Date of Admission
- User wants ONLY the status header in this placeholder
- Extra information should be removed from {{DISCHARGE_SUMMARY}}
Solution:
Modified buildAutoDischargeContent() method:
Before (lines 1679-1703):
- Built dischargeSummaryParts array with department/doctor/date
- Added all info in one section with header + div containing details
After:
- {{DISCHARGE_SUMMARY}} now contains ONLY the status header
- Removed department, doctor, and admission date from this section
- Status header comes from ipd_discharg_status table via:
ipd_master.ipd_status (or discarge_patient_status) = ipd_discharg_status.id
Returns ipd_discharg_status.status_details field
Status Values:
- ipd_status = 0 → 'Discharge Summary' (hardcoded)
- ipd_status = 1 → From DB: 'Discharge Summary'
- ipd_status = 2 → From DB: 'Leave Against Medical Advice'
- ipd_status = 3 → From DB: 'Refer To Higher Centre'
- ipd_status = 5 → From DB: 'Dead Summary'
- ipd_status = 7 → From DB: 'Discharge on Request'
Now {{DISCHARGE_SUMMARY}} outputs:
<h4 class='discharge-section-heading'>Discharge Summary</h4>
OR
<h4 class='discharge-section-heading'>Leave Against Medical Advice</h4>
That's it - no extra lines below.
If user needs department/doctor/date info, they can use individual tokens:
- {{DEPARTMENT}}
- {{DOCTOR_NAMES}}
- {{ADMIT_DATE_ONLY}}
- {{DISCHARGE_DATE_ONLY}}
- {{ADMISSION_TIME}}
- {{DISCHARGE_TIME}}
Or use {{PATIENT_INFO_TABLE}} which has all patient demographics.
Testing:
- Visit: /Ipd_discharge/debug_discharge_html/1
- Check {{DISCHARGE_SUMMARY}} section
- Should only show status header, no other info"
This commit is contained in:
parent
751fdfaedb
commit
d096585df6
|
|
@ -1676,30 +1676,13 @@ class Ipd_discharge extends BaseController
|
|||
// It is available as {{PATIENT_INFO_TABLE}} token for templates to use if needed.
|
||||
// This matches CI3 behavior where template controlled the patient info display.
|
||||
|
||||
// Build Discharge Summary section (high-level overview)
|
||||
$dischargeSummaryParts = [];
|
||||
$admitDate = trim((string) ($ipd->admit_date ?? ''));
|
||||
$dischargeDate = trim((string) ($ipd->discharge_date ?? ''));
|
||||
$deptName = $this->getDischargeDepartmentName($ipd);
|
||||
$doctorNames = $this->getDischargeDoctorNames($ipd);
|
||||
// Build Discharge Summary section - ONLY the status header
|
||||
// Get discharge status text based on ipd_status from ipd_discharg_status table
|
||||
$dischargeStatusHeader = $this->getDischargeStatusText($ipd);
|
||||
|
||||
if ($deptName !== '') {
|
||||
$dischargeSummaryParts[] = '<b>Department:</b> ' . esc($deptName);
|
||||
}
|
||||
if ($doctorNames !== '') {
|
||||
$dischargeSummaryParts[] = '<b>Treating Doctor(s):</b> ' . esc($doctorNames);
|
||||
}
|
||||
if ($admitDate !== '') {
|
||||
$dischargeSummaryParts[] = '<b>Date of Admission:</b> ' . esc($admitDate);
|
||||
}
|
||||
// NOTE: Date of Discharge removed per user request
|
||||
|
||||
if (! empty($dischargeSummaryParts)) {
|
||||
// Get discharge status text based on ipd_status
|
||||
$dischargeStatusHeader = $this->getDischargeStatusText($ipd);
|
||||
|
||||
$sections[] = '<h4 class="discharge-section-heading">' . esc($dischargeStatusHeader) . '</h4>'
|
||||
. '<div class="discharge-summary-info">' . implode('<br>', $dischargeSummaryParts) . '</div>';
|
||||
if ($dischargeStatusHeader !== '') {
|
||||
// {{DISCHARGE_SUMMARY}} placeholder - ONLY the status header, no additional info
|
||||
$sections[] = '<h4 class="discharge-section-heading">' . esc($dischargeStatusHeader) . '</h4>';
|
||||
}
|
||||
|
||||
$complaints = $this->byIpdRows('ipd_discharge_complaint', ['comp_report', 'comp_remark'], 'id ASC', $ipdId);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user