|
@@ -1598,6 +1598,55 @@ ORDER BY claim.created_at DESC
|
|
|
$notes = Note::where('is_cancelled', false);
|
|
|
|
|
|
// filters
|
|
|
+ $proUid = $request->input('proUid');
|
|
|
+ if($proUid) {
|
|
|
+ $fPro = Pro::where('uid', $proUid)->first();
|
|
|
+ if($fPro) {
|
|
|
+ $notes = $notes->where('hcp_pro_id', $fPro->id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $proSigned = $request->input('proSigned');
|
|
|
+ switch($proSigned) {
|
|
|
+ case 'yes': $notes = $notes->where('is_signed_by_hcp', true); break;
|
|
|
+ case 'no': $notes = $notes->where('is_signed_by_hcp', '!=', true); break;
|
|
|
+ }
|
|
|
+ $billingMarkedDone = $request->input('billingMarkedDone');
|
|
|
+ switch($billingMarkedDone) {
|
|
|
+ case 'yes': $notes = $notes->where('is_billing_marked_done', true); break;
|
|
|
+ case 'no': $notes = $notes->where('is_billing_marked_done', '!=', true); break;
|
|
|
+ }
|
|
|
+ $billingClosed = $request->input('billingClosed');
|
|
|
+ switch($billingClosed) {
|
|
|
+ case 'yes': $notes = $notes->where('is_bill_closed', true); break;
|
|
|
+ case 'no': $notes = $notes->where('is_bill_closed', '!=', true); break;
|
|
|
+ }
|
|
|
+ $claimingClosed = $request->input('claimingClosed');
|
|
|
+ switch($claimingClosed) {
|
|
|
+ case 'yes': $notes = $notes->where('is_claim_closed', true); break;
|
|
|
+ case 'no': $notes = $notes->where('is_claim_closed', '!=', true); break;
|
|
|
+ }
|
|
|
+ $allClaimsSubmitted = $request->input('allClaimsSubmitted');
|
|
|
+ if($allClaimsSubmitted) {
|
|
|
+ // TODO
|
|
|
+ }
|
|
|
+ $goodBad = $request->input('goodBad');
|
|
|
+ switch($goodBad) {
|
|
|
+ case 'good': $notes = $notes->whereRaw("(detail_json)::json->>'isBad' = 'false'"); break;
|
|
|
+ case 'bad': $notes = $notes->whereRaw("(detail_json)::json->>'isBad' = 'true'"); break;
|
|
|
+ case 'unclassified': $notes = $notes->whereRaw("(detail_json)::json->>'isBad' is null"); break;
|
|
|
+ }
|
|
|
+ $startDate = $request->input('startDate');
|
|
|
+ if($startDate) {
|
|
|
+ $notes = $notes->where('effective_dateest', '>=', $startDate);
|
|
|
+ }
|
|
|
+ $endDate = $request->input('endDate');
|
|
|
+ if($endDate) {
|
|
|
+ $notes = $notes->where('effective_dateest', '<=', $endDate);
|
|
|
+ }
|
|
|
+ $mcPartB = $request->input('mcPartB');
|
|
|
+ if($mcPartB) {
|
|
|
+ // TODO
|
|
|
+ }
|
|
|
|
|
|
$notes = $notes->orderBy('effective_dateest')->paginate();
|
|
|
|