|
@@ -339,6 +339,11 @@ SELECT effective_date, count(*), sum(number_of_units) as units FROM bill WHERE c
|
|
|
$query = $query->whereIn('hcp_pro_id', $filterByProsIDs);
|
|
|
}
|
|
|
|
|
|
+ $filterByAllyProsIDs = $request->get('ally_pros');
|
|
|
+ if($filterByAllyProsIDs && count($filterByAllyProsIDs)){
|
|
|
+ $query = $query->whereIn('ally_pro_id', $filterByAllyProsIDs);
|
|
|
+ }
|
|
|
+
|
|
|
$filterByPatientsIDs = $request->get('patients');
|
|
|
if($filterByPatientsIDs && count($filterByPatientsIDs)){
|
|
|
$query = $query->whereIn('client_id', $filterByPatientsIDs);
|
|
@@ -347,21 +352,27 @@ SELECT effective_date, count(*), sum(number_of_units) as units FROM bill WHERE c
|
|
|
$status = $request->get('status');
|
|
|
if($status){
|
|
|
if($status == 'CANCELLED') $query = $query->where('is_cancelled', true);
|
|
|
+ if($status == 'SIGNED') $query = $query->where('is_signed_by_hcp', true);
|
|
|
if($status == 'NOT_YET_SIGNED') $query = $query->where('is_signed_by_hcp', false);
|
|
|
if($status == 'NOT_YET_SIGNED_BUT_ALLY_SIGNED') $query = $query->where('is_signed_by_hcp', false)->where('is_signed_by_ally', true);
|
|
|
+ if($status == 'WITH_BILLS') $query = $query->where('is_signed_by_hcp', true)->where('is_cancelled', false)->whereHas('bills');
|
|
|
if($status == 'WITHOUT_BILLS') $query = $query->where('is_signed_by_hcp', true)->where('is_cancelled', false)->whereDoesntHave('bills');
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
- $allProsWithNotesIDs = Note::pluck('hcp_pro_id')->toArray();
|
|
|
+ $allProsWithNotesIDs = DB::table('note')->pluck('hcp_pro_id')->toArray();
|
|
|
$allProsWithNotes = Pro::whereIn('id', $allProsWithNotesIDs)->get();
|
|
|
|
|
|
- $allPatientsWithNotesIDs = Note::pluck('client_id')->toArray();
|
|
|
+ $allPatientsWithNotesIDs = DB::table('note')->pluck('client_id')->toArray();
|
|
|
$allPatientsWithNotes = Client::whereIn('id', $allPatientsWithNotesIDs)->get();
|
|
|
|
|
|
+ $allAllyProsIDs = DB::table('note')->pluck('ally_pro_id')->toArray();
|
|
|
+ $allAllyPros = Pro::whereIn('id', $allAllyProsIDs)->get();
|
|
|
+
|
|
|
$notes = $query->orderBy('created_at', 'desc')->paginate(30);
|
|
|
|
|
|
- return view('app.practice-management.all-notes', compact('notes', 'filters','allProsWithNotes', 'allPatientsWithNotes'));
|
|
|
+ return view('app.practice-management.all-notes', compact('notes', 'filters','allProsWithNotes', 'allPatientsWithNotes', 'allAllyPros'));
|
|
|
}
|
|
|
|
|
|
public function dnaNotesPendingMcpSign(Request $request)
|