From a929100d4d12591b67a93bd8ad47dbb4262211d7 Mon Sep 17 00:00:00 2001
From: DevSoftTech Server
Date: Sun, 7 Jun 2026 11:07:29 +0530
Subject: [PATCH] Add text alignment and enhanced CKEditor tools to IPD
discharge templates
ENHANCEMENT: Expanded CKEditor toolbar in discharge template editor
NEW TOOLBAR BUTTONS:
1. Text Alignment:
- JustifyLeft (align left)
- JustifyCenter (align center)
- JustifyRight (align right)
- JustifyBlock (justify)
2. Enhanced Basic Styles:
- Strike (strikethrough)
- Subscript
- Superscript
3. Enhanced Insert Tools:
- Image
- PageBreak
4. Enhanced Tools:
- ShowBlocks (show/hide block elements)
CONFIGURATION:
- Added extraPlugins: 'justify,pagebreak' to enable alignment and page break
- Added allowedContent: true to allow all HTML content
- Added entities: false, basicEntities: false to preserve special characters
- Added fillEmptyBlocks: false for cleaner HTML output
FILE: app/Views/Setting/Template/discharge_templates.php (lines 473-495)
ROUTE: /setting/template/discharge_template_get/{id}
BENEFIT: Template editors now have full control over text alignment, formatting, and layout
---
.../Setting/Template/discharge_templates.php | 15 +-
pdf_test_html.html | 154 +++++++++++++++---
2 files changed, 138 insertions(+), 31 deletions(-)
diff --git a/app/Views/Setting/Template/discharge_templates.php b/app/Views/Setting/Template/discharge_templates.php
index d4ed4a5..c14fbf8 100644
--- a/app/Views/Setting/Template/discharge_templates.php
+++ b/app/Views/Setting/Template/discharge_templates.php
@@ -475,14 +475,21 @@ $status = (int) ($edit['status'] ?? 1);
toolbar: [
{ name: 'document', items: ['Source'] },
{ name: 'clipboard', items: ['Undo', 'Redo'] },
- { name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'RemoveFormat'] },
+ { name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', 'RemoveFormat'] },
{ name: 'paragraph', items: ['NumberedList', 'BulletedList', 'Outdent', 'Indent', 'Blockquote'] },
+ { name: 'align', items: ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'] },
{ name: 'links', items: ['Link', 'Unlink'] },
- { name: 'insert', items: ['Table', 'HorizontalRule', 'SpecialChar'] },
+ { name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar', 'PageBreak'] },
{ name: 'styles', items: ['Format', 'Font', 'FontSize'] },
{ name: 'colors', items: ['TextColor', 'BGColor'] },
- { name: 'tools', items: ['Maximize'] }
- ]
+ { name: 'tools', items: ['Maximize', 'ShowBlocks'] }
+ ],
+ removeButtons: '',
+ extraPlugins: 'justify,pagebreak',
+ allowedContent: true,
+ entities: false,
+ basicEntities: false,
+ fillEmptyBlocks: false
});
} catch (e) {
console.error('CKEditor replace failed:', e);
diff --git a/pdf_test_html.html b/pdf_test_html.html
index 3f1e848..90e390e 100644
--- a/pdf_test_html.html
+++ b/pdf_test_html.html
@@ -1,4 +1,3 @@
-Discharge Summary HTML Source (IPD ID: 1)
Discharge Summary
| Name | KAMLA SINGH | UHID | P26051000001 |
| Age & Gender | 26 Year / Female | IPD No. | A26050000001 |
| Guardian | W/O of RAM SINGH | Admission | 23-05-2026 |
| Phone No. | 9720958717 | Discharge | 05-06-2026 |
| Address | KASHIPUR | Org. Name | Direct |
| Department | Cardiology | | |
-
-Surgery :
Laparocopy
-
-Procedure :
Procedure TEST / Date of Procedure : 2026-06-03
-Presenting Complaints and Reason for Admission :
Acute rheumatic fever with acute arthritis
Able to cough
-Pain Measurement Scale: Mild Pain (1)
+ text-indent: 0px;
+ font-size: 10pt;
+ font-family: Verdana, Geneva, Tahoma, sans-serif;
+ font-size: 10pt;
+ padding: 0px;
+ margin:0px;
+
+ }
+
+/* Section Headings */
+.discharge-section-heading {
+ margin: 5px 0 8px 0;
+ font-size: 12pt;
+ font-weight: bold;
+}
+
+.discharge-title {
+ text-align: center;
+ margin: 2px 0;
+ font-size: 18pt;
+}
+
+/* Lists */
+.discharge-list {
+ margin: 0 0 10px 20px;
+}
+
+.discharge-sublist {
+ margin: 2px 0 8px 20px;
+}
+
+/* Text */
+.discharge-remark {
+ color: #475569;
+ font-style: italic;
+}
+
+/* Tables */
+.discharge-table {
+ width: 100%;
+ border-collapse: collapse;
+ margin: 4px 0 8px 0;
+}
+
+.discharge-medicine-table {
+ width: 100%;
+ border-style: inset;
+ margin-bottom: 10px;
+}
+
+.discharge-signature-table {
+ width: 100%;
+ text-align: center;
+}
+
+/* Separators */
+.discharge-separator {
+ margin: 1px 0;
+ padding: 0;
+ border-top: 1px solid #000;
+}Discharge Summary
+
+
+
+
+
+ | Patient Name |
+ SUNITA DEVI |
+ |
+ |
+ UHID / Patient ID |
+ P26061331171 |
+
+
+ | Guardian |
+ Wife of of JOGENDRA KUMAR |
+ |
+ |
+ IPD No. |
+ A26061007144 |
+
+
+ | Age / Gender |
+ 40 Year / Female |
+ |
+ |
+ Admission Date |
+ 04-06-2026 03:14 PM |
+
+
+ | Address |
+ MALDHAN***** |
+ |
+ |
+ Discharge Date |
+ 07-06-2026 10:00 AM |
+
+
+ | Phone No. |
+ 9520497324 |
+ |
+ |
+ TPA |
+ Direct |
+
+
+ | Department |
+ General Surgery |
+ |
+ |
+ |
+ |
+
+
+
+
-
-
-
-
-
Clinical Investigation Reports
In-Hospital Lab:
| Test | Fixed Normals | 31-05-2026 |
|---|
| Eosinophils | | 30 |
| Hemoglobin | | 11 |
| Total Leukocyte Count | | 10 |
| Neutrophils | | 10 |
| Lymphocytes | | 10 |
| Monocytes | | 10 |
| Red Blood Cells | | 10 |
| Packed Cell Volume | | 10 |
| Mean Corpuscular Volume | | 10 |
| Mean Corpuscular Hemoglobin | | 10 |
| Mean Corpuscular Hemoglobin Concentration | | 1 |
| Platelet Count | | 010 |
-
-
-
Examination on Discharge : Pulse /min :
80/min Respiration /min :
30/min BP mmHg :
80/120mmHg SPO2 :
95
-
-
Discharge Medications
| # | Medicine | Qty | Days | Notes |
|---|
| 1 | Capsule Aciloc | | 1 day | |
| 2 | Capsule Aciloc | | 1 | |
| 3 | Capsule Aciloc | | 1 day | |
| 4 | Capsule Aciloc | | 1 | |
-
Dietary Advice: - Use appropriate medicine as Prescribed.: निर्धारित अनुसार उचित दवा का उपयोग करें।
- Fruits and Vegetables: पर्याप्त विटामिन और खनिज सुनिश्चित करने के लिए प्रतिदिन विभिन्न प्रकार के ताजे फल और सब्जियों का सेवन करें।
- Special Considerations: यदि आपको मधुमेह, उच्च रक्तचाप या किडनी संबंधी समस्या जैसी कोई विशेष समस्या है, तो अपने स्वास्थ्य सेवा प्रदाता द्वारा बताए गए आहार प्रतिबंधों का पालन करें। सर्जरी के बाद ठीक होने के लिए, उपचार को बढ़ावा देने के लिए अंडे, दाल और डेयरी उत्पादों जैसे प्रोटीन युक्त खाद्य पदार्थों को शामिल करें।
-| | | |
| _________________________ | _________________________ | _________________________ |
-Discharge Advice/Instructions/Summary
-
Discharge Summary
Date of Discharge: 2026-06-05
-
-
Signature of Consultant |
\ No newline at end of file
+
Final Diagnosis :
RIGHT CERVICAL LYMPHADENOPATHY WITH ABSCESS
+
Procedure :
I & D WITH L. N. EXCISION DONE UNDER GA / Date of Procedure : 2026-06-05
Presenting Complaints and Reason for Admission :
PAIN WITH SWELLING RIGHT SIDE NECK 1 MONTH
+
Drug Allergy / ADR
Drug Allergy Status: No Known Drug Allergy
+
General Examination on Admission :
Pulse /min :72/min Respiration /min :16/min BP mmHg :172/92mmHg
+
Course in the hospital :
IVF IV ANTIBIOTICS , ANALGESIC ATT STARTED FROM 6/6/26
Examination on Discharge : Pulse /min :
76/min Respiration /min :
18/min BP mmHg :
132/84mmHg
+
Discharge Medications
| Medicine Name | Dosage | Qty | Day |
|---|
| TAB POP DSR | BID (TWO TIME A DAY) / दिन में दो बार | 1 | 5 DAYS |
| TAB CEFUBON CV | BID (TWO TIME A DAY) / दिन में दो बार | 1 | 5 DAYS |
| TAB DICLOSIS SP | TID (THREE TIME A DAY) / दिन में तीन बार | 1 | 5 DAYS |
| TAB FORECOX | BID (TWO TIME A DAY) / दिन में दो बार | 1 | 15 DAYS |
| TAB BONCORED | BID (TWO TIME A DAY) / दिन में दो बार | 1 | 15 DAYS |
Dietary Advice:- DIET AS ADVICE: DIET AS ADVICE
- Balanced Meals: प्रत्येक भोजन में कार्बोहाइड्रेट, प्रोटीन और स्वस्थ वसा का मिश्रण शामिल करें।
- Small, Frequent Meals: पाचन तंत्र पर अधिक बोझ से बचने के लिए तीन बार अधिक भोजन करने के बजाय दिन में 5-6 बार छोटी मात्रा में भोजन करें।
- Avoid Processed Foods: मीठे, नमकीन और तले हुए खाद्य पदार्थों का सेवन सीमित करें। डिब्बाबंद स्नैक्स और ज़्यादा प्रिज़र्वेटिव वाले पेय पदार्थों से बचें।
PT WAS K/C/O RT CERVICAL LYMPHADENOPATHY WITH ABSCESS NOW ADMITTED FOR OPERATION . ALL NECESSARY INVESTIGATION WERE CARRIED OUT. PT WAS OPERATED I & D WITH L. N . EXCISION DONE UNDER GA AND MANAGED WITH IVF IV ANTIBIOTICS ANALGESIC AND OTHER SUPPORTIVE MEASURES.
+
+
NOW PT IS BEING DISCHARGED IN A STABLE CONDITION WITH MEDICATION .
+| | | |
| _________________________ | _________________________ | _________________________ |
Discharge Advice/Instructions/Summary
Discharge Summary
+
Signature of Consultant |
\ No newline at end of file