diff --git a/app/Controllers/PrintResult.php b/app/Controllers/PrintResult.php index 1385845..f0f0081 100644 --- a/app/Controllers/PrintResult.php +++ b/app/Controllers/PrintResult.php @@ -275,7 +275,7 @@ class PrintResult extends BaseController { -
" . $space . $item["test_eng"]." "."".$item["test_ind"]."
+
" . $space . $item["test_eng"]." "."".$item["test_ind"]."
" . $resflag . " @@ -408,41 +408,56 @@ class PrintResult extends BaseController { // return $chapterid !== 3 && $chapterid !== 4 && $chapterid !== 61 && $chapterid !== 62 || $tesscode == 'NOTE'; // }); - $data_urine_lengkap = array_filter($results, function($item) { - $serum_type = $item["serum_type"]; - $chapterid = $item["CHAPID"]; - return $serum_type == 'Urine' && $chapterid == 61; - }); $data_pregnancy = array_filter($results, function($item) { $serum_type = $item["serum_type"]; - $chapterid = $item["CHAPID"]; - return $serum_type == 'Urine' && $chapterid == 62; + $tesscode = $item["TESTCODE"]; + return $serum_type == 'Urine' && $tesscode == 'PPT'; + }); + $data_urine_lengkap = array_filter($results, function($item) { + $serum_type = $item["serum_type"]; + $tesscode = $item["TESTCODE"]; + return $serum_type == 'Urine' && $tesscode != 'PPT'; + }); + + $data_feces_stc2 = array_filter($results, function($item) { + $serum_type = $item["serum_type"]; + $tesscode = $item["TESTCODE"]; + return $serum_type == 'Feces' && in_array($tesscode, ['STC2', 'SCSAL', 'SCSHI']); + }); + $data_feces_stc4 = array_filter($results, function($item) { + $serum_type = $item["serum_type"]; + $tesscode = $item["TESTCODE"]; + return $serum_type == 'Feces' && in_array($tesscode, ['STC4', 'FCSAL', 'FCSHI', 'FCVIB', 'FCESC']); }); $data_feces_lengkap = array_filter($results, function($item) { $serum_type = $item["serum_type"]; - $chapterid = $item["CHAPID"]; - return $serum_type == 'Feces' && $chapterid == 4; + $tesscode = $item["TESTCODE"]; + return $serum_type == 'Feces' && !in_array($tesscode, ['STC2', 'SCSAL', 'SCSHI', 'STC4', 'FCSAL', 'FCSHI', 'FCVIB', 'FCESC']); }); $data_others = array_filter($results, function($item) { $serum_type = $item["serum_type"]; $chapter_eng = $item['chap_eng']; - // return $chapterid !== 3 && $chapterid !== 4 && $chapterid !== 61 && $chapterid !== 62 || $tesscode == 'NOTE'; return $serum_type != 'Feces' && $serum_type != 'Urine' && $chapter_eng != 'Note'; }); $fullPage = ""; - - if ($data_urine_lengkap != null && count($data_urine_lengkap) > 1) { + if ($data_urine_lengkap != null) { $fullPage .= $this->otherTests($data_urine_lengkap, $data); } - if ($data_pregnancy != null && count($data_pregnancy) > 1) { + if ($data_pregnancy != null) { $fullPage .= $this->otherTests($data_pregnancy, $data); } - if ($data_feces_lengkap != null && count($data_feces_lengkap) > 1) { + if ($data_feces_lengkap != null) { $fullPage .= $this->otherTests($data_feces_lengkap, $data); } - if ($data_others != null && count($data_others) > 1) { + if ($data_feces_stc2 != null) { + $fullPage .= $this->otherTests($data_feces_stc2, $data); + } + if ($data_feces_stc4 != null) { + $fullPage .= $this->otherTests($data_feces_stc4, $data); + } + if ($data_others != null) { $fullPage .= $this->otherTests($data_others, $data); }