fix patnumber empty, change merge sample if datetime is the same coll/recv
This commit is contained in:
parent
8f0d1e3c2e
commit
b8a4f35eff
@ -20,17 +20,17 @@ class PrintResult extends BaseController {
|
|||||||
$last_name = $data[0]['NAME'];
|
$last_name = $data[0]['NAME'];
|
||||||
|
|
||||||
$birth_date = $data[0]['BIRTHDATE'];
|
$birth_date = $data[0]['BIRTHDATE'];
|
||||||
$dateTime = \DateTime::createFromFormat('Y-m-d H:i:s.u', $birth_date);
|
$birth_date = \DateTime::createFromFormat('Y-m-d H:i:s.u', $birth_date);
|
||||||
if ($dateTime) {
|
if ($birth_date) { $birth_date = $birth_date->format('d-m-Y'); }
|
||||||
$birth_date = $dateTime->format('d-m-Y');
|
|
||||||
}
|
|
||||||
|
|
||||||
$hostordernumber = $data[0]['HOSTORDERNUMBER'];
|
$hostordernumber = $data[0]['HOSTORDERNUMBER'];
|
||||||
$collection_date = $data[0]['COLLECTIONDATE'];
|
$collection_date = $data[0]['COLLECTIONDATE'];
|
||||||
$dateTime = \DateTime::createFromFormat('Y-m-d H:i:s.u', $collection_date);
|
$dateTime = \DateTime::createFromFormat('Y-m-d H:i:s.u', $collection_date);
|
||||||
if ($dateTime) {
|
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 {
|
} else {
|
||||||
$sex ='';
|
$sex ='';
|
||||||
$accessnumber = "";
|
$accessnumber = "";
|
||||||
@ -87,7 +87,7 @@ class PrintResult extends BaseController {
|
|||||||
<td>$birth_date / $sex</td>
|
<td>$birth_date / $sex</td>
|
||||||
<th align='left'>Result Date/Time</th>
|
<th align='left'>Result Date/Time</th>
|
||||||
<td>:</td>
|
<td>:</td>
|
||||||
<td> </td>
|
<td>$resultdate</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
@ -116,16 +116,44 @@ class PrintResult extends BaseController {
|
|||||||
|
|
||||||
// Untuk Collection
|
// Untuk Collection
|
||||||
if ($data[1] != null) {
|
if ($data[1] != null) {
|
||||||
$cm_output = [];
|
|
||||||
$sp_output = [];
|
|
||||||
|
|
||||||
foreach ($data[1] as $item) {
|
foreach ($data[1] as $item) {
|
||||||
$cm_output[] = "{$item['SHORTTEXT']} " . date('Y-m-d H:i:s', strtotime($item['CM_collection_datetime']));
|
$samp = $item['SHORTTEXT'];
|
||||||
$sp_output[] = "{$item['SHORTTEXT']} " . date('Y-m-d H:i:s', strtotime($item['SP_reception_datetime']));
|
$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";
|
$collectionText = '';
|
||||||
$receptionText = implode(' | ', $sp_output) . "\n";
|
$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 = "
|
$resultNoteandSpecimen = "
|
||||||
|
|||||||
@ -127,7 +127,7 @@ $visitdate = $now;
|
|||||||
<table class="table table-sm table-borderless">
|
<table class="table table-sm table-borderless">
|
||||||
<input type='hidden' id='qpatid' value='' />
|
<input type='hidden' id='qpatid' value='' />
|
||||||
<tr class="align-middle"> <th>MR#</th> <th>:</th>
|
<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>
|
||||||
<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>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>
|
<tr class="align-middle"> <th>BirthDate</th> <th>:</th> <td><input class='form-control' type='date' id='qbirthdate'/></td> </tr>
|
||||||
|
|||||||
@ -48,7 +48,7 @@
|
|||||||
<table class="table table-sm table-borderless">
|
<table class="table table-sm table-borderless">
|
||||||
<input type='hidden' id='qpatid' value='' />
|
<input type='hidden' id='qpatid' value='' />
|
||||||
<tr class="align-middle"> <th>MR#</th> <th>:</th>
|
<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>
|
||||||
<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>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>
|
<tr class="align-middle"> <th>BirthDate</th> <th>:</th> <td><input class='form-control' type='date' id='qbirthdate'/></td> </tr>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user