|
@@ -1251,6 +1251,26 @@ ORDER BY claim.created_at ASC
|
|
return view('app.practice-management.bad-notes', compact('counts', 'notes'));
|
|
return view('app.practice-management.bad-notes', compact('counts', 'notes'));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function doneNotes(Request $request) {
|
|
|
|
+ $counts = [
|
|
|
|
+ "unpicked" => Note::where('is_cancelled', false)
|
|
|
|
+ ->whereNull('current_note_pickup_for_processing_id')
|
|
|
|
+ ->count(),
|
|
|
|
+ ];
|
|
|
|
+ $notes = Note::where('is_cancelled', false)
|
|
|
|
+ ->where('is_signed_by_hcp', true)
|
|
|
|
+ ->whereRaw("((detail_json)::json->>'isBad' is null OR ((detail_json)::json->>'isBad')::text != 'true')")
|
|
|
|
+ ->whereNull('current_note_pickup_for_processing_id')
|
|
|
|
+ ->where('is_billing_marked_done', true)
|
|
|
|
+ ->where('is_bill_closed', true)
|
|
|
|
+ ->where('is_claim_closed', true)
|
|
|
|
+ ->whereRaw("(SELECT count(id) FROM claim WHERE note_id = note.id) > 0")
|
|
|
|
+ ->whereRaw("(SELECT count(id) FROM claim WHERE note_id = note.id AND is_cancelled IS FALSE AND status != 'CANCELLED' AND status != 'SUBMITTED') = 0")
|
|
|
|
+ ->orderBy('effective_dateest', 'ASC')
|
|
|
|
+ ->paginate();
|
|
|
|
+ return view('app.practice-management.done-notes', compact('counts', 'notes'));
|
|
|
|
+ }
|
|
|
|
+
|
|
public function currentMbClaim(Request $request, $claimUid) {
|
|
public function currentMbClaim(Request $request, $claimUid) {
|
|
$claim = Claim::where('uid', $claimUid)->first();
|
|
$claim = Claim::where('uid', $claimUid)->first();
|
|
return json_encode(MBClaim::where('claim_version_id', $claim->currentVersion->id)->first());
|
|
return json_encode(MBClaim::where('claim_version_id', $claim->currentVersion->id)->first());
|