Pārlūkot izejas kodu

RPM matrix - UI/logic updates

Vijayakrishnan 3 gadi atpakaļ
vecāks
revīzija
b152e2e359

+ 26 - 2
app/Http/Controllers/PracticeManagementController.php

@@ -1335,6 +1335,16 @@ WHERE care_month.uid = '{$careMonthUid}' AND client.uid = '{$clientUid}'
         $sortDir = $request->input('sort_dir') ?: 'ASC';
         $orderBy = "ORDER BY $sortBy $sortDir NULLS LAST";
 
+        // special case of if-bill-exists
+        if($sortBy === 'mcp_rm_generic_bill_id' || $sortBy === 'rmm_rm_generic_bill_id') {
+            if($sortDir === 'ASC') {
+                $orderBy = "ORDER BY $sortBy $sortDir NULLS FIRST";
+            }
+            else {
+                $orderBy = "ORDER BY $sortBy $sortDir NULLS LAST";
+            }
+        }
+
         // filters from the UI
         if(trim($request->input('f_name'))) {
             $v = trim($request->input('f_name'));
@@ -1382,6 +1392,18 @@ WHERE care_month.uid = '{$careMonthUid}' AND client.uid = '{$clientUid}'
             }
         }
 
+        if($mode === 'mcp' || $mode === 'rmm') {
+            if(trim($request->input('f_billable'))) {
+                $v = trim($request->input('f_billable'));
+                if($v === 'yes') {
+                    $conditions[] = "(care_month.{$mode}_rm_generic_bill_id IS NOT NULL)";
+                }
+                elseif($v === 'no') {
+                    $conditions[] = "(care_month.{$mode}_rm_generic_bill_id IS NULL)";
+                }
+            }
+        }
+
         if(trim($request->input('f_md_op')) && trim($request->input('f_md')) !== '') {
             $o = trim($request->input('f_md_op'));
             $v = trim($request->input('f_md'));
@@ -1417,7 +1439,8 @@ WHERE care_month.uid = '{$careMonthUid}' AND client.uid = '{$clientUid}'
                 $genericBillIdColumns = "care_month.mcp_rm_generic_bill_id,
                    bill.uid as mcp_rm_generic_bill_uid,
                    bill.generic_pro_id as mcp_rm_generic_bill_generic_pro_id,
-                   bill.generic_pro_expected_payment_amount as mcp_rm_generic_bill_expected_payment_amount";
+                   bill.generic_pro_expected_payment_amount as mcp_rm_generic_bill_expected_payment_amount,
+                   bill.is_signed_by_generic_pro as mcp_rm_generic_bill_signed";
                 $genericBillJoinClause = 'left join bill on care_month.mcp_rm_generic_bill_id = bill.id';
                 break;
             case 'rmm':
@@ -1425,7 +1448,8 @@ WHERE care_month.uid = '{$careMonthUid}' AND client.uid = '{$clientUid}'
                 $genericBillIdColumns = "care_month.rmm_rm_generic_bill_id,
                    bill.uid as rmm_rm_generic_bill_uid,
                    bill.generic_pro_id as rmm_rm_generic_bill_generic_pro_id,
-                   bill.generic_pro_expected_payment_amount as rmm_rm_generic_bill_expected_payment_amount";
+                   bill.generic_pro_expected_payment_amount as rmm_rm_generic_bill_expected_payment_amount,
+                   bill.is_signed_by_generic_pro as rmm_rm_generic_bill_signed";
                 $genericBillJoinClause = 'left join bill on care_month.rmm_rm_generic_bill_id = bill.id';
                 break;
             case 'rme':

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

@@ -215,13 +215,13 @@
     </td>
     <td>
         @if($mode === 'mcp')
-            @if($lastVisitWithin90Days && $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)
+            @if($iPatient->mcp_rm_generic_bill_id)
                 <span class="text-success font-weight-bold">
                     <i class="fa fa-check"></i>
                     Yes
                 </span>
-                @if($iPatient->mcp_rm_generic_bill_id)
-                    (${{friendly_money($iPatient->mcp_rm_generic_bill_expected_payment_amount)}})
+                (${{friendly_money($iPatient->mcp_rm_generic_bill_expected_payment_amount)}})
+                @if($iPatient->mcp_rm_generic_bill_signed)
                     <div moe relative
                          class="d-inline-block {{ $iPatient->mcp_rm_generic_bill_generic_pro_id !== $pro->id ? 'moe-disabled' : '' }}"
                          title="{{ $iPatient->mcp_rm_generic_bill_generic_pro_id !== $pro->id ? 'Only the bill\'s pro can sign' : '' }}">
@@ -235,6 +235,8 @@
                             </div>
                         </form>
                     </div>
+                @else
+                    <span class="text-success">Signed</span>
                 @endif
             @else
                 <span class="text-danger font-weight-normal">
@@ -242,13 +244,13 @@
                 </span>
             @endif
         @elseif($mode === 'rmm')
-            @if($lastVisitWithin90Days && $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)
+            @if($iPatient->rmm_rm_generic_bill_id)
                 <span class="text-success font-weight-bold">
                     <i class="fa fa-check"></i>
                     Yes
                 </span>
-                @if($iPatient->rmm_rm_generic_bill_id)
-                    (${{friendly_money($iPatient->rmm_rm_generic_bill_expected_payment_amount)}})
+                (${{friendly_money($iPatient->rmm_rm_generic_bill_expected_payment_amount)}})
+                @if($iPatient->rmm_rm_generic_bill_signed)
                     <div moe relative
                          class="d-inline-block {{ $iPatient->rmm_rm_generic_bill_generic_pro_id !== $pro->id ? 'moe-disabled' : '' }}"
                          title="{{ $iPatient->rmm_rm_generic_bill_generic_pro_id !== $pro->id ? 'Only the bill\'s pro can sign' : '' }}">
@@ -262,6 +264,8 @@
                             </div>
                         </form>
                     </div>
+                @else
+                    <span class="text-success">Signed</span>
                 @endif
             @else
                 <span class="text-danger font-weight-normal">

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

@@ -229,6 +229,18 @@
                             </div>
                         </div>
 
+                        @if($mode === 'mcp' || $mode === 'rmm')
+                        <div>
+                            <label class="mb-0 text-sm {{request()->input('f_billable') && request()->input('f_billable') !== 'any' ? 'text-info' : 'text-secondary'}}">Billable</label>
+                            <select name="f_billable"
+                                    class="mr-2 form-control form-control-sm min-width-unset width-70px pl-0">
+                                <option {{request()->input('f_billable') === 'all' ? 'selected' : ''}} value="any">All</option>
+                                <option {{request()->input('f_billable') === 'yes' ? 'selected' : ''}} value="yes">Yes</option>
+                                <option {{request()->input('f_billable') === 'no' ? 'selected' : ''}} value="no">No</option>
+                            </select>
+                        </div>
+                        @endif
+
                         <div>
                             <label class="mb-0 text-sm text-secondary">&nbsp;</label>
                             <div class="d-flex align-items-start">
@@ -245,10 +257,10 @@
 
             <div class="card-body p-0">
                 <div class="d-flex align-items-stretch m-0 h-100">
-                    <div class="overflow-auto border-right h-100">
+                    <div class="overflow-auto border-right h-100 rpm-matrix-left-column">
                         @include('app.stat-tree.summary', ['slug' => 'rm-tree-' . $mode, 'showForPro' => $pro, 'noDropVisualize' => true, 'stParams' => ['start_date' => $rcmStartDate]])
                     </div>
-                    <div class="flex-grow-1 px-0 overflow-auto h-100">
+                    <div class="flex-grow-1 px-0 overflow-auto h-100 rpm-matrix-right-column">
                         <?php $trIndex = 0; ?>
                         @foreach ($patients as $iPatient)
                             <script>
@@ -303,8 +315,15 @@
                                     <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>
                                     <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => '#RME Mins.', 'key' => 'rm_total_time_in_seconds_by_rme_pro'])</th>
                                 @endif
-                                <th class="border-0 text-secondary"
-                                ">Billable</th>
+                                @if(!request()->input('f_billable') || request()->input('f_billable') === 'all')
+                                    @if($mode === 'mcp')
+                                        <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => 'Billable', 'key' => 'mcp_rm_generic_bill_id'])</th>
+                                    @elseif($mode === 'rmm')
+                                        <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => 'Billable', 'key' => 'rmm_rm_generic_bill_id'])</th>
+                                    @endif
+                                @else
+                                    <th class="border-0 text-secondary">Billable</th>
+                                @endif
                             </tr>
                             </thead>
                             <tbody>
@@ -415,6 +434,10 @@
                     });
 
                 initMoes();
+
+                // hack - init split at 22%
+                localStorage['v-split-rounded-rpm-matrix-split'] = 22;
+                initVSplitter('rpm-matrix-split', $('.rpm-matrix-left-column'), $('.rpm-matrix-right-column'), null, {marginLeft: '-3px', width: '5px', height: '100%', marginTop: 0, borderRadius: 0});
             }
 
             addMCInitializer('practice-remote-monitoring', init, '#practice-remote-monitoring');