Bladeren bron

fixed markup

= 4 jaren geleden
bovenliggende
commit
9a1a8ff54e

+ 32 - 21
app/Http/Controllers/PracticeManagementController.php

@@ -857,28 +857,33 @@ class PracticeManagementController extends Controller
         return view('app.practice-management.shipments-multi-print', compact('shipments'));
     }
 
-    public function patientClaimSummary(Request $request, $proUid=null)
+    public function patientClaimSummary(Request $request, $proUid = null)
     {
 
         $notesTotal = DB::select(DB::raw("SELECT COUNT(*) FROM note WHERE is_cancelled IS NOT TRUE"))[0]->count;
         $notesTotalWithBillingClosed = DB::select(DB::raw("SELECT COUNT(*) FROM note WHERE is_cancelled IS NOT TRUE AND is_bill_closed IS TRUE"))[0]->count;
         $notesTotalWithClaimingClosed = DB::select(DB::raw("SELECT COUNT(*) FROM note WHERE is_cancelled IS NOT TRUE AND is_claim_closed IS TRUE"))[0]->count;
 
+        $notes3rdPartyTotal = DB::select(DB::raw("SELECT COUNT(*) FROM note n LEFT JOIN client c ON n.client_id = c.id WHERE n.is_cancelled IS NOT TRUE AND c.is_part_b_primary <> 'YES'"))[0]->count;
+        $notes3rdPartyTotalWithBillingClosed = DB::select(DB::raw("SELECT COUNT(*) FROM note n LEFT JOIN client c ON n.client_id = c.id WHERE n.is_cancelled IS NOT TRUE AND n.is_bill_closed IS TRUE AND c.is_part_b_primary <> 'YES'"))[0]->count;
+        $notes3rdPartyTotalWithClaimingClosed = DB::select(DB::raw("SELECT COUNT(*) FROM note n LEFT JOIN client c ON n.client_id = c.id WHERE n.is_cancelled IS NOT TRUE AND n.is_claim_closed IS TRUE AND c.is_part_b_primary <> 'YES'"))[0]->count;
+
         $patientsTotal = DB::select(DB::raw("SELECT COUNT(*) FROM client WHERE is_active IS TRUE AND 0 NOT IN (SELECT c FROM (SELECT COUNT(*) c FROM note WHERE is_cancelled IS NOT TRUE AND note.client_id = client.id) x)"))[0]->count;
         $patientsTotalWithBillingClosed = DB::select(DB::raw("SELECT COUNT(*) FROM client WHERE is_active IS TRUE AND 0 NOT IN (SELECT c FROM (SELECT COUNT(*) c FROM note WHERE is_cancelled IS NOT TRUE AND note.client_id = client.id) y) AND 0 IN (SELECT c FROM (SELECT COUNT(*) c FROM note WHERE is_cancelled IS NOT TRUE AND is_bill_closed IS NOT TRUE AND note.client_id = client.id) x)"))[0]->count;
         $patientsTotalWithClaimingClosed = DB::select(DB::raw("SELECT COUNT(*) FROM client WHERE is_active IS TRUE AND 0 NOT IN (SELECT c FROM (SELECT COUNT(*) c FROM note WHERE is_cancelled IS NOT TRUE AND note.client_id = client.id) y) AND 0 IN (SELECT c FROM (SELECT COUNT(*) c FROM note WHERE is_cancelled IS NOT TRUE AND is_claim_closed IS NOT TRUE AND note.client_id = client.id) x)"))[0]->count;
 
+
         $performerPro = $this->performer->pro;
         $allPros = [];
         if ($performerPro->pro_type == 'ADMIN') {
             $allPros = Pro::all();
         } else {
-           $allPros = [$performerPro];
+            $allPros = [$performerPro];
         }
 
         //Patient | MCP | # Notes Total | # Notes without Billing Closed | # Notes without Claiming Closed
         $patientsQuery = Client::where('is_dummy', '=', false)
-            ->select('id', 'uid', 'name_first', 'name_last', 'mcp_pro_id','is_part_b_primary','medicare_advantage_plan',
+            ->select('id', 'uid', 'name_first', 'name_last', 'mcp_pro_id', 'is_part_b_primary', 'medicare_advantage_plan',
                 DB::raw("(SELECT name_first||' '||name_last FROM pro where pro.id = client.mcp_pro_id) as mcp"),
                 DB::raw("(SELECT uid FROM pro where pro.id = mcp_pro_id) as mcp_pro_uid"),
                 DB::raw("(SELECT COUNT(*) FROM note where note.client_id = client.id) as notes_total"),
@@ -886,26 +891,32 @@ class PracticeManagementController extends Controller
                 DB::raw("(SELECT COUNT(*) FROM note where note.client_id = client.id AND is_claim_closed IS NOT true) as notes_without_claiming_closed")
             )->orderBy('is_part_b_primary', 'asc')->orderBy('notes_without_claiming_closed', 'desc');
 
-            if($proUid){
-                $mcpPro = Pro::where('uid', $proUid)->first();
-                if($mcpPro){
-                    $patientsQuery->where('client.mcp_pro_id','=', $mcpPro->id);
-                }
+        if ($proUid) {
+            $mcpPro = Pro::where('uid', $proUid)->first();
+            if ($mcpPro) {
+                $patientsQuery->where('client.mcp_pro_id', '=', $mcpPro->id);
             }
+        }
 
-           $patients =  $patientsQuery->paginate(50);
-
-            $data = [
-                'patients' => $patients,
-                'proUid' => $proUid,
-                'allPros' => $allPros,
-                'notesTotal' => $notesTotal,
-                'notesTotalWithBillingClosed' => $notesTotalWithBillingClosed,
-                'notesTotalWithClaimingClosed' => $notesTotalWithClaimingClosed,
-                'patientsTotal' => $patientsTotal,
-                'patientsTotalWithBillingClosed' => $patientsTotalWithBillingClosed,
-                'patientsTotalWithClaimingClosed' => $patientsTotalWithClaimingClosed
-            ];
+        $patients = $patientsQuery->paginate(50);
+
+        $data = [
+            'patients' => $patients,
+            'proUid' => $proUid,
+            'allPros' => $allPros,
+            'notesTotal' => $notesTotal,
+            'notesTotalWithBillingClosed' => $notesTotalWithBillingClosed,
+            'notesTotalWithClaimingClosed' => $notesTotalWithClaimingClosed,
+
+            'notes3rdPartyTotal' => $notes3rdPartyTotal,
+            'notes3rdPartyTotalWithBillingClosed' => $notes3rdPartyTotalWithBillingClosed,
+            'notes3rdPartyTotalWithClaimingClosed' => $notes3rdPartyTotalWithClaimingClosed,
+
+            'patientsTotal' => $patientsTotal,
+            'patientsTotalWithBillingClosed' => $patientsTotalWithBillingClosed,
+            'patientsTotalWithClaimingClosed' => $patientsTotalWithClaimingClosed
+
+        ];
 
         return view('app.practice-management.patient-claim-summary', $data);
     }

+ 29 - 0
resources/views/app/practice-management/patient-claim-summary.blade.php

@@ -43,6 +43,35 @@
                         </td>
                     </tr>
 
+                    <tr>
+                        <th class="border-top-0 pl-2" style="width: 300px;">Total notes, 3rd party</th>
+                        <td class="border-top-0 px-2"  style="width: 100px;">{{$notes3rdPartyTotal}}</td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <th class="pl-2">Notes with billing closed, 3rdParty</th>
+                        <td class="px-2">{{$notes3rdPartyTotalWithBillingClosed}} / {{ $notes3rdPartyTotal }}</td>
+                        <td>
+                            <div class="d-flex align-items-center">
+                                <span class="fill-percent-value">{{round(($notes3rdPartyTotalWithBillingClosed) *100/ $notes3rdPartyTotal, 1)}}%</span>
+                                <div class="flex-grow-1 position-relative fill-bar">
+                                    <div class="bg-info position-absolute" style="left: 0; top: 0; height: 100%; width: {{ ($notesTotalWithBillingClosed) * 100/ $notesTotal }}%"></div>
+                                </div>
+                            </div>
+                        </td>
+                    </tr>
+                    <tr>
+                        <th class="pl-2">Notes with claiming closed, 3rdParty</th>
+                        <td class="px-2">{{$notes3rdPartyTotalWithClaimingClosed}} / {{ $notes3rdPartyTotal }}</td>
+                        <td>
+                            <div class="d-flex align-items-center">
+                                <span class="fill-percent-value">{{round(($notes3rdPartyTotalWithClaimingClosed) *100/ $notes3rdPartyTotal, 1)}}%</span>
+                                <div class="flex-grow-1 position-relative fill-bar">
+                                    <div class="bg-info position-absolute" style="left: 0; top: 0; height: 100%; width: {{ ($notesTotalWithClaimingClosed) * 100/ $notesTotal }}%"></div>
+                                </div>
+                            </div>
+                        </td>
+                    </tr>
 
                     <tr>
                         <th class="border-top-0 pl-2" style="width: 250px;">Total patients w/ notes</th>