diff --git a/app/Controllers/Ipd_discharge.php b/app/Controllers/Ipd_discharge.php
index f0c5505..18bc29d 100644
--- a/app/Controllers/Ipd_discharge.php
+++ b/app/Controllers/Ipd_discharge.php
@@ -5901,8 +5901,11 @@ class Ipd_discharge extends BaseController
return $this->response->setStatusCode(404)->setBody('IPD not found');
}
+ // Check if user wants to force regenerate content (ignoring cache)
+ $forceRegenerate = (int) ($this->request->getGet('refresh') ?? 0) === 1;
+
$content = $this->getDischargeContent($ipdId);
- if (trim(strip_tags($content)) === '') {
+ if ($forceRegenerate || trim(strip_tags($content)) === '') {
$content = $this->buildAutoDischargeContent($ipdId, $panelData);
if (trim(strip_tags($content)) !== '') {
$this->saveDischargeContent($ipdId, $content);
diff --git a/pdf_test_html.html b/pdf_test_html.html
index b03f7f7..3f1e848 100644
--- a/pdf_test_html.html
+++ b/pdf_test_html.html
@@ -1,4255 +1,71 @@
-
-
-
-
| 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 |
+Procedure :
Procedure TEST / Date of Procedure : 2026-06-03
+
+
+
+
+
| 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 |
+
| # | Medicine | Qty | Days | Notes |
|---|---|---|---|---|
| 1 | Capsule Aciloc | 1 day | ||
| 2 | Capsule Aciloc | 1 | ||
| 3 | Capsule Aciloc | 1 day | ||
| 4 | Capsule Aciloc | 1 |
| _________________________ | _________________________ | _________________________ |
| Signature of Consultant | \ No newline at end of file