Add discharge summary free-text content to PDF output
- Include ipd_discharge_instructions.comp_remark in discharge summary section - Previously only showed status header, missing actual discharge narrative - Reuse existing instructionRowForMeta query to avoid duplicate DB calls - Apply renderRichText() to properly display HTML editor content Fixes missing discharge summary text for IPD 1007168 and similar cases
This commit is contained in:
parent
3dc9fe1df6
commit
c091b60168
|
|
@ -1873,13 +1873,28 @@ 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 - ONLY the status header
|
||||
// Build Discharge Summary section with status header and free-text content
|
||||
// Get discharge status text based on ipd_status from ipd_discharg_status table
|
||||
$dischargeStatusHeader = $this->getDischargeStatusText($ipd);
|
||||
|
||||
if ($dischargeStatusHeader !== '') {
|
||||
// {{DISCHARGE_SUMMARY}} placeholder - ONLY the status header, no additional info
|
||||
$sections[] = '<h4 class="discharge-section-heading">' . esc($dischargeStatusHeader) . '</h4>';
|
||||
// Get discharge summary free-text content from ipd_discharge_instructions.comp_remark
|
||||
// (instructionRowForMeta was already loaded above at line ~1856)
|
||||
$dischargeSummaryText = $this->normalizeRichText((string) ($instructionRowForMeta['comp_remark'] ?? ''));
|
||||
|
||||
if ($dischargeStatusHeader !== '' || $dischargeSummaryText !== '') {
|
||||
$summaryHtml = '';
|
||||
|
||||
if ($dischargeStatusHeader !== '') {
|
||||
$summaryHtml .= '<h4 class="discharge-section-heading">' . esc($dischargeStatusHeader) . '</h4>';
|
||||
}
|
||||
|
||||
if ($dischargeSummaryText !== '') {
|
||||
$summaryHtml .= '<div class="discharge-summary-content">' . $this->renderRichText($dischargeSummaryText) . '</div>';
|
||||
}
|
||||
|
||||
if ($summaryHtml !== '') {
|
||||
$sections[] = $summaryHtml;
|
||||
}
|
||||
}
|
||||
|
||||
$complaints = $this->byIpdRows('ipd_discharge_complaint', ['comp_report', 'comp_remark'], 'id ASC', $ipdId);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user