diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 8cfeace..f52d7be 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -81,4 +81,5 @@ $routes->group('fo', ['filter' => 'role:fo'], static function ($routes) { // Printers $routes->get('/prints/single_sample/(:any)/(:any)', 'PrinterController::printSingleSampleBarcode/$1/$2'); -$routes->get('/prints/all_sample', 'PrinterController::printAllSampleBarcode'); \ No newline at end of file +$routes->get('/prints/all_sample', 'PrinterController::printAllSampleBarcode'); +$routes->get('/prints/result_test/(:any)', 'PrinterController::printResultTest/$1'); \ No newline at end of file diff --git a/app/Controllers/PrinterController.php b/app/Controllers/PrinterController.php index f8ade3b..df0183a 100644 --- a/app/Controllers/PrinterController.php +++ b/app/Controllers/PrinterController.php @@ -239,5 +239,1270 @@ P1 ); } + + public function testsUrineOrFeces($request){ + $fullPage=""; + $headPage = " +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CLINICAL LABORATORY
UHID:1BCJJAJSDKSample ID:LAB2420076951
Name:Ni Luh Putu Eka Putri Saraswati Specimen:Serum
Age/Gender:22 year(s) / MaleCollection Date/Time:26-10-2024 / 11:55:04
Speciality:Result Date/Time:26-10-2024 / 11:52:04
+ +
+ +
+
+ + + + + + + + + + + "; + + $resultTest =""; + $footerPage = " +
ParameterResultUnitNormal RangeNotes
+ + + + + + + + + + + + + + + + + + + + + +
+ "; + $lastDiv="
"; + + $i=0; + foreach ($request as $chapter) { + + $i++; + // Untuk Chapter + $resultTest .= " + + +
".$chapter['chapter_eng']."
+
 ".$chapter['chapter_ind']."
+ + + "; + + // Melebihi batas Kertas + if($i % 25 == 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 % 25 == 0) { + $resultTest .= ""; + $fullPage .= $headPage.$resultTest.$footerPage.$lastDiv; + $i=0; + $resultTest = ""; + } + } + + } + $resultTest .= " + + "; + + $fullPage .= $headPage.$resultTest.$footerPage.$lastDiv; + + return $fullPage; + } + + public function otherTests($request){ + $fullPage=""; + $headPage = " +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CLINICAL LABORATORY
UHID:1BCJJAJSDKSample ID:LAB2420076951
Name:Ni Luh Putu Eka Putri Saraswati Specimen:Serum
Age/Gender:22 year(s) / MaleCollection Date/Time:26-10-2024 / 11:55:04
Speciality:Result Date/Time:26-10-2024 / 11:52:04
+ +
+ +
+
+ + + + + + + + + + + "; + + $resultTest =""; + $resultNoteandSpecimen = " +
+ +
ParameterResultUnitNormal RangeNotes
+ + + + + + +
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->testsUrineOrFeces($data_urine); + } + if ($data_feces !== null) { + $fullPage .= $this->testsUrineOrFeces($data_feces); + } + if ($data_others !== null) { + $fullPage .= $this->otherTests($data_others); + } + + return view('result_report', ['data' => $fullPage]); + } + } \ No newline at end of file diff --git a/app/Views/admin/dashboard.php b/app/Views/admin/dashboard.php index 311e394..46974a8 100644 --- a/app/Views/admin/dashboard.php +++ b/app/Views/admin/dashboard.php @@ -17,6 +17,7 @@ Hosp Test Status + @@ -117,7 +118,8 @@ function index() { } let datarow = '' + '' + colldate + ' ' + patnumber + ' ' + accessnumber + ' ' + patname + ' ' + hon + ' ' + tests + '' + - ""+stattext+"" + ''; + ""+stattext+"" + + " " +''; $("#table-body").append(datarow); } $('#myTable').DataTable(); @@ -169,5 +171,9 @@ function viewAccess(access) { $('#modal').modal('show'); }); } +function resultPdfAccess(access) { + let url = 'prints/result_test/'+access; + window.open(url, '_blank'); +} endSection() ?> \ No newline at end of file diff --git a/app/Views/result_report.php b/app/Views/result_report.php new file mode 100644 index 0000000..a7846ca --- /dev/null +++ b/app/Views/result_report.php @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/assets/css/pdf.css b/public/assets/css/pdf.css new file mode 100644 index 0000000..9ede395 --- /dev/null +++ b/public/assets/css/pdf.css @@ -0,0 +1,125 @@ +/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ +button,hr,input{overflow:visible}progress,sub,sup{vertical-align:baseline}[type=checkbox],[type=radio],legend{box-sizing:border-box;padding:0}html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}details,main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:ButtonText dotted 1px}fieldset{padding:.35em .75em .625em}legend{color:inherit;display:table;max-width:100%;white-space:normal}textarea{overflow:auto}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}[hidden],template{display:none} +/*html,pre,th,table { font-family:'Courier New', Courier, monospace; font-size:7.8pt; margin:0;}*/ + +html,pre,th,table { font-family:'Lucida Console', Monaco, monospace; font-size:7.7pt; margin:0;} + +body { + background-color: rgb(17, 16, 16); +} + +#page { + background: rgb(255, 255, 255); + display: block; + margin: 0 auto; + margin-bottom: 1px; + /* border: solid 1px black; */ + /* margin-bottom: 5px; */ + page-break-after:always; + width: 210mm; + height: 297mm; +} +.table-justify { + text-align: justify; +} +#dinfo { + background-size: 100% auto; + background-repeat: no-repeat; +} + +#dresult { + margin: 0; + padding: 0; + height: 20.4cm; +} +.result { + table-layout:fixed; + border:solid 1px black; + width:95%; +} + +table { + align-items: center; + margin:0; + padding: 0; + width: 95%; + border-collapse:collapse; + /* border: 1px solid black; */ +} + +.t_center { + margin-left: auto; + margin-right: auto; +} +th,td { + padding: 2; + line-height:1.5; +} + +.result th,td { + line-height: 1.1 ; +} + +.t_background { + background-color: #f2f2f2; +} +.padmaColor { + /* background-color: rgba(190, 160, 160, 0.192); */ + background-color: #f2f2f2; + /* line-height: 1.5; */ + font-size: 1.2em; +} + +.info { border:solid 1px black; margin:-1cm 0 0 8.5cm; width:11cm;} +.flag { float:right; top:0; font-weight:bold; } + +.textC { font-size:7pt; } + +table.information { + border:1px solid rgba(0, 0, 0, 0.192); + /* border-collapse:collapse; */ +} +table.result tr{ + border:solid 1px rgba(0, 0, 0, 0.055); +} +table.result tr:nth-child(odd) { + background-color: #f2f2f2; + + /* border:solid 1px rgba(0, 0, 0, 0.055); */ +} + +.chapter { + /* font-size: 5em; */ +} + +tr.chapter td { + border: none; +} + +#notes { margin: 5mm 0 0 10mm; } + + +.table_collection { + font-size: 2em; +} + +#footer { + /* background-color: rgb(201, 230, 192); */ + /* float:left; */ + margin:0; + padding: 0; + height:2.85cm; +} + +.table_footer { + width: 95%; + /* border:solid 1px black; */ + border-collapse:collapse; +} + +.img { width:200mm; margin-left:0.5cm } + + +@media print { + @page { margin:0; size:210mm 297mm; } +} \ No newline at end of file diff --git a/public/assets/img/padma-header.png b/public/assets/img/padma-header.png new file mode 100644 index 0000000..e0e240f Binary files /dev/null and b/public/assets/img/padma-header.png differ diff --git a/public/assets/img/ttd.png b/public/assets/img/ttd.png new file mode 100644 index 0000000..a9e138e Binary files /dev/null and b/public/assets/img/ttd.png differ