|
@@ -35,11 +35,6 @@
|
|
<col span="4" class="cellular-weight">
|
|
<col span="4" class="cellular-weight">
|
|
</colgroup>
|
|
</colgroup>
|
|
<thead class="bg-light">
|
|
<thead class="bg-light">
|
|
- <tr>
|
|
|
|
- <th colspan="7"></th>
|
|
|
|
- <th colspan="4">Cellular BP</th>
|
|
|
|
- <th colspan="4">Cellular Weight</th>
|
|
|
|
- </tr>
|
|
|
|
<tr>
|
|
<tr>
|
|
<th class="px-3 border-0">Patient</th>
|
|
<th class="px-3 border-0">Patient</th>
|
|
<th class="border-0">DOB</th>
|
|
<th class="border-0">DOB</th>
|
|
@@ -49,15 +44,8 @@
|
|
<th class="border-0">MC</th>
|
|
<th class="border-0">MC</th>
|
|
<th class="border-0">MC Part-B</th>
|
|
<th class="border-0">MC Part-B</th>
|
|
|
|
|
|
- <th class="border-0">Sent?</th>
|
|
|
|
- <th class="border-0">First use</th>
|
|
|
|
- <th class="border-0">Last use</th>
|
|
|
|
- <th class="border-0">Total measurements</th>
|
|
|
|
-
|
|
|
|
- <th class="border-0">Sent?</th>
|
|
|
|
- <th class="border-0">First use</th>
|
|
|
|
- <th class="border-0">Last use</th>
|
|
|
|
- <th class="border-0">Total measurements</th>
|
|
|
|
|
|
+ <th class="border-0" colspan="4">Cellular BP</th>
|
|
|
|
+ <th class="border-0" colspan="4">Cellular Weight</th>
|
|
</tr>
|
|
</tr>
|
|
</thead>
|
|
</thead>
|
|
<tbody>
|
|
<tbody>
|
|
@@ -76,21 +64,133 @@
|
|
<td>{{ $client->was_medicare_validation_successful ? 'Yes' : '' }}</td>
|
|
<td>{{ $client->was_medicare_validation_successful ? 'Yes' : '' }}</td>
|
|
<td>{{ $client->was_medicare_validation_successful && $client->is_part_b_primary == 'YES' ? 'Yes' : '' }}</td>
|
|
<td>{{ $client->was_medicare_validation_successful && $client->is_part_b_primary == 'YES' ? 'Yes' : '' }}</td>
|
|
|
|
|
|
- <td>{{ $client->firstCellularBPDevice() ? 'Yes' : 'No' }}</td>
|
|
|
|
|
|
+ <td colspan="4">
|
|
|
|
+ <?php
|
|
|
|
+ $bpDevice = $client->firstCellularBPDevice();
|
|
|
|
+ $bpMeasurements = [];
|
|
|
|
+ if ($bpDevice) {
|
|
|
|
+ $bpMeasurements["first"] = \App\Models\Measurement
|
|
|
|
+ ::where('imei', $bpDevice->device->imei)
|
|
|
|
+ ->where('client_id', $client->id)
|
|
|
|
+ ->where('is_cellular_zero', false)
|
|
|
|
+ ->orderBy('ts')
|
|
|
|
+ ->first();
|
|
|
|
+ $bpMeasurements["last"] = \App\Models\Measurement
|
|
|
|
+ ::where('imei', $bpDevice->device->imei)
|
|
|
|
+ ->where('client_id', $client->id)
|
|
|
|
+ ->where('is_cellular_zero', false)
|
|
|
|
+ ->orderBy('ts', 'DESC')
|
|
|
|
+ ->first();
|
|
|
|
+ }
|
|
|
|
+ ?>
|
|
|
|
+ @if($bpDevice)
|
|
|
|
+ <div class="d-flex align-items-baseline mb-1">
|
|
|
|
+ <span class="width-100px">IMEI:</span>
|
|
|
|
+ <span class="ml-3">{{$bpDevice->device->imei}}</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="d-flex align-items-baseline mb-1">
|
|
|
|
+ <span class="width-100px">Sent:</span>
|
|
|
|
+ <span class="ml-3">Yes</span>*
|
|
|
|
+ </div>
|
|
|
|
+ <div class="d-flex align-items-baseline mb-1">
|
|
|
|
+ <span class="width-100px">Arrived:</span>
|
|
|
|
+ <span class="ml-3">Yes</span>*
|
|
|
|
+ </div>
|
|
|
|
+ <div class="d-flex align-items-baseline mb-1">
|
|
|
|
+ <span class="width-100px">First Use:</span>
|
|
|
|
+ @if(@$bpMeasurements["first"])
|
|
|
|
+ <span class="ml-3">{{ $bpMeasurements["first"]->sbp_mm_hg . '/' . $bpMeasurements["first"]->dbp_mm_hg . ' mmHg' }}</span>
|
|
|
|
+ <span class="ml-3 text-secondary">{{date("Y-m-d", $bpMeasurements["first"]->ts/1000)}}</span>
|
|
|
|
+ <span class="ml-3">{{date_diff(date_create(date("Y-m-d", $bpMeasurements["first"]->ts/1000)), date_create('now'))->days}} days ago</span>
|
|
|
|
+ @else
|
|
|
|
+ -
|
|
|
|
+ @endif
|
|
|
|
+ </div>
|
|
|
|
+ <div class="d-flex align-items-baseline mb-1">
|
|
|
|
+ <span class="width-100px">Last Use:</span>
|
|
|
|
+ @if(@$bpMeasurements["last"])
|
|
|
|
+ <span class="ml-3">{{ $bpMeasurements["last"]->sbp_mm_hg . '/' . $bpMeasurements["last"]->dbp_mm_hg . ' mmHg' }}</span>
|
|
|
|
+ <span class="ml-3 text-secondary">{{date("Y-m-d", $bpMeasurements["last"]->ts/1000)}}</span>
|
|
|
|
+ <span class="ml-3">{{date_diff(date_create(date("Y-m-d", $bpMeasurements["last"]->ts/1000)), date_create('now'))->days}} days ago</span>
|
|
|
|
+ @else
|
|
|
|
+ -
|
|
|
|
+ @endif
|
|
|
|
+ </div>
|
|
|
|
+ @endif
|
|
|
|
+ </td>
|
|
|
|
+
|
|
|
|
+ <td colspan="4">
|
|
|
|
+ <?php
|
|
|
|
+ $weightScale = $client->firstCellularWeightDevice();
|
|
|
|
+ $weightMeasurements = [];
|
|
|
|
+ if ($weightScale) {
|
|
|
|
+ $weightMeasurements["first"] = \App\Models\Measurement
|
|
|
|
+ ::where('imei', $weightScale->device->imei)
|
|
|
|
+ ->where('client_id', $client->id)
|
|
|
|
+ ->where('is_cellular_zero', false)
|
|
|
|
+ ->orderBy('ts')
|
|
|
|
+ ->first();
|
|
|
|
+ $weightMeasurements["last"] = \App\Models\Measurement
|
|
|
|
+ ::where('imei', $weightScale->device->imei)
|
|
|
|
+ ->where('client_id', $client->id)
|
|
|
|
+ ->where('is_cellular_zero', false)
|
|
|
|
+ ->orderBy('ts', 'DESC')
|
|
|
|
+ ->first();
|
|
|
|
+ }
|
|
|
|
+ ?>
|
|
|
|
+ @if($weightScale)
|
|
|
|
+ <div class="d-flex align-items-baseline mb-1">
|
|
|
|
+ <span class="width-100px">IMEI:</span>
|
|
|
|
+ <span class="ml-3">{{$weightScale->device->imei}}</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="d-flex align-items-baseline mb-1">
|
|
|
|
+ <span class="width-100px">Sent:</span>
|
|
|
|
+ <span class="ml-3">Yes</span>*
|
|
|
|
+ </div>
|
|
|
|
+ <div class="d-flex align-items-baseline mb-1">
|
|
|
|
+ <span class="width-100px">Arrived:</span>
|
|
|
|
+ <span class="ml-3">Yes</span>*
|
|
|
|
+ </div>
|
|
|
|
+ <div class="d-flex align-items-baseline mb-1">
|
|
|
|
+ <span class="width-100px">First Use:</span>
|
|
|
|
+ @if($weightMeasurements["first"])
|
|
|
|
+ <span class="ml-3">{{ round($weightMeasurements["first"]->value, 2) . ' lbs' }}</span>
|
|
|
|
+ <span class="ml-3 text-secondary">{{date("Y-m-d", $weightMeasurements["first"]->ts/1000)}}</span>
|
|
|
|
+ <span class="ml-3">{{date_diff(date_create(date("Y-m-d", $weightMeasurements["first"]->ts/1000)), date_create('now'))->days}} days ago</span>
|
|
|
|
+ @else
|
|
|
|
+ -
|
|
|
|
+ @endif
|
|
|
|
+ </div>
|
|
|
|
+ <div class="d-flex align-items-baseline mb-1">
|
|
|
|
+ <span class="width-100px">Last Use:</span>
|
|
|
|
+ @if($weightMeasurements["last"])
|
|
|
|
+ <span class="ml-3">{{ round($weightMeasurements["last"]->value, 2) . ' lbs' }}</span>
|
|
|
|
+ <span class="ml-3 text-secondary">{{date("Y-m-d", $weightMeasurements["last"]->ts/1000)}}</span>
|
|
|
|
+ <span class="ml-3">{{date_diff(date_create(date("Y-m-d", $weightMeasurements["last"]->ts/1000)), date_create('now'))->days}} days ago</span>
|
|
|
|
+ @else
|
|
|
|
+ -
|
|
|
|
+ @endif
|
|
|
|
+ </div>
|
|
|
|
+ @endif
|
|
|
|
+ </td>
|
|
|
|
+
|
|
|
|
+ {{--
|
|
|
|
+ <td>{{ $client->firstCellularBPDevice() ? 'Yes' : '' }}</td>
|
|
<td>{{ $client->getFirstCellularBPMeasurementAt() }}</td>
|
|
<td>{{ $client->getFirstCellularBPMeasurementAt() }}</td>
|
|
<td>{{ $client->getLatestCellularBPMeasurementAt() }}</td>
|
|
<td>{{ $client->getLatestCellularBPMeasurementAt() }}</td>
|
|
<td>{{ $client->getTotalCellularBPMeasurements() }}</td>
|
|
<td>{{ $client->getTotalCellularBPMeasurements() }}</td>
|
|
|
|
|
|
- <td>{{ $client->firstCellularWeightDevice() ? 'Yes' : 'No' }}</td>
|
|
|
|
|
|
+ <td>{{ $client->firstCellularWeightDevice() ? 'Yes' : '' }}</td>
|
|
<td>{{ $client->getFirstCellularWeightMeasurementAt() }}</td>
|
|
<td>{{ $client->getFirstCellularWeightMeasurementAt() }}</td>
|
|
<td>{{ $client->getLatestCellularWeightMeasurementAt() }}</td>
|
|
<td>{{ $client->getLatestCellularWeightMeasurementAt() }}</td>
|
|
<td>{{ $client->getTotalCellularWeightMeasurements() }}</td>
|
|
<td>{{ $client->getTotalCellularWeightMeasurements() }}</td>
|
|
|
|
+ --}}
|
|
|
|
|
|
</tr>
|
|
</tr>
|
|
@endforeach
|
|
@endforeach
|
|
</tbody>
|
|
</tbody>
|
|
</table>
|
|
</table>
|
|
- <div>
|
|
|
|
|
|
+ <div class="border-top px-3 pt-3">
|
|
{{$clients->links()}}
|
|
{{$clients->links()}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|