Browse Source

RPM manager (wip)

Vijayakrishnan 2 years ago
parent
commit
f505947d78

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

@@ -2250,7 +2250,6 @@ WHERE
                    left join bill rmmBill on care_month.rmm_rm_generic_bill_id = rmmBill.id";
 
         $defaultPageSize = 25;
-
         $page = $request->input('page') ?: 1;
         $perPage = $request->input('per_page') ?: $defaultPageSize;
         $offset = ($page - 1) * $perPage;
@@ -2428,6 +2427,146 @@ WHERE
         return view('app.practice-management.rpm-matrix-for-admin', compact('patients', 'daysRemaining', 'careMonthStart', 'paginator', 'perPage', 'stats'));
     }
 
+    public function rpmManager(Request $request) {
+
+        // whether this pro should be allowed access
+        $performer = $this->performer();
+        $pro = $performer->pro;
+        if($pro->pro_type !== 'ADMIN' &&
+            !$pro->is_considered_for_mcp_assignment &&
+            !$pro->is_considered_for_rmm &&
+            !$pro->is_considered_for_rme) {
+            abort(403);
+        }
+
+        $conditions = [];
+
+        // show only if enrolled in RPM
+        $conditions[] = "(care_month.is_client_enrolled_in_rm IS TRUE)";
+
+        // m and y are mandatory
+        $v = trim($request->input('m'));
+        if(!$v) $v = date("m");
+        $conditions[] = "(EXTRACT(MONTH from care_month.start_date) = $v)";
+        $month = $v;
+        $v = trim($request->input('y'));
+        if(!$v) $v = date("Y");
+        $conditions[] = "(EXTRACT(YEAR from care_month.start_date) = $v)";
+        $year = $v;
+
+        // count query
+        $countQuery = "
+SELECT count(*) 
+FROM care_month join client on care_month.client_id = client.id 
+    left join pro mcpPro on care_month.mcp_pro_id = mcpPro.id
+    left join pro rmmPro on care_month.rmm_pro_id = rmmPro.id
+    left join pro rmePro on care_month.rme_pro_id = rmePro.id
+    left join note mrnote on client.most_recent_completed_mcp_note_id = mrnote.id
+    left join appointment nv on nv.id = mrnote.follow_up_appointment_id
+WHERE
+      " . (count($conditions) > 0 ? implode(" AND ", $conditions) : '') . "      
+";
+
+        $countResult = DB::select($countQuery);
+        $total = $countResult[0]->count;
+
+        $orderBy = "care_month.start_date DESC, 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";
+        $defaultPageSize = 25;
+        $page = $request->input('page') ?: 1;
+        $perPage = $request->input('per_page') ?: $defaultPageSize;
+        $offset = ($page - 1) * $perPage;
+
+        // main query
+        $query = "
+SELECT 
+       -- display columns
+       (client.name_first || ' ' || client.name_last) as client_name,
+       client.dob,
+       care_month.start_date,
+       (mcpPro.name_first || ' ' || mcpPro.name_last) as mcp_name,
+       (rmmPro.name_first || ' ' || rmmPro.name_last) as rmm_name,
+       (rmePro.name_first || ' ' || rmePro.name_last) as rme_name,
+       care_month.days_between_most_recent_mcp_note_date_and_end_of_care_month,
+       care_month.number_of_days_with_remote_measurements,
+       care_month.number_of_days_with_remote_bp_measurements,
+       care_month.number_of_days_with_remote_weight_measurements,
+       care_month.has_cellular_weight_scale_been_ordered,
+       care_month.has_cellular_weight_scale_device,
+       care_month.most_recent_cellular_weight_value,
+       care_month.most_recent_cellular_weight_measurement_at,
+       care_month.has_cellular_bp_device,
+       care_month.has_cellular_bp_meter_been_ordered,
+       care_month.most_recent_cellular_bp_dbp_mm_hg,
+       care_month.most_recent_cellular_bp_sbp_mm_hg,
+       care_month.most_recent_cellular_bp_measurement_at,
+       care_month.entries_json,
+       care_month.has_mcp_interacted_with_client_about_rm,
+       care_month.has_anyone_interacted_with_client_about_rm,
+       care_month.has_admin_interacted_with_client_about_rm,
+       care_month.has_rmm_interacted_with_client_about_rm,
+       care_month.rm_total_time_in_seconds,
+       care_month.rm_total_time_in_seconds_by_mcp,
+       care_month.rm_total_time_in_seconds_by_rmm_pro,
+       care_month.is_billable_by_mcp,
+       care_month.is_billed_by_mcp,
+       care_month.is_billable_by_rmm,
+       care_month.is_billed_by_rmm,
+       care_month.is_billable_by_rme,
+       care_month.is_billed_by_rme,
+       care_month.is_99454_claimable,
+       care_month.is_99454_claimed,
+       care_month.is_99454_claiming_waived,
+       care_month.why_99454_not_claimable_reason,
+       care_month.why_claiming_99454_waived,
+       care_month.is_99457_claimable,
+       care_month.is_99457_claimed,
+       care_month.is_99457_claiming_waived,
+       care_month.why_99457_not_claimable_reason,
+       care_month.why_claiming_99457_waived,
+       care_month.is_99458_claimable,
+       care_month.is_99458_claimed,
+       care_month.is_99458_claiming_waived,
+       care_month.why_99458_not_claimable_reason,
+       care_month.why_claiming_99458_waived,
+       nv.raw_date as next_visit_date,
+       -- TODO vital settings
+       
+       -- functionality support columns
+       client.uid as client_uid,
+       care_month.uid as care_month_uid,
+       mcpPro.mcp_rpm_payment_strategy,
+       mcpPro.mcp_rpm_payment_amount,
+       rmmPro.rmm_payment_strategy,
+       rmmPro.rmm_payment_amount,
+       rmePro.rme_payment_strategy,
+       rmePro.rme_payment_amount
+
+FROM care_month join client on care_month.client_id = client.id 
+    left join pro mcpPro on care_month.mcp_pro_id = mcpPro.id
+    left join pro rmmPro on care_month.rmm_pro_id = rmmPro.id
+    left join pro rmePro on care_month.rme_pro_id = rmePro.id
+    left join note mrnote on client.most_recent_completed_mcp_note_id = mrnote.id
+    left join appointment nv on nv.id = mrnote.follow_up_appointment_id
+WHERE
+      " . (count($conditions) > 0 ? implode(" AND ", $conditions) : '') . "
+      ORDER BY {$orderBy} OFFSET {$offset} LIMIT {$perPage}
+      
+";
+
+        $patients = DB::select($query);
+        $paginator = new LengthAwarePaginator($patients, $total, $request->input('per_page') ?: $defaultPageSize, $request->input('page') ?: 1);
+        $paginator->setPath(route('practice-management.rpm-matrix-admin'));
+
+        $proRoles = [];
+        if($pro->pro_type === 'ADMIN') $proRoles[] = 'ADMIN';
+        if($pro->pro_type === 'ADMIN' || $pro->is_considered_for_mcp_assignment) $proRoles[] = 'MCP';
+        if($pro->pro_type === 'ADMIN' || $pro->is_considered_for_rmm) $proRoles[] = 'RMM';
+        if($pro->pro_type === 'ADMIN' || $pro->is_considered_for_rme) $proRoles[] = 'RME';
+        $viewingAs = $request->input('viewingAs') ?: $proRoles[0];
+
+        return view('app.practice-management.rpm-manager.index', compact('patients', 'month', 'year','paginator', 'perPage', 'proRoles', 'viewingAs'));
+    }
+
     public function claimsReport(Request $request) {
 
         $performer = $this->performer();

+ 97 - 0
resources/views/app/practice-management/rpm-manager/index.blade.php

@@ -0,0 +1,97 @@
+@extends ('layouts/template')
+
+@section('content')
+    <style>
+        #admin-table-rm-matrix_wrapper {
+            padding-top: 10px;
+        }
+    </style>
+    <link rel="stylesheet" href="https://cdn.datatables.net/1.11.5/css/jquery.dataTables.min.css">
+    <script src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.min.js"></script>
+
+    <div class="p-3 mcp-theme-1" id="practice-rpm-manager">
+
+        <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" id="rpm-matrix-filter">
+                    <div class="d-flex align-items-baseline">
+                        <span class="font-size-16">RPM Manager</span>
+                    </div>
+                </form>
+            </div>
+
+            <div class="card-body p-0">
+                <div class="d-flex align-items-baseline p-2 border-bottom">
+                    <div class="d-inline-flex align-items-center">
+                        <form action="">
+                            <div class="mr-3 d-inline-flex align-items-center">
+                                <label class="mb-0 mr-2">Month</label>
+                                <select name="m" class="form-control form-control-sm min-width-unset pl-0"
+                                    onchange="fastLoad('{{route('practice-management.rpm-manager')}}?' + $(this).closest('form').serialize())">
+                                    <option value="">All</option>
+                                    <option value="01" {{$month && intval($month) === 1 ? 'selected' : ''}}>Jan</option>
+                                    <option value="02" {{$month && intval($month) === 2 ? 'selected' : ''}}>Feb</option>
+                                    <option value="03" {{$month && intval($month) === 3 ? 'selected' : ''}}>Mar</option>
+                                    <option value="04" {{$month && intval($month) === 4 ? 'selected' : ''}}>Apr</option>
+                                    <option value="05" {{$month && intval($month) === 5 ? 'selected' : ''}}>May</option>
+                                    <option value="06" {{$month && intval($month) === 6 ? 'selected' : ''}}>Jun</option>
+                                    <option value="07" {{$month && intval($month) === 7 ? 'selected' : ''}}>Jul</option>
+                                    <option value="08" {{$month && intval($month) === 8 ? 'selected' : ''}}>Aug</option>
+                                    <option value="09" {{$month && intval($month) === 9 ? 'selected' : ''}}>Sep</option>
+                                    <option value="10" {{$month && intval($month) === 10 ? 'selected' : ''}}>Oct</option>
+                                    <option value="11" {{$month && intval($month) === 11 ? 'selected' : ''}}>Nov</option>
+                                    <option value="12" {{$month && intval($month) === 12 ? 'selected' : ''}}>Dec</option>
+                                </select>
+                            </div>
+                            <div class="mr-3 d-inline-flex align-items-center">
+                                <label class="mb-0 mr-2">Year</label>
+                                <select name="y" class="form-control form-control-sm min-width-unset pl-0"
+                                    onchange="fastLoad('{{route('practice-management.rpm-manager')}}?' + $(this).closest('form').serialize())">
+                                    <option value="">All</option>
+                                    <option value="2020" {{$year && intval($year) === 2020 ? 'selected' : ''}}>2020</option>
+                                    <option value="2021" {{$year && intval($year) === 2021 ? 'selected' : ''}}>2021</option>
+                                    <option value="2022" {{$year && intval($year) === 2022 ? 'selected' : ''}}>2022</option>
+                                </select>
+                            </div>
+                            <div class="mr-3 d-inline-flex align-items-center">
+                                <label class="mb-0 mr-2 text-nowrap">Viewing As</label>
+                                <select name="viewingAs" class="form-control form-control-sm min-width-unset pl-0"
+                                    onchange="fastLoad('{{route('practice-management.rpm-manager')}}?' + $(this).closest('form').serialize())">
+                                    @foreach($proRoles as $proRole)
+                                        <option value="{{$proRole}}" {{$viewingAs === $proRole ? 'selected' : ''}}>{{$proRole}}</option>
+                                    @endforeach
+                                </select>
+                            </div>
+                        </form>
+                    </div>
+                    @if($paginator->total())
+                        <div class="d-inline-flex align-items-baseline ml-auto mb-0-pagination">
+                            <div class="mr-2"><b>{{$paginator->firstItem()}}</b> to <b>{{$paginator->lastItem()}}</b> (page {{$paginator->currentPage()}}) of <b>{{$paginator->total()}}</b> care months</div>
+                            {!! $paginator->onEachSide(2)->withQueryString()->links() !!}
+                            <select class="form-control form-control-sm min-width-unset width-140px px-2 ml-2" onchange="fastLoad('{{ route('practice-management.rpm-manager') }}?{{queryLineExcept(['per_page', 'page'])}}&per_page=' + this.value)">
+                                <option {{$perPage == 25 ? 'selected' : ''}} value="25">25/page</option>
+                                <option {{$perPage == 50 ? 'selected' : ''}} value="50">50/page</option>
+                                <option {{$perPage == 75 ? 'selected' : ''}} value="75">75/page</option>
+                                <option {{$perPage == 100 ? 'selected' : ''}} value="100">100/page</option>
+                            </select>
+                        </div>
+                    @endif
+                </div>
+                @include('app.practice-management.rpm-manager.table', compact('viewingAs'))
+            </div>
+        </div>
+    </div>
+    <script>
+        (function () {
+
+            function init() {
+                let parent = $('#practice-rpm-manager');
+
+                // TODO:
+            }
+
+            addMCInitializer('practice-rpm-manager', init, '#practice-rpm-manager');
+        }).call(window);
+    </script>
+@endsection

+ 214 - 0
resources/views/app/practice-management/rpm-manager/row.blade.php

@@ -0,0 +1,214 @@
+<?php $lastVisitWithinDays = !is_null($iPatient->days_between_most_recent_mcp_note_date_and_end_of_care_month) && $iPatient->days_between_most_recent_mcp_note_date_and_end_of_care_month <= 120; ?>
+<tr data-client-uid="{{$iPatient->client_uid}}" data-care-month-uid="{{$iPatient->care_month_uid}}">
+
+    <td>
+        <a href="/patients/view/{{ $iPatient->client_uid }}"
+           native target="_blank"
+           open-in-stag-popup
+           class="text-nowrap d-block max-width-170px overflow-hidden text-ellipsis"
+        >{{ $iPatient->client_name }}</a>
+    </td>
+    <td><span class="text-nowrap">{{$iPatient->dob}}</span></td>
+    <td><div class="text-nowrap" title="{{$iPatient->mcp_name ?: ''}}">{{$iPatient->mcp_name ?: '-'}}</div></td>
+    <td><div class="text-nowrap" title="{{$iPatient->rmm_name ?: ''}}">{{$iPatient->rmm_name ?: '-'}}</div></td>
+    <td><div class="text-nowrap" title="{{$iPatient->rme_name ?: ''}}">{{$iPatient->rme_name ?: '-'}}</div></td>
+    <td>{{$iPatient->days_between_most_recent_mcp_note_date_and_end_of_care_month}}</td>
+
+    <!--# Meas. Days-->
+    <td>{{$iPatient->number_of_days_with_remote_measurements}}</td>
+    <td>{{$iPatient->number_of_days_with_remote_bp_measurements}}</td>
+    <td>{{$iPatient->number_of_days_with_remote_weight_measurements}}</td>
+
+    <td>
+        @if(!$iPatient->has_cellular_bp_device)
+            @if($iPatient->has_cellular_bp_meter_been_ordered)
+                Ordered
+            @else
+                Not Ordered
+            @endif
+        @else
+            @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"
+                              title="{{friendly_date_time($iPatient->most_recent_cellular_bp_measurement_at)}}">{{friendly_date_est_compact($iPatient->most_recent_cellular_bp_measurement_at)}}</span>
+                    @endif
+                </div>
+            @endif
+        @endif
+    </td>
+    <td>
+        @if(!$iPatient->has_cellular_bp_device)
+            @if($iPatient->has_cellular_bp_meter_been_ordered)
+                Ordered
+            @else
+                Not Ordered
+            @endif
+        @else
+            @if($iPatient->most_recent_cellular_weight_value)
+                <div class="text-nowrap">
+                    <span class="sort-data">{{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"
+                              title="{{friendly_date_time($iPatient->most_recent_cellular_weight_measurement_at)}}">{{friendly_date_est_compact($iPatient->most_recent_cellular_weight_measurement_at)}}</span>
+                    @endif
+                </div>
+            @endif
+        @endif
+    </td>
+
+    @if($viewingAs !== 'RME')
+        <td>my entries</td>
+        <td>other entries</td>
+    @endif
+
+    <td>
+        @if($viewingAs === 'ADMIN')
+            <div class="d-flex align-items-baseline flex-nowrap">
+                <i class="fa fa-circle text-sm opacity-35 {{$iPatient->has_mcp_interacted_with_client_about_rm ? 'text-success' : 'text-danger'}}"></i>
+                <span class="ml-1 mr-2 text-sm">MCP</span>
+                <i class="fa fa-circle text-sm opacity-35 {{$iPatient->has_rmm_interacted_with_client_about_rm ? 'text-success' : 'text-danger'}}"></i>
+                <span class="ml-1 mr-2 text-sm">RMM</span>
+                <i class="fa fa-circle text-sm opacity-35 {{$iPatient->has_admin_interacted_with_client_about_rm ? 'text-success' : 'text-danger'}}"></i>
+                <span class="ml-1 mr-2 text-sm">Admin</span>
+            </div>
+        @elseif($viewingAs === 'MCP')
+            <div class="d-flex align-items-baseline flex-nowrap">
+                <i class="fa fa-circle text-sm opacity-35 {{$iPatient->has_mcp_interacted_with_client_about_rm ? 'text-success' : 'text-danger'}}"></i>
+                <span class="ml-1 mr-2 text-sm">Yes</span>
+            </div>
+        @elseif($viewingAs === 'RMM')
+            <div class="d-flex align-items-baseline flex-nowrap">
+                <i class="fa fa-circle text-sm opacity-35 {{$iPatient->has_mcp_interacted_with_client_about_rm ? 'text-success' : 'text-danger'}}"></i>
+                <span class="ml-1 mr-2 text-sm">Yes</span>
+            </div>
+        @endif
+    </td>
+
+    <!--Time-->
+    @if($viewingAs !== 'RME')
+        @if($viewingAs === 'ADMIN' || $viewingAs === 'MCP')
+            <td>
+                <div class="d-flex align-items-baseline">
+                    <i class="mr-1 text-sm fa fa-circle opacity-35 {{$iPatient->rm_total_time_in_seconds_by_mcp >= 1200 ? 'text-success' : 'text-danger'}}"></i>
+                    <span class="text-nowrap">{{round($iPatient->rm_total_time_in_seconds_by_mcp / 60)}}:{{round($iPatient->rm_total_time_in_seconds_by_mcp % 60)}}</span>
+                    <span class="sort-data d-none">{{$iPatient->rm_total_time_in_seconds_by_mcp}}</span>
+                </div>
+            </td>
+        @endif
+        @if($viewingAs === 'ADMIN' || $viewingAs === 'RMM')
+            <td>
+                <div class="d-flex align-items-baseline">
+                    <i class="mr-1 text-sm fa fa-circle opacity-35 {{$iPatient->rm_total_time_in_seconds_by_rmm_pro >= 1200 ? 'text-success' : 'text-danger'}}"></i>
+                    <span class="text-nowrap">{{round($iPatient->rm_total_time_in_seconds_by_rmm_pro / 60)}}:{{round($iPatient->rm_total_time_in_seconds_by_rmm_pro % 60)}}</span>
+                    <span class="sort-data d-none">{{$iPatient->rm_total_time_in_seconds_by_rmm_pro}}</span>
+                </div>
+            </td>
+        @endif
+        @if($viewingAs === 'ADMIN')
+            <td>
+                <div class="d-flex align-items-baseline">
+                    <i class="mr-1 text-sm fa fa-circle opacity-35 {{$iPatient->rm_total_time_in_seconds >= 1200 ? 'text-success' : 'text-danger'}}"></i>
+                    <span class="text-nowrap">{{round($iPatient->rm_total_time_in_seconds / 60)}}:{{round($iPatient->rm_total_time_in_seconds % 60)}}</span>
+                    <span class="sort-data d-none">{{$iPatient->rm_total_time_in_seconds}}</span>
+                </div>
+            </td>
+        @endif
+    @endif
+
+    <!--Reimb.-->
+    @if($viewingAs === 'ADMIN' || $viewingAs === 'MCP')
+        <td>
+            @if($iPatient->is_billable_by_mcp)
+                @if($iPatient->is_billed_by_mcp)
+                    Billed
+                @else
+                    Billable
+                @endif
+            @else
+                Not Billable
+            @endif
+        </td>
+    @endif
+    @if($viewingAs === 'ADMIN' || $viewingAs === 'RMM')
+        <td>
+            @if($iPatient->is_billable_by_rmm)
+                @if($iPatient->is_billed_by_rmm)
+                    Billed
+                @else
+                    Billable
+                @endif
+            @else
+                Not Billable
+            @endif
+        </td>
+    @endif
+    @if($viewingAs === 'ADMIN' || $viewingAs === 'RME')
+        <td>
+            @if($iPatient->is_billable_by_rme)
+                @if($iPatient->is_billed_by_rme)
+                    Billed
+                @else
+                    Billable
+                @endif
+            @else
+                Not Billable
+            @endif
+        </td>
+    @endif
+
+    <!--Claim-->
+    @if($viewingAs === 'ADMIN')
+        <td>
+            @if($iPatient->is_99454_claiming_waived)
+                <span title="{{$iPatient->why_claiming_99454_waived ?: ''}}">Waived</span>
+            @else
+                @if($iPatient->is_99454_claimable)
+                    @if($iPatient->is_99454_claimed)
+                        Claimed
+                    @else
+                        Claimable
+                    @endif
+                @else
+                    <span title="{{$iPatient->why_99454_not_claimable_reason ?: ''}}"></span>Not Claimable
+                @endif
+            @endif
+        </td>
+        <td>
+            @if($iPatient->is_99457_claiming_waived)
+                <span title="{{$iPatient->why_claiming_99457_waived ?: ''}}">Waived</span>
+            @else
+                @if($iPatient->is_99457_claimable)
+                    @if($iPatient->is_99457_claimed)
+                        Claimed
+                    @else
+                        Claimable
+                    @endif
+                @else
+                    <span title="{{$iPatient->why_99457_not_claimable_reason ?: ''}}"></span>Not Claimable
+                @endif
+            @endif
+        </td>
+        <td>
+            @if($iPatient->is_99458_claiming_waived)
+                <span title="{{$iPatient->why_claiming_99458_waived ?: ''}}">Waived</span>
+            @else
+                @if($iPatient->is_99458_claimable)
+                    @if($iPatient->is_99458_claimed)
+                        Claimed
+                    @else
+                        Claimable
+                    @endif
+                @else
+                    <span title="{{$iPatient->why_99458_not_claimable_reason ?: ''}}"></span>Not Claimable
+                @endif
+            @endif
+        </td>
+    @endif
+
+    <td><span class="text-nowrap">{{$iPatient->next_visit_date ?: '-'}}</span></td>
+
+    <td></td>
+
+</tr>

+ 109 - 0
resources/views/app/practice-management/rpm-manager/table.blade.php

@@ -0,0 +1,109 @@
+<div class="d-flex align-items-stretch m-0 h-100">
+    {{--@if(!request()->input('not-enrolled'))
+        <div class="overflow-auto border-right h-100 rpm-matrix-left-column">
+            @if(request()->input('f_mcp'))
+                @include('app.stat-tree.summary', ['slug' => 'rm-tree-mcp', 'showForPro' => $pro, 'noDropVisualize' => true, 'stParams' => ['start_date' => $rcmStartDate]])
+            @else
+                @include('app.stat-tree.summary', ['slug' => 'rm-tree-admin', 'noDropVisualize' => true, 'stParams' => ['start_date' => $rcmStartDate]])
+            @endif
+        </div>
+    @endif--}}
+    <div class="flex-grow-1 px-0 overflow-auto h-100 rpm-matrix-right-column">
+        <?php $trIndex = 0; ?>
+        @foreach ($patients as $iPatient)
+            <?php $trIndex++; ?>
+        @endforeach
+        <table class="table table-sm table-bordered table-striped table-hover p-0 m-0 min-width-1100px border-0" id="table-rm-matrix">
+            <thead class="bg-light">
+            <tr>
+                <th class="border-top-0"></th>
+                <th class="border-top-0"></th>
+                <th class="border-top-0"></th>
+                <th class="border-top-0"></th>
+                <th class="border-top-0"></th>
+                <th class="border-top-0"></th>
+                <th class="border-top-0 bg-aliceblue" colspan="3"># Meas. Days</th>
+                <th class="border-top-0"></th>
+                <th class="border-top-0"></th>
+                @if($viewingAs !== 'RME')
+                    <th class="border-top-0 bg-aliceblue" colspan="2">Entries</th>
+                @endif
+                <th class="border-top-0"></th>
+                @if($viewingAs !== 'RME')
+                    <th class="border-top-0 bg-aliceblue" colspan="{{$viewingAs === 'ADMIN' ? 3 : 1}}">Time</th>
+                @endif
+                <th class="border-top-0 bg-aliceblue" colspan="{{$viewingAs === 'ADMIN' ? 3 : 1}}">Reimbursement</th>
+                @if($viewingAs === 'ADMIN')
+                    <th class="border-top-0 bg-aliceblue" colspan="3">Claim</th>
+                @endif
+                <th class="border-top-0"></th>
+                <th class="border-top-0"></th>
+            </tr>
+            <tr>
+                <th class="border-bottom-0 border-top-0">Name</th>
+                <th class="border-bottom-0 border-top-0">DOB</th>
+                <th class="border-bottom-0 border-top-0">MCP</th>
+                <th class="border-bottom-0 border-top-0">RMM</th>
+                <th class="border-bottom-0 border-top-0">RME</th>
+                <th class="border-bottom-0 border-top-0">DSLV</th>
+
+                <!--# Meas. Days-->
+                <th class="border-bottom-0 border-top-0">Total</th>
+                <th class="border-bottom-0 border-top-0">BP</th>
+                <th class="border-bottom-0 border-top-0">WT</th>
+
+                <th class="border-bottom-0 border-top-0">BP</th>
+                <th class="border-bottom-0 border-top-0">Weight</th>
+
+                @if($viewingAs !== 'RME')
+                    <th class="border-bottom-0 border-top-0">Mine</th>
+                    <th class="border-bottom-0 border-top-0">Others</th>
+                @endif
+
+                <th class="border-bottom-0 border-top-0">Comm.</th>
+
+                <!--Time-->
+                @if($viewingAs !== 'RME')
+                    @if($viewingAs === 'ADMIN' || $viewingAs === 'MCP')
+                        <th class="border-bottom-0 border-top-0">MCP</th>
+                    @endif
+                    @if($viewingAs === 'ADMIN' || $viewingAs === 'RMM')
+                        <th class="border-bottom-0 border-top-0">RMM</th>
+                    @endif
+                    @if($viewingAs === 'ADMIN')
+                        <th class="border-bottom-0 border-top-0">Total</th>
+                    @endif
+                @endif
+
+                <!--Reimb.-->
+                @if($viewingAs === 'ADMIN' || $viewingAs === 'MCP')
+                    <th class="border-bottom-0 border-top-0">MCP</th>
+                @endif
+                @if($viewingAs === 'ADMIN' || $viewingAs === 'RMM')
+                    <th class="border-bottom-0 border-top-0">RMM</th>
+                @endif
+                @if($viewingAs === 'ADMIN' || $viewingAs === 'RME')
+                    <th class="border-bottom-0 border-top-0">RME</th>
+                @endif
+
+                <!--Claim-->
+                @if($viewingAs === 'ADMIN')
+                    <th class="border-bottom-0 border-top-0">454</th>
+                    <th class="border-bottom-0 border-top-0">457</th>
+                    <th class="border-bottom-0 border-top-0">458</th>
+                @endif
+
+                <th class="border-bottom-0 border-top-0">Next</th>
+                <th class="border-bottom-0 border-top-0"></th>
+            </tr>
+            </thead>
+            <tbody>
+            <?php $trIndex = 0; ?>
+            @foreach ($patients as $iPatient)
+                @include('app.practice-management.rpm-manager.row', compact('viewingAs'))
+                <?php $trIndex++; ?>
+            @endforeach
+            </tbody>
+        </table>
+    </div>
+</div>

+ 3 - 0
routes/web.php

@@ -381,6 +381,9 @@ Route::middleware('pro.auth')->group(function () {
 
             Route::get('rpm-admin', 'PracticeManagementController@rpmMatrixForAdmin')->name('rpm-matrix-admin');
 
+            // rpm manager (new)
+            Route::get('rpm-manager', 'PracticeManagementController@rpmManager')->name('rpm-manager');
+
             Route::get('claims-report', 'PracticeManagementController@claimsReport')->name('claims-report');
 
             Route::get('problems-report', 'PracticeManagementController@problemsReport')->name('problems-report');