diff --git a/app/Controllers/PrintResult.php b/app/Controllers/PrintResult.php index 17e4345..80ac439 100644 --- a/app/Controllers/PrintResult.php +++ b/app/Controllers/PrintResult.php @@ -5,8 +5,6 @@ class PrintResult extends BaseController { public function otherTests($resultData, $data, $note){ - // var_dump($data);die(); - if($data[0] != null) { $accessnumber = $data[0]['SP_ACCESSNUMBER']; @@ -99,12 +97,12 @@ class PrintResult extends BaseController { - + - - - - + + + + "; @@ -236,7 +234,7 @@ class PrintResult extends BaseController { $i++; // Melebihi batas Kertas - if($i % 30 == 0) { + if($i % 28 == 0) { $resultTest .= "
ParameterParameter ResultUnitNormal RangeSample TypeResultUnitNormal RangeSample
"; $fullPage .= $headPage.$resultTest.$footerPage.$lastDiv; $i=0; @@ -258,7 +256,7 @@ class PrintResult extends BaseController { } // Melebihi batas Kertas - if($i % 30 == 0 && $i!=0) { + if($i % 28 == 0 && $i!=0) { $resultTest .= ""; $fullPage .= $headPage.$resultTest.$footerPage.$lastDiv; $i=0; @@ -279,23 +277,44 @@ class PrintResult extends BaseController { $unit = $item['UNIT']; $unittext = $item['UNITTEXT']; if($unittext !='') {$unit = $unittext;} - $resultTest .= " - - - -
" . $space . $item["test_eng"]." "."".$item["test_ind"]."
- - - " . $resflag . " - " . $resvalue . " - " . $unit . " - " . $reff . " - " . $serum_type . " - - "; + + $color = ""; + if($resflag == 'L' || $resflag == 'H'){ + $color = "red_font"; + } + + // Untuk Nama Test Apakah lebih dari 24 karakter + if ( strlen($item['test_eng']) > 24 || strlen($item['test_ind']) > 24) { + $resultTest .= " + + +
" . $space . $item["test_eng"].""."
$space".$item["test_ind"]."
+ + " . $resflag . " + " . $resvalue . " + " . $unit . " + " . $reff . " + " . $serum_type . " + + "; + } else { + $resultTest .= " + + +
" . $space . $item["test_eng"]." "."".$item["test_ind"]."
+ + " . $resflag . " + " . $resvalue . " + " . $unit . " + " . $reff . " + " . $serum_type . " + + "; + } + // Melebihi batas Kertas - if($i % 30 == 0 && $i != 0) { + if($i % 28 == 0 && $i != 0) { $resultTest .= ""; $fullPage .= $headPage.$resultTest.$footerPage.$lastDiv; $i=0; @@ -373,6 +392,7 @@ class PrintResult extends BaseController { cdt.TEXT2 as test_ind, cdt.UNIT as UNITTEXT, t.DEPTH, + t.NOTPRINTABLE, t.TESTORDER, dt.SHORTTEXT, RESULT = case when t.RESVALUE is null then tx.FULLTEXT else t.RESVALUE end, @@ -397,40 +417,53 @@ class PrintResult extends BaseController { $serum_type = $item["serum_type"]; $tesscode = $item["TESTCODE"]; $test_eng = $item["test_eng"]; - return $serum_type == 'Urine' && ($tesscode == 'PPT' || $test_eng == "Pregnancy Test"); + $printable = $item['NOTPRINTABLE']; + return $serum_type == 'Urine' && ($tesscode == 'PPT' || $test_eng == "Pregnancy Test") && $printable !=1; }); $data_urine_lengkap = array_filter($results, function($item) { $serum_type = $item["serum_type"]; $tesscode = $item["TESTCODE"]; $test_eng = $item["test_eng"]; $chap_eng = $item["chap_eng"]; - return $serum_type == 'Urine' && $tesscode != 'PPT' && $test_eng != "Pregnancy Test" && $chap_eng != "MICROBIOLOGY"; + $printable = $item['NOTPRINTABLE']; + return $serum_type == 'Urine' && $tesscode != 'PPT' && $test_eng != "Pregnancy Test" && $chap_eng != "MICROBIOLOGY" && $printable !=1; }); $data_urine_kultur = array_filter($results, function($item) { $serum_type = $item["serum_type"]; $chap_eng = $item["chap_eng"]; - return $serum_type == 'Urine' && $chap_eng == "MICROBIOLOGY"; + $printable = $item['NOTPRINTABLE']; + return $serum_type == 'Urine' && $chap_eng == "MICROBIOLOGY" && $printable !=1; }); $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']); + $printable = $item['NOTPRINTABLE']; + return $serum_type == 'Feces' && in_array($tesscode, ['STC2', 'SCSAL', 'SCSHI']) && $printable !=1; }); $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']); + $printable = $item['NOTPRINTABLE']; + return $serum_type == 'Feces' && in_array($tesscode, ['STC4', 'FCSAL', 'FCSHI', 'FCVIB', 'FCESC']) && $printable !=1; }); $data_feces_lengkap = array_filter($results, function($item) { $serum_type = $item["serum_type"]; $tesscode = $item["TESTCODE"]; - return $serum_type == 'Feces' && !in_array($tesscode, ['STC2', 'SCSAL', 'SCSHI', 'STC4', 'FCSAL', 'FCSHI', 'FCVIB', 'FCESC']); + $printable = $item['NOTPRINTABLE']; + return $serum_type == 'Feces' && !in_array($tesscode, ['STC2', 'SCSAL', 'SCSHI', 'STC4', 'FCSAL', 'FCSHI', 'FCVIB', 'FCESC']) && $printable !=1; + }); + + $data_RCS = array_filter($results, function($item) { + $serum_type = $item["serum_type"]; + $printable = $item['NOTPRINTABLE']; + return $serum_type == 'Swab Tenggorokan' && $printable !=1; }); $data_others = array_filter($results, function($item) { $serum_type = $item["serum_type"]; $chapter_eng = $item['chap_eng']; - return $serum_type != 'Feces' && $serum_type != 'Urine' && $chapter_eng != 'Note'; + $printable = $item['NOTPRINTABLE']; + return $serum_type != 'Feces' && $serum_type != 'Urine' && $chapter_eng != 'Note' && $serum_type != 'Swab Tenggorokan' && $printable !=1; }); $notes = array_filter($results, function($item) { @@ -442,13 +475,16 @@ class PrintResult extends BaseController { $notes = reset($notes); // Ambil elemen pertama $note = $notes["RESULT"] ?? "-"; // Ambil nilai RESULT, atau null jika tidak ada - $fullPage = ""; if ($data_others != null) { $fullPage .= $this->otherTests($data_others, $data, $note); } + if ($data_RCS != null) { + $fullPage .= $this->otherTests($data_RCS, $data, $note); + } + if ($data_urine_kultur != null) { $fullPage .= $this->otherTests($data_urine_kultur, $data, $note); } diff --git a/public/assets/css/pdf.css b/public/assets/css/pdf.css index a341192..744d3fd 100644 --- a/public/assets/css/pdf.css +++ b/public/assets/css/pdf.css @@ -8,6 +8,10 @@ body { background-color: rgb(17, 16, 16); } +.red_font { + color: red; +} + #page { background: rgb(255, 255, 255); display: block;