Browse Source

Merge branch 'master' into dev-vj

Vijayakrishnan 4 năm trước cách đây
mục cha
commit
0ea8101b49

+ 8 - 1
app/Http/Controllers/PracticeManagementController.php

@@ -864,6 +864,10 @@ class PracticeManagementController extends Controller
         $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;
 
+        $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') {
@@ -897,7 +901,10 @@ class PracticeManagementController extends Controller
                 'allPros' => $allPros,
                 'notesTotal' => $notesTotal,
                 'notesTotalWithBillingClosed' => $notesTotalWithBillingClosed,
-                'notesTotalWithClaimingClosed' => $notesTotalWithClaimingClosed
+                'notesTotalWithClaimingClosed' => $notesTotalWithClaimingClosed,
+                'patientsTotal' => $patientsTotal,
+                'patientsTotalWithBillingClosed' => $patientsTotalWithBillingClosed,
+                'patientsTotalWithClaimingClosed' => $patientsTotalWithClaimingClosed
             ];
 
         return view('app.practice-management.patient-claim-summary', $data);

+ 34 - 3
resources/views/app/practice-management/patient-claim-summary.blade.php

@@ -14,12 +14,12 @@
                 <table class="table mb-0 table-sm table-bordered table-striped">
                     <tbody>
                     <tr>
-                        <th class="border-top-0 pl-2" style="width: 130px;">Total notes</th>
+                        <th class="border-top-0 pl-2" style="width: 300px;">Total notes</th>
                         <td class="border-top-0 px-2"  style="width: 100px;">{{$notesTotal}}</td>
                         <td></td>
                     </tr>
                     <tr>
-                        <th class="pl-2">Billing closed</th>
+                        <th class="pl-2">Notes with billing closed</th>
                         <td class="px-2">{{$notesTotalWithBillingClosed}} / {{ $notesTotal }}</td>
                         <td>
                             <div class="d-flex align-items-center">
@@ -31,7 +31,7 @@
                         </td>
                     </tr>
                     <tr>
-                        <th class="pl-2">Claiming closed</th>
+                        <th class="pl-2">Notes with claiming closed</th>
                         <td class="px-2">{{$notesTotalWithClaimingClosed}} / {{ $notesTotal }}</td>
                         <td>
                             <div class="d-flex align-items-center">
@@ -42,6 +42,37 @@
                             </div>
                         </td>
                     </tr>
+
+
+                    <tr>
+                        <th class="border-top-0 pl-2" style="width: 250px;">Total patients w/ notes</th>
+                        <td class="border-top-0 px-2"  style="width: 100px;">{{$patientsTotal}}</td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <th class="pl-2">Patients with notes & billing closed</th>
+                        <td class="px-2">{{$patientsTotalWithBillingClosed}} / {{ $patientsTotal }}</td>
+                        <td>
+                            <div class="d-flex align-items-center">
+                                <span class="fill-percent-value">{{round(($patientsTotalWithBillingClosed) *100/ $patientsTotal, 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: {{ ($patientsTotalWithBillingClosed) * 100/ $patientsTotal }}%"></div>
+                                </div>
+                            </div>
+                        </td>
+                    </tr>
+                    <tr>
+                        <th class="pl-2">Patients with notes & claiming closed</th>
+                        <td class="px-2">{{$patientsTotalWithClaimingClosed}} / {{ $patientsTotal }}</td>
+                        <td>
+                            <div class="d-flex align-items-center">
+                                <span class="fill-percent-value">{{round(($patientsTotalWithClaimingClosed) *100/ $patientsTotal, 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: {{ ($patientsTotalWithClaimingClosed) * 100/ $patientsTotal }}%"></div>
+                                </div>
+                            </div>
+                        </td>
+                    </tr>
                     </tbody>
                 </table>
             </div>