'
+ . '
'
. 'NABH guidance note: Ensure diagnosis, procedures, clinical course, condition at discharge, medication with dose/duration, follow-up advice, red-flag signs, and emergency contact are documented.'
. '
'
- . '
{{DISCHARGE_SUMMARY}}
'
- . '
{{PRESENTING_COMPLAINTS}}
'
- . '
{{PAIN_MEASUREMENT_SCALE}}
'
- . '
{{GENERAL_EXAM_ADMISSION}}
'
- . '
{{CLINICAL_INVESTIGATION_REPORTS}}
'
- . '
{{FINAL_DIAGNOSIS}}
'
- . '
{{COURSE_IN_HOSPITAL}}
'
- . '
{{EXAMINATION_ON_DISCHARGE}}
'
- . '
{{SURGERY}}
'
- . '
{{PROCEDURE}}
'
- . '
{{PERSONAL_HISTORY}}
'
- . '
{{DRUG_ALLERGY_ADR}}
'
- . '
{{CO_MORBIDITIES}}
'
- . '
{{DISCHARGE_MEDICATIONS}}
'
- . '
{{DIETARY_ADVICE}}
'
- . '
{{DISCHARGE_INSTRUCTIONS}}
'
- . '
Counselling & Handover Confirmation
'
- . '
'
- . '| Medication explained to patient/attendant | | Remarks: |
'
+ . '{{DISCHARGE_SUMMARY}}
'
+ . '{{PRESENTING_COMPLAINTS}}
'
+ . '{{PAIN_MEASUREMENT_SCALE}}
'
+ . '{{GENERAL_EXAM_ADMISSION}}
'
+ . '{{CLINICAL_INVESTIGATION_REPORTS}}
'
+ . '{{FINAL_DIAGNOSIS}}
'
+ . '{{COURSE_IN_HOSPITAL}}
'
+ . '{{EXAMINATION_ON_DISCHARGE}}
'
+ . '{{SURGERY}}
'
+ . '{{PROCEDURE}}
'
+ . '{{PERSONAL_HISTORY}}
'
+ . '{{DRUG_ALLERGY_ADR}}
'
+ . '{{CO_MORBIDITIES}}
'
+ . '{{DISCHARGE_MEDICATIONS}}
'
+ . '{{DIETARY_ADVICE}}
'
+ . '{{DISCHARGE_INSTRUCTIONS}}
'
+ . 'Counselling & Handover Confirmation
'
+ . ''
+ . '| Medication explained to patient/attendant | | Remarks: |
'
. '| Follow-up date and department explained | | Next Visit: __________________ |
'
. '| Red-flag symptoms explained | | Emergency Contact: __________________ |
'
. '| Diet and activity instructions explained | | |
'
. '
'
- . ''
+ . ''
. ''
- . '____________________ Consultant Name/Signature | '
- . '____________________ Medical Officer Signature | '
- . '____________________ Patient/Attendant Signature & Date | '
+ . '____________________ Consultant Name/Signature | '
+ . '____________________ Medical Officer Signature | '
+ . '____________________ Patient/Attendant Signature & Date | '
. '
'
. '
';
}
@@ -1451,7 +1451,7 @@ class Ipd_discharge extends BaseController
return;
}
- $html = '' . esc($title) . '
';
+ $html = '' . esc($title) . '
';
foreach ($rows as $row) {
$report = trim((string) ($row['comp_report'] ?? ''));
$remark = trim((string) ($row['comp_remark'] ?? ''));
@@ -1461,7 +1461,7 @@ class Ipd_discharge extends BaseController
$line = esc($report);
if ($remark !== '') {
- $line .= ' (' . esc($remark) . ')';
+ $line .= ' ';
}
$html .= '- ' . $line . '
';
@@ -1541,8 +1541,8 @@ class Ipd_discharge extends BaseController
// Get discharge status header
$statusHeader = $this->getDischargeStatusText($ipd);
- return '' . esc($statusHeader) . '
'
- . '
'
+ return '' . esc($statusHeader) . '
'
+ . '
'
. ''
. '| Name | ' . esc($patientName) . ' | UHID | ' . esc($patientCode) . ' |
'
. '| Age & Gender | ' . esc(trim($age . ' / ' . ((string) ($person->xgender ?? '')))) . ' | IPD No. | ' . esc((string) ($ipd->ipd_code ?? '')) . ' |
'
@@ -1551,7 +1551,7 @@ class Ipd_discharge extends BaseController
. '| Address | ' . esc($address) . ' | Org. Name | ' . esc($orgName) . ' |
'
. '| Department | ' . esc($department) . ' | | |
'
. '
'
- . '
';
+ . '
';
}
private function renderStoredHtmlFragment(string $raw): string
@@ -1698,8 +1698,8 @@ class Ipd_discharge extends BaseController
// Get discharge status text based on ipd_status
$dischargeStatusHeader = $this->getDischargeStatusText($ipd);
- $sections[] = '' . esc($dischargeStatusHeader) . '
'
- . '' . implode('
', $dischargeSummaryParts) . '
';
+ $sections[] = '' . esc($dischargeStatusHeader) . '
'
+ . '' . implode('
', $dischargeSummaryParts) . '
';
}
$complaints = $this->byIpdRows('ipd_discharge_complaint', ['comp_report', 'comp_remark'], 'id ASC', $ipdId);
@@ -1750,10 +1750,10 @@ class Ipd_discharge extends BaseController
continue;
}
- $sysHtml .= '' . nl2br(esc($value)) . '
';
+ $sysHtml .= '' . nl2br(esc($value)) . '
';
}
if ($sysHtml !== '') {
- $sections[] = 'Other / Systemic Examinations
' . $sysHtml;
+ $sections[] = 'Other / Systemic Examinations
' . $sysHtml;
}
$personalHistory = [];
@@ -1780,7 +1780,7 @@ class Ipd_discharge extends BaseController
}
if (! empty($personalHistory)) {
- $sections[] = 'Personal History
' . esc(implode(', ', $personalHistory)) . '
';
+ $sections[] = 'Personal History
' . esc(implode(', ', $personalHistory)) . '
';
}
$allergySection = '';
@@ -1799,12 +1799,12 @@ class Ipd_discharge extends BaseController
$allergyLines[] = 'Current Medications: ' . esc((string) ($opdHistory['current_medications'] ?? '')) . '
';
}
if (! empty($allergyLines)) {
- $allergySection = 'Drug Allergy / ADR
' . implode('', $allergyLines);
+ $allergySection = 'Drug Allergy / ADR
' . implode('', $allergyLines);
}
$coMorbText = trim((string) ($opdHistory['co_morbidities'] ?? ''));
if ($coMorbText !== '') {
- $sections[] = 'Co-Morbidities
' . esc($coMorbText) . '
';
+ $sections[] = 'Co-Morbidities
' . esc($coMorbText) . '
';
}
$admitDate = $this->normalizeDateValue((string) ($ipd->register_date ?? '')) ?? '';
@@ -1856,17 +1856,17 @@ class Ipd_discharge extends BaseController
}
if (! empty($pathologyMatrix['rows']) || ! empty($selectedLabRows) || ! empty($selectedNonPathRows) || trim((string) ($otherExamParsed['text'] ?? '')) !== '') {
- $html = 'Clinical Investigation Reports
';
+ $html = 'Clinical Investigation Reports
';
if (! empty($pathologyMatrix['rows'])) {
$html .= 'In-Hospital Lab:
'
- . ''
+ . ''
. ''
- . '| Test | '
- . 'Fixed Normals | ';
+ . 'Test | '
+ . 'Fixed Normals | ';
foreach (($pathologyMatrix['dates'] ?? []) as $dt) {
- $html .= '' . esc((string) ($pathologyMatrix['date_labels'][$dt] ?? $dt)) . ' | ';
+ $html .= '' . esc((string) ($pathologyMatrix['date_labels'][$dt] ?? $dt)) . ' | ';
}
$html .= '
';
@@ -1886,7 +1886,7 @@ class Ipd_discharge extends BaseController
$html .= '
';
} elseif (! empty($selectedLabRows)) {
// Fallback when value-matrix cannot be built from current schema/data.
- $html .= 'In-Hospital Lab: