perbaikan hasil laporan

This commit is contained in:
mikael-zakaria 2024-12-08 17:31:18 +08:00
parent 4a3ce59b11
commit a5b31960d7

View File

@ -510,32 +510,35 @@ P1
$data_urine = array_filter($results, function($item) { $data_urine = array_filter($results, function($item) {
$chapterid = $item["CHAPID"]; $chapterid = $item["CHAPID"];
$tesscode = $item['TESTCODE'];
// Memfilter data dengan CHAPID 3, 61, atau 62 // 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" // Seleksi data yang mengandung "FESES"
$data_feces = array_filter($results, function($item) { $data_feces = array_filter($results, function($item) {
$chapterid = $item["CHAPID"]; $chapterid = $item["CHAPID"];
$tesscode = $item['TESTCODE'];
// Memfilter data yang 4 // Memfilter data yang 4
return $chapterid == 4; return $chapterid == 4 || $tesscode == 'NOTE';
}); });
// Seleksi data yang tidak mengandung "urine" dan "feces" // Seleksi data yang tidak mengandung "urine" dan "feces"
$data_others = array_filter($results, function($item) { $data_others = array_filter($results, function($item) {
$chapterid = $item["CHAPID"]; $chapterid = $item["CHAPID"];
$tesscode = $item['TESTCODE'];
// Memfilter data yang bukan 61 atau 3 // 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 = ""; $fullPage = "";
if ($data_urine != null) { if ($data_urine != null && count($data_urine) > 1) {
$fullPage .= $this->otherTests($data_urine); $fullPage .= $this->otherTests($data_urine);
} }
if ($data_feces != null) { if ($data_feces != null && count($data_feces) > 1) {
$fullPage .= $this->otherTests($data_feces); $fullPage .= $this->otherTests($data_feces);
} }
if ($data_others != null) { if ($data_others != null && count($data_others) > 1) {
$fullPage .= $this->otherTests($data_others); $fullPage .= $this->otherTests($data_others);
} }