update minor hasil laporan

This commit is contained in:
mikael-zakaria 2024-12-30 09:29:14 +07:00
parent f5514db2d5
commit ca1d128f56
2 changed files with 98 additions and 50 deletions

View File

@ -99,20 +99,21 @@ class PrintResult extends BaseController {
<table class='result t_center'>
<tr align='left'>
<th class='padmaColor' style='width:34%'>Parameter</th>
<th class='padmaColor' style='width:43%'>Parameter</th>
<th class='padmaColor' style='width:1%'> </th>
<th class='padmaColor' style='width:13%'>Result</th>
<th class='padmaColor' style='width:13%'>Unit</th>
<th class='padmaColor' style='width:20%'>Normal Range</th>
<th class='padmaColor' style='width:20%'>Sample Type</th>
<th class='padmaColor' style='width:12%'>Result</th>
<th class='padmaColor' style='width:11%'>Unit</th>
<th class='padmaColor' style='width:21%'>Normal Range</th>
<th class='padmaColor' style='width:13%'>Sample Type</th>
</tr>
";
$resultTest ="";
$notes = end($resultData);
$note = $notes['RESULT'] == "" ? "-" : $notes['RESULT'];
$note = "-";
// $notes = end($resultData);
// $note = $notes['RESULT'] == "" ? "-" : $notes['RESULT'];
// Untuk Collection
if ($data[1] != null) {
@ -163,10 +164,12 @@ class PrintResult extends BaseController {
<table class='t_center table_collection' >
<tr>
<td>Collection datetime : $colltext </td>
<td width='15%'>Collection datetime : </td>
<td>$colltext</td>
</tr>
<tr>
<td>Reception datetime : $recvtext </td>
<td>Reception datetime : </td>
<td>$recvtext</td>
</tr>
</table>
";
@ -198,17 +201,35 @@ class PrintResult extends BaseController {
$tempChapEng = "";
$tempChapInd = "";
array_pop($resultData);
// array_pop($resultData);
$i=0;
foreach ($resultData as $item) {
$space="";
if ($item['DEPTH'] > 0) {
if ($item['RESULT'] != null) {
$j=0;
for ($j=0; $j<$item['DEPTH']; $j++) {
$space .= "&nbsp;";
$space.="&nbsp;";
for ($j=0; $j<=$item['DEPTH']; $j++) {
$space .= "&nbsp;&nbsp;";
}
if ($item['DEPTH']==0){
$space.="&nbsp;";
}
} else {
for ($j=0; $j<=$item['DEPTH']; $j++) {
$space .= "&nbsp;&nbsp;";
}
}
if ($item["RESULT"] == null) {
$serum_type = "";
}else {
$serum_type = $item["serum_type"];
}
$resflag = $item["RESFLAG"] == "N" ? '' : $item["RESFLAG"];
@ -223,19 +244,20 @@ class PrintResult extends BaseController {
<tr align='left' class='chapter'>
<td colspan='5'>
<pre><b>".$tempChapEng."</b></pre>
<!-- <pre><b>".$i.". ".$tempChapEng."</b></pre> -->
</td>
</tr>
";
}
// Melebihi batas Kertas
if($i % 20 == 0) {
$resultTest .= "</table></div>";
$fullPage .= $headPage.$resultTest.$footerPage.$lastDiv;
$i=0;
$resultTest = "";
}
// // Melebihi batas Kertas
// if($i % 30 == 0) {
// $resultTest .= "</table></div>";
// $fullPage .= $headPage.$resultTest.$footerPage.$lastDiv;
// $i=0;
// $resultTest = "";
// }
$i++;
if ($item['RESTYPE'] == "CE"){
@ -249,23 +271,24 @@ class PrintResult extends BaseController {
$unit = $item['UNIT'];
$unittext = $item['UNITTEXT'];
if($unittext !='') {$unit = $unittext;}
$resultTest .= "
$resultTest .= "
<tr>
<td colspan='1' class=''>
<pre> ".$space . $item["test_eng"]."</pre>
<pre> ".$space."<small>".$item["test_ind"]."</small></pre>
<!-- <pre> ".$space . $i.". ".$item["test_eng"]." ". "<small>".$item["test_ind"]."</small></pre> -->
<pre>" . $space . $item["test_eng"]." "."<small>".$item["test_ind"]."</small></pre>
<!-- <pre> ".$space."<small>".$item["test_ind"]."</small></pre> -->
</td>
<td class=''>" . $resflag . "</td>
<td class=''>" . $resvalue . "</td>
<td class=''>" . $unit . "</td>
<td class=''>" . $reff . "</td>
<td class=''>" . $item["serum_type"] . "</td>
<td class=''>" . $serum_type . "</td>
</tr>
";
// Melebihi batas Kertas
if($i % 21 == 0) {
if($i % 30 == 0) {
$resultTest .= "</table></div>";
$fullPage .= $headPage.$resultTest.$footerPage.$lastDiv;
$i=0;
@ -357,43 +380,67 @@ class PrintResult extends BaseController {
left join cmod.dbo.CM_DICT_TESTS cdt on dt.TESTCODE=cdt.TESTCODE
left join cmod.dbo.CM_RESULTS cr on cr.ACCESSNUMBER=r.ACCESSNUMBER and cr.TESTCODE=cdt.TESTCODE and cr.TESTCODE=dt.TESTCODE
where r.ACCESSNUMBER='$access'
ORDER BY t.TESTORDER
ORDER BY dc.CHAPID, t.TESTORDER
";
$query = $db->query($sql);
$results = $query->getResultArray();
// // Seleksi data yang mengandung "URINE"
// $data_urine = array_filter($results, function($item) {
// $chapterid = $item["CHAPID"];
// $tesscode = $item['TESTCODE'];
// // Memfilter data dengan CHAPID 3, 61, atau 62
// return $chapterid == 3 || $chapterid == 61 || $chapterid == 62 || $tesscode == 'NOTE';
// });
// // Seleksi data yang mengandung "FESES"
// $data_feces = array_filter($results, function($item) {
// $chapterid = $item["CHAPID"];
// $tesscode = $item['TESTCODE'];
// // Memfilter data yang 4
// return $chapterid == 4 || $chapterid == 5 || $tesscode == 'NOTE';
// });
// // Seleksi data yang tidak mengandung "urine" dan "feces"
// $data_others = array_filter($results, function($item) {
// $chapterid = $item["CHAPID"];
// $tesscode = $item['TESTCODE'];
// // Memfilter data yang bukan
// return $chapterid !== 3 && $chapterid !== 4 && $chapterid !== 61 && $chapterid !== 62 || $tesscode == 'NOTE';
// });
$data_urine = array_filter($results, function($item) {
$chapterid = $item["CHAPID"];
$tesscode = $item['TESTCODE'];
// Memfilter data dengan CHAPID 3, 61, atau 62
return $chapterid == 3 || $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;
});
$data_feces_lengkap = array_filter($results, function($item) {
$serum_type = $item["serum_type"];
$chapterid = $item["CHAPID"];
return $serum_type == 'Feces' && $chapterid == 4;
});
// Seleksi data yang mengandung "FESES"
$data_feces = array_filter($results, function($item) {
$chapterid = $item["CHAPID"];
$tesscode = $item['TESTCODE'];
// Memfilter data yang 4
return $chapterid == 4 || $tesscode == 'NOTE';
});
// Seleksi data yang tidak mengandung "urine" dan "feces"
$data_others = array_filter($results, function($item) {
$chapterid = $item["CHAPID"];
$tesscode = $item['TESTCODE'];
// Memfilter data yang bukan 61 atau 3
return $chapterid !== 3 && $chapterid !== 4 && $chapterid !== 61 && $chapterid !== 62 || $tesscode == 'NOTE';
$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 != null && count($data_urine) > 1) {
$fullPage .= $this->otherTests($data_urine, $data);
if ($data_urine_lengkap != null && count($data_urine_lengkap) > 1) {
$fullPage .= $this->otherTests($data_urine_lengkap, $data);
}
if ($data_feces != null && count($data_feces) > 1) {
$fullPage .= $this->otherTests($data_feces, $data);
if ($data_pregnancy != null && count($data_pregnancy) > 1) {
$fullPage .= $this->otherTests($data_pregnancy, $data);
}
if ($data_feces_lengkap != null && count($data_feces_lengkap) > 1) {
$fullPage .= $this->otherTests($data_feces_lengkap, $data);
}
if ($data_others != null && count($data_others) > 1) {
$fullPage .= $this->otherTests($data_others, $data);

View File

@ -2,7 +2,7 @@
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.8pt; margin:0;}
html,pre,th,table { font-family: Arial; font-size:7.8pt; margin:0;}
body {
background-color: rgb(17, 16, 16);
@ -56,6 +56,7 @@ th,td {
padding-top: 4px ;
padding-bottom: 2px ;
line-height:1.5;
/* border: 1px solid black; */
}
.result th,td {