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


NameKAMLA SINGHUHIDP26051000001
Age & Gender26 Year / FemaleIPD No.A26050000001
GuardianW/O of RAM SINGHAdmission23-05-2026
Phone No.9720958717Discharge05-06-2026
AddressKASHIPUROrg. NameDirect
DepartmentCardiology


-
-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 NameSUNITA DEVI  UHID / Patient IDP26061331171
GuardianWife of of   JOGENDRA KUMAR  IPD No.A26061007144
Age / Gender40 Year / Female  Admission Date04-06-2026 03:14 PM
AddressMALDHAN*****  Discharge Date07-06-2026 10:00 AM
Phone No.9520497324  TPADirect
Department General Surgery    
+


- 
- 
- 
-
-

Clinical Investigation Reports

In-Hospital Lab:
TestFixed Normals31-05-2026
Eosinophils30
Hemoglobin11
Total Leukocyte Count10
Neutrophils10
Lymphocytes10
Monocytes10
Red Blood Cells10
Packed Cell Volume10
Mean Corpuscular Volume10
Mean Corpuscular Hemoglobin10
Mean Corpuscular Hemoglobin Concentration1
Platelet Count010
-
 
- 
-Examination on Discharge : Pulse /min :80/min   Respiration /min :30/min   BP mmHg :80/120mmHg   SPO2 :95

-

 
-

Discharge Medications

#MedicineQtyDaysNotes
1Capsule Aciloc1 day
2Capsule Aciloc1
3Capsule Aciloc1 day
4Capsule Aciloc1

-Dietary Advice:
  1. Use appropriate medicine as Prescribed.: निर्धारित अनुसार उचित दवा का उपयोग करें।
  2. Fruits and Vegetables: पर्याप्त विटामिन और खनिज सुनिश्चित करने के लिए प्रतिदिन विभिन्न प्रकार के ताजे फल और सब्जियों का सेवन करें।
  3. Special Considerations: यदि आपको मधुमेह, उच्च रक्तचाप या किडनी संबंधी समस्या जैसी कोई विशेष समस्या है, तो अपने स्वास्थ्य सेवा प्रदाता द्वारा बताए गए आहार प्रतिबंधों का पालन करें। सर्जरी के बाद ठीक होने के लिए, उपचार को बढ़ावा देने के लिए अंडे, दाल और डेयरी उत्पादों जैसे प्रोटीन युक्त खाद्य पदार्थों को शामिल करें।
- 
-

Discharge Advice/Instructions/Summary


-

Discharge Summary

Date of Discharge: 2026-06-05
-


-

\ 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

   
___________________________________________________________________________
Signature of Consultant
Medicine NameDosageQtyDay
TAB POP DSRBID (TWO TIME A DAY) / दिन में दो बार15 DAYS
TAB CEFUBON CVBID (TWO TIME A DAY) / दिन में दो बार15 DAYS
TAB DICLOSIS SPTID (THREE TIME A DAY) / दिन में तीन बार15 DAYS
TAB FORECOXBID (TWO TIME A DAY) / दिन में दो बार115 DAYS
TAB BONCOREDBID (TWO TIME A DAY) / दिन में दो बार115 DAYS
  Dietary Advice:
  1. DIET AS ADVICE: DIET AS ADVICE
  2. Balanced Meals: प्रत्येक भोजन में कार्बोहाइड्रेट, प्रोटीन और स्वस्थ वसा का मिश्रण शामिल करें।
  3. Small, Frequent Meals: पाचन तंत्र पर अधिक बोझ से बचने के लिए तीन बार अधिक भोजन करने के बजाय दिन में 5-6 बार छोटी मात्रा में भोजन करें।
  4. 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

+

\ No newline at end of file
   
___________________________________________________________________________
Signature of Consultant