浏览代码

Notes processing center filters impl

Vijayakrishnan 3 年之前
父节点
当前提交
8bb23af019

+ 49 - 0
app/Http/Controllers/PracticeManagementController.php

@@ -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();
 

+ 3 - 3
resources/views/app/practice-management/notes-processing-center.blade.php

@@ -278,9 +278,9 @@
                 @if($pro->currentNotePickupForProcessing && $pro->currentNotePickupForProcessing->note)
                     $('#target-chart').attr('src', $('#target-chart').attr('data-src'));
                     $('#target-note').attr('src', $('#target-note').attr('data-src'));
-                    window.setTimeout(() => {
-                        $('.row.iframes')[0].scrollIntoView();
-                    }, 250);
+                    // window.setTimeout(() => {
+                    //     $('.row.iframes')[0].scrollIntoView();
+                    // }, 250);
                 @endif
             }
             addMCInitializer('notes-processing-center', init, '#notes-processing-center')