pbmc-cmod/app/Controllers/PrinterController.php

1351 lines
50 KiB
PHP
Raw Normal View History

<?php
namespace App\Controllers;
class PrinterController extends BaseController {
// Data ZPL untuk mencetak label
// $startSection = "^XA\n^PW400\n^LL224\n";
// $nameSection = "^FO10,2\n^A0N,23,23\n^FD MRS. I PUTU AYU PUTRI PERTIWI ^FS\n";
// $yearSection = "^FO12,25\n^A0N,22,22\n^FD F 24Y ^FS\n";
// $labelBarcodeSection = "^FO85,50\n^BY2,2.0,45\n^BCN,100,N,N,N\n^FD25082257^FS\n";
// $numberCodeSection = "^FO374,43\n^A0B,25,25\n^FD 25082257 ^FS\n";
// $sampleSection = "^FO19,45\n^A0B,27,27\n^FD $sample ^FS\n";
// $parameterSection = "^FO10,165\n^A0N,23,23\n^FD PSA, HDL, LDL, BUN, SGOT ^FS\n";
// $lisNumSection = "^FO10,195\n^A0N,17,20\n^FD LIS 4112082257 ^FS\n";
// $hisNumSection = "^FO10,210\n^A0N,20,20\n^FD HIS 01241101855 ^FS\n";
// $numSampleSection = "^FO240,200\n^A0N,27,27\n^FD $access 115 ^FS\n";
// $endSection = "^XZ";
public function printSingleSampleBarcode($access, $sample) {
$time = microtime(true);
$logTime = date('d-m-Y_H_i_s', $time) . sprintf('_%03d', ($time - floor($time)) * 1000);
$filename = "sample_".$logTime;
$role = session()->get('userrole');
$networkPath = "";
// Ruang Analis Printer POSTEK C168/200s
if ($role === 'admin' || $role === 'user') {
// Buka Mapping Drive PC Laboratorium
exec('net use L: \\\\10.148.5.20\\Labelshare /user:Administrator 2>&1', $output, $return_var);
$pathNetworkFolder = 'L:/Sampling_Labels/';
$letterPath = 'L:';
// Printer Posteck
$sampleLable ="N
OD
q400
Q200,10+0
I8,A,001
D10
A4,3,0,2,1,1,N,\"Mr.I Putu Agus Ariesta Adi Wawan\"
A4,25,0,2,1,1,N,\"M 29Y\"
A4,55,0,2,1,1,N,\"SAMPLE\"
A4,75,0,2,1,1,N,\"Chapter\"
B149,35,0,1,3,8,70,N,\"24020840\"
A199,110,0,2,1,1,N,\"LAB 24020840\"
A4,140,0,2,1,1,N,\"UH : 1B094943\"
A4,160,0,2,1,1,N,\"BV : BV035725\"
A195,156,0,2,1,1,N,\"$filename\"
P1
";
// Ruang Analis Printer Zebra
} else if ($role === 'sampling') {
// Buka Mapping Drive PC Sampling
exec('net use S: \\\\10.148.3.169\\Labelshare /user:Administrator 2>&1', $output, $return_var);
$pathNetworkFolder = 'S:/Sampling_Labels/';
$letterPath = 'S:';
// Printer Zebra
$sampleLable ="N
OD
q400
Q185,10+0
I8,A,001
D10
A4,3,0,2,1,1,N,\"Mr.I Putu Agus Ariesta Adi Wawan\"
A4,25,0,2,1,1,N,\"M 29Y\"
A4,55,0,2,1,1,N,\"SAMPLE\"
A4,75,0,2,1,1,N,\"Chapter\"
B149,35,0,1,3,8,70,N,\"24020840\"
A199,110,0,2,1,1,N,\"LAB 24020840\"
A4,140,0,2,1,1,N,\"UH : 1B094943\"
A4,160,0,2,1,1,N,\"BV : BV035725\"
A195,156,0,2,1,1,N,\"03/12/2024 07:10\"
P1
";
} else {
// Eksekusi Kode Berikut Apabila Role Bukan Analis atau Sampling
return $this->response->setJSON([
'message' => "Akses Tidak Berwenang",
'error' => "Hak Akses Anda Tidak Dikenali",
'status' => false,
]);
}
$fullPath = $pathNetworkFolder . $filename;
// Tulis file ke folder tujuan
if (!file_put_contents($fullPath, $sampleLable)) {
exec('net use '. $letterPath .' /delete 2>&1', $output, $return_var);
// Eksekusi Kode Berikut Apabila Ada Error
return $this->response->setJSON([
'error' => $output,
'message' => "Gagal Melakukan Print, Mohon Ulangi Atau Cek Koneksi Printer Anda",
'status' => false,
]);
} else {
// Hapus Koneksi
exec('net use '. $letterPath .' /delete 2>&1', $output, $return_var);
return $this->response->setJSON(
[
'message' => "Print Berhasil",
'status' => true,
]
);
}
}
public function printAllSampleBarcode() {
$data = 3;
$role = session()->get('userrole');
$networkPath = "";
// Ruang Analis Printer POSTEK
if ($role === 'admin' || $role === 'user') {
// Buka Mapping Drive PC Laboratorium
exec('net use L: \\\\10.148.5.20\\Labelshare /user:Administrator 2>&1', $output, $return_var);
$pathNetworkFolder = 'L:/Sampling_Labels/';
$letterPath = 'L:';
for ($i=0; $i<$data; $i++) {
$time = microtime(true);
$logTime = date('d-m-Y_H_i_s', $time) . sprintf('_%03d', ($time - floor($time)) * 1000);
$filename = "sample_".$logTime;
// Printer Posteck
$sampleLable ="N
OD
q400
Q200,10+0
I8,A,001
D10
A4,3,0,2,1,1,N,\"Mr.I Putu Agus Ariesta Adi Wawan\"
A4,25,0,2,1,1,N,\"M 29Y\"
A4,55,0,2,1,1,N,\"SAMPLE\"
A4,75,0,2,1,1,N,\"Chapter\"
B149,35,0,1,3,8,70,N,\"24020840\"
A199,110,0,2,1,1,N,\"LAB 24020840\"
A4,140,0,2,1,1,N,\"UH : 1B094943\"
A4,160,0,2,1,1,N,\"BV : BV035725\"
A195,156,0,2,1,1,N,\"$filename\"
P1
";
$fullPath = $pathNetworkFolder . $filename;
// Tulis file ke folder tujuan
if (!file_put_contents($fullPath, $sampleLable)) {
exec('net use '. $letterPath .' /delete 2>&1', $output, $return_var);
// Eksekusi Kode Berikut Apabila Ada Error
return $this->response->setJSON([
'error' => $output,
'message' => "Gagal Melakukan Print, Mohon Ulangi Atau Cek Koneksi Printer Anda",
'status' => false,
]);
}
}
// Ruang Analis Printer Zebra
} else if ($role === 'sampling') {
// Buka Mapping Drive PC Sampling
exec('net use S: \\\\10.148.3.169\\Labelshare /user:Administrator 2>&1', $output, $return_var);
$pathNetworkFolder = 'S:/Sampling_Labels/';
$letterPath = 'S:';
for ($i=0; $i<$data; $i++) {
$time = microtime(true);
$logTime = date('d-m-Y_H_i_s', $time) . sprintf('_%03d', ($time - floor($time)) * 1000);
$filename = "sample_".$logTime;
// Printer Zebra
$sampleLable ="N
OD
q400
Q185,10+0
I8,A,001
D10
A4,3,0,2,1,1,N,\"Mr.I Putu Agus Ariesta Adi Wawan\"
A4,25,0,2,1,1,N,\"M 29Y\"
A4,55,0,2,1,1,N,\"SAMPLE\"
A4,75,0,2,1,1,N,\"Chapter\"
B149,35,0,1,3,8,70,N,\"24020840\"
A199,110,0,2,1,1,N,\"LAB 24020840\"
A4,140,0,2,1,1,N,\"UH : 1B094943\"
A4,160,0,2,1,1,N,\"BV : BV035725\"
A195,156,0,2,1,1,N,\"03/12/2024 07:10\"
P1
";
$fullPath = $pathNetworkFolder . $filename;
// Tulis file ke folder tujuan
if (!file_put_contents($fullPath, $sampleLable)) {
exec('net use '. $letterPath .' /delete 2>&1', $output, $return_var);
// Eksekusi Kode Berikut Apabila Ada Error
return $this->response->setJSON([
'error' => $output,
'message' => "Gagal Melakukan Print, Mohon Ulangi Atau Cek Koneksi Printer Anda",
'status' => false,
]);
}
}
} else {
// Eksekusi Kode Berikut Apabila Role Bukan Analis atau Sampling
return $this->response->setJSON([
'message' => "Akses Tidak Berwenang",
'error' => "Hak Akses Anda Tidak Dikenali",
'status' => false,
]);
}
// Hapus Koneksi
exec('net use '. $letterPath .' /delete 2>&1', $output, $return_var);
return $this->response->setJSON(
[
'message' => "Print Berhasil",
'status' => true,
]
);
}
public function otherTests($request){
$fullPage="";
$headPage = "
<div id='page'>
<div id='pagetop' style='height:0.01cm'> </div>
2024-12-07 09:25:13 +07:00
<img src='".base_url()."assets/img/padma-header.png' class='img' />
<div id='dinfo'>
<table class='information t_center'>
<tr>
<th class='padmaColor' colspan='6' align='center'>CLINICAL LABORATORY</th>
</tr>
<tr>
<th style='width:12%' align='left'>UHID</th>
<td style='width:2%'>:</td>
<td style='width:44%'>1BCJJAJSDK</td>
<th style='width:20%' align='left'>Sample ID</th>
<td style='width:2%'>:</td>
<td style='width:20%'>LAB2420076951</td>
</tr>
<tr>
<th align='left'>Name</th>
<td>:</td>
<td>Ni Luh Putu Eka Putri Saraswati </td>
<th align='left'>Specimen</th>
<td>:</td>
<td>Serum</td>
</tr>
<tr>
<th align='left'>Age/Gender</th>
<td>:</td>
<td>22 year(s) / Male</td>
<th align='left'>Collection Date/Time</th>
<td>:</td>
<td>26-10-2024 / 11:55:04</td>
</tr>
<tr>
<th align='left'>Speciality</th>
<td>:</td>
<td></td>
<th align='left'>Result Date/Time</th>
<td>:</td>
<td>26-10-2024 / 11:52:04</td>
</tr>
</table>
</div>
<div id='dresult'>
<br>
<table class='result t_center'>
<tr align='left'>
<th class='padmaColor' style='width:25%'>Parameter</th>
<th class='padmaColor' style='width:15%'>Result</th>
<th class='padmaColor' style='width:8%'>Unit</th>
<th class='padmaColor' style='width:17%'>Normal Range</th>
<th class='padmaColor' style='width:35%'>Notes</th>
</tr>
";
$resultTest ="";
$resultNoteandSpecimen = "
<br>
<table class='result t_center'>
<tr>
<th align='left' class='padmaColor'>Notes</th>
</tr>
<tr>
<td>
Hasil pemeriksaan sedikit di luar rentang normal. Disarankan untuk memantau kondisi ini dan melakukan pemeriksaan ulang jika diperlukan.
</td>
</tr>
</table>
<br>
<table class='t_center table_collection' >
<tr>
<td><pre>Collection datetime : EDTA,SERUM 13-11-2024 10.00</pre></td>
</tr>
<tr>
<td><pre>Reception datetime : EDTA,SERUM 13-11-2024 12.00</pre></td>
</tr>
</table>
";
$footerPage = "
<div id='footer'>
<table class='table_footer t_center'>
<tr>
<td></td>
<td align='right'><img src='http://cmod.id/assets/img/ttd.png' alt=''></td>
</tr>
<tr>
<td><u>Entered By</u></td>
<td align='right'><u>Verified By</u></td>
</tr>
<tr>
<td>Lab Technician</td>
<td align='right'>dr. I Komang Parwata Sp.PK</td>
</tr>
<tr>
<td>Mrs. Gst Ayu Riska Mastari</td>
<td align='right'>Reg. No: 570/SIPDS/0001/I/DPMPTSP/2023</td>
</tr>
</table>
</div>
";
$lastDiv="</div>";
$i=0;
foreach ($request as $chapter) {
$i++;
// Untuk Chapter
$resultTest .= "
<tr align='left' class='chapter'>
<td colspan='5'>
<pre><b>".$chapter['chapter_eng']."</b></pre>
<pre> <small><b>".$chapter['chapter_ind']."</b></small></pre>
</td>
</tr>
";
// Melebihi batas Kertas
if($i % 22 == 0) {
$resultTest .= "</table></div>";
$fullPage .= $headPage.$resultTest.$footerPage.$lastDiv;
$i=0;
$resultTest = "";
}
foreach($chapter["tests"] as $test) {
$i++;
$resultTest .= "
<tr>
<td colspan='1' class=''>
<pre> ".$test["test_eng"]."</pre>
<pre> <small>".$test["test_ind"]."</small></pre>
</td>
<td class=''>" . $test["result"] . "</td>
<td class=''>" . $test["unit"] . "</td>
<td class=''>" . $test["range"] . "</td>
<td class=''>" . $test["notes"] . "</td>
</tr>
";
// Melebihi batas Kertas
if($i % 22 == 0) {
$resultTest .= "</table></div>";
$fullPage .= $headPage.$resultTest.$footerPage.$lastDiv;
$i=0;
$resultTest = "";
}
}
}
$resultTest .= "
</table>
".$resultNoteandSpecimen."
</div>";
$fullPage .= $headPage.$resultTest.$footerPage.$lastDiv;
return $fullPage;
}
public function printResultTest($access) {
2024-12-07 09:25:13 +07:00
$data_mentah = [
[
"chapter_eng" => "IMUNOLOGY 4 PANEL",
"chapter_ind" => "IMUNOLOGI 4 PANEL",
"tests" => [
[
"test_eng" => "HBsAg",
"test_ind" => "HBsAg",
"result" => "Non-Reactive",
"unit" => "mL/g",
"range" => "Non-Reactive",
"notes" => "Baik dan Tidak Berbahaya"
],
[
"test_eng" => "Anti-TP Test",
"test_ind" => "Tes Anti-TP",
"result" => "Non-Reactive",
"unit" => "",
"range" => "",
"notes" => "Baik dan Tidak Berbahaya"
]
]
],
[
"chapter_eng" => "CARDIOLOGY 2 PANEL",
"chapter_ind" => "KARDIOLOGI 2 PANEL",
"tests" => [
[
"test_eng" => "Troponin I",
"test_ind" => "Troponin I",
"result" => "0.03",
"unit" => "ng/mL",
"range" => "< 0.04",
"notes" => "Normal"
],
[
"test_eng" => "CK-MB",
"test_ind" => "CK-MB",
"result" => "5.0",
"unit" => "ng/mL",
"range" => "0 - 5",
"notes" => "Normal"
]
]
],
[
"chapter_eng" => "DIABETES 3 PANEL",
"chapter_ind" => "DIABETES 3 PANEL",
"tests" => [
[
"test_eng" => "Fasting Blood Glucose",
"test_ind" => "Gula Darah Puasa",
"result" => "95",
"unit" => "mg/dL",
"range" => "70 - 99",
"notes" => "Normal"
],
[
"test_eng" => "HbA1c",
"test_ind" => "HbA1c",
"result" => "5.6%",
"unit" => "%",
"range" => "< 5.7%",
"notes" => "Tidak ada indikasi diabetes"
],
[
"test_eng" => "Random Blood Glucose",
"test_ind" => "Gula Darah Sewaktu",
"result" => "130",
"unit" => "mg/dL",
"range" => "70 - 140",
"notes" => "Normal"
]
]
],
[
"chapter_eng" => "LIVER FUNCTION PANEL",
"chapter_ind" => "PANEL FUNGSI HATI",
"tests" => [
[
"test_eng" => "ALT (SGPT)",
"test_ind" => "ALT (SGPT)",
"result" => "25",
"unit" => "U/L",
"range" => "0 - 35",
"notes" => "Normal"
],
[
"test_eng" => "AST (SGOT)",
"test_ind" => "AST (SGOT)",
"result" => "20",
"unit" => "U/L",
"range" => "0 - 35",
"notes" => "Normal"
]
]
],
[
"chapter_eng" => "RENAL FUNCTION PANEL",
"chapter_ind" => "PANEL FUNGSI GINJAL",
"tests" => [
[
"test_eng" => "Creatinine",
"test_ind" => "Kreatinin",
"result" => "1.0",
"unit" => "mg/dL",
"range" => "0.7 - 1.3",
"notes" => "Normal"
],
[
"test_eng" => "Urea",
"test_ind" => "Ureum",
"result" => "35",
"unit" => "mg/dL",
"range" => "15 - 40",
"notes" => "Normal"
]
]
],
[
"chapter_eng" => "FECES",
"chapter_ind" => "PANEL FESES",
"tests" => [
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Consistency",
"test_ind" => "Konsistensi",
"result" => "Soft",
"unit" => "",
"range" => "Normal",
"notes" => "Konsistensi lunak, tidak cair atau keras"
],
[
"test_eng" => "Occult Blood",
"test_ind" => "Darah Tersembunyi",
"result" => "Negative",
"unit" => "",
"range" => "Negative",
"notes" => "Tidak ditemukan darah tersembunyi"
],
[
"test_eng" => "Parasites",
"test_ind" => "Parasit",
"result" => "None",
"unit" => "",
"range" => "None",
"notes" => "Tidak ditemukan parasit"
]
]
],
[
"chapter_eng" => "URINE",
"chapter_ind" => "PANEL URIN",
"tests" => [
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Yellow",
"unit" => "",
"range" => "Normal",
"notes" => "Warna kuning normal"
],
[
"test_eng" => "Clarity",
"test_ind" => "Kejernihan",
"result" => "Clear",
"unit" => "",
"range" => "Normal",
"notes" => "Jernih tanpa sedimen"
],
[
"test_eng" => "pH",
"test_ind" => "pH",
"result" => "6.0",
"unit" => "",
"range" => "4.5 - 8.0",
"notes" => "pH dalam rentang normal"
],
[
"test_eng" => "Protein",
"test_ind" => "Protein",
"result" => "Negative",
"unit" => "",
"range" => "Negative",
"notes" => "Tidak ada protein dalam urin"
],
[
"test_eng" => "Glucose",
"test_ind" => "Glukosa",
"result" => "Negative",
"unit" => "",
"range" => "Negative",
"notes" => "Tidak ada glukosa dalam urin"
]
]
],
[
"chapter_eng" => "IMUNOLOGY 4 PANEL",
"chapter_ind" => "IMUNOLOGI 4 PANEL",
"tests" => [
[
"test_eng" => "HBsAg",
"test_ind" => "HBsAg",
"result" => "Non-Reactive",
"unit" => "mL/g",
"range" => "Non-Reactive",
"notes" => "Baik dan Tidak Berbahaya"
],
[
"test_eng" => "Anti-TP Test",
"test_ind" => "Tes Anti-TP",
"result" => "Non-Reactive",
"unit" => "",
"range" => "",
"notes" => "Baik dan Tidak Berbahaya"
]
]
],
[
"chapter_eng" => "CARDIOLOGY 2 PANEL",
"chapter_ind" => "KARDIOLOGI 2 PANEL",
"tests" => [
[
"test_eng" => "Troponin I",
"test_ind" => "Troponin I",
"result" => "0.03",
"unit" => "ng/mL",
"range" => "< 0.04",
"notes" => "Normal"
],
[
"test_eng" => "CK-MB",
"test_ind" => "CK-MB",
"result" => "5.0",
"unit" => "ng/mL",
"range" => "0 - 5",
"notes" => "Normal"
]
]
],
[
"chapter_eng" => "DIABETES 3 PANEL",
"chapter_ind" => "DIABETES 3 PANEL",
"tests" => [
[
"test_eng" => "Fasting Blood Glucose",
"test_ind" => "Gula Darah Puasa",
"result" => "95",
"unit" => "mg/dL",
"range" => "70 - 99",
"notes" => "Normal"
],
[
"test_eng" => "HbA1c",
"test_ind" => "HbA1c",
"result" => "5.6%",
"unit" => "%",
"range" => "< 5.7%",
"notes" => "Tidak ada indikasi diabetes"
],
[
"test_eng" => "Random Blood Glucose",
"test_ind" => "Gula Darah Sewaktu",
"result" => "130",
"unit" => "mg/dL",
"range" => "70 - 140",
"notes" => "Normal"
]
]
],
[
"chapter_eng" => "LIVER FUNCTION PANEL",
"chapter_ind" => "PANEL FUNGSI HATI",
"tests" => [
[
"test_eng" => "ALT (SGPT)",
"test_ind" => "ALT (SGPT)",
"result" => "25",
"unit" => "U/L",
"range" => "0 - 35",
"notes" => "Normal"
],
[
"test_eng" => "AST (SGOT)",
"test_ind" => "AST (SGOT)",
"result" => "20",
"unit" => "U/L",
"range" => "0 - 35",
"notes" => "Normal"
]
]
],
[
"chapter_eng" => "RENAL FUNCTION PANEL",
"chapter_ind" => "PANEL FUNGSI GINJAL",
"tests" => [
[
"test_eng" => "Creatinine",
"test_ind" => "Kreatinin",
"result" => "1.0",
"unit" => "mg/dL",
"range" => "0.7 - 1.3",
"notes" => "Normal"
],
[
"test_eng" => "Urea",
"test_ind" => "Ureum",
"result" => "35",
"unit" => "mg/dL",
"range" => "15 - 40",
"notes" => "Normal"
]
]
],
[
"chapter_eng" => "FECES",
"chapter_ind" => "PANEL FESES",
"tests" => [
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Consistency",
"test_ind" => "Konsistensi",
"result" => "Soft",
"unit" => "",
"range" => "Normal",
"notes" => "Konsistensi lunak, tidak cair atau keras"
],
[
"test_eng" => "Occult Blood",
"test_ind" => "Darah Tersembunyi",
"result" => "Negative",
"unit" => "",
"range" => "Negative",
"notes" => "Tidak ditemukan darah tersembunyi"
],
[
"test_eng" => "Parasites",
"test_ind" => "Parasit",
"result" => "None",
"unit" => "",
"range" => "None",
"notes" => "Tidak ditemukan parasit"
]
]
],
[
"chapter_eng" => "URINE",
"chapter_ind" => "PANEL URIN",
"tests" => [
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Yellow",
"unit" => "",
"range" => "Normal",
"notes" => "Warna kuning normal"
],
[
"test_eng" => "Clarity",
"test_ind" => "Kejernihan",
"result" => "Clear",
"unit" => "",
"range" => "Normal",
"notes" => "Jernih tanpa sedimen"
],
[
"test_eng" => "pH",
"test_ind" => "pH",
"result" => "6.0",
"unit" => "",
"range" => "4.5 - 8.0",
"notes" => "pH dalam rentang normal"
],
[
"test_eng" => "Protein",
"test_ind" => "Protein",
"result" => "Negative",
"unit" => "",
"range" => "Negative",
"notes" => "Tidak ada protein dalam urin"
],
[
"test_eng" => "Glucose",
"test_ind" => "Glukosa",
"result" => "Negative",
"unit" => "",
"range" => "Negative",
"notes" => "Tidak ada glukosa dalam urin"
]
]
],
[
"chapter_eng" => "FECES",
"chapter_ind" => "PANEL FESES",
"tests" => [
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Consistency",
"test_ind" => "Konsistensi",
"result" => "Soft",
"unit" => "",
"range" => "Normal",
"notes" => "Konsistensi lunak, tidak cair atau keras"
],
[
"test_eng" => "Occult Blood",
"test_ind" => "Darah Tersembunyi",
"result" => "Negative",
"unit" => "",
"range" => "Negative",
"notes" => "Tidak ditemukan darah tersembunyi"
],
[
"test_eng" => "Parasites",
"test_ind" => "Parasit",
"result" => "None",
"unit" => "",
"range" => "None",
"notes" => "Tidak ditemukan parasit"
]
]
],
[
"chapter_eng" => "URINE",
"chapter_ind" => "PANEL URIN",
"tests" => [
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Yellow",
"unit" => "",
"range" => "Normal",
"notes" => "Warna kuning normal"
],
[
"test_eng" => "Clarity",
"test_ind" => "Kejernihan",
"result" => "Clear",
"unit" => "",
"range" => "Normal",
"notes" => "Jernih tanpa sedimen"
],
[
"test_eng" => "pH",
"test_ind" => "pH",
"result" => "6.0",
"unit" => "",
"range" => "4.5 - 8.0",
"notes" => "pH dalam rentang normal"
],
[
"test_eng" => "Protein",
"test_ind" => "Protein",
"result" => "Negative",
"unit" => "",
"range" => "Negative",
"notes" => "Tidak ada protein dalam urin"
],
[
"test_eng" => "Glucose",
"test_ind" => "Glukosa",
"result" => "Negative",
"unit" => "",
"range" => "Negative",
"notes" => "Tidak ada glukosa dalam urin"
]
]
],
[
"chapter_eng" => "FECES",
"chapter_ind" => "PANEL FESES",
"tests" => [
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Consistency",
"test_ind" => "Konsistensi",
"result" => "Soft",
"unit" => "",
"range" => "Normal",
"notes" => "Konsistensi lunak, tidak cair atau keras"
],
[
"test_eng" => "Occult Blood",
"test_ind" => "Darah Tersembunyi",
"result" => "Negative",
"unit" => "",
"range" => "Negative",
"notes" => "Tidak ditemukan darah tersembunyi"
],
[
"test_eng" => "Parasites",
"test_ind" => "Parasit",
"result" => "None",
"unit" => "",
"range" => "None",
"notes" => "Tidak ditemukan parasit"
]
]
],
[
"chapter_eng" => "URINE",
"chapter_ind" => "PANEL URIN",
"tests" => [
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Yellow",
"unit" => "",
"range" => "Normal",
"notes" => "Warna kuning normal"
],
[
"test_eng" => "Clarity",
"test_ind" => "Kejernihan",
"result" => "Clear",
"unit" => "",
"range" => "Normal",
"notes" => "Jernih tanpa sedimen"
],
[
"test_eng" => "pH",
"test_ind" => "pH",
"result" => "6.0",
"unit" => "",
"range" => "4.5 - 8.0",
"notes" => "pH dalam rentang normal"
],
[
"test_eng" => "Protein",
"test_ind" => "Protein",
"result" => "Negative",
"unit" => "",
"range" => "Negative",
"notes" => "Tidak ada protein dalam urin"
],
[
"test_eng" => "Glucose",
"test_ind" => "Glukosa",
"result" => "Negative",
"unit" => "",
"range" => "Negative",
"notes" => "Tidak ada glukosa dalam urin"
]
]
],
[
"chapter_eng" => "FECES",
"chapter_ind" => "PANEL FESES",
"tests" => [
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Brown",
"unit" => "",
"range" => "Normal",
"notes" => "Warna normal tanpa indikasi penyakit"
],
[
"test_eng" => "Consistency",
"test_ind" => "Konsistensi",
"result" => "Soft",
"unit" => "",
"range" => "Normal",
"notes" => "Konsistensi lunak, tidak cair atau keras"
],
[
"test_eng" => "Occult Blood",
"test_ind" => "Darah Tersembunyi",
"result" => "Negative",
"unit" => "",
"range" => "Negative",
"notes" => "Tidak ditemukan darah tersembunyi"
],
[
"test_eng" => "Parasites",
"test_ind" => "Parasit",
"result" => "None",
"unit" => "",
"range" => "None",
"notes" => "Tidak ditemukan parasit"
]
]
],
[
"chapter_eng" => "URINE",
"chapter_ind" => "PANEL URIN",
"tests" => [
[
"test_eng" => "Color",
"test_ind" => "Warna",
"result" => "Yellow",
"unit" => "",
"range" => "Normal",
"notes" => "Warna kuning normal"
],
[
"test_eng" => "Clarity",
"test_ind" => "Kejernihan",
"result" => "Clear",
"unit" => "",
"range" => "Normal",
"notes" => "Jernih tanpa sedimen"
],
[
"test_eng" => "pH",
"test_ind" => "pH",
"result" => "6.0",
"unit" => "",
"range" => "4.5 - 8.0",
"notes" => "pH dalam rentang normal"
],
[
"test_eng" => "Protein",
"test_ind" => "Protein",
"result" => "Negative",
"unit" => "",
"range" => "Negative",
"notes" => "Tidak ada protein dalam urin"
],
[
"test_eng" => "Glucose",
"test_ind" => "Glukosa",
"result" => "Negative",
"unit" => "",
"range" => "Negative",
"notes" => "Tidak ada glukosa dalam urin"
]
]
],
];
// Seleksi data yang mengandung "URINE"
$data_urine = array_filter($data_mentah, function($item) {
$chapter = strtolower($item["chapter_eng"]);
return stripos($chapter, "urine") !== false;
});
// Seleksi data yang mengandung "FESES"
$data_feces = array_filter($data_mentah, function($item) {
$chapter = strtolower($item["chapter_eng"]);
return stripos($chapter, "feces") !== false;
});
// Seleksi data yang tidak mengandung kata "urine" atau "feces"
$data_others = array_filter($data_mentah, function($item) {
$chapter = strtolower($item["chapter_eng"]);
return stripos($chapter, "urine") === false && strpos($chapter, "feces") === false;
});
$fullPage = "";
if ($data_urine !== null) {
$fullPage .= $this->otherTests($data_urine);
}
if ($data_feces !== null) {
$fullPage .= $this->otherTests($data_feces);
}
if ($data_others !== null) {
$fullPage .= $this->otherTests($data_others);
}
return view('result_report', ['data' => $fullPage]);
}
}