Quellcode durchsuchen

fixed measurements

Josh vor 3 Jahren
Ursprung
Commit
08a8a42f79
2 geänderte Dateien mit 3 neuen und 2 gelöschten Zeilen
  1. 2 1
      app/Http/Controllers/PracticeManagementController.php
  2. 1 1
      app/Models/Client.php

+ 2 - 1
app/Http/Controllers/PracticeManagementController.php

@@ -70,7 +70,8 @@ class PracticeManagementController extends Controller
 		$isAdmin = $this->performer()->pro->pro_type == 'ADMIN';
 		//$rows = $isAdmin ? ClientMeasurementDaysPerMonth::all() : ClientMeasurementDaysPerMonth::where('mcp_pro_id', $proID)->orderBy('year_month', 'asc')->orderBy('num_of_days_with_measurement', 'asc')->get();
         $query = CareMonth::whereNotNull('mcp_pro_id')
-            ->where('number_of_days_with_remote_measurements', '>=', 16);
+            ->where('number_of_days_with_remote_measurements', '>=', 16)
+            ->where('days_between_most_recent_mcp_note_date_and_end_of_care_month', '<=', 90);
 	if(!$isAdmin) $query->where('mcp_pro_id', '=', $proID);
 	$rows = $query->orderByRaw(DB::raw('start_date DESC'))->paginate(50) ;
         return view ('app.practice-management.remote-monitoring-report', compact('rows', 'isAdmin'));

+ 1 - 1
app/Models/Client.php

@@ -199,7 +199,7 @@ class Client extends Model
     {
         return $this->hasMany(Measurement::class, 'client_id', 'id')
             /*->distinct('label')*/
-            ->where('is_removed', false)
+            ->where('is_active', true)
             ->orderByRaw('ts DESC NULLS LAST');
     }