|
@@ -26,7 +26,10 @@ class PatientController extends Controller
|
|
|
$facilities = []; // Facility::where('is_active', true)->get();
|
|
|
$devices = BDTDevice::where('is_active', true)->orderBy('imei', 'asc')->get();
|
|
|
$devices = $devices->filter(function ($record) {
|
|
|
- $matching = ClientBDTDevice::where('device_id', $record->id)->get();
|
|
|
+ $matching = ClientBDTDevice
|
|
|
+ ::where('device_id', $record->id)
|
|
|
+ ->where('is_active', true)
|
|
|
+ ->get();
|
|
|
return count($matching) === 0;
|
|
|
});
|
|
|
$dxInfoLines = ClientInfoLine::where('client_id', $patient->id)
|
|
@@ -153,7 +156,10 @@ class PatientController extends Controller
|
|
|
{
|
|
|
$devices = BDTDevice::where('is_active', true)->get();
|
|
|
$devices = $devices->filter(function ($record) {
|
|
|
- $matching = ClientBDTDevice::where('device_id', $record->id)->get();
|
|
|
+ $matching = ClientBDTDevice
|
|
|
+ ::where('device_id', $record->id)
|
|
|
+ ->where('is_active', true)
|
|
|
+ ->get();
|
|
|
return count($matching) === 0;
|
|
|
});
|
|
|
return view('app.patient.devices', compact('patient', 'devices'));
|