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 = "
| Parameter |
Result |
Unit |
Normal Range |
Notes |
";
$resultTest ="";
$resultNoteandSpecimen = "
| Notes |
|
Hasil pemeriksaan sedikit di luar rentang normal. Disarankan untuk memantau kondisi ini dan melakukan pemeriksaan ulang jika diperlukan.
|
Collection datetime : EDTA,SERUM 13-11-2024 10.00 |
Reception datetime : EDTA,SERUM 13-11-2024 12.00 |
";
$footerPage = "
";
$lastDiv="";
$i=0;
foreach ($request as $chapter) {
$i++;
// Untuk Chapter
$resultTest .= "
".$chapter['chapter_eng']."
".$chapter['chapter_ind']."
|
";
// Melebihi batas Kertas
if($i % 22 == 0) {
$resultTest .= "
";
$fullPage .= $headPage.$resultTest.$footerPage.$lastDiv;
$i=0;
$resultTest = "";
}
foreach($chapter["tests"] as $test) {
$i++;
$resultTest .= "
".$test["test_eng"]."
".$test["test_ind"]."
|
" . $test["result"] . " |
" . $test["unit"] . " |
" . $test["range"] . " |
" . $test["notes"] . " |
";
// Melebihi batas Kertas
if($i % 22 == 0) {
$resultTest .= "
";
$fullPage .= $headPage.$resultTest.$footerPage.$lastDiv;
$i=0;
$resultTest = "";
}
}
}
$resultTest .= "
".$resultNoteandSpecimen."
";
$fullPage .= $headPage.$resultTest.$footerPage.$lastDiv;
return $fullPage;
}
public function printResultTest($access) {
$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]);
}
}