Browse Source

Merge branch 'master' of rav.triplestart.com:jmudaka/stagfe2

= 3 years ago
parent
commit
1be5c3643e
32 changed files with 482 additions and 189 deletions
  1. 73 1
      app/Http/Controllers/PracticeManagementController.php
  2. 1 1
      config/app.php
  3. 164 1
      js-dev/stag-popup.js
  4. 23 0
      public/css/style.css
  5. 1 1
      resources/views/app/patient/canvas-sections/vitals/form.blade.php
  6. 1 1
      resources/views/app/patient/canvas-sections/vitals/summary.php
  7. 3 1
      resources/views/app/patient/care-month/_create-claim.blade.php
  8. 1 1
      resources/views/app/patient/note/dashboard-bu-b4-pure-soap.blade.php
  9. 1 1
      resources/views/app/patient/note/dashboard-old.blade.php
  10. 1 3
      resources/views/app/patient/note/dashboard.blade.php
  11. 2 2
      resources/views/app/patient/note/rhs-sidebar-nrc.blade.php
  12. 2 2
      resources/views/app/patient/note/rhs-sidebar.blade.php
  13. 9 41
      resources/views/app/patient/notes.blade.php
  14. 1 1
      resources/views/app/patient/page-sections/vitals/form.blade.php
  15. 1 1
      resources/views/app/patient/page-sections/vitals/summary.php
  16. 1 1
      resources/views/app/patient/partials/latest-vitals.blade.php
  17. 1 1
      resources/views/app/patient/segment-templates/mc_vitals/edit.blade.php
  18. 1 1
      resources/views/app/patient/segment-templates/mc_vitals/summary.blade.php
  19. 3 3
      resources/views/app/patient/segment-templates/omega_vitals/edit.blade.php
  20. 1 1
      resources/views/app/patient/segment-templates/omega_vitals/summary.blade.php
  21. 3 3
      resources/views/app/patient/segment-templates/psych_vitals/edit.blade.php
  22. 1 1
      resources/views/app/patient/segment-templates/psych_vitals/summary.blade.php
  23. 3 3
      resources/views/app/patient/segment-templates/sigma_vitals/edit.blade.php
  24. 1 1
      resources/views/app/patient/segment-templates/sigma_vitals/summary.blade.php
  25. 3 3
      resources/views/app/patient/segment-templates/vitals/edit.blade.php
  26. 1 1
      resources/views/app/patient/segment-templates/vitals/summary.blade.php
  27. 1 1
      resources/views/app/patient/vitals-settings.blade.php
  28. 16 2
      resources/views/app/practice-management/pro-financials.blade.php
  29. 29 29
      resources/views/app/practice-management/remote-monitoring-row-markup-for-admin.blade.php
  30. 65 0
      resources/views/app/practice-management/rpm-matrix-for-admin-table.blade.php
  31. 67 79
      resources/views/app/practice-management/rpm-matrix-for-admin.blade.php
  32. 1 1
      resources/views/layouts/template.blade.php

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

@@ -1001,6 +1001,24 @@ SELECT effective_date, count(*), sum(number_of_units) as units FROM bill WHERE c
         } else {
             $targetPro = $performerPro;
         }
+
+        // calculate totals (without pagination)
+        $fPros = Pro::whereNotNull('balance')->where('balance', '>', 0)->get();
+        $grandTotal = 0;
+        $companies = [];
+        foreach ($fPros as $row) {
+            foreach($row->companyPros as $companyPro) {
+                if($companyPro->balance) {
+                    if(!isset($companies[$companyPro->company->name])) {
+                        $companies[$companyPro->company->name] = 0;
+                    }
+                    $companies[$companyPro->company->name] += $companyPro->balance;
+                    $grandTotal += $companyPro->balance;
+                }
+            }
+        }
+        arsort($companies);
+
         $fPros = Pro::whereNotNull('balance');
         if($targetPro) {
             $fPros = $fPros->where('uid', $targetPro->uid);
@@ -1010,7 +1028,7 @@ SELECT effective_date, count(*), sum(number_of_units) as units FROM bill WHERE c
             ->orderBy('name_first')
             ->orderBy('name_last')
             ->paginate();
-        return view('app.practice-management.pro-financials', compact('fPros', 'targetPro'));
+        return view('app.practice-management.pro-financials', compact('fPros', 'targetPro', 'grandTotal', 'companies'));
     }
 
     public function hcpBillMatrix(Request $request, $proUid = null)
@@ -1654,11 +1672,41 @@ WHERE
             }
         }
 
+        // default sort
+        if(!$request->input('sort_by')) {
+            $orderBy = "ORDER BY care_month.number_of_days_with_remote_measurements DESC NULLS LAST, care_month.rm_total_time_in_seconds_by_mcp DESC NULLS LAST, care_month.rm_total_time_in_seconds_by_rmm_pro DESC NULLS LAST";
+        }
+        else {
+            $sortBy = $request->input('sort_by');
+            $sortDir = $request->input('sort_dir');
+            if($sortBy && $sortDir) {
+                if(!in_array($sortBy, ['number_of_days_with_remote_measurements', 'rm_total_time_in_seconds_by_mcp', 'rm_total_time_in_seconds_by_rmm_pro'])) {
+                    $orderBy = "ORDER BY $sortBy $sortDir NULLS LAST, care_month.number_of_days_with_remote_measurements DESC NULLS LAST, care_month.rm_total_time_in_seconds_by_mcp DESC NULLS LAST, care_month.rm_total_time_in_seconds_by_rmm_pro DESC NULLS LAST";
+                }
+                else {
+                    $orderBy = "ORDER BY $sortBy $sortDir NULLS LAST";
+                }
+            }
+        }
+
         // filters from the UI
+        if(trim($request->input('f_ces'))) {
+            $v = trim($request->input('f_ces'));
+            if($v === 'ACTIVE') {
+                $conditions[] = "(client.client_engagement_status_category IS NULL OR client.client_engagement_status_category = '{$v}')";
+            }
+            else {
+                $conditions[] = "(client.client_engagement_status_category = '{$v}')";
+            }
+        }
         if(trim($request->input('f_name'))) {
             $v = trim($request->input('f_name'));
             $conditions[] = "(client.name_first ILIKE '%{$v}%' OR client.name_last ILIKE '%{$v}%')";
         }
+        if(trim($request->input('f_mcp'))) {
+            $v = trim($request->input('f_mcp'));
+            $conditions[] = "(mcpPro.uid = '{$v}')";
+        }
         if(trim($request->input('f_dob_op')) && trim($request->input('f_dob'))) {
             $o = trim($request->input('f_dob_op'));
             $v = trim($request->input('f_dob'));
@@ -1691,6 +1739,23 @@ WHERE
                 $conditions[] = "(client.is_assigned_cellular_weight_scale_device IS NULL OR client.is_assigned_cellular_weight_scale_device = FALSE)";
             }
         }
+        if(trim($request->input('f_lmb'))) {
+            $v = trim($request->input('f_lmb'));
+            switch($v) {
+                case '1':
+                    $conditions[] = "(GREATEST(client.most_recent_cellular_bp_measurement_at::DATE, client.most_recent_cellular_weight_measurement_at::DATE)::DATE < (NOW() - INTERVAL '1 DAY')::DATE)";
+                    break;
+                case '2':
+                    $conditions[] = "(GREATEST(client.most_recent_cellular_bp_measurement_at::DATE, client.most_recent_cellular_weight_measurement_at::DATE)::DATE < (NOW() - INTERVAL '2 DAYS')::DATE)";
+                    break;
+                case '3':
+                    $conditions[] = "(GREATEST(client.most_recent_cellular_bp_measurement_at::DATE, client.most_recent_cellular_weight_measurement_at::DATE)::DATE < (NOW() - INTERVAL '3 DAYS')::DATE)";
+                    break;
+                case '3+':
+                    $conditions[] = "(GREATEST(client.most_recent_cellular_bp_measurement_at::DATE, client.most_recent_cellular_weight_measurement_at::DATE)::DATE < (NOW() - INTERVAL '4 DAYS')::DATE)";
+                    break;
+            }
+        }
         if(trim($request->input('f_comm'))) {
             $v = trim($request->input('f_comm'));
             if($v === 'yes') {
@@ -1742,6 +1807,13 @@ WHERE
             $conditions[] = "(care_month.rm_total_time_in_seconds_by_rmm_pro {$o} {$v})";
         }
 
+        if($request->input('not-enrolled')) {
+            $conditions[] = "(client.is_enrolled_in_rm != 'YES')";
+        }
+        else {
+            $conditions[] = "(client.is_enrolled_in_rm = 'YES')";
+        }
+
         $genericBillIdColumns = "care_month.mcp_rm_generic_bill_id,
                    mcpBill.uid as mcp_rm_generic_bill_uid,
                    mcpBill.generic_pro_id as mcp_rm_generic_bill_generic_pro_id,

+ 1 - 1
config/app.php

@@ -65,7 +65,7 @@ return [
 
     'hrm2_url' => env('HRM2_URL'),
 
-    'asset_version' => 91,
+    'asset_version' => 92,
 
     'temp_dir' => env('TEMP_DIR'),
 

+ 164 - 1
js-dev/stag-popup.js

@@ -116,7 +116,7 @@ function openDynamicStagPopup(_url, initer, title, updateParent, style = '', rep
             popup = $('.dynamic-popup[stag-popup-key="' + url + '"]');
             if(!popup.length) {
                 $('main.stag-content').append(
-                    '<div class="stag-popup ' + (style ? style : 'stag-popup-lg') + ' dynamic-popup mcp-theme-1" stag-popup-key="' + url + '">' +
+                    '<div class="stag-popup ' + (style ? style : 'stag-popup-lg') + ' dynamic-popup draggable resizable mcp-theme-1" stag-popup-key="' + url + '">' +
                     '<div class="stag-popup-content p-0">' +
                     '<h3 class="stag-popup-title mb-0 mt-3 mx-3 pb-0 border-bottom-0"><span></span>' +
                     '<a href="#" class="ml-auto text-secondary" onclick="return closeStagPopup()"><i class="fa fa-times-circle"></i></a>\n' +
@@ -296,6 +296,169 @@ function hasResponseError(_data) {
                 closeStagPopup();
                 return false;
             });
+
+        // draggable
+        let dragging = false, dragX, dragY;
+        $(document)
+            .off('mousedown.start-drag', '.stag-popup.dynamic-popup.draggable .stag-popup-title')
+            .on('mousedown.start-drag', '.stag-popup.dynamic-popup.draggable .stag-popup-title', function(_e) {
+                if(dragging && dragging.length) {
+                    dragging = false;
+                }
+                dragging = $(this).closest('.stag-popup-content');
+                dragX = _e.screenX;
+                dragY = _e.screenY;
+            });
+        $(document)
+            .off('mousemove.drag')
+            .on('mousemove.drag', function(_e) {
+                if(dragging && dragging.length) {
+                    let targetX = dragging.position().left + (_e.screenX - dragX),
+                        targetY = dragging.position().top + (_e.screenY - dragY);
+                    if(targetX >= 0) dragX = _e.screenX;
+                    if(targetY >= 0) dragY = _e.screenY;
+                    if(targetX < 0) targetX = 0;
+                    if(targetY < 0) targetY = 0;
+                    dragging[0].style.left = targetX + 'px';
+                    dragging[0].style.top = targetY + 'px';
+                    dragging[0].style.transform = 'none';
+                    return false;
+                }
+            });
+
+        // resizable
+        let resizeHighlighting = false, resizeDirection = false, resizeAnchor = false, resizing = false, resizeGutter = 8, resizeX, resizeY;
+        $(document)
+            .off('mousemove.highlight-resize', '.stag-popup.dynamic-popup.resizable .stag-popup-content')
+            .on('mousemove.highlight-resize', '.stag-popup.dynamic-popup.resizable .stag-popup-content', function(_e) {
+                if(dragging && dragging.length) return;
+                if(resizing && resizing.length) return;
+                let mouseX = _e.pageX - $(this).offset().left,
+                    mouseY = _e.pageY - $(this).offset().top;
+                if((mouseX >= 0 && mouseX <= resizeGutter) || (mouseX >= $(this).outerWidth() - resizeGutter && mouseX <= $(this).outerWidth())) {
+                    $(this).addClass('resizing-x');
+                    resizeHighlighting = $(this);
+                    resizeDirection = 'x';
+                    resizeAnchor = (mouseX >= 0 && mouseX <= resizeGutter) ? 'left' : 'right';
+                }
+                else if((mouseY >= 0 && mouseY <= resizeGutter) || (mouseY >= $(this).outerHeight() - resizeGutter && mouseY <= $(this).outerHeight())) {
+                    $(this).addClass('resizing-y');
+                    resizeHighlighting = $(this);
+                    resizeDirection = 'y';
+                    resizeAnchor = (mouseY >= 0 && mouseY <= resizeGutter) ? 'top' : 'bottom';
+                }
+                else {
+                    $(this).removeClass('resizing-x');
+                    $(this).removeClass('resizing-y');
+                    resizeHighlighting = false;
+                }
+            });
+        $(document)
+            .off('mousedown.start-resize', '.stag-popup.dynamic-popup.resizable .stag-popup-content')
+            .on('mousedown.start-resize', '.stag-popup.dynamic-popup.resizable .stag-popup-content', function(_e) {
+                if(resizeHighlighting && resizeHighlighting.length) {
+                    if(resizing && resizing.length) {
+                        resizing.removeClass('resizing-x resizing-y');
+                        resizing = false;
+                    }
+                    resizing = $(this);
+                    resizeX = _e.screenX;
+                    resizeY = _e.screenY;
+                }
+            });
+        $(document)
+            .off('mousemove.resize')
+            .on('mousemove.resize', function(_e) {
+                if(resizing && resizing.length) {
+
+                    console.log(resizeDirection);
+                    console.log(resizeAnchor);
+
+                    // x
+                    if(resizeDirection === 'x') {
+
+                        let deltaX = _e.screenX - resizeX;
+
+                        // anchor: left => update left and width of the popup
+                        if(resizeAnchor === 'left') {
+                            resizing[0].style.left = resizing.position().left + deltaX + 'px';
+                            resizing[0].style.width = resizing.outerWidth() - deltaX + 'px';
+                            resizing[0].style.transform = 'none';
+                        }
+
+                        // anchor: right => update width of the popup
+                        else if(resizeAnchor === 'right') {
+                            resizing[0].style.left = resizing.position().left + 'px'
+                            resizing[0].style.width = resizing.outerWidth() + deltaX + 'px';
+                            resizing[0].style.transform = 'none';
+                        }
+                    }
+
+                    // x
+                    if(resizeDirection === 'y') {
+
+                        let deltaY = _e.screenY - resizeY;
+
+                        // anchor: top => update top and height of the popup
+                        if(resizeAnchor === 'top') {
+                            resizing[0].style.top = resizing.position().top + deltaY + 'px';
+                            resizing[0].style.height = resizing.outerHeight() - deltaY + 'px';
+                        }
+
+                        // anchor: bottom => update height of the popup
+                        else if(resizeAnchor === 'bottom') {
+                            resizing[0].style.height = resizing.outerHeight() + deltaY + 'px';
+                        }
+                    }
+
+                    resizeX = _e.screenX;
+                    resizeY = _e.screenY;
+                    return false;
+                }
+            });
+        $(document)
+            .off('mouseleave.stop-resize', '.stag-popup.dynamic-popup.resizable .stag-popup-content')
+            .on('mouseleave.stop-resize', '.stag-popup.dynamic-popup.resizable .stag-popup-content', function(_e) {
+                if(resizing && resizing.length) return;
+                if(resizeHighlighting && resizeHighlighting.length) {
+                    resizeHighlighting.removeClass('resizing-x resizing-y');
+                    resizeHighlighting = false;
+                    return false;
+                }
+            });
+
+        // common
+        $(document)
+            .off('mouseleave.stop-drag-resize')
+            .on('mouseleave.stop-drag-resize', function() {
+                if(dragging && dragging.length) {
+                    dragging = false;
+                }
+                if(resizeHighlighting && resizeHighlighting.length) {
+                    resizeHighlighting.removeClass('resizing-x resizing-y');
+                    resizeHighlighting = false;
+                }
+                if(resizing && resizing.length) {
+                    resizing.removeClass('resizing-x resizing-y');
+                    resizing = false;
+                }
+            });
+        $(document)
+            .off('mouseup.stop-drag-resize')
+            .on('mouseup.stop-drag-resize', function() {
+                if(dragging && dragging.length) {
+                    dragging = false;
+                }
+                if(resizeHighlighting && resizeHighlighting.length) {
+                    resizeHighlighting.removeClass('resizing-x resizing-y');
+                    resizeHighlighting = false;
+                }
+                if(resizing && resizing.length) {
+                    resizing.removeClass('resizing-x resizing-y');
+                    resizing = false;
+                }
+            });
+
     }
     addMCInitializer('stag-popups', window.initStagPopupEvents);
 })();

+ 23 - 0
public/css/style.css

@@ -1325,6 +1325,29 @@ body .node input[type="number"] {
     border-top: 1px solid #e1e1e1;
 }
 
+/* draggable popup */
+.stag-popup.draggable .stag-popup-content {
+    position: absolute;
+    left: 50%;
+    transform: translate(-50%, 0);
+}
+.stag-popup.dynamic-popup.draggable .stag-popup-title {
+    cursor: move;
+}
+
+/* resizable popup */
+.stag-popup.resizable .stag-popup-content.resizing-x {
+    outline: 1px solid rgba(0, 128, 128, 0.3);
+    cursor: ew-resize;
+}
+.stag-popup.resizable .stag-popup-content.resizing-y {
+    outline: 1px solid rgba(0, 128, 128, 0.3);
+    cursor: ns-resize;
+}
+.stag-popup.resizable .stag-popup-content {
+    overflow: auto !important;
+}
+
 /* slide-in stag-popups */
 .stag-popup.stag-slide {
     display: block;

+ 1 - 1
resources/views/app/patient/canvas-sections/vitals/form.blade.php

@@ -114,7 +114,7 @@ $formID = rand(0, 100000);
                                data-field="value" v-model="bmi">
                         <p class="py-1 m-0 px-2 font-weight-bold bg-white" v-if="!!bmi">
                             <span class="text-sm text-warning-mellow" v-if="+bmi < 18.5">Underweight</span>
-                            <span class="text-sm text-success" v-if="+bmi >= 18.5 && +bmi < 25">Healthy Weight</span>
+                            <!--<span class="text-sm text-success" v-if="+bmi >= 18.5 && +bmi < 25">Healthy Weight</span>-->
                             <span class="text-sm text-warning-mellow" v-if="+bmi >= 25 && +bmi < 30">Overweight</span>
                             <span class="text-sm text-warning-mellow" v-if="+bmi >= 30">Obese</span>
                         </p>

+ 1 - 1
resources/views/app/patient/canvas-sections/vitals/summary.php

@@ -112,7 +112,7 @@ foreach ($vitalLabels as $k => $v) {
                         <span class="text-sm text-warning-mellow">(Underweight)</span>
                     <?php endif; ?>
                     <?php if($bmi >= 18.5 && $bmi < 25): ?>
-                        <span class="text-sm text-success">(Healthy Weight)</span>
+                        <!--<span class="text-sm text-success">(Healthy Weight)</span>-->
                     <?php endif; ?>
                     <?php if($bmi >= 25 && $bmi < 30): ?>
                         <span class="text-sm text-warning-mellow">(Overweight)</span>

+ 3 - 1
resources/views/app/patient/care-month/_create-claim.blade.php

@@ -236,8 +236,10 @@
             }
         },
         mounted: function () {
-            this.initICDAutoSuggest();
             this.getPrefillValues();
+            Vue.nextTick(() => {
+                this.initICDAutoSuggest();
+            });
         }
     });
 </script>

+ 1 - 1
resources/views/app/patient/note/dashboard-bu-b4-pure-soap.blade.php

@@ -979,7 +979,7 @@
                                         bmiCategory = '(Underweight)';
                                     }
                                     if (bmi >= 18.5 && bmi < 25) {
-                                        bmiCategory = '(Healthy)';
+                                        bmiCategory = '';
                                     }
                                     if (bmi >= 25 && bmi < 30) {
                                         bmiCategory = '(Overweight)';

+ 1 - 1
resources/views/app/patient/note/dashboard-old.blade.php

@@ -1125,7 +1125,7 @@ use App\Models\Handout;
                                         bmiCategory = '(Underweight)';
                                     }
                                     if (bmi >= 18.5 && bmi < 25) {
-                                        bmiCategory = '(Healthy)';
+                                        bmiCategory = '';
                                     }
                                     if (bmi >= 25 && bmi < 30) {
                                         bmiCategory = '(Overweight)';

+ 1 - 3
resources/views/app/patient/note/dashboard.blade.php

@@ -896,7 +896,7 @@ use App\Models\Handout;
                                         bmiCategory = '(Underweight)';
                                     }
                                     if (bmi >= 18.5 && bmi < 25) {
-                                        bmiCategory = '(Healthy)';
+                                        bmiCategory = '';
                                     }
                                     if (bmi >= 25 && bmi < 30) {
                                         bmiCategory = '(Overweight)';
@@ -1464,10 +1464,8 @@ use App\Models\Handout;
                 if(!noteCardHeader.length) return;
                 let resultTop = (noteCardHeader.offset().top + noteCardHeader.outerHeight(true)) - $(window).scrollTop();
                 if(resultTop <= 55) {
-                    @if(!$note->is_signed_by_hcp)
                     rhsSidebar.addClass('fixed');
                     rhsSidebar.closest('.note-container').addClass('rhs-sidebar-fixed');
-                    @endif
                 }
                 else {
                     rhsSidebar.removeClass('fixed');

+ 2 - 2
resources/views/app/patient/note/rhs-sidebar-nrc.blade.php

@@ -21,8 +21,8 @@
             ->whereNotNull('ts')
             ->whereRaw("(is_cellular_zero IS NULL OR is_cellular_zero = FALSE)")
             ->whereRaw("(label = 'BP' OR label = 'Wt. (lbs.)')")
-            ->where('ts', '>=', $start)
-            ->where('ts', '<=', $end)
+            /*->where('ts', '>=', $start)
+            ->where('ts', '<=', $end)*/
             ->orderBy('ts', 'desc')
             ->skip(0)
             ->take(10)

+ 2 - 2
resources/views/app/patient/note/rhs-sidebar.blade.php

@@ -31,8 +31,8 @@
             ->whereNotNull('ts')
             ->whereRaw("(is_cellular_zero IS NULL OR is_cellular_zero = FALSE)")
             ->whereRaw("(label = 'BP' OR label = 'Wt. (lbs.)')")
-            ->where('ts', '>=', $start)
-            ->where('ts', '<=', $end)
+            /*->where('ts', '>=', $start)
+            ->where('ts', '<=', $end)*/
             ->orderBy('ts', 'desc')
             ->skip(0)
             ->take(10)

+ 9 - 41
resources/views/app/patient/notes.blade.php

@@ -146,32 +146,21 @@
                     @if($pro->pro_type === 'ADMIN')
                         <div class="form-group mb-2 pt-2 d-flex">
                             <label class="my-0 mr-3 d-flex align-items-center">
-                                <input type="radio" class="mr-1" name="noteType" value="regular" required>
-                                Regular Note
+                                <input type="radio" class="mr-1" name="isNonMedical" value="0" required {{$pro->is_hcp ? 'checked' : ''}}>
+                                <span class="text-nowrap">Regular Note</span>
                             </label>
                             <label class="my-0 mr-3 d-flex align-items-center">
-                                <input type="radio" class="mr-1" name="noteType" value="admin" required>
-                                Admin Note
+                                <input type="radio" class="mr-1" name="isNonMedical" value="1" required {{$pro->is_hcp ? '' : 'checked'}}>
+                                <span class="text-nowrap">Admin Note</span>
                             </label>
                         </div>
-
-                        <div if-admin-note class="d-none">
-                            <input type="hidden" x-name="hcpProUid" value="{{config('app.adminNoteHcpProUid')}}">
-                        </div>
-
-                        <div class="form-group d-none" if-regular-note>
-                            <label for="" class="text-secondary text-sm mb-1">HCP Pro *</label>
-                            <select x-name="hcpProUid" class="form-control" provider-search required data-pro-uid="{{$pro->is_hcp ? $pro->uid : ''}}">
-                            </select>
-                        </div>
-                    @else
-                        <div class="form-group mb-2">
-                            <label for="" class="text-secondary text-sm mb-1">HCP Pro *</label>
-                            <select name="hcpProUid" class="form-control" provider-search required data-pro-uid="{{$pro->is_hcp ? $pro->uid : ''}}">
-                            </select>
-                        </div>
                     @endif
 
+                    <div class="form-group mb-2">
+                        <label for="" class="text-secondary text-sm mb-1">HCP Pro *</label>
+                        <select name="hcpProUid" class="form-control" provider-search required data-pro-uid="{{$pro->is_hcp ? $pro->uid : ''}}">
+                        </select>
+                    </div>
 
                     <div class="form-group mb-2">
                         <label for="" class="text-secondary text-sm mb-1">Note Template *</label>
@@ -439,27 +428,6 @@
                     }
                 });
 
-                $('[name="noteType"]').change(function() {
-                    let form = $(this).closest('form');
-                    form.find('[if-regular-note]').addClass('d-none');
-                    form.find('[if-regular-note] [x-name]').removeAttr('name');
-                    form.find('[if-admin-note]').addClass('d-none');
-                    form.find('[if-admin-note] [x-name]').removeAttr('name');
-                    if(form.find('[name="noteType"]:checked').attr('value') === 'regular') {
-                        form.find('[if-regular-note]').removeClass('d-none');
-                        form.find('[if-regular-note] [x-name]').each(function() {
-                            $(this).attr('name', $(this).attr('x-name'));
-                        });
-                    }
-                    else if(form.find('[name="noteType"]:checked').attr('value') === 'admin') {
-                        form.find('[if-admin-note]').removeClass('d-none');
-                        form.find('[if-admin-note] [x-name]').each(function() {
-                            $(this).attr('name', $(this).attr('x-name'));
-                        });
-                    }
-                    return false;
-                });
-
             }
             addMCInitializer('notes-list', initNotesList, '#notes-list-{{$patient->id}}');
         })();

+ 1 - 1
resources/views/app/patient/page-sections/vitals/form.blade.php

@@ -125,7 +125,7 @@ $formID = rand(0, 100000);
                                    data-field="value" v-model="bmi">
                             <p class="py-1 m-0 px-2 font-weight-bold bg-white" v-if="!!bmi">
                                 <span class="text-sm text-warning-mellow" v-if="+bmi < 18.5">Underweight</span>
-                                <span class="text-sm text-success" v-if="+bmi >= 18.5 && +bmi < 25">Healthy Weight</span>
+                                <!--<span class="text-sm text-success" v-if="+bmi >= 18.5 && +bmi < 25">Healthy Weight</span>-->
                                 <span class="text-sm text-warning-mellow" v-if="+bmi >= 25 && +bmi < 30">Overweight</span>
                                 <span class="text-sm text-warning-mellow" v-if="+bmi >= 30">Obese</span>
                             </p>

+ 1 - 1
resources/views/app/patient/page-sections/vitals/summary.php

@@ -111,7 +111,7 @@ foreach ($vitalLabels as $k => $v) {
                         <span class="text-sm text-warning-mellow">(Underweight)</span>
                     <?php endif; ?>
                     <?php if($bmi >= 18.5 && $bmi < 25): ?>
-                        <span class="text-sm text-success">(Healthy Weight)</span>
+                        <!--<span class="text-sm text-success">(Healthy Weight)</span>-->
                     <?php endif; ?>
                     <?php if($bmi >= 25 && $bmi < 30): ?>
                         <span class="text-sm text-warning-mellow">(Overweight)</span>

+ 1 - 1
resources/views/app/patient/partials/latest-vitals.blade.php

@@ -52,7 +52,7 @@ if (!!@$point->data) {
                         <span class="text-sm text-warning-mellow">(Underweight)</span>
                     @endif
                     @if($bmi >= 18.5 && $bmi < 25)
-                        <span class="text-sm text-success">(Healthy Weight)</span>
+                         <!--<span class="text-sm text-success">(Healthy Weight)</span>-->
                     @endif
                     @if($bmi >= 25 && $bmi < 30)
                         <span class="text-sm text-warning-mellow">(Overweight)</span>

+ 1 - 1
resources/views/app/patient/segment-templates/mc_vitals/edit.blade.php

@@ -125,7 +125,7 @@ $copyTriggerAdded = [];
                                                 <span class="text-sm text-warning-mellow" v-if="+bmi < 18.5">Underweight</span>
                                             @endif
                                             @if($bmi >= 18.5 && $bmi < 25)
-                                                <span class="text-sm text-success" v-if="+bmi >= 18.5 && +bmi < 25">Healthy Weight</span>
+                                                <!--<span class="text-sm text-success" v-if="+bmi >= 18.5 && +bmi < 25">Healthy Weight</span>-->
                                             @endif
                                             @if($bmi >= 25 && $bmi > 30)
                                                 <span class="text-sm text-warning-mellow" v-if="+bmi >= 25 && +bmi < 30">Overweight</span>

+ 1 - 1
resources/views/app/patient/segment-templates/mc_vitals/summary.blade.php

@@ -69,7 +69,7 @@ if(!$contentData) {
                         <span class="text-sm text-warning-mellow">(Underweight)</span>
                      @endif
                     @if($bmi >= 18.5 && $bmi < 25)
-                        <span class="text-sm text-success">(Healthy Weight)</span>
+                         <!--<span class="text-sm text-success">(Healthy Weight)</span>-->
                     @endif
                     @if($bmi >= 25 && $bmi < 30)
                         <span class="text-sm text-warning-mellow">(Overweight)</span>

+ 3 - 3
resources/views/app/patient/segment-templates/omega_vitals/edit.blade.php

@@ -130,7 +130,7 @@ if(!@$segment) {
                                                 <span class="text-sm text-warning-mellow">Underweight</span>
                                             @endif
                                             @if($bmi >= 18.5 && $bmi < 25)
-                                                <span class="text-sm text-success">Healthy Weight</span>
+                                                <!--<span class="text-sm text-success">Healthy Weight</span>-->
                                             @endif
                                             @if($bmi >= 25 && $bmi < 30)
                                                 <span class="text-sm text-warning-mellow">Overweight</span>
@@ -206,7 +206,7 @@ if(!@$segment) {
                                             <span class="text-sm text-warning-mellow ml-1">Underweight</span>
                                         @endif
                                         @if($prevBMI >= 18.5 && $prevBMI < 25)
-                                            <span class="text-sm text-success ml-1">Healthy Weight</span>
+                                            <!--<span class="text-sm text-success ml-1">Healthy Weight</span>-->
                                         @endif
                                         @if($prevBMI >= 25 && $prevBMI < 30)
                                             <span class="text-sm text-warning-mellow ml-1">Overweight</span>
@@ -256,7 +256,7 @@ if(!@$segment) {
                     bmiCategory = '<span class="text-sm text-warning-mellow">Underweight</span>';
                 }
                 else if(bmi >= 18.5 && bmi < 25) {
-                    bmiCategory = '<span class="text-sm text-success">Healthy Weight</span>';
+                    bmiCategory = '<span class="text-sm text-success"></span>';
                 }
                 else if(bmi >= 25 && bmi < 30) {
                     bmiCategory = '<span class="text-sm text-warning-mellow">Overweight</span>';

+ 1 - 1
resources/views/app/patient/segment-templates/omega_vitals/summary.blade.php

@@ -83,7 +83,7 @@ if(!$contentData) {
                             <span class="text-warning-mellow">(Underweight)</span>
                          @endif
                         @if($bmi >= 18.5 && $bmi < 25)
-                            <span class="text-success">(Healthy Weight)</span>
+                             <!--<span class="text-sm text-success">(Healthy Weight)</span>-->
                         @endif
                         @if($bmi >= 25 && $bmi < 30)
                             <span class="text-warning-mellow">(Overweight)</span>

+ 3 - 3
resources/views/app/patient/segment-templates/psych_vitals/edit.blade.php

@@ -132,7 +132,7 @@ if(!@$segment) {
                                                 <span class="text-sm text-warning-mellow">Underweight</span>
                                             @endif
                                             @if($bmi >= 18.5 && $bmi < 25)
-                                                <span class="text-sm text-success">Healthy Weight</span>
+                                                <!--<span class="text-sm text-success">Healthy Weight</span>-->
                                             @endif
                                             @if($bmi >= 25 && $bmi < 30)
                                                 <span class="text-sm text-warning-mellow">Overweight</span>
@@ -226,7 +226,7 @@ if(!@$segment) {
                                             <span class="text-sm text-warning-mellow ml-1">Underweight</span>
                                         @endif
                                         @if($prevBMI >= 18.5 && $prevBMI < 25)
-                                            <span class="text-sm text-success ml-1">Healthy Weight</span>
+                                            <!--<span class="text-sm text-success ml-1">Healthy Weight</span>-->
                                         @endif
                                         @if($prevBMI >= 25 && $prevBMI < 30)
                                             <span class="text-sm text-warning-mellow ml-1">Overweight</span>
@@ -276,7 +276,7 @@ if(!@$segment) {
                     bmiCategory = '<span class="text-sm text-warning-mellow">Underweight</span>';
                 }
                 else if(bmi >= 18.5 && bmi < 25) {
-                    bmiCategory = '<span class="text-sm text-success">Healthy Weight</span>';
+                    bmiCategory = '<span class="text-sm text-success"></span>';
                 }
                 else if(bmi >= 25 && bmi < 30) {
                     bmiCategory = '<span class="text-sm text-warning-mellow">Overweight</span>';

+ 1 - 1
resources/views/app/patient/segment-templates/psych_vitals/summary.blade.php

@@ -85,7 +85,7 @@ if(!$contentData) {
                             <span class="text-warning-mellow">(Underweight)</span>
                          @endif
                         @if($bmi >= 18.5 && $bmi < 25)
-                            <span class="text-success">(Healthy Weight)</span>
+                             <!--<span class="text-sm text-success">(Healthy Weight)</span>-->
                         @endif
                         @if($bmi >= 25 && $bmi < 30)
                             <span class="text-warning-mellow">(Overweight)</span>

+ 3 - 3
resources/views/app/patient/segment-templates/sigma_vitals/edit.blade.php

@@ -130,7 +130,7 @@ if(!@$segment) {
                                                 <span class="text-sm text-warning-mellow">Underweight</span>
                                             @endif
                                             @if($bmi >= 18.5 && $bmi < 25)
-                                                <span class="text-sm text-success">Healthy Weight</span>
+                                                <!--<span class="text-sm text-success">Healthy Weight</span>-->
                                             @endif
                                             @if($bmi >= 25 && $bmi < 30)
                                                 <span class="text-sm text-warning-mellow">Overweight</span>
@@ -206,7 +206,7 @@ if(!@$segment) {
                                             <span class="text-sm text-warning-mellow ml-1">Underweight</span>
                                         @endif
                                         @if($prevBMI >= 18.5 && $prevBMI < 25)
-                                            <span class="text-sm text-success ml-1">Healthy Weight</span>
+                                            <!--<span class="text-sm text-success ml-1">Healthy Weight</span>-->
                                         @endif
                                         @if($prevBMI >= 25 && $prevBMI < 30)
                                             <span class="text-sm text-warning-mellow ml-1">Overweight</span>
@@ -256,7 +256,7 @@ if(!@$segment) {
                     bmiCategory = '<span class="text-sm text-warning-mellow">Underweight</span>';
                 }
                 else if(bmi >= 18.5 && bmi < 25) {
-                    bmiCategory = '<span class="text-sm text-success">Healthy Weight</span>';
+                    bmiCategory = '<span class="text-sm text-success"></span>';
                 }
                 else if(bmi >= 25 && bmi < 30) {
                     bmiCategory = '<span class="text-sm text-warning-mellow">Overweight</span>';

+ 1 - 1
resources/views/app/patient/segment-templates/sigma_vitals/summary.blade.php

@@ -83,7 +83,7 @@ if(!$contentData) {
                             <span class="text-warning-mellow">(Underweight)</span>
                          @endif
                         @if($bmi >= 18.5 && $bmi < 25)
-                            <span class="text-success">(Healthy Weight)</span>
+                             <!--<span class="text-sm text-success">(Healthy Weight)</span>-->
                         @endif
                         @if($bmi >= 25 && $bmi < 30)
                             <span class="text-warning-mellow">(Overweight)</span>

+ 3 - 3
resources/views/app/patient/segment-templates/vitals/edit.blade.php

@@ -125,7 +125,7 @@ $copyTriggerAdded = [];
                                                 <span class="text-sm text-warning-mellow">Underweight</span>
                                             @endif
                                             @if($bmi >= 18.5 && $bmi < 25)
-                                                <span class="text-sm text-success">Healthy Weight</span>
+                                                <!--<span class="text-sm text-success">Healthy Weight</span>-->
                                             @endif
                                             @if($bmi >= 25 && $bmi < 30)
                                                 <span class="text-sm text-warning-mellow">Overweight</span>
@@ -201,7 +201,7 @@ $copyTriggerAdded = [];
                                             <span class="text-sm text-warning-mellow ml-1">Underweight</span>
                                         @endif
                                         @if($prevBMI >= 18.5 && $prevBMI < 25)
-                                            <span class="text-sm text-success ml-1">Healthy Weight</span>
+                                            <!--<span class="text-sm text-success ml-1">Healthy Weight</span>-->
                                         @endif
                                         @if($prevBMI >= 25 && $prevBMI < 30)
                                             <span class="text-sm text-warning-mellow ml-1">Overweight</span>
@@ -251,7 +251,7 @@ $copyTriggerAdded = [];
                     bmiCategory = '<span class="text-sm text-warning-mellow">Underweight</span>';
                 }
                 else if(bmi >= 18.5 && bmi < 25) {
-                    bmiCategory = '<span class="text-sm text-success">Healthy Weight</span>';
+                    bmiCategory = '<span class="text-sm text-success"></span>';
                 }
                 else if(bmi >= 25 && bmi < 30) {
                     bmiCategory = '<span class="text-sm text-warning-mellow">Overweight</span>';

+ 1 - 1
resources/views/app/patient/segment-templates/vitals/summary.blade.php

@@ -86,7 +86,7 @@ if(!$contentData) {
                             <span class="text-warning-mellow">(Underweight)</span>
                          @endif
                         @if($bmi >= 18.5 && $bmi < 25)
-                            <span class="text-success">(Healthy Weight)</span>
+                             <!--<span class="text-sm text-success">(Healthy Weight)</span>-->
                         @endif
                         @if($bmi >= 25 && $bmi < 30)
                             <span class="text-warning-mellow">(Overweight)</span>

+ 1 - 1
resources/views/app/patient/vitals-settings.blade.php

@@ -64,7 +64,7 @@
                         bmiCategory = '(Underweight)';
                     }
                     if (bmi >= 18.5 && bmi < 25) {
-                        bmiCategory = '(Healthy)';
+                        bmiCategory = '';
                     }
                     if (bmi >= 25 && bmi < 30) {
                         bmiCategory = '(Overweight)';

+ 16 - 2
resources/views/app/practice-management/pro-financials.blade.php

@@ -5,8 +5,22 @@
     <div class="p-3 mcp-theme-1" id="processing-bill-matrix">
 
         <div class="card">
-
-            <div class="card-header px-2 py-1 d-flex align-items-center">
+            <!-- totals -->
+            <div class="card-header px-2 py-2 font-weight-bold bg-white">
+                <div class="d-flex align-items-baseline mb-1">
+                    <div class="font-size-16 width-100px">{{friendly_money($grandTotal)}}</div>
+                    <div class="font-size-16">Total</div>
+                </div>
+                @foreach($companies as $name => $total)
+                    @if(intval(round($total)) !== 0)
+                        <div class="d-flex align-items-baseline">
+                            <div class="width-100px">{{friendly_money($total)}}</div>
+                            <div>{{$name}}</div>
+                        </div>
+                    @endif
+                @endforeach
+            </div>
+            <div class="card-header px-2 py-1 d-flex align-items-center border-bottom-0">
                 <strong class="text-nowrap">
                     <i class="fas fa-user"></i>
                     Pro Financials

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

@@ -12,26 +12,34 @@
     </td>
 
     <td>{{friendly_date($iPatient->dob)}}</td>
-    <td>{!! $iPatient->is_enrolled_in_rm === 'YES' ? '<i class="fa fa-check text-success"></i>' : 'No' !!}</td>
+    {{--<td>{!! $iPatient->is_enrolled_in_rm === 'YES' ? '<i class="fa fa-check text-success"></i>' : 'No' !!}</td>--}}
     <td>{!! $iPatient->is_assigned_cellular_bp_device ? '<i class="fa fa-check text-success"></i>' : 'No' !!}</td>
     <td>{!! $iPatient->is_assigned_cellular_weight_scale_device ? '<i class="fa fa-check text-success"></i>' : 'No' !!}</td>
     <td>
-        <div class="text-nowrap">
-            <span class="sort-data">{{$iPatient->most_recent_cellular_bp_sbp_mm_hg ?: '-'}}</span>/{{$iPatient->most_recent_cellular_bp_dbp_mm_hg ?: '-'}}
-            @if($iPatient->most_recent_cellular_bp_measurement_at)
-                <span class="text-sm text-secondary text-nowrap ml-1"
-                      title="{{friendly_date_time($iPatient->most_recent_cellular_bp_measurement_at)}}">({{friendly_date_est($iPatient->most_recent_cellular_bp_measurement_at)}})</span>
-            @endif
-        </div>
+        @if($iPatient->most_recent_cellular_bp_sbp_mm_hg && $iPatient->most_recent_cellular_bp_dbp_mm_hg)
+            <div class="text-nowrap">
+                <span class="sort-data">{{$iPatient->most_recent_cellular_bp_sbp_mm_hg ?: '-'}}</span>/{{$iPatient->most_recent_cellular_bp_dbp_mm_hg ?: '-'}}
+                @if($iPatient->most_recent_cellular_bp_measurement_at)
+                    <span class="text-sm text-secondary text-nowrap ml-1"
+                          title="{{friendly_date_time($iPatient->most_recent_cellular_bp_measurement_at)}}">({{friendly_date_est($iPatient->most_recent_cellular_bp_measurement_at)}})</span>
+                @endif
+            </div>
+        @else
+            -
+        @endif
     </td>
     <td>
-        <div class="text-nowrap">
-            <span class="sort-data">{{$iPatient->most_recent_cellular_weight_value ? round($iPatient->most_recent_cellular_weight_value, 1) : '-'}}</span>
-            @if($iPatient->most_recent_cellular_weight_measurement_at)
-                <span class="text-sm text-secondary text-nowrap ml-1"
-                      title="{{friendly_date_time($iPatient->most_recent_cellular_weight_measurement_at)}}">({{friendly_date_est($iPatient->most_recent_cellular_weight_measurement_at)}})</span>
-            @endif
-        </div>
+        @if($iPatient->most_recent_cellular_weight_value)
+            <div class="text-nowrap">
+                <span class="sort-data">{{$iPatient->most_recent_cellular_weight_value ? round($iPatient->most_recent_cellular_weight_value, 1) : '-'}}</span>
+                @if($iPatient->most_recent_cellular_weight_measurement_at)
+                    <span class="text-sm text-secondary text-nowrap ml-1"
+                          title="{{friendly_date_time($iPatient->most_recent_cellular_weight_measurement_at)}}">({{friendly_date_est($iPatient->most_recent_cellular_weight_measurement_at)}})</span>
+                @endif
+            </div>
+        @else
+            -
+        @endif
     </td>
     
     <td>
@@ -80,34 +88,26 @@
     </td>
 
     <td>
-        @if($iPatient->mcp_rm_generic_bill_id)
+        @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)
             <span class="text-success font-weight-bold">
                 <i class="fa fa-check"></i>
-                Yes
+                ${{friendly_money($pro->mcp_rpm_payment_amount, 0)}}
             </span>
-            (${{friendly_money($iPatient->mcp_rm_generic_bill_expected_payment_amount)}})
-            @if($iPatient->mcp_rm_generic_bill_signed)
-                <span class="text-success">Signed</span>
-            @endif
         @else
             <span class="text-danger font-weight-normal">
-                Not yet
+                No
             </span>
         @endif
     </td>
     <td>
-        @if($iPatient->rmm_rm_generic_bill_id)
+        @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)
             <span class="text-success font-weight-bold">
                 <i class="fa fa-check"></i>
-                Yes
+                ${{friendly_money($pro->rmm_payment_amount, 0)}}
             </span>
-            (${{friendly_money($iPatient->rmm_rm_generic_bill_expected_payment_amount)}})
-            @if($iPatient->rmm_rm_generic_bill_signed)
-                <span class="text-success">Signed</span>
-            @endif
         @else
             <span class="text-danger font-weight-normal">
-                Not yet
+                No
             </span>
         @endif
     </td>

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

@@ -0,0 +1,65 @@
+<div class="d-flex align-items-stretch m-0 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>
+                addMCHook(
+                    'refresh-rpm-row-{{$trIndex}}',
+                    function () {
+                        refreshRpmRow({{$trIndex}});
+                    }
+                );
+            </script>
+            <?php $trIndex++; ?>
+        @endforeach
+        <table class="table table-sm table-striped table-hover p-0 m-0 min-width-1100px" id="table-rm-matrix">
+            <thead class="bg-light">
+            <tr>
+
+                <th class="border-0 pl-2">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'Name', 'key' => 'client_name'])</th>
+                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'DOB', 'key' => 'dob'])</th>
+                {{--<th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'RPM?', 'key' => 'is_enrolled_in_rm'])</th>--}}
+                <th class="border-0 text-secondary">BP?</th>
+                <th class="border-0 text-secondary">Scale?</th>
+                <th class="border-0 text-secondary">Latest BP</th>
+                <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-admin"), 'label' => 'Days Since Last Visit', 'key' => 'most_recent_completed_mcp_note_date'])</th>
+                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'Comm?', '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-admin"), '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-admin"), 'label' => '#MCP Unst.', 'key' => 'rm_num_measurements_not_stamped_by_mcp'])</th>
+                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => '#RMM Unst.', 'key' => 'rm_num_measurements_not_stamped_by_rmm'])</th>
+                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => '#MCP Mins.', 'key' => 'rm_total_time_in_seconds_by_mcp'])</th>
+                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => '#RMM Mins.', 'key' => 'rm_total_time_in_seconds_by_rmm_pro'])</th>
+                @if(!request()->input('f_mcp_billable') || request()->input('f_mcp_billable') === 'all')
+                    <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'MCP Bill', 'key' => 'mcp_rm_generic_bill_id'])</th>
+                @else
+                    <th class="border-0 text-secondary">MCP Bill</th>
+                @endif
+                @if(!request()->input('f_rmm_billable') || request()->input('f_rmm_billable') === 'all')
+                    <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'RMM Bill', 'key' => 'rmm_rm_generic_bill_id'])</th>
+                @else
+                    <th class="border-0 text-secondary">RMM Bill</th>
+                @endif
+            </tr>
+            </thead>
+            <tbody>
+            <?php $trIndex = 0; ?>
+            @foreach ($patients as $iPatient)
+                <?php
+
+                $daysDiff = -1;
+                if ($iPatient->most_recent_completed_mcp_note_date) {
+                    $careMonthLastDay = date_add(date_create($rcmStartDate), date_interval_create_from_date_string("1 month"));
+                    $careMonthLastDay = date_sub($careMonthLastDay, date_interval_create_from_date_string("1 day"));
+                    $daysDiff = date_diff($careMonthLastDay, date_create($iPatient->most_recent_completed_mcp_note_date))->days;
+                }
+                $lastVisitWithin90Days = ($daysDiff !== -1 && $daysDiff <= 90);
+
+                ?>
+                @include('app.practice-management.remote-monitoring-row-markup-for-admin')
+                <?php $trIndex++; ?>
+            @endforeach
+            </tbody>
+        </table>
+    </div>
+</div>

+ 67 - 79
resources/views/app/practice-management/rpm-matrix-for-admin.blade.php

@@ -21,12 +21,12 @@
             padding: 0.5rem;
         }
     </style>
-    <div class="p-3 mcp-theme-1 body-height" id="practice-remote-monitoring" v-cloak>
+    <div class="p-3 mcp-theme-1" id="practice-remote-monitoring" v-cloak>
 
         <div class="card h-100">
 
             <div class="card-header px-2 py-2 d-flex align-items-baseline">
-                <form class="d-block w-100" action="" method="GET">
+                <form class="d-block w-100" action="" method="GET" id="rpm-matrix-filter">
 
                     <div class="d-flex align-items-end">
                         <span class="mr-4">
@@ -73,14 +73,36 @@
                     <div class="d-flex align-items-start mt-2 pt-1 border-top">
 
                         <div>
-                            <label class="mb-0 text-sm {{request()->input('f_name') ? 'text-info' : 'text-secondary'}}">Name</label>
+                            <label class="mb-0 text-sm {{request()->input('f_ces') && request()->input('f_ces') !== 'ACTIVE' ? 'font-weight-bold text-info' : 'text-secondary'}}">Status</label>
+                            <select name="f_ces" class="mr-2 form-control form-control-sm min-width-unset max-width-110px pl-0">
+                                <option {{!request()->input('f_ces') || request()->input('f_ces') === 'ACTIVE' ? 'selected' : ''}} value="ACTIVE">Active</option>
+                                <option {{request()->input('f_ces') === 'INACTIVE' ? 'selected' : ''}} value="INACTIVE">Inactive</option>
+                                <option {{request()->input('f_ces') === 'ENTRY_ERROR' ? 'selected' : ''}} value="ENTRY_ERROR">Entry Error</option>
+                                <option {{request()->input('f_ces') === 'DUMMY' ? 'selected' : ''}} value="DUMMY">Test Chart</option>
+                                <option {{request()->input('f_ces') === 'DECEASED' ? 'selected' : ''}} value="DECEASED">Deceased</option>
+                                <option {{request()->input('f_ces') === 'DUPLICATE' ? 'selected' : ''}} value="DUPLICATE">Duplicate</option>
+                                <option {{request()->input('f_ces') === 'NO_LONGER_INTERESTED' ? 'selected' : ''}} value="NO_LONGER_INTERESTED">No Longer Interested</option>
+                                <option {{request()->input('f_ces') === 'BAD_RECORD' ? 'selected' : ''}} value="BAD_RECORD">Bad Record</option>
+                                <option {{request()->input('f_ces') === 'NO_LONGER_ELIGIBLE' ? 'selected' : ''}} value="NO_LONGER_ELIGIBLE">No Longer Eligible</option>
+                            </select>
+                        </div>
+
+                        <div>
+                            <label class="mb-0 text-sm {{request()->input('f_name') ? 'font-weight-bold text-info' : 'text-secondary'}}">Name</label>
                             <input type="text"
                                    class="mr-2 form-control form-control-sm min-width-unset max-width-110px"
                                    name="f_name" value="{{request()->input('f_name')}}">
                         </div>
 
+                        <div class="max-width-110px mr-2">
+                            <label class="mb-0 text-sm {{request()->input('f_mcp') ? 'font-weight-bold text-info' : 'text-secondary'}}">MCP</label>
+                            <select name="f_mcp" class="form-control form-control-sm min-width-unset" provider-search provider-type="hcp" data-pro-uid="{{request()->input('f_mcp')}}">
+                                <option value="">--select--</option>
+                            </select>
+                        </div>
+
                         <div>
-                            <label class="mb-0 text-sm {{request()->input('f_dob') ? 'text-info' : 'text-secondary'}}">DOB</label>
+                            <label class="mb-0 text-sm {{request()->input('f_dob') ? 'font-weight-bold text-info' : 'text-secondary'}}">DOB</label>
                             <div class="d-flex align-items-start">
                                 <select name="f_dob_op"
                                         class="mr-1 form-control form-control-sm min-width-unset width-40px pl-0">
@@ -96,18 +118,18 @@
                             </div>
                         </div>
 
-                        <div>
-                            <label class="mb-0 text-sm {{request()->input('f_rpm') && request()->input('f_rpm') !== 'any' ? 'text-info' : 'text-secondary'}}">RPM</label>
+                        {{--<div>
+                            <label class="mb-0 text-sm {{request()->input('f_rpm') && request()->input('f_rpm') !== 'any' ? 'font-weight-bold text-info' : 'text-secondary'}}">RPM</label>
                             <select name="f_rpm"
                                     class="mr-2 form-control form-control-sm min-width-unset width-70px pl-0">
                                 <option {{request()->input('f_rpm') === 'any' ? 'selected' : ''}} value="any">Any</option>
                                 <option {{request()->input('f_rpm') === 'yes' ? 'selected' : ''}} value="yes">Yes</option>
                                 <option {{request()->input('f_rpm') === 'no' ? 'selected' : ''}} value="no">No</option>
                             </select>
-                        </div>
+                        </div>--}}
 
                         <div>
-                            <label class="mb-0 text-sm {{request()->input('f_cell_bp') && request()->input('f_cell_bp') !== 'any' ? 'text-info' : 'text-secondary'}}">Cell. BP</label>
+                            <label class="mb-0 text-sm {{request()->input('f_cell_bp') && request()->input('f_cell_bp') !== 'any' ? 'font-weight-bold text-info' : 'text-secondary'}}">Cell. BP</label>
                             <select name="f_cell_bp"
                                     class="mr-2 form-control form-control-sm min-width-unset width-70px pl-0">
                                 <option {{request()->input('f_cell_bp') === 'any' ? 'selected' : ''}} value="any">Any</option>
@@ -117,7 +139,7 @@
                         </div>
 
                         <div>
-                            <label class="mb-0 text-sm {{request()->input('f_cell_wt') && request()->input('f_cell_wt') !== 'any' ? 'text-info' : 'text-secondary'}}">Cell. Wt</label>
+                            <label class="mb-0 text-sm {{request()->input('f_cell_wt') && request()->input('f_cell_wt') !== 'any' ? 'font-weight-bold text-info' : 'text-secondary'}}">Cell. Wt</label>
                             <select name="f_cell_wt"
                                     class="mr-2 form-control form-control-sm min-width-unset width-70px pl-0">
                                 <option {{request()->input('f_cell_wt') === 'any' ? 'selected' : ''}} value="any">Any</option>
@@ -127,7 +149,18 @@
                         </div>
 
                         <div>
-                            <label class="mb-0 text-sm {{request()->input('f_comm') && request()->input('f_comm') !== 'any' ? 'text-info' : 'text-secondary'}}">Comm.</label>
+                            <label class="mb-0 text-sm {{request()->input('f_lmb') && request()->input('f_lmb') !== 'ACTIVE' ? 'font-weight-bold text-info' : 'text-secondary'}}">LMB</label>
+                            <select name="f_lmb" class="mr-2 form-control form-control-sm min-width-unset width-70px pl-0">
+                                <option {{request()->input('f_lmb') === 'any' ? 'selected' : ''}} value="any">Any</option>
+                                <option {{request()->input('f_lmb') === '1' ? 'selected' : ''}} value="1">1 day</option>
+                                <option {{request()->input('f_lmb') === '2' ? 'selected' : ''}} value="2">2 days</option>
+                                <option {{request()->input('f_lmb') === '3' ? 'selected' : ''}} value="3">3 days</option>
+                                <option {{request()->input('f_lmb') === '3+' ? 'selected' : ''}} value="3+">3+ days</option>
+                            </select>
+                        </div>
+
+                        <div>
+                            <label class="mb-0 text-sm {{request()->input('f_comm') && request()->input('f_comm') !== 'any' ? 'font-weight-bold text-info' : 'text-secondary'}}">Comm.</label>
                             <select name="f_comm"
                                     class="mr-2 form-control form-control-sm min-width-unset width-70px pl-0">
                                 <option {{request()->input('f_comm') === 'any' ? 'selected' : ''}} value="any">Any</option>
@@ -137,7 +170,7 @@
                         </div>
 
                         <div>
-                            <label class="mb-0 text-sm {{request()->input('f_md') ? 'text-info' : 'text-secondary'}}">Meas. Days</label>
+                            <label class="mb-0 text-sm {{request()->input('f_md') ? 'font-weight-bold text-info' : 'text-secondary'}}">Meas. Days</label>
                             <div class="d-flex align-items-start">
                                 <select name="f_md_op"
                                         class="mr-1 form-control form-control-sm min-width-unset width-40px pl-0">
@@ -154,7 +187,7 @@
                         </div>
 
                         <div>
-                            <label class="mb-0 text-sm {{request()->input('f_unst') ? 'text-info' : 'text-secondary'}}">Unstamped</label>
+                            <label class="mb-0 text-sm {{request()->input('f_unst') ? 'font-weight-bold text-info' : 'text-secondary'}}">Unstamped</label>
                             <div class="d-flex align-items-start">
                                 <select name="f_unst_op"
                                         class="mr-1 form-control form-control-sm min-width-unset width-40px pl-0">
@@ -171,7 +204,7 @@
                         </div>
 
                         <div>
-                            <label class="mb-0 text-sm {{request()->input('f_mcp_mins') ? 'text-info' : 'text-secondary'}}">MCP Mins.</label>
+                            <label class="mb-0 text-sm {{request()->input('f_mcp_mins') ? 'font-weight-bold text-info' : 'text-secondary'}}">MCP Mins.</label>
                             <div class="d-flex align-items-start">
                                 <select name="f_mcp_mins_op"
                                         class="mr-1 form-control form-control-sm min-width-unset width-40px pl-0">
@@ -188,7 +221,7 @@
                         </div>
 
                         <div>
-                            <label class="mb-0 text-sm {{request()->input('f_rmm_mins') ? 'text-info' : 'text-secondary'}}">RMM Mins.</label>
+                            <label class="mb-0 text-sm {{request()->input('f_rmm_mins') ? 'font-weight-bold text-info' : 'text-secondary'}}">RMM Mins.</label>
                             <div class="d-flex align-items-start">
                                 <select name="f_rmm_mins_op"
                                         class="mr-1 form-control form-control-sm min-width-unset width-40px pl-0">
@@ -204,8 +237,9 @@
                             </div>
                         </div>
 
+                        {{--
                         <div>
-                            <label class="mb-0 text-sm {{request()->input('f_mcp_billable') && request()->input('f_mcp_billable') !== 'any' ? 'text-info' : 'text-secondary'}}">MCP Billable</label>
+                            <label class="mb-0 text-sm {{request()->input('f_mcp_billable') && request()->input('f_mcp_billable') !== 'any' ? 'font-weight-bold text-info' : 'text-secondary'}}">MCP Billable</label>
                             <select name="f_mcp_billable"
                                     class="mr-2 form-control form-control-sm min-width-unset width-70px pl-0">
                                 <option {{request()->input('f_mcp_billable') === 'all' ? 'selected' : ''}} value="any">All</option>
@@ -215,7 +249,7 @@
                         </div>
 
                         <div>
-                            <label class="mb-0 text-sm {{request()->input('f_rmm_billable') && request()->input('f_rmm_billable') !== 'any' ? 'text-info' : 'text-secondary'}}">RMM Billable</label>
+                            <label class="mb-0 text-sm {{request()->input('f_rmm_billable') && request()->input('f_rmm_billable') !== 'any' ? 'font-weight-bold text-info' : 'text-secondary'}}">RMM Billable</label>
                             <select name="f_rmm_billable"
                                     class="mr-2 form-control form-control-sm min-width-unset width-70px pl-0">
                                 <option {{request()->input('f_rmm_billable') === 'all' ? 'selected' : ''}} value="any">All</option>
@@ -223,6 +257,7 @@
                                 <option {{request()->input('f_rmm_billable') === 'no' ? 'selected' : ''}} value="no">No</option>
                             </select>
                         </div>
+                        --}}
 
                         <div>
                             <label class="mb-0 text-sm text-secondary">&nbsp;</label>
@@ -233,77 +268,30 @@
                         </div>
                     </div>
 
+                    <input type="hidden" name="not-enrolled" value="{{request()->input('not-enrolled')}}">
+
                 </form>
             </div>
 
             <?php $rc = request()->input('rc') ? request()->input('rc') : 1; ?>
 
             <div class="card-body p-0">
-                <div class="d-flex align-items-stretch m-0 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>
-                                addMCHook(
-                                    'refresh-rpm-row-{{$trIndex}}',
-                                    function () {
-                                        refreshRpmRow({{$trIndex}});
-                                    }
-                                );
-                            </script>
-                            <?php $trIndex++; ?>
-                        @endforeach
-                        <table class="table table-sm table-striped table-hover p-0 m-0 min-width-1100px" id="table-rm-matrix">
-                            <thead class="bg-light">
-                            <tr>
-
-                                <th class="border-0 pl-2">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'Name', 'key' => 'client_name'])</th>
-                                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'DOB', 'key' => 'dob'])</th>
-                                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'RPM?', 'key' => 'is_enrolled_in_rm'])</th>
-                                <th class="border-0 text-secondary">Cell. BP?</th>
-                                <th class="border-0 text-secondary">Cell. Scale?</th>
-                                <th class="border-0 text-secondary">Latest BP</th>
-                                <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-admin"), 'label' => 'Days Since Last Visit', 'key' => 'most_recent_completed_mcp_note_date'])</th>
-                                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'Comm?', '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-admin"), '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-admin"), 'label' => '#MCP Unst.', 'key' => 'rm_num_measurements_not_stamped_by_mcp'])</th>
-                                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => '#RMM Unst.', 'key' => 'rm_num_measurements_not_stamped_by_rmm'])</th>
-                                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => '#MCP Mins.', 'key' => 'rm_total_time_in_seconds_by_mcp'])</th>
-                                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => '#RMM Mins.', 'key' => 'rm_total_time_in_seconds_by_rmm_pro'])</th>
-                                @if(!request()->input('f_mcp_billable') || request()->input('f_mcp_billable') === 'all')
-                                    <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'MCP Bill', 'key' => 'mcp_rm_generic_bill_id'])</th>
-                                @else
-                                    <th class="border-0 text-secondary">MCP Bill</th>
-                                @endif
-                                @if(!request()->input('f_rmm_billable') || request()->input('f_rmm_billable') === 'all')
-                                    <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'RMM Bill', 'key' => 'rmm_rm_generic_bill_id'])</th>
-                                @else
-                                    <th class="border-0 text-secondary">RMM Bill</th>
-                                @endif
-                            </tr>
-                            </thead>
-                            <tbody>
-                            <?php $trIndex = 0; ?>
-                            @foreach ($patients as $iPatient)
-                                <?php
-
-                                $daysDiff = -1;
-                                if ($iPatient->most_recent_completed_mcp_note_date) {
-                                    $careMonthLastDay = date_add(date_create($rcmStartDate), date_interval_create_from_date_string("1 month"));
-                                    $careMonthLastDay = date_sub($careMonthLastDay, date_interval_create_from_date_string("1 day"));
-                                    $daysDiff = date_diff($careMonthLastDay, date_create($iPatient->most_recent_completed_mcp_note_date))->days;
-                                }
-                                $lastVisitWithin90Days = ($daysDiff !== -1 && $daysDiff <= 90);
-
-                                ?>
-                                @include('app.practice-management.remote-monitoring-row-markup-for-admin')
-                                <?php $trIndex++; ?>
-                            @endforeach
-                            </tbody>
-                        </table>
+                <div>
+                    <div class="d-flex align-items-baseline p-2 border-bottom" 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());"
+                           tab-link="rpm">Enrolled in RPM</a>
+                        <a class="{{ request()->input('not-enrolled') ? 'tab-link-active' : '' }} text-dark c-pointer"
+                           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>
+                <div class="cm-tab {{!request()->input('not-enrolled') ? '' : 'd-none'}}" tab-key="rpm">
+                    @include('app.practice-management.rpm-matrix-for-admin-table')
+                </div>
+                <div class="cm-tab {{request()->input('not-enrolled') ? '' : 'd-none'}}" tab-key="no-rpm">
+                    @include('app.practice-management.rpm-matrix-for-admin-table')
+                </div>
             </div>
         </div>
     </div>

+ 1 - 1
resources/views/layouts/template.blade.php

@@ -187,7 +187,7 @@
                             <a class="dropdown-item" href="{{ route('practice-management.coverages') }}">Coverage Center</a>
                             <a class="dropdown-item" href="{{ route('practice-management.notes-resolution-center') }}">Notes Resolution Center</a>
                             <a class="dropdown-item" href="{{ route('practice-management.notes-resolution-center-v2') }}">Notes Resolution Center V2</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.remote-monitoring-admin') }}">Remote Monitoring (admin)</a>
+                            <a class="dropdown-item" href="{{ route('practice-management.rpm-matrix-admin') }}">RPM (Admin)</a>
                             <a class="dropdown-item" href="{{ route('practice-management.daily-treatment-services') }}">Daily Treatment Services</a>
 
                             <a class="dropdown-item" href="{{ route('practice-management.client-pro-changes') }}">Client Pro Changes</a>