From a5b31960d76ac21986a6d98f5cf44bac6c111369 Mon Sep 17 00:00:00 2001 From: mikael-zakaria Date: Sun, 8 Dec 2024 17:31:18 +0800 Subject: [PATCH] perbaikan hasil laporan --- app/Controllers/PrinterController.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/Controllers/PrinterController.php b/app/Controllers/PrinterController.php index ae5e732..817f5ae 100644 --- a/app/Controllers/PrinterController.php +++ b/app/Controllers/PrinterController.php @@ -510,32 +510,35 @@ P1 $data_urine = array_filter($results, function($item) { $chapterid = $item["CHAPID"]; + $tesscode = $item['TESTCODE']; // Memfilter data dengan CHAPID 3, 61, atau 62 - return $chapterid == 3 || $chapterid == 61 || $chapterid == 62; + return $chapterid == 3 || $chapterid == 61 || $chapterid == 62 || $tesscode == 'NOTE'; }); // Seleksi data yang mengandung "FESES" $data_feces = array_filter($results, function($item) { $chapterid = $item["CHAPID"]; + $tesscode = $item['TESTCODE']; // Memfilter data yang 4 - return $chapterid == 4; + return $chapterid == 4 || $tesscode == 'NOTE'; }); // Seleksi data yang tidak mengandung "urine" dan "feces" $data_others = array_filter($results, function($item) { $chapterid = $item["CHAPID"]; + $tesscode = $item['TESTCODE']; // Memfilter data yang bukan 61 atau 3 - return $chapterid !== 3 && $chapterid !== 4 && $chapterid !== 61 && $chapterid !== 62; + return $chapterid !== 3 && $chapterid !== 4 && $chapterid !== 61 && $chapterid !== 62 || $tesscode == 'NOTE'; }); $fullPage = ""; - if ($data_urine != null) { + if ($data_urine != null && count($data_urine) > 1) { $fullPage .= $this->otherTests($data_urine); } - if ($data_feces != null) { + if ($data_feces != null && count($data_feces) > 1) { $fullPage .= $this->otherTests($data_feces); } - if ($data_others != null) { + if ($data_others != null && count($data_others) > 1) { $fullPage .= $this->otherTests($data_others); }