Vijayakrishnan 3 lat temu
rodzic
commit
13811ff045

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

@@ -1046,7 +1046,7 @@ ORDER BY care_month.number_of_days_with_remote_measurements DESC NULLS LAST, cli
         $count = DB::select(
             DB::raw(
                 "
-SELECT count(client.id)
+SELECT count(*)
 FROM care_month join client on care_month.client_id = client.id
 WHERE
       client.mcp_pro_id = {$performer->pro->id}
@@ -1059,6 +1059,88 @@ WHERE
         return $count[0]->count;
     }
 
+    public function remoteMonitoringAdmin(Request $request) {
+
+        $ym = ($request->input('y') ?: 'Y') . '-' . ($request->input('m') ?: 'm');
+        $careMonthStart = date($ym . '-01');
+
+        $rc = $request->input('rc') ?: 1;
+        $rc2 = $request->input('rc2') ?: 2;
+
+        $conditions = $this->rpmConditionsAdmin($this->performer(), $rc, $rc2);
+
+        $patients = DB::select(
+            DB::raw(
+                "
+SELECT client.name_first, 
+       client.name_last, 
+       client.uid as client_uid, 
+       client.dob,
+       client.is_enrolled_in_rm,
+       client.most_recent_completed_mcp_note_date,
+       care_month.uid as care_month_uid,
+       care_month.id as care_month_id,
+       care_month.start_date,
+       care_month.rm_total_time_in_seconds_by_mcp,
+       care_month.number_of_days_with_remote_measurements,
+       care_month.has_anyone_interacted_with_client_about_rm_outside_note,
+       care_month.rm_num_measurements_not_stamped_by_mcp,
+       care_month.rm_num_measurements_not_stamped_by_non_hcp,
+       care_month.rm_num_measurements_not_stamped_by_rmm,
+       care_month.rm_num_measurements_not_stamped_by_rme,
+       client.mcp_pro_id,
+       client.default_na_pro_id,
+       client.rmm_pro_id,
+       client.rme_pro_id,
+       client.cell_number,
+       client.most_recent_cellular_bp_dbp_mm_hg,
+       client.most_recent_cellular_bp_sbp_mm_hg,
+       client.most_recent_cellular_bp_measurement_at,      
+       client.most_recent_cellular_weight_value,
+       client.most_recent_cellular_weight_measurement_at
+FROM care_month join client on care_month.client_id = client.id
+WHERE
+      client.shadow_pro_id is null AND client.is_enrolled_in_rm = 'YES'
+      AND EXTRACT(MONTH from care_month.start_date) = " . ($request->input('m') ?: 'EXTRACT(MONTH from now())') . "
+      AND EXTRACT(YEAR from care_month.start_date) = " . ($request->input('y') ?: 'EXTRACT(YEAR from now())') . "
+      " . (count($conditions) > 0 ? 'AND ' . implode(" AND ", $conditions) : '') . "
+ORDER BY care_month.number_of_days_with_remote_measurements DESC NULLS LAST, client.name_first, client.name_last
+"
+            )
+        );
+
+        $timestamp = strtotime(date('Y-m-d'));
+        $daysRemaining = (int)date('t', $timestamp) - (int)date('j', $timestamp);
+
+        return view('app.practice-management.remote-monitoring-admin', compact('patients', 'daysRemaining', 'careMonthStart'));
+    }
+
+    public function remoteMonitoringAdminCount(Request $request) {
+
+        $ym = ($request->input('y') ?: 'Y') . '-' . ($request->input('m') ?: 'm');
+        $careMonthStart = date($ym . '-01');
+
+        $rc = $request->input('rc') ?: 1;
+        $rc2 = $request->input('rc2') ?: 2;
+
+        $conditions = $this->rpmConditionsAdmin($this->performer(), $rc, $rc2);
+
+        $count = DB::select(
+            DB::raw(
+                "
+SELECT count(*)
+FROM care_month join client on care_month.client_id = client.id
+WHERE
+      client.shadow_pro_id is null AND client.is_enrolled_in_rm = 'YES'
+      AND EXTRACT(MONTH from care_month.start_date) = " . ($request->input('m') ?: 'EXTRACT(MONTH from now())') . "
+      AND EXTRACT(YEAR from care_month.start_date) = " . ($request->input('y') ?: 'EXTRACT(YEAR from now())') . "
+      " . (count($conditions) > 0 ? 'AND ' . implode(" AND ", $conditions) : '')
+            )
+        );
+
+        return $count[0]->count;
+    }
+
     private function rpmConditions($performer, $rc, $rc2) {
         $conditions = [];
 
@@ -1114,6 +1196,57 @@ WHERE
         return $conditions;
     }
 
+    private function rpmConditionsAdmin($performer, $rc, $rc2) {
+        $conditions = [];
+
+        $c_enrolledInRPM = "client.is_enrolled_in_rm = 'YES'";
+        $c_hasDevice = "(SELECT COUNT(client_bdt_device.id) FROM client_bdt_device JOIN bdt_device bd on client_bdt_device.device_id = bd.id WHERE client_bdt_device.client_id = client.id) > 0";
+        $c_lastVisitBefore90Days = "DATE_PART('day', client.most_recent_completed_mcp_note_date::timestamp - care_month.start_date::timestamp) > 90";
+        $c_lastVisitWithin90Days = "DATE_PART('day', client.most_recent_completed_mcp_note_date::timestamp - care_month.start_date::timestamp) <= 90";
+        $c_notSpokenToThisMonth = "(care_month.has_anyone_interacted_with_client_about_rm_outside_note IS NULL OR care_month.has_anyone_interacted_with_client_about_rm_outside_note = FALSE)";
+        $c_spokenToThisMonth = "care_month.has_anyone_interacted_with_client_about_rm_outside_note = TRUE";
+        $c_hasUnstamped = "care_month.rm_num_measurements_not_stamped_by_mcp > 0";
+        $c_hasNoUnstamped = "care_month.rm_num_measurements_not_stamped_by_mcp = 0";
+        $c_lt16MeasurementDays = "care_month.number_of_days_with_remote_measurements < 16";
+        $c_gte16MeasurementDays = "care_month.number_of_days_with_remote_measurements >= 16";
+        $c_subscribedToSMS = "client.send_sms_on_bdt_measurement = TRUE";
+        $c_deviceUsed = "(client.most_recent_cellular_bp_measurement_at IS NOT NULL OR most_recent_cellular_weight_measurement_at IS NOT NULL)";
+        $c_lt20BillingMinutes = "care_month.rm_total_time_in_seconds_by_mcp < 1200";
+        $c_gte20BillingMinutes = "care_month.rm_total_time_in_seconds_by_mcp >= 1200";
+
+        switch ($rc) {
+            case 2:
+                $conditions = [$c_enrolledInRPM];
+                break;
+            case 3:
+                $conditions = [$c_enrolledInRPM, $c_hasDevice];
+                break;
+            case 4:
+                $conditions = [$c_enrolledInRPM, $c_hasDevice, ($rc2 == 1 ? $c_lastVisitBefore90Days : $c_lastVisitWithin90Days)];
+                break;
+            case 5:
+                $conditions = [$c_enrolledInRPM, $c_hasDevice, $c_lastVisitWithin90Days, ($rc2 == 1 ? $c_notSpokenToThisMonth : $c_spokenToThisMonth)];
+                break;
+            case 6:
+                $conditions = [$c_enrolledInRPM, $c_hasDevice, $c_lastVisitWithin90Days, $c_spokenToThisMonth, ($rc2 == 1 ? $c_hasUnstamped : $c_hasNoUnstamped)];
+                break;
+            case 7:
+                $conditions = [$c_enrolledInRPM, $c_hasDevice, $c_lastVisitWithin90Days, $c_spokenToThisMonth, ($rc2 == 1 ? $c_lt16MeasurementDays : $c_gte16MeasurementDays)];
+                break;
+            case 10:
+                $conditions = [$c_enrolledInRPM, $c_hasDevice, $c_lastVisitWithin90Days, $c_spokenToThisMonth, $c_gte16MeasurementDays, ($rc2 == 1 ? $c_lt20BillingMinutes : $c_gte20BillingMinutes)];
+                break;
+            case 8:
+                $conditions = [$c_enrolledInRPM, $c_subscribedToSMS];
+                break;
+            case 9:
+                $conditions = [$c_enrolledInRPM, $c_deviceUsed];
+                break;
+        }
+
+        return $conditions;
+    }
+
     public function remoteMonitoringMeasurements(Request $request, CareMonth $careMonth) {
 
         $performer = $this->performer();

+ 21 - 0
resources/views/app/dashboard-admin.blade.php

@@ -195,6 +195,13 @@
                                 Appointments
                             </a>
                         </li>
+                        <li class="nav-item">
+                            <a native data-tab="rpm" class="nav-link"
+                               :class="tab == 'rpm' ? 'active' : ''" href="#"
+                               v-on:click.prevent="tab='rpm';">
+                                RPM
+                            </a>
+                        </li>
                         <li class="nav-item">
                             <a native data-tab="measurements" class="nav-link"
                                :class="tab == 'measurements' ? 'active' : ''" href="#"
@@ -333,6 +340,20 @@
                                 Please select a date from the calendar on the left
                             </div>
                         </div>
+                        <div v-show="tab==='rpm'">
+                            <div id="rpm-tab">
+                                <div class="card mb-4">
+                                    <div class="card-header pl-2">
+                                        <strong>
+                                            Remote Monitoring: {{friendly_month(date('Y-m-d'))}}
+                                        </strong>
+                                    </div>
+                                    <div class="card-body p-1">
+                                        @include('app.practice-management.remote-monitoring-admin-tree')
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
                         <div v-show="tab==='measurements'">
                             <div id="measurements-tab">Loading...</div>
                         </div>

+ 89 - 0
resources/views/app/practice-management/remote-monitoring-admin-tree.blade.php

@@ -0,0 +1,89 @@
+<?php
+if(!@$rc) {
+    $rc = 0;
+}
+?>
+<div class="conditions-tree" id="remote-monitoring-tree">
+    <div class="condition">
+        <a href="{{route('practice-management.remote-monitoring-admin')}}?m={{request()->input('m')}}&y={{request()->input('y')}}&rc=2"
+                {!! $rc == 2 ? 'class="bg-aliceblue font-weight-bold"' : ''!!}>How many are enrolled in RPM?
+            <span class="rm-count ml-1" data-rc="2">(0)</span>
+        </a>
+        <div class="condition-children">
+            <div class="condition">
+                <a href="{{route('practice-management.remote-monitoring-admin')}}?m={{request()->input('m')}}&y={{request()->input('y')}}&rc=3"
+                        {!! $rc == 3 ? 'class="bg-aliceblue font-weight-bold"' : ''!!}>How many given a cellular device?
+                    <span class="rm-count ml-1" data-rc="3">(0)</span>
+                </a>
+                <div class="condition-children">
+                    <div class="condition">
+                        <a href="{{route('practice-management.remote-monitoring-admin')}}?m={{request()->input('m')}}&y={{request()->input('y')}}&rc=4"
+                                {!! $rc == 4 ? 'class="bg-aliceblue font-weight-bold"' : ''!!}>How many seen w/in 90 days?
+                            <span class="rm-count ml-1" data-rc="4">(0)</span>
+                        </a>
+                        <div class="condition-children">
+                            <div class="condition">
+                                <a href="{{route('practice-management.remote-monitoring-admin')}}?m={{request()->input('m')}}&y={{request()->input('y')}}&rc=5"
+                                        {!! $rc == 5 ? 'class="bg-aliceblue font-weight-bold"' : ''!!}>How many spoken to this month?
+                                    <span class="rm-count ml-1" data-rc="5">(0)</span>
+                                </a>
+                                <div class="condition-children">
+                                    <div class="condition">
+                                        <a href="{{route('practice-management.remote-monitoring-admin')}}?m={{request()->input('m')}}&y={{request()->input('y')}}&rc=6"
+                                                {!! $rc == 6 ? 'class="bg-aliceblue font-weight-bold"' : ''!!}>How many with no unstamped meas.?
+                                            <span class="rm-count ml-1" data-rc="6">(0)</span>
+                                        </a>
+                                    </div>
+                                    <div class="condition">
+                                        <a href="{{route('practice-management.remote-monitoring-admin')}}?m={{request()->input('m')}}&y={{request()->input('y')}}&rc=7"
+                                                {!! $rc == 7 ? 'class="bg-aliceblue font-weight-bold"' : ''!!}>How many with 16 or more meas. days?
+                                            <span class="rm-count ml-1" data-rc="7">(0)</span>
+                                        </a>
+                                        <div class="condition-children">
+                                            <div class="condition">
+                                                <a href="{{route('practice-management.remote-monitoring-admin')}}?m={{request()->input('m')}}&y={{request()->input('y')}}&rc=10"
+                                                        {!! $rc == 10 ? 'class="bg-aliceblue font-weight-bold"' : ''!!}>How many with 20 or more billing mins.?
+                                                    <span class="rm-count ml-1" data-rc="10">(0)</span>
+                                                </a>
+                                            </div>
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="condition">
+                        <a href="{{route('practice-management.remote-monitoring-admin')}}?m={{request()->input('m')}}&y={{request()->input('y')}}&rc=8"
+                                {!! $rc == 8 ? 'class="bg-aliceblue font-weight-bold"' : ''!!}>Home many have subscribed to SMS?
+                            <span class="rm-count ml-1" data-rc="8">(0)</span>
+                        </a>
+                    </div>
+                    <div class="condition">
+                        <a href="{{route('practice-management.remote-monitoring-admin')}}?m={{request()->input('m')}}&y={{request()->input('y')}}&rc=9"
+                                {!! $rc == 9 ? 'class="bg-aliceblue font-weight-bold"' : ''!!}>How many have used the device?
+                            <span class="rm-count ml-1" data-rc="9">(0)</span>
+                        </a>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<script>
+    (function() {
+        function init() {
+            window.setTimeout(() => {
+                $('#remote-monitoring-tree .rm-count').each(function() {
+                    let params = '?rc=' + $(this).attr('data-rc');
+                    if($(this).is('[data-rc2]')) params += '&rc2=' + $(this).attr('data-rc2');
+                    @if(request()->input('m')) params += '&m={{request()->input('m')}}'; @endif
+                    @if(request()->input('y')) params += '&y={{request()->input('y')}}'; @endif
+                    $.get('{{route('practice-management.remote-monitoring-admin-count')}}' + params, _data => {
+                        $(this).text('(' + _data + ')');
+                    });
+                });
+            }, 250);
+        }
+        addMCInitializer('remote-monitoring-tree', init, '#remote-monitoring-tree')
+    }).call(window);
+</script>

+ 143 - 0
resources/views/app/practice-management/remote-monitoring-admin.blade.php

@@ -0,0 +1,143 @@
+@extends ('layouts/template')
+
+@section('content')
+
+    <div class="p-3 mcp-theme-1" id="practice-remote-monitoring">
+
+        <div class="card">
+
+            <div class="card-header px-2 py-2 d-flex align-items-center">
+                <span class="mr-4">
+                    <span class="font-size-14">Remote Monitoring</span>
+                    <i class="fas fa-arrow-right text-sm mx-1"></i>
+                    <b class="font-size-14">{{friendly_month(date((request()->input('y') ?: 'Y') . '-' . (request()->input('m') ?: 'm') . '-d'))}}</b>
+                </span>
+                <form class="ml-auto d-inline-flex flex-nowrap align-items-center" action="" method="GET">
+
+                    <span class="mr-2">Month</span>
+                    <select class="form-control form-control-sm min-width-unset width-100px mr-3" name="m"
+                            onchange="fastLoad('{{route('practice-management.remote-monitoring-admin')}}?' + $(this).closest('form').serialize())">
+                        <option value="01" {{request()->input('m') === '01' ? 'selected' : ''}}>Jan</option>
+                        <option value="02" {{request()->input('m') === '02' ? 'selected' : ''}}>Feb</option>
+                        <option value="03" {{request()->input('m') === '03' ? 'selected' : ''}}>Mar</option>
+                        <option value="04" {{request()->input('m') === '04' ? 'selected' : ''}}>Apr</option>
+                        <option value="05" {{request()->input('m') === '05' ? 'selected' : ''}}>May</option>
+                        <option value="06" {{request()->input('m') === '06' ? 'selected' : ''}}>Jun</option>
+                        <option value="07" {{request()->input('m') === '07' ? 'selected' : ''}}>Jul</option>
+                        <option value="08" {{request()->input('m') === '08' ? 'selected' : ''}}>Aug</option>
+                        <option value="09" {{request()->input('m') === '09' ? 'selected' : ''}}>Sep</option>
+                        <option value="10" {{request()->input('m') === '10' ? 'selected' : ''}}>Oct</option>
+                        <option value="11" {{request()->input('m') === '11' ? 'selected' : ''}}>Nov</option>
+                        <option value="12" {{request()->input('m') === '12' ? 'selected' : ''}}>Dec</option>
+                    </select>
+                    <span class="mr-2">Year</span>
+                    <select class="form-control form-control-sm min-width-unset width-100px" name="y"
+                            onchange="fastLoad('{{route('practice-management.remote-monitoring-admin')}}?' + $(this).closest('form').serialize())">
+                        <option value="2020" {{request()->input('y') === '2020' ? 'selected' : ''}}>2020</option>
+                        <option value="2021" {{request()->input('y') === '2021' ? 'selected' : ''}}>2021</option>
+                        <option value="2022" {{request()->input('y') === '2022' ? 'selected' : ''}}>2022</option>
+                    </select>
+                </form>
+            </div>
+
+            <?php $rc = request()->input('rc') ? request()->input('rc') : 1; ?>
+
+            <div class="card-body p-0">
+                <div class="row m-0">
+                    <div class="col-4 p-0">
+                        @include('app.practice-management.remote-monitoring-admin-tree')
+                    </div>
+                    <div class="col-8 border-left p-0">
+                        @if($rc == 4)
+                            <?php $rc2 = request()->input('rc2') ? request()->input('rc2') : 2; ?>
+                            <div class="d-flex align-items-baseline p-2 border-bottom">
+                                <a href="{{route('practice-management.remote-monitoring-admin')}}?m={{request()->input('m')}}&y={{request()->input('y')}}&rc=4&rc2=1" class="border p-2 mr-2 {{$rc2 == 1 ? 'bg-aliceblue font-weight-bold' : ''}}" >Patients not seen in over 90 days</a>
+                                <a href="{{route('practice-management.remote-monitoring-admin')}}?m={{request()->input('m')}}&y={{request()->input('y')}}&rc=4&rc2=2" class="border p-2 mr-2 {{$rc2 == 2 ? 'bg-aliceblue font-weight-bold' : ''}}" >Patients seen w/in last 90 days</a>
+                            </div>
+                        @elseif($rc == 5)
+                            <?php $rc2 = request()->input('rc2') ? request()->input('rc2') : 2; ?>
+                            <div class="d-flex align-items-baseline p-2 border-bottom">
+                                <a href="{{route('practice-management.remote-monitoring-admin')}}?m={{request()->input('m')}}&y={{request()->input('y')}}&rc=5&rc2=1" class="border p-2 mr-2 {{$rc2 == 1 ? 'bg-aliceblue font-weight-bold' : ''}}" >Patients not spoken to this month</a>
+                                <a href="{{route('practice-management.remote-monitoring-admin')}}?m={{request()->input('m')}}&y={{request()->input('y')}}&rc=5&rc2=2" class="border p-2 mr-2 {{$rc2 == 2 ? 'bg-aliceblue font-weight-bold' : ''}}" >Patients spoken to this month</a>
+                            </div>
+                        @elseif($rc == 6)
+                            <?php $rc2 = request()->input('rc2') ? request()->input('rc2') : 2; ?>
+                            <div class="d-flex align-items-baseline p-2 border-bottom">
+                                <a href="{{route('practice-management.remote-monitoring-admin')}}?m={{request()->input('m')}}&y={{request()->input('y')}}&rc=6&rc2=1" class="border p-2 mr-2 {{$rc2 == 1 ? 'bg-aliceblue font-weight-bold' : ''}}" >Unstamped Measurements > 0</a>
+                                <a href="{{route('practice-management.remote-monitoring-admin')}}?m={{request()->input('m')}}&y={{request()->input('y')}}&rc=6&rc2=2" class="border p-2 mr-2 {{$rc2 == 2 ? 'bg-aliceblue font-weight-bold' : ''}}" >All Measurements Stamped</a>
+                            </div>
+                        @elseif($rc == 7)
+                            <?php $rc2 = request()->input('rc2') ? request()->input('rc2') : 2; ?>
+                            <div class="d-flex align-items-baseline p-2 border-bottom">
+                                <a href="{{route('practice-management.remote-monitoring-admin')}}?m={{request()->input('m')}}&y={{request()->input('y')}}&rc=7&rc2=1" class="border p-2 mr-2 {{$rc2 == 1 ? 'bg-aliceblue font-weight-bold' : ''}}" >Measurement Days < 16</a>
+                                <a href="{{route('practice-management.remote-monitoring-admin')}}?m={{request()->input('m')}}&y={{request()->input('y')}}&rc=7&rc2=2" class="border p-2 mr-2 {{$rc2 == 2 ? 'bg-aliceblue font-weight-bold' : ''}}" >Measurement Days >= 16</a>
+                            </div>
+                        @elseif($rc == 10)
+                            <?php $rc2 = request()->input('rc2') ? request()->input('rc2') : 2; ?>
+                            <div class="d-flex align-items-baseline p-2 border-bottom">
+                                <a href="{{route('practice-management.remote-monitoring-admin')}}?m={{request()->input('m')}}&y={{request()->input('y')}}&rc=10&rc2=1" class="border p-2 mr-2 {{$rc2 == 1 ? 'bg-aliceblue font-weight-bold' : ''}}" >Billing Minutes < 20</a>
+                                <a href="{{route('practice-management.remote-monitoring-admin')}}?m={{request()->input('m')}}&y={{request()->input('y')}}&rc=10&rc2=2" class="border p-2 mr-2 {{$rc2 == 2 ? 'bg-aliceblue font-weight-bold' : ''}}" >Billing Minutes >= 20</a>
+                            </div>
+                        @endif
+                        <table class="table table-sm table-striped table-hover p-0 m-0 foo-bar-t">
+                            <thead class="bg-light">
+                            <tr>
+                                <th class="border-0">Patient</th>
+                                <th class="border-0">MCP</th>
+                                <th class="border-0">DOB</th>
+                                <th class="border-0">Enrolled in RPM?</th>
+                                <th class="border-0">Cellular BP?</th>
+                                <th class="border-0">Cellular Scale?</th>
+                                <th class="border-0">Latest BP</th>
+                                <th class="border-0">Latest Weight</th>
+                                <th class="border-0">Latest Visit</th>
+                                <th class="border-0">RPM Interaction This Month?</th>
+                                <th class="border-0">Measurements Pending Stamp</th>
+                                <th class="border-0"># Meas. Days This Month</th>
+                                <th class="border-0"># RPM Minutes</th>
+
+                            </tr>
+                            </thead>
+                            <tbody>
+                            @foreach ($patients as $iPatient)
+                                <?php $oPatient = \App\Models\Client::where('uid', $iPatient->client_uid)->first(); ?>
+                                <tr>
+                                    <td class="">
+                                        <a href="/patients/view/{{ $iPatient->client_uid }}" class="text-nowrap">{{ $oPatient->displayName() }}</a>
+                                    </td>
+                                    <td class="">
+                                        {{$oPatient->mcp ? $oPatient->mcp->displayName() : '-'}}
+                                    </td>
+
+                                    <td>{{friendly_date($iPatient->dob)}}</td>
+                                    <td>{{ucwords(strtolower($iPatient->is_enrolled_in_rm ?: ''))}}</td>
+                                    <td>{{$oPatient->hasBPDevice() ? 'Yes' : 'No'}}</td>
+                                    <td>{{$oPatient->hasBPDevice() ? 'Yes' : 'No'}}</td>
+                                    <td>
+                                        {{$iPatient->most_recent_cellular_bp_sbp_mm_hg ?: '-'}}/{{$iPatient->most_recent_cellular_bp_dbp_mm_hg ?: '-'}}
+                                        @if($iPatient->most_recent_cellular_bp_measurement_at)
+                                            <div class="text-sm text-secondary text-nowrap">{{friendly_date_time($iPatient->most_recent_cellular_bp_measurement_at)}}</div>
+                                        @endif
+                                    </td>
+                                    <td>
+                                        {{$iPatient->most_recent_cellular_weight_value ? round($iPatient->most_recent_cellular_weight_value, 1) : '-'}}
+                                        @if($iPatient->most_recent_cellular_weight_measurement_at)
+                                            <div class="text-sm text-secondary text-nowrap">{{friendly_date_time($iPatient->most_recent_cellular_weight_measurement_at)}}</div>
+                                        @endif
+                                    </td>
+                                    <td>{{$iPatient->most_recent_completed_mcp_note_date ? friendly_date($iPatient->most_recent_completed_mcp_note_date) : '-'}}</td>
+                                    <td>{{$iPatient->has_anyone_interacted_with_client_about_rm_outside_note ? 'Yes' : 'No'}}</td>
+                                    <td>{{$iPatient->rm_num_measurements_not_stamped_by_mcp}}</td>
+                                    <td>{{$iPatient->number_of_days_with_remote_measurements ?: 0}}</td>
+                                    <td>{{floor($iPatient->rm_total_time_in_seconds_by_mcp / 60)}}</td>
+
+                                </tr>
+                            @endforeach
+                            </tbody>
+                        </table>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+@endsection

+ 1 - 1
resources/views/app/practice-management/remote-monitoring-tree.blade.php

@@ -86,7 +86,7 @@ if(!@$rc) {
                     if($(this).is('[data-rc2]')) params += '&rc2=' + $(this).attr('data-rc2');
                     @if(request()->input('m')) params += '&m={{request()->input('m')}}'; @endif
                     @if(request()->input('y')) params += '&y={{request()->input('y')}}'; @endif
-                    $.get('{{route('practice-management.remote-monitoring-count')}}?' + params, _data => {
+                    $.get('{{route('practice-management.remote-monitoring-count')}}' + params, _data => {
                         $(this).text('(' + _data + ')');
                     });
                 });

+ 2 - 2
resources/views/app/practice-management/remote-monitoring.blade.php

@@ -13,7 +13,7 @@
                     <b class="font-size-14">{{friendly_month(date((request()->input('y') ?: 'Y') . '-' . (request()->input('m') ?: 'm') . '-d'))}}</b>
                 </span>
                 <form class="ml-auto d-inline-flex flex-nowrap align-items-center" action="" method="GET">
-                    <span class="mr-2">M</span>
+                    <span class="mr-2">Month</span>
                     <select class="form-control form-control-sm min-width-unset width-100px mr-3" name="m"
                             onchange="fastLoad('{{route('practice-management.remote-monitoring')}}?' + $(this).closest('form').serialize())">
                         <option value="01" {{request()->input('m') === '01' ? 'selected' : ''}}>Jan</option>
@@ -29,7 +29,7 @@
                         <option value="11" {{request()->input('m') === '11' ? 'selected' : ''}}>Nov</option>
                         <option value="12" {{request()->input('m') === '12' ? 'selected' : ''}}>Dec</option>
                     </select>
-                    <span class="mr-2">Y</span>
+                    <span class="mr-2">Year</span>
                     <select class="form-control form-control-sm min-width-unset width-100px" name="y"
                             onchange="fastLoad('{{route('practice-management.remote-monitoring')}}?' + $(this).closest('form').serialize())">
                         <option value="2020" {{request()->input('y') === '2020' ? 'selected' : ''}}>2020</option>

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

@@ -123,7 +123,11 @@
                         <i class="mr-1 fas fa-tasks"></i> Practice
                     </a>
                     <div class="dropdown-menu mcp-theme-1 no-overflow-menu p-0" aria-labelledby="practice-management">
-                        <a class="dropdown-item" href="{{ route('practice-management.remote-monitoring') }}">Remote Monitoring</a>
+                        @if($pro->pro_type !== 'ADMIN')
+                            <a class="dropdown-item" href="{{ route('practice-management.remote-monitoring') }}">Remote Monitoring</a>
+                        @else
+                            <a class="dropdown-item" href="{{ route('practice-management.remote-monitoring-admin') }}">Remote Monitoring (admin)</a>
+                        @endif
                         @if($pro->pro_type == 'ADMIN')
                             <a class="dropdown-item" href="{{ route('practice-management.rpmMatrix') }}">RPM Matrix</a>
                             {{--<a class="dropdown-item" href="{{ route('practice-management.previousBills') }}">Previous Bills</a>--}}

+ 3 - 0
routes/web.php

@@ -303,6 +303,9 @@ Route::middleware('pro.auth')->group(function () {
         Route::get('remote-monitoring', 'PracticeManagementController@remoteMonitoring')->name('remote-monitoring');
         Route::get('remote-monitoring-count', 'PracticeManagementController@remoteMonitoringCount')->name('remote-monitoring-count');
 
+        Route::get('remote-monitoring-admin', 'PracticeManagementController@remoteMonitoringAdmin')->name('remote-monitoring-admin');
+        Route::get('remote-monitoring-admin-count', 'PracticeManagementController@remoteMonitoringAdminCount')->name('remote-monitoring-admin-count');
+
 
         //stat tree stuff
         Route::name('clauses.')->prefix('clauses/')->group(function () {