|
@@ -1099,6 +1099,85 @@ ORDER BY claim.created_at ASC
|
|
|
return view('app.practice-management.process-claims', compact('claims', 'status'));
|
|
|
}
|
|
|
|
|
|
+ public function processNotes(Request $request) {
|
|
|
+
|
|
|
+ $mode = $request->input('mode') ? $request->input('mode') : '1';
|
|
|
+ if($mode < 1 || $mode > 5) $mode = 1;
|
|
|
+
|
|
|
+ $counts = [
|
|
|
+ "mode-1" => Note::where('is_cancelled', false)
|
|
|
+ ->where('is_signed_by_hcp', false)
|
|
|
+ ->whereRaw("((detail_json)::json->>'isBad' is null OR ((detail_json)::json->>'isBad')::text != 'true')")
|
|
|
+ ->whereNull('current_note_pickup_for_processing_id')
|
|
|
+ ->count(),
|
|
|
+ "mode-2" => 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', false)
|
|
|
+ ->count(),
|
|
|
+ "mode-3" => 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', false)
|
|
|
+ ->count(),
|
|
|
+ "mode-4" => 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', false)
|
|
|
+ ->count(),
|
|
|
+ "mode-5" => 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 AND is_cancelled IS FALSE AND status != 'CANCELLED' AND status != 'SUBMITTED') > 0")
|
|
|
+ ->count(),
|
|
|
+ "mode-6" => 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")
|
|
|
+ ->count(),
|
|
|
+ "mode-7" => Note::where('is_cancelled', false)
|
|
|
+ ->whereRaw("(detail_json)::json->>'isBad' = 'true'")
|
|
|
+ ->count(),
|
|
|
+ ];
|
|
|
+
|
|
|
+ /*$notes = Note::where('is_cancelled', false);
|
|
|
+
|
|
|
+ $mode = $request->input('mode') ? $request->input('mode') : '1';
|
|
|
+ if($mode < 1 || $mode > 5) $mode = 1;
|
|
|
+
|
|
|
+ switch (+$mode) {
|
|
|
+ case 1:
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ $notes = $notes->orderBy('effective_dateest', 'ASC')->skip(0)->take(1)->get();*/
|
|
|
+
|
|
|
+ return view('app.practice-management.process-notes', compact('mode', 'counts'));
|
|
|
+ }
|
|
|
+
|
|
|
public function currentMbClaim(Request $request, $claimUid) {
|
|
|
$claim = Claim::where('uid', $claimUid)->first();
|
|
|
return json_encode(MBClaim::where('claim_version_id', $claim->currentVersion->id)->first());
|