Merge branch 'main' into zakaria

merge
This commit is contained in:
mikael-zakaria 2024-12-18 10:23:59 +08:00
commit 059f5ce04a
3 changed files with 43 additions and 15 deletions

View File

@ -20,17 +20,17 @@ class PrintResult extends BaseController {
$last_name = $data[0]['NAME'];
$birth_date = $data[0]['BIRTHDATE'];
$dateTime = \DateTime::createFromFormat('Y-m-d H:i:s.u', $birth_date);
if ($dateTime) {
$birth_date = $dateTime->format('d-m-Y');
}
$birth_date = \DateTime::createFromFormat('Y-m-d H:i:s.u', $birth_date);
if ($birth_date) { $birth_date = $birth_date->format('d-m-Y'); }
$hostordernumber = $data[0]['HOSTORDERNUMBER'];
$collection_date = $data[0]['COLLECTIONDATE'];
$dateTime = \DateTime::createFromFormat('Y-m-d H:i:s.u', $collection_date);
if ($dateTime) {
$collection_date = $dateTime->format('d-m-Y H:i:s');
$collection_date = $dateTime->format('d-m-Y H:i');
}
$resultdate = date('d-m-Y H:i', time());
} else {
$sex ='';
$accessnumber = "";
@ -87,7 +87,7 @@ class PrintResult extends BaseController {
<td>$birth_date / $sex</td>
<th align='left'>Result Date/Time</th>
<td>:</td>
<td> </td>
<td>$resultdate</td>
</tr>
</table>
@ -116,16 +116,44 @@ class PrintResult extends BaseController {
// Untuk Collection
if ($data[1] != null) {
$cm_output = [];
$sp_output = [];
foreach ($data[1] as $item) {
$cm_output[] = "{$item['SHORTTEXT']} " . date('Y-m-d H:i:s', strtotime($item['CM_collection_datetime']));
$sp_output[] = "{$item['SHORTTEXT']} " . date('Y-m-d H:i:s', strtotime($item['SP_reception_datetime']));
$samp = $item['SHORTTEXT'];
$colldate = date('Y-m-d H:i', strtotime($item['CM_collection_datetime']));
$recvdate = date('Y-m-d H:i', strtotime($item['SP_reception_datetime']));
$colldates[$samp] = $colldate;
$recvdates[$samp] = $recvdate;
}
$collectionText = implode(' | ', $cm_output) . "\n";
$receptionText = implode(' | ', $sp_output) . "\n";
$collectionText = '';
$date1 = '';
$i = 1 ;
foreach( $colldates as $qsamp => $qdate ) {
if($date1 != $qdate) {
$date1 = $qdate;
if($i != 1) { $collectionText .= ", "; }
$collectionText .= "$qdate $qsamp";
} else {
$collectionText .= ", $qsamp";
}
$i++;
}
$receptionText = '';
$date1 = '';
$i = 1 ;
foreach( $recvdates as $qsamp => $qdate ) {
if($date1 != $qdate) {
$date1 = $qdate;
if($i != 1) { $receptionText .= ", "; }
$receptionText .= "$qdate $qsamp";
} else {
$receptionText .= ", $qsamp";
}
$i++;
}
//$receptionText = implode(' | ', $sp_output) . "\n";
}
$resultNoteandSpecimen = "

View File

@ -127,7 +127,7 @@ $visitdate = $now;
<table class="table table-sm table-borderless">
<input type='hidden' id='qpatid' value='' />
<tr class="align-middle"> <th>MR#</th> <th>:</th>
<td><input class='form-control' type='text' id='qpatnumber' /></td>
<td><input class='form-control' type='text' id='qpatnumber' oninput='this.value = this.value.toUpperCase();' /></td>
</tr>
<tr class="align-middle"> <th>Patient Name</th> <th>:</th> <td><input class='form-control' type='text' id='qpatname'/></td> </tr>
<tr class="align-middle"> <th>BirthDate</th> <th>:</th> <td><input class='form-control' type='date' id='qbirthdate'/></td> </tr>

View File

@ -48,7 +48,7 @@
<table class="table table-sm table-borderless">
<input type='hidden' id='qpatid' value='' />
<tr class="align-middle"> <th>MR#</th> <th>:</th>
<td><input class='form-control' type='text' id='qpatnumber' /></td>
<td><input class='form-control' type='text' id='qpatnumber' oninput='this.value = this.value.toUpperCase();' /></td>
</tr>
<tr class="align-middle"> <th>Patient Name</th> <th>:</th> <td><input class='form-control' type='text' id='qpatname'/></td> </tr>
<tr class="align-middle"> <th>BirthDate</th> <th>:</th> <td><input class='form-control' type='date' id='qbirthdate'/></td> </tr>