Browse Source

added rmb

= 3 years ago
parent
commit
664ebeb478

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

@@ -1408,6 +1408,7 @@ ORDER BY claim.created_at DESC
             ->where('rm_total_time_in_seconds_by_mcp', '>=', 1800)
             ->where('rm_total_time_in_seconds', '>=', 4200) // at 4200 (70 minutes, it becomes eligible for plus40)
             ->where('number_of_days_with_remote_measurements', '>=', 16 )
+            ->whereRaw('is_rm_time_waived IS NOT TRUE')
             ->whereRaw('(has_anyone_interacted_with_client_about_rm_outside_note IS  TRUE OR has_mcp_rm_interacted_by_note IS  TRUE )')
             ->count();
 
@@ -1419,6 +1420,7 @@ ORDER BY claim.created_at DESC
             ->where('rm_total_time_in_seconds_by_mcp', '>=', 1800)
             ->where('rm_total_time_in_seconds', '>=', 4200) // at 4200 (70 minutes, it becomes eligible for plus40)
             ->where('number_of_days_with_remote_measurements', '>=', 16 )
+            ->whereRaw('is_rm_time_waived IS NOT TRUE')
             ->whereRaw('(has_anyone_interacted_with_client_about_rm_outside_note IS NOT TRUE AND has_mcp_rm_interacted_by_note IS NOT TRUE AND is_rm_interaction_waived IS NOT TRUE )')
             ->count();
 
@@ -1431,6 +1433,7 @@ ORDER BY claim.created_at DESC
             ->where('rm_total_time_in_seconds', '<', 4200)
             ->where('rm_total_time_in_seconds', '>=', 3000) // at 3000 (50 minutes, it becomes eligible for plus20)
             ->where('number_of_days_with_remote_measurements', '>=', 16 )
+            ->whereRaw('is_rm_time_waived IS NOT TRUE')
             ->whereRaw('(has_anyone_interacted_with_client_about_rm_outside_note IS TRUE OR has_mcp_rm_interacted_by_note IS TRUE)')
             ->count();
 
@@ -1443,6 +1446,7 @@ ORDER BY claim.created_at DESC
             ->where('rm_total_time_in_seconds', '<', 4200)
             ->where('rm_total_time_in_seconds', '>=', 3000) // at 3000 (50 minutes, it becomes eligible for plus20)
             ->where('number_of_days_with_remote_measurements', '>=', 16 )
+            ->whereRaw('is_rm_time_waived IS NOT TRUE')
             ->whereRaw('(has_anyone_interacted_with_client_about_rm_outside_note IS NOT TRUE AND has_mcp_rm_interacted_by_note IS NOT TRUE AND is_rm_interaction_waived IS NOT TRUE )')
             ->count();
 
@@ -1452,10 +1456,20 @@ ORDER BY claim.created_at DESC
             ->whereNotNull('company_location_id')
             ->whereRaw('(SELECT count(id) FROM care_month_cm_rm_reason WHERE care_month_id = care_month.id) > 0')
             ->where('rm_total_time_in_seconds_by_mcp', '>=', 1800)
+            ->whereRaw('is_rm_time_waived IS NOT TRUE')
             ->whereRaw('(rm_total_time_in_seconds < 3000 OR (rm_total_time_in_seconds >= 3000 AND is_rm_interaction_waived IS TRUE))')
             ->where('number_of_days_with_remote_measurements', '>=', 16 )
             ->count();
 
+        $keyNumbers['careMonthsEligibleForBillGeneration_RMB'] = CareMonth::where('is_bill_closed', false)
+            ->whereNotNull('company_pro_id')
+            ->whereNotNull('company_pro_payer_id')
+            ->whereNotNull('company_location_id')
+            ->whereRaw('(SELECT count(id) FROM care_month_cm_rm_reason WHERE care_month_id = care_month.id) > 0')
+            ->whereRaw('is_rm_time_waived IS TRUE')
+            ->where('number_of_days_with_remote_measurements', '>=', 16 )
+            ->count();
+
         $keyNumbers['careMonthsWith16OrMoreMeasurementDays'] = CareMonth::where('is_bill_closed', false)
             ->where('number_of_days_with_remote_measurements', '>=', 16 )
             ->count();

+ 14 - 1
resources/views/app/practice-management/rm-launch-and-clean.blade.php

@@ -27,6 +27,12 @@
                 <td class="text-nowrap">Care Months Eligible For <b>RM30 HCP Only</b></td>
                 <td class="text-success font-weight-bold text-right">{{$keyNumbers['careMonthsEligibleForBillGeneration_RM30_HCP']}}</td>
             </tr>
+
+            <tr>
+                <td class="text-nowrap">Care Months Eligible For <b>RMB</b></td>
+                <td class="text-success font-weight-bold text-right">{{$keyNumbers['careMonthsEligibleForBillGeneration_RMB']}}</td>
+            </tr>
+
             <tr>
                 <td class="text-nowrap">Care Months Eligible For <b>RM30 HCP + 40 EXTRA IF HAD INTERACTION</b></td>
                 <td class="text-success font-weight-bold text-right">{{$keyNumbers['careMonthsEligibleForBillGeneration_RM30_HCP_PLUS_40_ifHadInteraction']}}</td>
@@ -40,7 +46,9 @@
                 <td class="text-nowrap">Care Months With <b>16+ Measurement Days</b></td>
                 <td class="text-success font-weight-bold text-right">{{$keyNumbers['careMonthsWith16OrMoreMeasurementDays']}}</td>
             </tr>
-           
+
+
+        
             </tbody>
         </table>
         <div class="d-flex align-items-center">
@@ -59,6 +67,11 @@
                     {{@$keyNumbers['careMonthsEligibleForBillGeneration_RM30_HCP'] ? '' : 'perm-disabled'}}
                     data-ep="rm-admin-launch-rm30-hcp">Generate RM-30 HCP ({{@$keyNumbers['careMonthsEligibleForBillGeneration_RM30_HCP']}})
             </button>
+            <button class="btn btn-sm btn-primary btn-launch px-3 font-weight-bold mr-3"
+                    {{@$keyNumbers['careMonthsEligibleForBillGeneration_RMB'] ? '' : 'disabled'}}
+                    {{@$keyNumbers['careMonthsEligibleForBillGeneration_RMB'] ? '' : 'perm-disabled'}}
+                    data-ep="rm-admin-launch-rm30-hcp">Generate RMB ({{@$keyNumbers['careMonthsEligibleForBillGeneration_RMB']}})
+            </button>
         </div>
         <div class="my-3 text-secondary text-sm text-monospace launch-result" style="white-space: pre;">
         </div>