Selaa lähdekoodia

Merge branch 'cleanup' of https://rav.triplestart.com/tigerphp/stagfe2 into cleanup

root 1 vuosi sitten
vanhempi
commit
25cd325e6d
23 muutettua tiedostoa jossa 584 lisäystä ja 246 poistoa
  1. 2 2
      app/Helpers/helpers.php
  2. 36 100
      app/Models/CareMonth.php
  3. 4 0
      app/Models/CompanyLocation.php
  4. 3 0
      public/css/style.css
  5. 2 2
      resources/views/app/dashboard-mcp.blade.php
  6. 1 13
      resources/views/app/mcp/dashboard/caremonth-tiers-list.blade.php
  7. 7 15
      resources/views/app/patient/care-month/dashboard.blade.php
  8. 20 0
      resources/views/app/patient/care-month/forms/put-company-location.blade.php
  9. 20 0
      resources/views/app/patient/care-month/forms/put-company-pro-payer.blade.php
  10. 21 0
      resources/views/app/patient/care-month/forms/put-company-pro.blade.php
  11. 13 0
      resources/views/app/patient/care-month/forms/wipe-company-location.blade.php
  12. 13 0
      resources/views/app/patient/care-month/forms/wipe-company-pro-payer.blade.php
  13. 13 0
      resources/views/app/patient/care-month/forms/wipe-company-pro.blade.php
  14. 277 0
      resources/views/app/patient/care-month/partials/admin-settings.blade.php
  15. 19 0
      resources/views/app/patient/care-month/partials/tier-explainer.blade.php
  16. 2 7
      resources/views/app/patient/care-months.blade.php
  17. 4 9
      resources/views/app/patient/partials/caremonth-summary.blade.php
  18. 79 76
      resources/views/app/practice-management/remote-monitoring-row-markup-by-pro-type.blade.php
  19. 10 1
      resources/views/app/practice-management/remote-monitoring-row-markup-for-admin.blade.php
  20. 2 4
      resources/views/app/practice-management/rpm-matrix-by-pro-type-table.blade.php
  21. 19 14
      resources/views/app/practice-management/rpm-matrix-by-pro-type.blade.php
  22. 6 2
      resources/views/app/practice-management/rpm-matrix-for-admin-table.blade.php
  23. 11 1
      resources/views/app/practice-management/rpm-matrix-for-admin.blade.php

+ 2 - 2
app/Helpers/helpers.php

@@ -1201,11 +1201,11 @@ if(!function_exists('getSurveyData')) {
 if(!function_exists('determineTier')) {
     function determineTier($careMonth) {
         $tier = null;
-		if($careMonth->number_of_days_with_remote_measurements >= 7 && $careMonth->rm_total_time_in_seconds_by_mcp >= 10*60 ){
+		if($careMonth->number_of_days_with_remote_measurements >= 7 && $careMonth->rm_total_time_in_seconds_by_mcp >= 10*60 && $careMonth->has_mcp_interacted_with_client_about_rm ){
 			$tier = 'TIER_1';
 		}
 
-		if($careMonth->number_of_days_with_remote_measurements >= 16 && $careMonth->rm_total_time_in_seconds >= 20*60) {
+		if($careMonth->number_of_days_with_remote_measurements >= 16 && $careMonth->rm_total_time_in_seconds_by_mcp >= 20*60 && $careMonth->has_mcp_interacted_with_client_about_rm) {
 			$tier = 'TIER_2';
 		}
         return $tier;

+ 36 - 100
app/Models/CareMonth.php

@@ -175,72 +175,38 @@ class CareMonth extends Model
 
     public function calculateBillabilityForMcp(){
 
-
-        $strategy = $this->mcp_rpm_payment_strategy;
-        if(!$strategy){
+        $tier1Strategy = $this->mcp_rpm_payment_strategy_tier_one;
+        $tier2Strategy = $this->mcp_rpm_payment_strategy_tier_two;
+        if(!$tier1Strategy || !$tier2Strategy){
             return [
-                'billable' => false, 
+                'billable' => false,
                 'reason' => 'MCP RPM strategy has not been set.'
             ];
         }
-        
-        $mcpRpmPaymentAmount =  $this->mcp_rpm_payment_amount;
-        $has16PlusDays = $this->number_of_days_with_remote_measurements >= 16;
-        $hasMcpBilled20Minutes = $this->rm_total_time_in_seconds_by_mcp >= 1200;
-        $hasMcpInteracted = $this->has_mcp_interacted_with_client_about_rm;
 
-        if (is_null($this->days_between_most_recent_mcp_note_date_and_end_of_care_month) || $this->days_between_most_recent_mcp_note_date_and_end_of_care_month > config('app.maxDaysSinceLastVisit')) {
+        $tier = determineTier($this);
+
+        if (!$tier) {
             return [
                 'billable' => false,
                 'reason' => "Patient has not had a visit recent enough to bill for RPM"
             ];
         }
 
-        if($strategy == 'X16_DAYS'){
-            //only check for 16 days
-            if($has16PlusDays){
-                return [
-                    'billable' => true, 
-                    'amount' => $mcpRpmPaymentAmount
-                ];
-            } else {
-                //not billable
-                return [
-                    'billable' => false, 
-                    'reason' => "This care month does not have 16 or more measurement days."
-                ];
-            }
+        if($tier == 'TIER_1'){
+            return [
+                'billable' => true,
+                'amount' => $this->mcp_rpm_payment_amount_tier_one
+            ];
         }
-    
-        if($strategy == 'X16_DAYS_20_MINS_ON_OWN_MCP_COM_DURING_CM'){
-            if ($has16PlusDays && $hasMcpBilled20Minutes && $hasMcpInteracted) {
-                return [
-                    'billable' => true, 
-                    'amount' => $mcpRpmPaymentAmount
-                ];
-            } else {
-                if(!$has16PlusDays){
-                    return [
-                        'billable' => false, 
-                        'reason' => 'Care month does not have 16 or more measurement days.'
-                    ];
-                }
-                if(!$hasMcpBilled20Minutes){
-                    return [
-                        'billable' => false, 
-                        'reason' => 'Care month does not have 20 minutes billed time.'
-                    ];
-                }
-                if(!$hasMcpInteracted){
-                    return [
-                        'billable' => false, 
-                        'reason' => 'Care month does MCP interaction.'
-                    ];
-                }
-                
-            }
+
+        if($tier == 'TIER_2'){
+            return [
+                'billable' => true,
+                'amount' => $this->mcp_rpm_payment_amount_tier_two
+            ];
         }
-    
+
     }
 
     public function calculateBillabilityForRmm(){
@@ -252,69 +218,39 @@ class CareMonth extends Model
             ];
         }
 
-        $strategy = $this->rmm_payment_strategy;
-        if(!$strategy){
+        $tier1Strategy = $this->mcp_rpm_payment_tier_one_strategy;
+        $tier2Strategy = $this->mcp_rpm_payment_tier_two_strategy;
+
+        if(!$tier1Strategy || !$tier2Strategy){
             return [
                 'billable' => false,
                 'reason' => 'RPM strategy has not been set.'
             ];
         }
 
+        $tier = determineTier($this);
+
         $rmmRpmPaymentAmount =  $this->rmm_payment_amount;
-        $has16PlusDays = $this->number_of_days_with_remote_measurements >= 16;
-        $hasRmmBilled20Minutes = $this->rm_total_time_in_seconds_by_rmm_pro >= 1200;
-        $hasMcpInteracted = $this->has_mcp_interacted_with_client_about_rm;
 
-        if (is_null($this->days_between_most_recent_mcp_note_date_and_end_of_care_month) || $this->days_between_most_recent_mcp_note_date_and_end_of_care_month > config('app.maxDaysSinceLastVisit')) {
+        if (!$tier) {
             return [
                 'billable' => false,
                 'reason' => "Patient has not had a visit recent enough to bill for RPM"
             ];
         }
 
-        if($strategy == 'X16_DAYS'){
-            //only check for 16 days
-            if($has16PlusDays){
-                return [
-                    'billable' => true,
-                    'amount' => $rmmRpmPaymentAmount
-                ];
-            } else {
-                //not billable
-                return [
-                    'billable' => false,
-                    'reason' => "This care month does not have 16 or more measurement days."
-                ];
-            }
+        if($tier == 'TIER_1'){
+            return [
+                'billable' => true,
+                'amount' => $rmmRpmPaymentAmount
+            ];
         }
 
-        if($strategy == 'X16_DAYS_20_MINS_ON_OWN_MCP_COM_DURING_CM'){
-            if ($has16PlusDays && $hasRmmBilled20Minutes && $hasMcpInteracted) {
-                return [
-                    'billable' => true,
-                    'amount' => $rmmRpmPaymentAmount
-                ];
-            } else {
-                if(!$has16PlusDays){
-                    return [
-                        'billable' => false,
-                        'reason' => 'Care month does not have 16 or more measurement days.'
-                    ];
-                }
-                if(!$hasRmmBilled20Minutes){
-                    return [
-                        'billable' => false,
-                        'reason' => 'Care month does not have 20 minutes in entries.'
-                    ];
-                }
-                if(!$hasMcpInteracted){
-                    return [
-                        'billable' => false,
-                        'reason' => 'Care month does not have MCP interaction.'
-                    ];
-                }
-
-            }
+        if($tier == 'TIER_2'){
+            return [
+                'billable' => true,
+                'amount' => $rmmRpmPaymentAmount
+            ];
         }
 
     }

+ 4 - 0
app/Models/CompanyLocation.php

@@ -9,4 +9,8 @@ class CompanyLocation extends Model
 
     protected $table = 'company_location';
 
+    public function displayName(){
+        return implode(" ", [$this->line1, $this->city, $this->state]);
+    }
+
 }

+ 3 - 0
public/css/style.css

@@ -63,6 +63,9 @@
 .bg-warning-mellow {
     background-color: #ffc10755 !important;
 }
+.bg-success-mellow {
+    background-color: #c6e8c3 !important;
+}
 .text-link {
     color: rgb(13, 89, 175) !important;
 }

+ 2 - 2
resources/views/app/dashboard-mcp.blade.php

@@ -311,7 +311,7 @@
                                 </tr>
                                 </tbody>
                             </table>
-                        </div>                        
+                        </div>
                     </div>
                     <div class="card mb-4" stag-collapsible-card="mcp-practice-management" collapsed>
                         <div class="card-header pl-2">
@@ -442,7 +442,7 @@
                                 </div>
                             </div>
 
-                            <div>
+                            <div class="d-none">
                                 @include('app.mcp.dashboard.caremonth-tiers-list')
                             </div>
 

+ 1 - 13
resources/views/app/mcp/dashboard/caremonth-tiers-list.blade.php

@@ -48,19 +48,7 @@
                         @else
                             <span class="text-danger">No</span>
                         @endif
-
-                        <div class="on-hover-show d-inline-block on-hover-opaque">
-                            <i class="fa fa-info-circle ml-1"></i>
-                            <div class="on-hover-content p-2 text-dark width-200px">
-                              @if(!$cm->tier())
-                              <h5 class="mb-2 font-weight-bold">Tier 1 Qualification:</h5>
-                              <p class="m-0 text-muted">Minimum of <b>7 days</b>, <b>10 mins</b> and <b>interaction</b> is required.</p>
-                              @elseif($cm->tier() === 'TIER_1')
-                              <h5 class="mb-2 font-weight-bold">Tier 2 Qualification:</h5>
-                              <p class="m-0 text-muted">Minimum of <b>16 days</b> and <b>20 mins</b> is required.</p>
-                              @endif
-                            </div>
-                        </div>
+                        @include('app.patient.care-month.partials.tier-explainer', ['careMonth' => $cm])
                     </td>
                 </tr>
                 @endforeach

+ 7 - 15
resources/views/app/patient/care-month/dashboard.blade.php

@@ -213,16 +213,11 @@
                                 <!-- days with meas. -->
                                 <div class="mt-2">
                                     <span class="font-weight-bold text-secondary">Days with meas.:</span>
-                                    <b class="{{$careMonth->number_of_days_with_remote_measurements >= 16 ? 'text-success' : 'text-warning-mellow'}}">
+                                    <b class="{{ determineTier($careMonth) ? 'text-success' : 'text-warning-mellow'}}">
                                         {{$careMonth->number_of_days_with_remote_measurements}}
-                                        @if($careMonth->number_of_days_with_remote_measurements >= 16)
-                                            <i class="fa fa-check"></i>
-                                        @else
-                                            <i class="fa fa-exclamation-triangle"></i>
-                                        @endif
-                                        <span class="ml-1 text-secondary text-sm font-weight-normal">(16 needed)</span>
+                                        @include('app.patient.care-month.partials.tier-explainer', ['careMonth' => $careMonth])
                                     </b>
-                                    @if($careMonth->number_of_days_with_remote_measurements < 16)
+                                    @if(!determineTier($careMonth))
                                         <div moe relative class="ml-2">
                                             <a href="#" start show class="text-sm">SMS Patient</a>
                                             <form url="/api/clientSms/createOutgoing" right="" class="mcp-theme-1" noreload="" style="display: none;">
@@ -245,7 +240,7 @@
                                 </div>
                                 @if($careMonth->showMeasurementDaysWarning())
                                     <?php
-                                    $moreDays = 16 - $careMonth->number_of_days_with_remote_measurements;
+                                    $moreDays = 7 - $careMonth->number_of_days_with_remote_measurements;
                                     if($moreDays < 0) $moreDays = 0;
                                     ?>
                                     @if($moreDays > 0)
@@ -298,12 +293,7 @@
 
                                     <b class="{{$minsBilled >= 20 ? 'text-success' : 'text-warning-mellow'}}">
                                         {{$minsBilled}}
-                                        @if($minsBilled < 20)
-                                            <i class="fa fa-exclamation-triangle"></i>
-                                        @else
-                                            <i class="fa fa-check"></i>
-                                        @endif
-                                        <span class="ml-1 text-secondary text-sm font-weight-normal">(20 needed)</span>
+                                        @include('app.patient.care-month.partials.tier-explainer', ['careMonth' => $careMonth])
                                     </b>
                                     <span class="mx-2 text-secondary">|</span>
                                     @include('app.practice-management.care_month_add_entry_form', ['right' => true])
@@ -1510,6 +1500,8 @@
                 @endif
             </div>
         </div>
+        <hr class="m-negator mt-4 mb-3">
+        @include('app.patient.care-month.partials.admin-settings')
         @endif
 
         {{-- generic bills --}}{{--

+ 20 - 0
resources/views/app/patient/care-month/forms/put-company-location.blade.php

@@ -0,0 +1,20 @@
+<div moe class="ml-1">
+    Company Location: <a class="text-primary" href="" show start>{{ $careMonth->companyLocation ? $careMonth->companyLocation->displayName() : '---' }} <i class="fa fa-edit"></i></a>
+    <form url="/api/careMonth/putCompanyLocation">
+        <input type="hidden" name="uid" value="{{ $careMonth->uid }}">
+        <div class="mb-2">
+            <select name="companyLocationUid" class="form-control form-control-sm">
+                <option value="">-- select --</option>
+                @if ($careMonth->company && $careMonth->company->locations)
+                    @foreach ($careMonth->company->locations as $location)
+                        <option value="{{ $location->uid }}">{{ $location->line1 . ', ' . $location->city }}</option>
+                    @endforeach
+                @endif
+            </select>
+        </div>
+        <div class="mb-0">
+            <button class="btn btn-success btn-sm" submit>Submit</button>
+            <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+        </div>
+    </form>
+</div>

+ 20 - 0
resources/views/app/patient/care-month/forms/put-company-pro-payer.blade.php

@@ -0,0 +1,20 @@
+<div moe class="ml-1">
+    Company Pro Payer: <a class="text-primary" href="" show start>{{ $careMonth->companyProPayer ? $careMonth->companyProPayer->payer->name : '---' }} <i class="fa fa-edit"></i></a>
+    <form url="/api/careMonth/putCompanyProPayer">
+        <input type="hidden" name="uid" value="{{ $careMonth->uid }}">
+        <div class="mb-2">
+            <select name="companyProPayerUid" class="form-control form-control-sm">
+                <option value="">-- select --</option>
+                @if($careMonth->companyPro && $careMonth->companyPro->companyProPayers)
+                    @foreach ($careMonth->companyPro->companyProPayers as $companyProPayer)
+                        <option value="{{ $companyProPayer->uid }}">{{ $companyProPayer->payer->name }}</option>
+                    @endforeach
+                @endif
+            </select>
+        </div>
+        <div class="mb-0">
+            <button class="btn btn-success btn-sm" submit>Submit</button>
+            <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+        </div>
+    </form>
+</div>

+ 21 - 0
resources/views/app/patient/care-month/forms/put-company-pro.blade.php

@@ -0,0 +1,21 @@
+<div moe class="ml-1">
+    Company Pro: <a class="text-primary" href="" show start>{{ $careMonth->companyPro ? $careMonth->companyPro->displayName() : '---' }} <i class="fa fa-edit"></i></a>
+    <form url="/api/careMonth/putCompanyPro">
+        <input type="hidden" name="uid" value="{{ $careMonth->uid }}">
+        <div class="mb-2">
+            <select name="companyProUid" class="form-control form-control-sm">
+                <option value="">-- select --</option>
+                @if($careMonth->mcp && $careMonth->mcp->companyPros)
+                    @foreach ($careMonth->mcp->companyPros as $companyPro)
+                        <option value="{{ $companyPro->uid }}">
+                            {{ $companyPro->pro->displayName() . ' / ' . $companyPro->company->name }}</option>
+                    @endforeach
+                @endif
+            </select>
+        </div>
+        <div class="mb-0">
+            <button class="btn btn-success btn-sm" submit>Submit</button>
+            <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+        </div>
+    </form>
+</div>

+ 13 - 0
resources/views/app/patient/care-month/forms/wipe-company-location.blade.php

@@ -0,0 +1,13 @@
+<div moe class="ml-1">
+    <a class="text-danger" href="" show start><i class="fa fa-trash"></i></a>
+    <form url="/api/careMonth/wipeCompanyLocation">
+        <input type="hidden" name="uid" value="{{ $careMonth->uid }}">
+        <div class="mb-2">
+            <label>Are you sure?</label>
+        </div>
+        <div class="mb-0">
+            <button class="btn btn-danger btn-sm" submit>Wipe</button>
+            <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+        </div>
+    </form>
+</div>

+ 13 - 0
resources/views/app/patient/care-month/forms/wipe-company-pro-payer.blade.php

@@ -0,0 +1,13 @@
+<div moe class="ml-1">
+    <a class="text-danger" href="" show start><i class="fa fa-trash"></i></a>
+    <form url="/api/careMonth/wipeCompanyProPayer">
+        <input type="hidden" name="uid" value="{{ $careMonth->uid }}">
+        <div class="mb-2">
+            <label>Are you sure?</label>
+        </div>
+        <div class="mb-0">
+            <button class="btn btn-danger btn-sm" submit>Wipe</button>
+            <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+        </div>
+    </form>
+</div>

+ 13 - 0
resources/views/app/patient/care-month/forms/wipe-company-pro.blade.php

@@ -0,0 +1,13 @@
+<div moe class="ml-1">
+    <a class="text-danger" href="" show start><i class="fa fa-trash"></i></a>
+    <form url="/api/careMonth/wipeCompanyPro">
+        <input type="hidden" name="uid" value="{{ $careMonth->uid }}">
+        <div class="mb-2">
+            <label>Are you sure?</label>
+        </div>
+        <div class="mb-0">
+            <button class="btn btn-danger btn-sm" submit>Wipe</button>
+            <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+        </div>
+    </form>
+</div>

+ 277 - 0
resources/views/app/patient/care-month/partials/admin-settings.blade.php

@@ -0,0 +1,277 @@
+<?php
+$moes = [
+    'setIsClientEnrolledInCmToTrue' => [
+        'type' => 'boolean',
+        'label' => 'Is client enrolled in CM',
+        'field' => 'is_client_enrolled_in_cm',
+        'undoApi' => 'setIsClientEnrolledInCmToFalse',
+    ],
+    'setIsClientEnrolledInRmToTrue' => [
+        'type' => 'boolean',
+        'label' => 'Is client enrolled in RM',
+        'field' => 'is_client_enrolled_in_rm',
+        'undoApi' => 'setIsClientEnrolledInRmToFalse',
+    ],
+    'setIsCmCanceledThisMonthToTrue' => [
+        'type' => 'boolean',
+        'label' => 'Is CM canceled this month',
+        'field' => 'is_cm_canceled_this_month',
+        'undoApi' => 'setIsCmCanceledThisMonthToFalse',
+    ],
+    'setIsTmThisMonthToTrue' => [
+        'type' => 'boolean',
+        'label' => 'Is TM this month',
+        'field' => 'is_tm_this_month',
+        'undoApi' => 'setIsTmThisMonthToFalse',
+    ],
+    'setIsRmCanceledThisMonthToTrue' => [
+        'type' => 'boolean',
+        'label' => 'Is RM canceled this month',
+        'field' => 'is_rm_canceled_this_month',
+        'undoApi' => 'setIsRmCanceledThisMonthToFalse',
+    ],
+    'setBillingMarkedDoneToTrue' => [
+        'type' => 'boolean',
+        'label' => 'Is billing marked done',
+        'field' => 'is_billing_marked_done',
+        'undoApi' => 'setBillingMarkedDoneToFalse',
+    ],
+    'setIsRmInteractionWaivedToTrue' => [
+        'type' => 'boolean',
+        'label' => 'Is RM interaction waived',
+        'field' => 'is_rm_interaction_waived',
+        'undoApi' => 'setIsRmInteractionWaivedToFalse',
+    ],
+    'setIsRmTimeWaivedToTrue' => [
+        'type' => 'boolean',
+        'label' => 'Is RM time waived',
+        'field' => 'is_rm_time_waived',
+        'undoApi' => 'setIsRmTimeWaivedToFalse',
+    ],
+    'updateWhyNotEnrolledInCm' => [
+        'type' => 'form',
+        'label' => 'Update why not enrolled in CM',
+        'fields' => [
+            'whyNotEnrolledInCmCategory' => [
+                'label' => 'Why not enrolled in cm category',
+                'type' => 'text',
+                'column' => 'why_not_enrolled_in_cm_category',
+            ],
+            'whyNotEnrolledInCmMemo' => [
+                'label' => 'Why not enrolled in cm memo',
+                'type' => 'text',
+                'column' => 'why_not_enrolled_in_cm_memo',
+            ],
+        ],
+    ],
+    'updateWhyNotEnrolledInRm' => [
+        'type' => 'form',
+        'label' => 'Update why not enrolled in RM',
+        'fields' => [
+            'whyNotEnrolledInRmCategory' => [
+                'label' => 'Why not enrolled in rm category',
+                'type' => 'text',
+                'column' => 'why_not_enrolled_in_rm_category',
+            ],
+            'whyNotEnrolledInRmMemo' => [
+                'label' => 'Why not enrolled in rm memo',
+                'type' => 'text',
+                'column' => 'why_not_enrolled_in_rm_memo',
+            ],
+        ],
+    ],
+    'updateWhyIsCmCanceledThisMonth' => [
+        'type' => 'form',
+        'label' => 'Update why is CM canceled this month',
+        'fields' => [
+            'memo' => [
+                'label' => 'Memo',
+                'type' => 'text',
+                'column' => 'why_is_cm_canceled_this_month',
+            ],
+        ],
+    ],
+    'updateWhyIsRmCanceledThisMonth' => [
+        'type' => 'form',
+        'label' => 'Update why is RM canceled this month',
+        'fields' => [
+            'memo' => [
+                'label' => 'Memo',
+                'type' => 'text',
+                'column' => 'why_is_rm_canceled_this_month',
+            ],
+        ],
+    ],
+    'updateClaimTotalExpected' => [
+        'type' => 'form',
+        'label' => 'Update claim total expected',
+        'fields' => [
+            'claimTotalExpected' => [
+                'label' => 'Claim total expected',
+                'type' => 'text',
+                'column' => 'claim_total_expected',
+            ],
+        ],
+    ],
+    'closeClaiming' => [
+        'type' => 'boolean',
+        'label' => 'Close Claiming',
+        'field' => 'is_claiming_closed',
+        'undoApi' => 'reopenClaiming',
+    ],
+    'updateClaimSummary' => [
+        'type' => 'form',
+        'label' => 'Update claim summary',
+        'fields' => [
+            'claimSummary' => [
+                'label' => 'Claim summary',
+                'type' => 'text',
+                'column' => 'claim_summary',
+            ],
+        ],
+    ],
+    'updateClaimTotalPaid' => [
+        'type' => 'form',
+        'label' => 'Update claim total paid',
+        'fields' => [
+            'claimTotalPaid' => [
+                'label' => 'Claim Total Paid',
+                'type' => 'text',
+                'column' => 'claim_total_paid',
+            ],
+        ],
+    ],
+    'markRmSetupPerformed' => [
+        'type' => 'boolean',
+        'label' => 'Mark RM setup performed',
+        'field' => 'was_rm_setup_performed',
+        'undoApi' => 'undoMarkRmSetupPerformed',
+    ],
+    'updateClaimWaivers' => [
+        'type' => 'form',
+        'label' => 'Update claim waivers',
+        'fields' => [
+            'is99454ClaimingWaived' => [
+                'label' => 'Is 99454 claiming waived',
+                'type' => 'checkbox',
+                'column' => 'is_99454_claiming_waived',
+            ],
+            'whyClaiming99454Waived' => [
+                'label' => 'Why claiming 99454 waived',
+                'type' => 'text',
+                'column' => 'why_claiming_99454_waived',
+            ],
+            'is99457ClaimingWaived' => [
+                'label' => 'Is 99457 claiming waived',
+                'type' => 'checkbox',
+                'column' => 'is_99457_claiming_waived',
+            ],
+            'whyClaiming99457Waived' => [
+                'label' => 'Why claiming 99457 waived',
+                'type' => 'text',
+                'column' => 'why_claiming_99457_waived',
+            ],
+            'is99458ClaimingWaived' => [
+                'label' => 'Is 99458 claiming waived',
+                'type' => 'checkbox',
+                'column' => 'is_99458_claiming_waived',
+            ],
+            'whyClaiming99458Waived' => [
+                'label' => 'Why claiming 99458 waived',
+                'type' => 'text',
+                'column' => 'why_claiming_99458_waived',
+            ],
+        ],
+    ],
+];
+?>
+<style>
+    .setting-item {
+        flex-basis: 25%;
+    }
+</style>
+<div class="d-flex flex-wrap align-items-start">
+    @foreach ($moes as $apiKey => $moe)
+        <div class="setting-item">
+            @if ($moe['type'] === 'boolean')
+                <div class="mr-3">
+                    {{ $moe['label'] }}: <b>{{ $careMonth->{$moe['field']} ? 'Yes' : 'No' }}</b>
+                    <div moe class="text-left ml-2 mb-2">
+                        <a class="" href="" show start>Toggle</a>
+                        @if ($careMonth->{$moe['field']})
+                            <form url="/api/careMonth/{{ $moe['undoApi'] }}">
+                                <input type="hidden" name="uid" value="{{ $careMonth->uid }}">
+                                <p>Set <b>{{ $moe['label'] }}</b> to false?</p>
+                                <div class="mb-0">
+                                    <button class="btn btn-primary btn-sm" submit>Submit</button>
+                                    <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                                </div>
+                            </form>
+                        @else
+                            <form url="/api/careMonth/{{ $apiKey }}">
+                                <input type="hidden" name="uid" value="{{ $careMonth->uid }}">
+                                <p>Set <b>{{ $moe['label'] }}</b> to true?</p>
+                                <div class="mb-0">
+                                    <button class="btn btn-primary btn-sm" submit>Submit</button>
+                                    <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                                </div>
+                            </form>
+                        @endif
+                    </div>
+                </div>
+            @endif
+            @if ($moe['type'] === 'form')
+                <div class="mr-3">
+                    {{ $moe['label'] }}:
+                    <div moe class="text-left ml-2 mb-2">
+                        <a class="" href="" show start>Update</a>
+                        <form url="/api/careMonth/{{ $apiKey }}">
+                            <input type="hidden" name="uid" value="{{ $careMonth->uid }}">
+                            @foreach ($moe['fields'] as $fieldName => $field)
+                                @if ($field['type'] === 'text')
+                                    <div class="form-group">
+                                        <label>{{ $field['label'] }}</label>
+                                        <input type="text" name="{{ $fieldName }}" class="form-control"
+                                            value="{{ $careMonth->{$field['column']} }}" />
+                                    </div>
+                                @endif
+                                @if ($field['type'] === 'checkbox')
+                                    <div class="form-group">
+                                        <label>{{ $field['label'] }} <input type="checkbox" name="{{ $fieldName }}"
+                                                class="form-control"
+                                                value="{{ $careMonth->{$field['column']} }}" /></label>
+                                    </div>
+                                @endif
+                            @endforeach
+                            <div class="mb-0">
+                                <button class="btn btn-primary btn-sm" submit>Submit</button>
+                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                            </div>
+                        </form>
+                    </div>
+                </div>
+            @endif
+        </div>
+    @endforeach
+</div>
+<hr />
+<div class="d-flex flex-column align-items-start flwx-wrap">
+    <div class="mr-3">
+        @include('app.patient.care-month.forms.put-company-pro')
+        @if ($careMonth->companyPro)
+            @include('app.patient.care-month.forms.wipe-company-pro')
+        @endif
+    </div>
+    <div class="mr-3">
+        @include('app.patient.care-month.forms.put-company-pro-payer')
+        @if ($careMonth->companyPro)
+            @include('app.patient.care-month.forms.wipe-company-pro-payer')
+        @endif
+    </div>
+    <div class="mr-3">
+        @include('app.patient.care-month.forms.put-company-location')
+        @if ($careMonth->companyPro)
+            @include('app.patient.care-month.forms.wipe-company-location')
+        @endif
+    </div>
+</div>

+ 19 - 0
resources/views/app/patient/care-month/partials/tier-explainer.blade.php

@@ -0,0 +1,19 @@
+@if ($careMonth->tier() !== 'TIER_2')
+<div class="on-hover-show d-inline-block on-hover-opaque">
+        <i class="fa fa-info-circle text-muted"></i>
+    <div class="on-hover-content p-2 text-dark width-200px">
+        @if (!$careMonth->tier())
+            <h5 class="mb-2 font-weight-bold">Goal Qualification:</h5>
+            <p class="m-0 text-muted">Minimum of <b>7 days</b>, <b>10 mins</b> and <b>interaction</b> is required.</p>
+        @elseif($careMonth->tier() === 'TIER_1')
+            <h5 class="mb-2 font-weight-bold">Partial Qualification:</h5>
+            <p class="m-0 text-muted">Minimum of <b>16 days</b>, <b>20 mins</b> and <b>interaction</b> is required.</p>
+        @endif
+    </div>
+</div>
+@endif
+@if($careMonth->tier() === 'TIER_1')
+<span class="text-muted">(Goal <i class="fa fa-check text-success"></i>)</span>
+@elseif($careMonth->tier() === 'TIER_2')
+<span class="text-muted">(Partial <i class="fa fa-check text-success"></i>)</span>
+@endif

+ 2 - 7
resources/views/app/patient/care-months.blade.php

@@ -146,14 +146,9 @@
 
                             $minsBilled = floor($minsBilled / 60);
                         ?>
-                        <b class="{{$minsBilled >= 20 ? 'text-success' : 'text-warning-mellow'}}">
+                        <b class="{{ determineTier($careMonth) ? 'text-success' : 'text-warning-mellow'}}">
                             {{$minsBilled}}
-                            @if($minsBilled < 20)
-                                <i class="fa fa-exclamation-triangle"></i>
-                            @else
-                                <i class="fa fa-check"></i>
-                            @endif
-                            <span class="ml-1 text-secondary text-sm font-weight-normal">(20 needed)</span>
+                            @include('app.patient.care-month.partials.tier-explainer', ['careMonth' => $careMonth])
                         </b>
                     </td>
                     <td>

+ 4 - 9
resources/views/app/patient/partials/caremonth-summary.blade.php

@@ -29,16 +29,11 @@
 
     <div class="mt-2">
         <span class="font-weight-bold text-secondary">Days with meas.:</span>
-        <b class="{{$careMonth->number_of_days_with_remote_measurements >= 16 ? 'text-success' : 'text-warning-mellow'}}">
+        <b class="{{determineTier($careMonth) ? 'text-success' : 'text-warning-mellow'}}">
             {{$careMonth->number_of_days_with_remote_measurements}}
-            @if($careMonth->number_of_days_with_remote_measurements >= 16)
-                <i class="fa fa-check"></i>
-            @else
-                <i class="fa fa-exclamation-triangle"></i>
-            @endif
-            <span class="ml-1 text-secondary text-sm font-weight-normal">(16 needed)</span>
+            @include('app.patient.care-month.partials.tier-explainer', ['careMonth' => $careMonth])
         </b>
-        @if($careMonth->number_of_days_with_remote_measurements < 16)
+        @if(!determineTier($careMonth))
             <div moe relative class="ml-2">
                 <a href="#" start show class="text-sm">SMS Patient</a>
                 <form url="/api/clientSms/createOutgoing" right="" class="mcp-theme-1" noreload="" style="display: none;">
@@ -61,7 +56,7 @@
     </div>
     @if($careMonth->showMeasurementDaysWarning())
         <div class="alert alert-warning p-2 mt-1">
-            Need <b>{{16 - $careMonth->number_of_days_with_remote_measurements}} more days</b> with measurements before RM becomes billable.
+            Need <b>{{7 - $careMonth->number_of_days_with_remote_measurements}} more days</b> with measurements before RM becomes billable.
         </div>
     @endif
 

+ 79 - 76
resources/views/app/practice-management/remote-monitoring-row-markup-by-pro-type.blade.php

@@ -5,7 +5,10 @@
 @elseif($mode === 'rmm')
     <?php $strategy = $pro->rme_payment_strategy; ?>
 @endif
-<tr data-client-uid="{{$iPatient->client_uid}}" data-care-month-uid="{{$iPatient->care_month_uid}}">
+@php
+  $careMonth = \App\Models\CareMonth::where('uid', $iPatient->care_month_uid)->first();
+@endphp
+<tr class="{{($careMonth->tier() === 'TIER_1' && !$careMonth->mcpRmGenericBill) ? 'bg-warning-mellow' : (($careMonth->tier() == 'TIER_2' && !$careMonth->mcpRmGenericBill) ? 'bg-success-mellow' : '')}}" data-client-uid="{{$iPatient->client_uid}}" data-care-month-uid="{{$iPatient->care_month_uid}}">
     <td class="pl-2">
         <a href="/patients/view/{{ $iPatient->client_uid }}/care-months/view/{{$iPatient->care_month_uid}}" class="text-nowrap"
            native target="_blank"
@@ -38,7 +41,7 @@
             @endif
         </div>
     </td>
-    
+
     <td>
         <div class="d-flex align-items-baseline">
             <i class="mr-1 text-sm fa {{$lastVisitWithinDays ? 'fa-check text-success' : 'fa-exclamation-triangle text-danger on-hover-opaque'}}"></i>
@@ -47,70 +50,68 @@
     </td>
 
     @if($mode === 'mcp' || $mode === 'rmm')
-        @if($strategy === 'X16_DAYS_20_MINS_ON_OWN_MCP_COM_DURING_CM')
-            <td>
-                <div class="d-flex align-items-baseline">
-                    <i class="mr-1 text-sm fa {{$iPatient->has_mcp_interacted_with_client_about_rm ? 'fa-check text-success' : 'fa-exclamation-triangle text-danger on-hover-opaque'}}"></i>
-                    <span class="sort-data">{{$iPatient->has_mcp_interacted_with_client_about_rm ? 'Yes' : 'No'}}</span>
-                    @if(!request()->input('not-enrolled'))
-                        @if($mode === 'mcp')
-                            <div moe large relative class="ml-2">
-                                <a start show class="py-0 mb-3 text-sm">Entry</a>
-                                <form url="/api/careMonthEntry/createForRm" right hook="refresh-rpm-row-{{$trIndex}}">
-                                    <input type="hidden" name="careMonthUid" value="{{ $iPatient->care_month_uid }}">
-                                    <input type="hidden" name="proUid" value="{{ $pro->uid }}">
-                                    <div class="mb-2">
-                                        <div class="row">
-                                            <div class="col-6 pr-0">
-                                                <?php
-                                                $sD = strtotime($rcmStartDate);
-                                                $y = date('Y', $sD);
-                                                $m0 = date('m', $sD);
-                                                $d = date('t', $sD);
-                                                $defaultED = $sD >= strtotime(date('Y-m-d')) ? date('Y-m-d') : $rcmStartDate;
-                                                ?>
-                                                <label class="text-sm text-secondary mb-1">Effective Date</label>
-                                                <input autofocus type="date" min="{{ date($y . '-' . $m0 . '-01') }}" max="{{ date($y . '-' . $m0 . '-' . $d) }}"
-                                                       value="{{$defaultED}}"
-                                                       class="form-control form-control-sm w-100" name="effectiveDate"
-                                                       placeholder="Effective Date" required>
-                                            </div>
-                                            <div class="col-6">
-                                                <label class="text-sm text-secondary mb-1">Seconds</label>
-                                                <input type="number" min="75" max="300" class="form-control form-control-sm w-100 cm-time-value" name="timeInSeconds"
-                                                       value="75" placeholder="Time (secs.)" required>
-                                            </div>
-                                        </div>
-                                    </div>
-                                    <div class="mb-2 border border-info p-2 mt-2 bg-light">
-                                        <span>I have had interactive communication with <b>{{$iPatient->client_name}}</b>.</span>
-                                        <div class="d-flex border-top mt-2">
-                                            <label class="mt-2 mb-0 d-inline-flex align-items-center mr-3">
-                                                <input type="radio" class="mr-2" name="didProInteractWithClientAboutRm" value="true" required>
-                                                <span>Yes</span>
-                                            </label>
-                                            <label class="mt-2 mb-0 d-inline-flex align-items-center">
-                                                <input type="radio" class="mr-2" name="didProInteractWithClientAboutRm" value="false" required>
-                                                <span>No</span>
-                                            </label>
-                                        </div>
-                                    </div>
-                                    <div class="mb-2">
-                                        <label class="text-sm text-secondary mb-1">Memo</label>
-                                        <textarea class="form-control form-control-sm w-100" name="contentText"
-                                                  required>Interacted with the patient</textarea>
-                                    </div>
-                                    <div class="d-flex align-items-center">
-                                        <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                                        <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                    </div>
-                                </form>
-                            </div>
-                        @endif
-                    @endif
+        <td>
+          <div class="d-flex align-items-baseline">
+            <i class="mr-1 text-sm fa {{$iPatient->has_mcp_interacted_with_client_about_rm ? 'fa-check text-success' : 'fa-exclamation-triangle text-danger on-hover-opaque'}}"></i>
+            <span class="sort-data">{{$iPatient->has_mcp_interacted_with_client_about_rm ? 'Yes' : 'No'}}</span>
+            @if(!request()->input('not-enrolled'))
+            @if($mode === 'mcp')
+            <div moe large relative class="ml-2">
+              <a start show class="py-0 mb-3 text-sm">Entry</a>
+              <form url="/api/careMonthEntry/createForRm" right hook="refresh-rpm-row-{{$trIndex}}">
+                <input type="hidden" name="careMonthUid" value="{{ $iPatient->care_month_uid }}">
+                <input type="hidden" name="proUid" value="{{ $pro->uid }}">
+                <div class="mb-2">
+                  <div class="row">
+                    <div class="col-6 pr-0">
+                      <?php
+                      $sD = strtotime($rcmStartDate);
+                      $y = date('Y', $sD);
+                      $m0 = date('m', $sD);
+                      $d = date('t', $sD);
+                      $defaultED = $sD >= strtotime(date('Y-m-d')) ? date('Y-m-d') : $rcmStartDate;
+                      ?>
+                      <label class="text-sm text-secondary mb-1">Effective Date</label>
+                      <input autofocus type="date" min="{{ date($y . '-' . $m0 . '-01') }}" max="{{ date($y . '-' . $m0 . '-' . $d) }}"
+                      value="{{$defaultED}}"
+                      class="form-control form-control-sm w-100" name="effectiveDate"
+                      placeholder="Effective Date" required>
+                    </div>
+                    <div class="col-6">
+                      <label class="text-sm text-secondary mb-1">Seconds</label>
+                      <input type="number" min="75" max="300" class="form-control form-control-sm w-100 cm-time-value" name="timeInSeconds"
+                      value="75" placeholder="Time (secs.)" required>
+                    </div>
+                  </div>
                 </div>
-            </td>
-        @endif
+                <div class="mb-2 border border-info p-2 mt-2 bg-light">
+                  <span>I have had interactive communication with <b>{{$iPatient->client_name}}</b>.</span>
+                  <div class="d-flex border-top mt-2">
+                    <label class="mt-2 mb-0 d-inline-flex align-items-center mr-3">
+                      <input type="radio" class="mr-2" name="didProInteractWithClientAboutRm" value="true" required>
+                      <span>Yes</span>
+                    </label>
+                    <label class="mt-2 mb-0 d-inline-flex align-items-center">
+                      <input type="radio" class="mr-2" name="didProInteractWithClientAboutRm" value="false" required>
+                      <span>No</span>
+                    </label>
+                  </div>
+                </div>
+                <div class="mb-2">
+                  <label class="text-sm text-secondary mb-1">Memo</label>
+                  <textarea class="form-control form-control-sm w-100" name="contentText"
+                  required>Interacted with the patient</textarea>
+                </div>
+                <div class="d-flex align-items-center">
+                  <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
+                  <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
+                </div>
+              </form>
+            </div>
+            @endif
+            @endif
+          </div>
+        </td>
         <td>
             <div class="d-flex align-items-baseline">
                 <i class="mr-1 text-sm fa {{$iPatient->number_of_days_with_remote_measurements >= 16 ? 'fa-check text-success' : 'fa-exclamation-triangle text-danger on-hover-opaque'}}"></i>
@@ -139,7 +140,7 @@
                 @endif--}}
             </div>
         </td>
-    @elseif($mode === 'rme')
+    @elseif($mode === 'rme' && false)
         <td>
             <div class="d-flex align-items-baseline">
                 <i class="mr-1 text-sm fa {{$iPatient->number_of_days_with_remote_measurements >= 16 ? 'fa-check text-success' : 'fa-exclamation-triangle text-danger on-hover-opaque'}}"></i>
@@ -176,13 +177,14 @@
                 <span class="text-nowrap">{{round($iPatient->rm_total_time_in_seconds_by_mcp / 60)}}m {{round($iPatient->rm_total_time_in_seconds_by_mcp % 60)}}s</span>
                 <span class="sort-data d-none">{{$iPatient->rm_total_time_in_seconds_by_mcp}}</span>
             </div>
-        @elseif($mode === 'rmm')
+
+        @elseif($mode === 'rmm' && false)
             <div class="d-flex align-items-baseline">
                 <i class="mr-1 text-sm fa {{$iPatient->rm_total_time_in_seconds_by_rmm_pro >= 1200 ? 'fa-check text-success' : 'fa-exclamation-triangle text-danger on-hover-opaque'}}"></i>
                 <span class="text-nowrap">{{round($iPatient->rm_total_time_in_seconds_by_rmm_pro / 60)}}m {{round($iPatient->rm_total_time_in_seconds_by_rmm_pro % 60)}}s</span>
                 <span class="sort-data d-none">{{$iPatient->rm_total_time_in_seconds_by_rmm_pro}}</span>
             </div>
-        @elseif($mode === 'rmm')
+        @elseif($mode === 'rmm' && false)
             <div class="d-flex align-items-baseline">
                 <i class="mr-1 text-sm fa {{$iPatient->rm_total_time_in_seconds_by_rme_pro >= 1200 ? 'fa-check text-success' : 'fa-exclamation-triangle text-danger on-hover-opaque'}}"></i>
                 <span class="text-nowrap">{{round($iPatient->rm_total_time_in_seconds_by_rme_pro / 60)}}m {{round($iPatient->rm_total_time_in_seconds_by_rme_pro % 60)}}s</span>
@@ -193,10 +195,7 @@
     @if(!request()->input('not-enrolled'))
     <td>
         @if($mode === 'mcp')
-            @if($lastVisitWithinDays && $iPatient->has_mcp_interacted_with_client_about_rm && $iPatient->number_of_days_with_remote_measurements >= 16 && $iPatient->rm_total_time_in_seconds_by_mcp >= 1200)
-                @php
-                    $careMonth = \App\Models\CareMonth::where('uid', $iPatient->care_month_uid)->first();
-                @endphp
+            @if($lastVisitWithinDays && $careMonth->tier())
                 @if($careMonth->mcpRmGenericBill == null )
 
                     @php
@@ -204,7 +203,7 @@
                     @endphp
 
                     @if(!$rpmBillability['billable'])
-                        <div class="alert alert-info m-0">{{$rpmBillability['reason']}}</div>
+                        <div class="alert alert-info m-0 p-1">{{$rpmBillability['reason']}}</div>
                     @else
                         <div moe relative class="d-inline-block">
                             <a class="font-weight-normal" href="" show start>Bill ${{$rpmBillability['amount']}}</a>
@@ -217,6 +216,8 @@
                                 </div>
                             </form>
                         </div>
+                        <span class="mx-1">|</span>
+                        @include('app.patient.care-month.partials.tier-explainer', ['careMonth' => $careMonth])
                     @endif
                 @else
                     <div class="font-weight-bold">
@@ -243,8 +244,10 @@
                 <span class="text-danger font-weight-normal">
                     No
                 </span>
+                @include('app.patient.care-month.partials.tier-explainer', ['careMonth' => $careMonth])
             @endif
-        @elseif($mode === 'rmm')
+        @endif
+        @if($mode === 'rmm' && false)
             @if($lastVisitWithinDays && $iPatient->has_mcp_interacted_with_client_about_rm && $iPatient->number_of_days_with_remote_measurements >= 16 && $iPatient->rm_total_time_in_seconds_by_rmm_pro >= 1200)
                 <span class="text-success font-weight-bold">
                     <i class="fa fa-check"></i>
@@ -289,7 +292,7 @@
                     No
                 </span>
             @endif
-        @elseif($mode === 'rme')
+        @elseif($mode === 'rme' && false)
             @if($lastVisitWithinDays && $iPatient->number_of_days_with_remote_measurements >= 16)
                 <span class="text-success font-weight-bold">
                     <i class="fa fa-check"></i>
@@ -303,4 +306,4 @@
         @endif
     </td>
     @endif
-</tr>
+</tr>

+ 10 - 1
resources/views/app/practice-management/remote-monitoring-row-markup-for-admin.blade.php

@@ -1,5 +1,5 @@
 <?php $lastVisitWithinDays = !is_null($iPatient->days_between_most_recent_mcp_note_date_and_end_of_care_month) && $iPatient->days_between_most_recent_mcp_note_date_and_end_of_care_month <= 120; ?>
-<tr data-client-uid="{{$iPatient->client_uid}}" data-care-month-uid="{{$iPatient->care_month_uid}}">
+<tr class="{{($careMonth->tier() === 'TIER_1' && !$careMonth->mcpRmGenericBill) ? 'bg-warning-mellow' : (($careMonth->tier() == 'TIER_2' && !$careMonth->mcpRmGenericBill) ? 'bg-success-mellow' : '')}}" data-client-uid="{{$iPatient->client_uid}}" data-care-month-uid="{{$iPatient->care_month_uid}}">
     <td>{{ $trIndex + 1 }}</td>
     <td>{{friendly_month_short($iPatient->start_date)}}</td>
     <td>
@@ -195,4 +195,13 @@
             @endif
         @endif
     </td>
+    <td>
+      @if($careMonth->tier() == 'TIER_1')
+        1
+      @elseif($careMonth->tier() == 'TIER_2')
+        2
+      @else
+         -
+      @endif
+    </td>
 </tr>

+ 2 - 4
resources/views/app/practice-management/rpm-matrix-by-pro-type-table.blade.php

@@ -28,9 +28,7 @@
                 <th class="border-0 text-secondary">Latest Wt</th>
                 <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => 'Days Since Last Visit', 'key' => 'days_between_most_recent_mcp_note_date_and_end_of_care_month'])</th>
                 @if($mode === 'mcp' || $mode === 'rmm')
-                    @if($strategy === 'X16_DAYS_20_MINS_ON_OWN_MCP_COM_DURING_CM')
-                        <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => 'Interacted?', 'key' => 'has_mcp_interacted_with_client_about_rm'])</th>
-                    @endif
+                    <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => 'Interacted?', 'key' => 'has_mcp_interacted_with_client_about_rm'])</th>
                     <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => '#Meas. Days', 'key' => 'number_of_days_with_remote_measurements'])</th>
                     @if($mode === 'mcp')
                         <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => '#MCP Mins.', 'key' => 'rm_total_time_in_seconds_by_mcp'])</th>
@@ -77,4 +75,4 @@
             </tbody>
         </table>
     </div>
-</div>
+</div>

+ 19 - 14
resources/views/app/practice-management/rpm-matrix-by-pro-type.blade.php

@@ -6,10 +6,10 @@
         function strategy_display($_strategy, $_mode)
         {
             switch ($_strategy) {
+                case 'X7_DAYS_10_MINS_ON_OWN_MCP_COM_DURING_CM':
+                    return '7 meas. days + 10 mins + inter. done during the caremonth';
                 case 'X16_DAYS_20_MINS_ON_OWN_MCP_COM_DURING_CM':
-                    return '16 meas. days + 20 mins + comm. done during the caremonth';
-                case 'X16_DAYS':
-                    return '16 meas. days';
+                    return '16 meas. days + 20 mins + inter. done during the caremonth';
                 default:
                     return '-';
             }
@@ -67,17 +67,22 @@
                            title="RPM Work Matrix">
                             RPM Work Matrix
                         </a>--}}
-                        <span class="ml-3 mr-1 text-secondary">Strategy:</span>
-                        @if($mode === 'mcp')
-                            {{strategy_display($pro->mcp_rpm_payment_strategy, $mode)}}
-                            <?php $strategy = $pro->mcp_rpm_payment_strategy; ?>
-                        @elseif($mode === 'rmm')
-                            {{strategy_display($pro->rme_payment_strategy, $mode)}}
-                            <?php $strategy = $pro->rmm_payment_strategy; ?>
-                        @elseif($mode === 'rmm')
-                            {{strategy_display($pro->rmm_payment_strategy, $mode)}}
-                            <?php $strategy = $pro->rme_payment_strategy; ?>
-                        @endif
+                        <div class="">
+                          <div class="">
+                            <span class="ml-3 mr-1 text-secondary">Goal:</span>
+                            @if($mode === 'mcp')
+                            {{strategy_display($pro->mcp_rpm_payment_strategy_tier_one, $mode)}} <span class="text-muted">(${{$pro->mcp_rpm_payment_amount_tier_one ?? '-'}} per patient)</span>
+                            <?php $strategy = $pro->mcp_rpm_payment_strategy_tier_one; ?>
+                            @endif
+                          </div>
+                          <div class="">
+                            <span class="ml-3 mr-1 text-secondary">Partial Goal:</span>
+                            @if($mode === 'mcp')
+                            {{strategy_display($pro->mcp_rpm_payment_strategy_tier_two, $mode)}} <span class="text-muted">(${{$pro->mcp_rpm_payment_amount_tier_two ?? '-'}} per patient)</span>
+                            <?php $strategy = $pro->mcp_rpm_payment_strategy_tier_two; ?>
+                            @endif
+                          </div>
+                        </div>
 
                         <div class="ml-auto d-inline-flex flex-nowrap align-items-baseline">
                             <span class="mr-2">Month</span>

+ 6 - 2
resources/views/app/practice-management/rpm-matrix-for-admin-table.blade.php

@@ -41,16 +41,20 @@
                 <th class="border-0">@include('app.practice-management._sort_header_multi_v2', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'Done<br>457', 'key' => 'is_99457_claimed'])</th>
                 <th class="border-0">@include('app.practice-management._sort_header_multi_v2', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'Can<br>458', 'key' => 'is_99458_claimable'])</th>
                 <th class="border-0">@include('app.practice-management._sort_header_multi_v2', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'Done<br>458', 'key' => 'is_99458_claimed'])</th>
+                <th class="border-0 text-secondary">Tier</th>
             </tr>
             </thead>
             <tbody>
             <?php $trIndex = 0; ?>
             @foreach ($patients as $iPatient)
-                @include('app.practice-management.remote-monitoring-row-markup-for-admin')
+                @php
+                $careMonth = \App\Models\CareMonth::where('uid', $iPatient->care_month_uid)->first();
+                @endphp
+                @include('app.practice-management.remote-monitoring-row-markup-for-admin', ['careMonth'=> $careMonth])
                 <?php $trIndex++; ?>
             @endforeach
             </tbody>
         </table>
     </div>
-  
+
 </div>

+ 11 - 1
resources/views/app/practice-management/rpm-matrix-for-admin.blade.php

@@ -525,7 +525,7 @@
             <?php $rc = request()->input('rc') ? request()->input('rc') : 1; ?>
 
             <div class="card-body p-0">
-                <div class="d-flex align-items-baseline p-2 border-bottom">
+                <div class="d-flex align-items-center p-2 border-bottom">
                     <div class="d-inline-flex align-items-baseline" tab-links="">
                         <a class="{{ !request()->input('not-enrolled') ? 'tab-link-active' : '' }} text-dark c-pointer"
                            onclick="$('[name=not-enrolled]').val(''); return fastLoad('{{route('practice-management.rpm-matrix-admin')}}?' + $('#rpm-matrix-filter').serialize());"
@@ -534,6 +534,16 @@
                            onclick="$('[name=not-enrolled]').val('1'); return fastLoad('{{route('practice-management.rpm-matrix-admin')}}?' + $('#rpm-matrix-filter').serialize());"
                            tab-link="no-rpm">Not Enrolled in RPM</a>
                     </div>
+                    <div class="ml-3">
+                      <div class="d-flex align-items-baseline">
+                        <div class="py-1 px-2 bg-warning-mellow border mr-1"></div>
+                        <span>- Tier 1 qualified / not billed.</span>
+                      </div>
+                      <div class="d-flex align-items-baseline">
+                        <div class="py-1 px-2 bg-success-mellow border mr-1"></div>
+                        <span>- Tier 2 qualified / not billed.</span>
+                      </div>
+                    </div>
                     @if($paginator->total() || true)
                         <div class="d-inline-flex align-items-baseline ml-auto mb-0-pagination">
                             <div class="mr-2"><b>{{$paginator->firstItem()}}</b> to <b>{{$paginator->lastItem()}}</b> (page {{$paginator->currentPage()}}) of <b>{{$paginator->total()}}</b> care months</div>