Переглянути джерело

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

= 2 роки тому
батько
коміт
0485426671

+ 17 - 0
app/Helpers/helpers.php

@@ -280,6 +280,23 @@ if(!function_exists('friendly_date_est_compact')) {
     }
 }
 
+if(!function_exists('friendly_date_compact')) {
+    function friendly_date_compact($value, $default = '-') {
+
+        if(!$value || empty($value)) return $default;
+        try {
+
+            $date = new DateTime($value);
+
+            return $date->format('y') === date('y') ? $date->format("m/d") : $date->format("m/d/y");
+
+        }
+        catch (Exception $e) {
+            return $e->getMessage();
+        }
+    }
+}
+
 
 if(!function_exists('friendly_date_time')) {
     function friendly_date_time($value, $includeTime = true, $default = '-', $long_year=false) {

+ 49 - 15
app/Http/Controllers/PracticeManagementController.php

@@ -394,7 +394,7 @@ OFFSET {$offset} LIMIT {$perPage}
 
         $testClientIds = [];
         if(!$request->input('itr')) {
-            $testClients = Client::whereRaw("(name_first NOT ILIKE '%test%' AND name_last NOT ILIKE '%test%' AND client_engagement_status_category != 'DUMMY')")->select('id')->get();
+            $testClients = Client::whereRaw("(name_first ILIKE '%test%' OR name_last ILIKE '%test%' OR client_engagement_status_category = 'DUMMY')")->select('id')->get();
             $testClientIds = $testClients->map(function($_x) {return $_x->id;})->toArray();
         }
 
@@ -2458,16 +2458,36 @@ WHERE
 
         $conditions = [];
 
-        switch($viewingAs) {
-            case 'MCP':
-                $conditions[] = "(care_month.mcp_pro_id = {$pro->id})";
-                break;
-            case 'RMM':
-                $conditions[] = "(care_month.rmm_pro_id = {$pro->id})";
-                break;
-            case 'RME':
-                $conditions[] = "(care_month.rme_pro_id = {$pro->id})";
-                break;
+        if($pro->pro_type !== 'ADMIN') {
+            switch ($viewingAs) {
+                case 'MCP':
+                    $conditions[] = "(care_month.mcp_pro_id = {$pro->id})";
+                    break;
+                case 'RMM':
+                    $conditions[] = "(care_month.rmm_pro_id = {$pro->id})";
+                    break;
+                case 'RME':
+                    $conditions[] = "(care_month.rme_pro_id = {$pro->id})";
+                    break;
+            }
+        }
+        else {
+            if($request->input('proUid') && $viewingAs !== 'ADMIN') {
+                $targetPro = Pro::where('uid', $request->input('proUid'))->first();
+                if($targetPro) {
+                    switch ($viewingAs) {
+                        case 'MCP':
+                            $conditions[] = "(care_month.mcp_pro_id = {$targetPro->id})";
+                            break;
+                        case 'RMM':
+                            $conditions[] = "(care_month.rmm_pro_id = {$targetPro->id})";
+                            break;
+                        case 'RME':
+                            $conditions[] = "(care_month.rme_pro_id = {$targetPro->id})";
+                            break;
+                    }
+                }
+            }
         }
 
         // show only if enrolled in RPM
@@ -2487,6 +2507,10 @@ WHERE
         $yStr = request()->input('y') ? request()->input('y') : date('Y');
         $cmStartDate = $yStr . '-' . $mStr . '-' . '01';
 
+        $cmEndDate = date_add(date_create($cmStartDate), date_interval_create_from_date_string("1 month"));
+        $cmEndDate = date_sub($cmEndDate, date_interval_create_from_date_string("1 day"));
+        $cmEndDate = date_format($cmEndDate, "Y-m-d");
+
         // count query
         $countQuery = "
 SELECT count(*) 
@@ -2585,7 +2609,11 @@ SELECT
        care_month.end_date as care_month_end_date,
        mcpBill.has_generic_pro_been_paid as mcp_paid,
        rmmBill.has_generic_pro_been_paid as rmm_paid,
-       rmeBill.has_generic_pro_been_paid as rme_paid
+       rmeBill.has_generic_pro_been_paid as rme_paid,
+       care_month.rm_reason_icd1,
+       care_month.rm_reason_icd2,
+       care_month.rm_reason_icd3,
+       care_month.rm_reason_icd4
 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
@@ -2605,7 +2633,7 @@ WHERE
         $paginator = new LengthAwarePaginator($patients, $total, $request->input('per_page') ?: $defaultPageSize, $request->input('page') ?: 1);
         $paginator->setPath(route('practice-management.rpm-manager'));
 
-        return view('app.practice-management.rpm-manager.index', compact('patients', 'month', 'year','paginator', 'perPage', 'proRoles', 'viewingAs', 'cmStartDate'));
+        return view('app.practice-management.rpm-manager.index', compact('patients', 'month', 'year', 'paginator', 'perPage', 'proRoles', 'viewingAs', 'cmStartDate', 'cmEndDate'));
     }
 
     public function rpmManagerRow(Request $request, $uid) {
@@ -2684,7 +2712,11 @@ SELECT
        care_month.end_date as care_month_end_date,
        mcpBill.has_generic_pro_been_paid as mcp_paid,
        rmmBill.has_generic_pro_been_paid as rmm_paid,
-       rmeBill.has_generic_pro_been_paid as rme_paid
+       rmeBill.has_generic_pro_been_paid as rme_paid,
+       care_month.rm_reason_icd1,
+       care_month.rm_reason_icd2,
+       care_month.rm_reason_icd3,
+       care_month.rm_reason_icd4
 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
@@ -2714,7 +2746,9 @@ WHERE
 
         $updateModel = true;
 
-        return view('app.practice-management.rpm-manager.row', compact('iPatient', 'index', 'month', 'year', 'viewingAs', 'updateModel', 'daysRemaining'));
+        $specificDate = $request->input('specificDate');
+
+        return view('app.practice-management.rpm-manager.row', compact('iPatient', 'index', 'month', 'year', 'viewingAs', 'updateModel', 'daysRemaining', 'specificDate'));
     }
 
     public function claimsReport(Request $request) {

+ 1 - 1
config/app.php

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

+ 13 - 1
public/css/style.css

@@ -3756,7 +3756,7 @@ table.v-top th {
     width: 140px !important;
 }
 .mcp-theme-1 .rmgr-name-column .rmgr-name-element {
-    width: 140px !important;
+    max-width: 140px !important;
     overflow: hidden;
     white-space: nowrap;
     text-overflow: ellipsis;
@@ -3769,11 +3769,23 @@ table.v-top th {
     top: calc(100% - 6px);
 }
 .mcp-theme-1 .rpm-manager-popover-trigger div.rpm-manager-popover {
+    position: fixed;
     pointer-events: none;
     width: 450px;
     box-shadow: 0 0 8px #bbb;
 }
 .mcp-theme-1 .rpm-manager-popover-trigger div.rpm-manager-popover.show {
+    position: absolute;
     pointer-events: all;
     opacity: 1;
 }
+.mcp-theme-1 .rpm-manager-table-container {
+    height: calc(100vh - 180px);
+    overflow: auto;
+}
+.mcp-theme-1 .v-sep-before {
+    border-left: 3px solid #ccc;
+}
+.mcp-theme-1 .v-sep-after {
+    border-right: 3px solid #ccc;
+}

+ 234 - 220
resources/views/app/practice-management/rpm-manager/index.blade.php

@@ -1,11 +1,6 @@
 @extends ('layouts/template')
 
 @section('content')
-    <style>
-        #admin-table-rm-matrix_wrapper {
-            padding-top: 10px;
-        }
-    </style>
     <link href="/c3/c3.min.css" rel="stylesheet">
     <script src="/c3/d3.v5.min.js" charset="utf-8"></script>
     <script src="/c3/c3.min.js"></script>
@@ -37,7 +32,7 @@
                 $timestampInSec = floor($iPatient->measurements_bp_json[$i]->ts / 1000);
                 $iPatient->measurements_bp_json[$i]->date_display = friendly_date_time_short_with_tz_from_timestamp($timestampInSec, 'EASTERN', '-', 'm/d/y');
                 $iPatient->measurements_bp_json[$i]->date_standard = friendly_date_time_short_with_tz_from_timestamp($timestampInSec, 'EASTERN', '-', 'Y-m-d');
-                $iPatient->measurements_bp_json[$i]->time_display = friendly_date_time_short_with_tz_from_timestamp($timestampInSec, 'EASTERN', '-', 'h:i A') . ' EST';
+                $iPatient->measurements_bp_json[$i]->time_display = friendly_date_time_short_with_tz_from_timestamp($timestampInSec, 'EASTERN', '-', 'h:i A');
             }
         }
         if(!!$iPatient->measurements_weight_json) {
@@ -46,33 +41,96 @@
                 $timestampInSec = floor($iPatient->measurements_weight_json[$i]->ts / 1000);
                 $iPatient->measurements_weight_json[$i]->date_display = friendly_date_time_short_with_tz_from_timestamp($timestampInSec, 'EASTERN', '-', 'm/d/y');
                 $iPatient->measurements_weight_json[$i]->date_standard = friendly_date_time_short_with_tz_from_timestamp($timestampInSec, 'EASTERN', '-', 'Y-m-d');
-                $iPatient->measurements_weight_json[$i]->time_display = friendly_date_time_short_with_tz_from_timestamp($timestampInSec, 'EASTERN', '-', 'h:i A') . ' EST';
+                $iPatient->measurements_weight_json[$i]->time_display = friendly_date_time_short_with_tz_from_timestamp($timestampInSec, 'EASTERN', '-', 'h:i A');
                 $iPatient->measurements_weight_json[$i]->numericValue = round($iPatient->measurements_weight_json[$i]->numericValue, 1);
             }
         }
         $iPatient->month_display = friendly_month($iPatient->care_month_start_date);
         $careMonths[$iPatient->care_month_uid] = $iPatient;
     }
+    $specificDate = request()->input('specificDate');
     ?>
 
+    <style>
+        table#table-pm-manager-matrix {
+            position: relative;
+            border-collapse: separate !important;
+            border-spacing: 0;
+        }
+        table#table-pm-manager-matrix thead tr th {
+            background-color: #f8f9fa;
+            z-index: 2;
+        }
+        table#table-pm-manager-matrix thead tr th:not(.v-sep-before) {
+            border-left-width: 0 !important;
+        }
+        table#table-pm-manager-matrix thead tr:nth-child(1) th {
+            text-align: center;
+            position: sticky;
+            top: 0;
+            z-index: 2;
+            height: 28px;
+        }
+        table#table-pm-manager-matrix thead tr:nth-child(2) th {
+            text-align: center;
+            position: sticky;
+            top: 28px;
+            z-index: 2;
+            height: 28px;
+            border-bottom: 1px solid #ddd !important;
+        }
+        table#table-pm-manager-matrix thead th {
+
+        }
+        table#table-pm-manager-matrix th:nth-child(1) {
+            position: sticky;
+            left: 0;
+            z-index: 3 !important;
+            background-color: #f8f9fa;
+        }
+        table#table-pm-manager-matrix th:nth-child(2) {
+            position: sticky;
+            left: 41px;
+            z-index: 3 !important;
+            background-color: #f8f9fa;
+            border-right: 2px solid #ddd !important;
+        }
+        table#table-pm-manager-matrix tbody tr td:nth-child(1) {
+            position: sticky;
+            left: 0;
+            z-index: 1;
+            background-color: #f8f9fa;
+            border-right: 1px solid #ddd !important;
+        }
+        table#table-pm-manager-matrix tbody tr td:nth-child(2) {
+            position: sticky;
+            left: 41px;
+            z-index: 1;
+            background-color: #f8f9fa;
+            border-right: 2px solid #ddd !important;
+        }
+        table#table-pm-manager-matrix tbody tr td {
+            border-top-width: 0 !important;
+        }
+        table#table-pm-manager-matrix tbody tr td:not(.v-sep-before) {
+            border-left-width: 0 !important;
+        }
+    </style>
+
     <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 - {{$viewingAs}} - {{friendly_month($cmStartDate)}}</span>
-                    </div>
-                </form>
+                <span class="font-size-16">RPM Manager - {{$viewingAs}} - {{friendly_month($cmStartDate)}}</span>
             </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>
+                            <div class="mr-2 d-inline-flex align-items-center">
+                                <label class="mb-0 mr-1">Month</label>
                                 <select name="m" class="form-control form-control-sm min-width-unset pl-0 font-weight-bold"
                                     onchange="fastLoad('{{route('practice-management.rpm-manager')}}?' + $(this).closest('form').serialize())">
                                     <option value="">All</option>
@@ -90,8 +148,8 @@
                                     <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>
+                            <div class="mr-2 d-inline-flex align-items-center">
+                                <label class="mb-0 mr-1">Year</label>
                                 <select name="y" class="form-control form-control-sm min-width-unset pl-0 font-weight-bold"
                                     onchange="fastLoad('{{route('practice-management.rpm-manager')}}?' + $(this).closest('form').serialize())">
                                     <option value="">All</option>
@@ -100,21 +158,44 @@
                                     <option value="2022" {{$year && intval($year) === 2022 ? 'selected' : ''}}>2022</option>
                                 </select>
                             </div>
+                            @if(count($proRoles) > 1)
+                                <div class="mr-2 d-inline-flex align-items-center">
+                                    <label class="mb-0 mr-1 text-nowrap">View As</label>
+                                    <select name="viewingAs" class="form-control form-control-sm min-width-unset pl-0 font-weight-bold"
+                                        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>
+                            @else
+                                <input type="hidden" name="viewingAs" value="{{$viewingAs}}">
+                            @endif
+                            @if($pro->pro_type === 'ADMIN' && $viewingAs !== 'ADMIN')
+                                <div class="mr-2 d-inline-flex align-items-center">
+                                    <label class="mb-0 mr-1 text-nowrap">{{$viewingAs}}</label>
+                                    <div class="position-relative">
+                                        <select name="proUid" class="form-control form-control-sm min-width-unset pl-0 font-weight-bold"
+                                                provider-search data-pro-uid="{{request()->input('proUid')}}"
+                                                onchange="fastLoad('{{route('practice-management.rpm-manager')}}?' + $(this).closest('form').serialize())">
+                                        </select>
+                                    </div>
+                                </div>
+                            @endif
                             <div class="mr-3 d-inline-flex align-items-center">
-                                <label class="mb-0 mr-2 text-nowrap">View As</label>
-                                <select name="viewingAs" class="form-control form-control-sm min-width-unset pl-0 font-weight-bold"
-                                    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>
+                                <label class="mb-0 mr-1 text-nowrap">Date</label>
+                                <input name="specificDate" class="form-control form-control-sm min-width-unset pl-1 font-weight-bold"
+                                       value="{{$specificDate}}"
+                                       type="date" min="{{$cmStartDate}}" max="{{$cmEndDate}}"
+                                       onchange="fastLoad('{{route('practice-management.rpm-manager')}}?' + $(this).closest('form').serialize())">
                             </div>
+                            <a href="#" onclick="return fastLoad('{{route('practice-management.rpm-manager')}}')">Clear</a>
                         </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() !!}
+                            <div class="mr-2"><b>{{$paginator->firstItem()}}</b> to <b>{{$paginator->lastItem()}}</b> (page {{$paginator->currentPage()}}) of <b>{{$paginator->total()}}</b></div>
+                            {!! $paginator->onEachSide(1)->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>
@@ -124,174 +205,133 @@
                         </div>
                     @endif
                 </div>
-                <div class="d-flex align-items-stretch m-0 h-100">
-                    <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 border-bottom-0 border-left-0"></th>
-                            <th class="border-top-0 border-bottom-0"></th>
-                            <th class="border-top-0 border-bottom-0"></th>
-                            @if($viewingAs === 'ADMIN')
-                                <th class="border-top-0 border-bottom-0 rmgr-name-column"></th>
-                                <th class="border-top-0 border-bottom-0 rmgr-name-column"></th>
-                                <th class="border-top-0 border-bottom-0 rmgr-name-column"></th>
-                            @endif
-                            <th class="border-top-0 border-bottom-0"></th>
-                            <th class="border-top-0 border-bottom-0 bg-aliceblue text-nowrap" colspan="3"># Meas. Days</th>
-                            <th class="border-top-0 border-bottom-0"></th>
-                            <th class="border-top-0 border-bottom-0"></th>
-                            @if($viewingAs !== 'RME')
-                                <th class="border-top-0 border-bottom-0 bg-aliceblue" colspan="2">Entries</th>
-                            @endif
+                <div class="rpm-manager-table-container">
+                    <table class="table table-sm table-bordered table-striped table-hover p-0 mb-4 min-width-1100px border-0" id="table-pm-manager-matrix">
+                    <thead class="bg-light">
+                    <tr>
+                        <th class="border-top-0 border-bottom-0 border-left-0"></th>
+                        <th class="border-top-0 border-bottom-0"></th>
+                        <th class="border-top-0 border-bottom-0"></th>
+                        @if($viewingAs !== 'RME')
                             <th class="border-top-0 border-bottom-0"></th>
-                            @if($viewingAs !== 'RME')
-                                <th class="border-top-0 border-bottom-0 bg-aliceblue" colspan="{{$viewingAs === 'ADMIN' ? 3 : 1}}">Time</th>
+                        @endif
+                        @if($viewingAs === 'ADMIN')
+                            <th class="border-top-0 border-bottom-0 rmgr-name-column"></th>
+                            <th class="border-top-0 border-bottom-0 rmgr-name-column"></th>
+                            <th class="border-top-0 border-bottom-0 rmgr-name-column"></th>
+                        @endif
+                        <th class="border-top-0 border-bottom-0"></th>
+                        <th class="border-top-0 border-bottom-0 bg-aliceblue text-nowrap" colspan="3"># Meas. Days</th>
+                        <th class="border-top-0 border-bottom-0 text-nowrap" colspan="2">
+                            @if($specificDate)
+                                Values: <span class="text-info">{{$specificDate}}</span>
+                            @else
+                                Latest Value
                             @endif
-                            <th class="border-top-0 border-bottom-0 bg-aliceblue" colspan="{{$viewingAs === 'ADMIN' ? 3 : 1}}">Reimb.</th>
-                            @if($viewingAs === 'ADMIN' && !(date('m') == $month && date('Y') == $year))
-                                <th class="border-top-0 border-bottom-0 bg-aliceblue" colspan="3">Claim</th>
-                            @endif
-                            <th class="border-top-0 border-bottom-0"></th>
-                            <th class="border-top-0 border-bottom-0 border-right-0 w-25"></th>
-                        </tr>
-                        <tr>
-                            <th class="border-bottom-0 border-top border-left-0 text-right">#</th>
-                            <th class="border-bottom-0 border-top">Name</th>
-                            <th class="border-bottom-0 border-top">Age</th>
-                            @if($viewingAs === 'ADMIN')
-                                <th class="border-bottom-0 border-top">MCP</th>
-                                <th class="border-bottom-0 border-top">RMM</th>
-                                <th class="border-bottom-0 border-top">RME</th>
-                            @endif
-                            <th class="border-bottom-0 border-top">DSLV</th>
-
-                            <!--# Meas. Days-->
-                            <th class="border-bottom-0 border-top">All</th>
-                            <th class="border-bottom-0 border-top">BP</th>
-                            <th class="border-bottom-0 border-top">WT</th>
-
-                            <th class="border-bottom-0 border-top">BP</th>
-                            <th class="border-bottom-0 border-top">WT</th>
-
-                            @if($viewingAs !== 'RME')
-                                <th class="border-bottom-0 border-top">Mine</th>
-                                <th class="border-bottom-0 border-top">Others</th>
-                            @endif
-
-                            <th class="border-bottom-0 border-top">
-                                @if($viewingAs === 'ADMIN')
-                                    Inter.
+                        </th>
+                        @if($viewingAs !== 'RME')
+                            <th class="border-top-0 border-bottom-0 bg-aliceblue text-nowrap" colspan="2">
+                                @if($specificDate)
+                                    Entries: <span class="text-info">{{$specificDate}}</span>
                                 @else
-                                    MCPI
+                                    Latest Entry
                                 @endif
                             </th>
-
-                            <!--Time-->
-                            @if($viewingAs !== 'RME')
-                                @if($viewingAs === 'ADMIN' || $viewingAs === 'MCP')
-                                    <th class="border-bottom-0 border-top">MCP</th>
-                                @endif
-                                @if($viewingAs === 'ADMIN' || $viewingAs === 'RMM')
-                                    <th class="border-bottom-0 border-top">RMM</th>
-                                @endif
-                                @if($viewingAs === 'ADMIN')
-                                    <th class="border-bottom-0 border-top">Total</th>
-                                @endif
+                        @endif
+                        <th class="border-top-0 border-bottom-0"></th>
+                        @if($viewingAs !== 'RME')
+                            <th class="border-top-0 border-bottom-0 bg-aliceblue" colspan="{{$viewingAs === 'ADMIN' ? 3 : 1}}">Time</th>
+                        @endif
+                        <th class="border-top-0 border-bottom-0 bg-aliceblue v-sep-before" colspan="{{$viewingAs === 'ADMIN' ? 3 : 1}}">Reimb.</th>
+                        @if($viewingAs === 'ADMIN' && !(date('m') == $month && date('Y') == $year))
+                            <th class="border-top-0 border-bottom-0 bg-aliceblue v-sep-before" colspan="3">Claim</th>
+                        @endif
+                        <th class="border-top-0 border-bottom-0"></th>
+                        <th class="border-top-0 border-bottom-0 border-right-0 w-25"></th>
+                    </tr>
+                    <tr>
+                        <th class="border-bottom-0 border-top border-left-0 text-right">#</th>
+                        <th class="border-bottom-0 border-top">Name</th>
+                        <th class="border-bottom-0 border-top">Age</th>
+                        @if($viewingAs !== 'RME')
+                            <th class="border-bottom-0 border-top">ICDs</th>
+                        @endif
+                        @if($viewingAs === 'ADMIN')
+                            <th class="border-bottom-0 border-top">MCP</th>
+                            <th class="border-bottom-0 border-top">RMM</th>
+                            <th class="border-bottom-0 border-top">RME</th>
+                        @endif
+                        <th class="border-bottom-0 border-top">DSLV</th>
+
+                        <!--# Meas. Days-->
+                        <th class="border-bottom-0 border-top">All</th>
+                        <th class="border-bottom-0 border-top">BP</th>
+                        <th class="border-bottom-0 border-top">WT</th>
+
+                        <th class="border-bottom-0 border-top">BP</th>
+                        <th class="border-bottom-0 border-top">WT</th>
+
+                        @if($viewingAs !== 'RME')
+                            <th class="border-bottom-0 border-top">Mine</th>
+                            <th class="border-bottom-0 border-top">Others</th>
+                        @endif
+
+                        <th class="border-bottom-0 border-top">
+                            @if($viewingAs === 'ADMIN')
+                                Inter.
+                            @else
+                                MCPI
                             @endif
+                        </th>
 
-                            <!--Reimb.-->
+                        <!--Time-->
+                        @if($viewingAs !== 'RME')
                             @if($viewingAs === 'ADMIN' || $viewingAs === 'MCP')
                                 <th class="border-bottom-0 border-top">MCP</th>
                             @endif
                             @if($viewingAs === 'ADMIN' || $viewingAs === 'RMM')
                                 <th class="border-bottom-0 border-top">RMM</th>
                             @endif
-                            @if($viewingAs === 'ADMIN' || $viewingAs === 'RME')
-                                <th class="border-bottom-0 border-top">RME</th>
-                            @endif
-
-                            <!--Claim-->
-                            @if($viewingAs === 'ADMIN' && !(date('m') == $month && date('Y') == $year))
-                                <th class="border-bottom-0 border-top">4</th>
-                                <th class="border-bottom-0 border-top">7</th>
-                                <th class="border-bottom-0 border-top">8</th>
+                            @if($viewingAs === 'ADMIN')
+                                <th class="border-bottom-0 border-top">Total</th>
                             @endif
-
-                            <th class="border-bottom-0 border-top">NV</th>
-                            <th class="border-bottom-0 border-top border-right-0"></th>
-                        </tr>
-                        </thead>
-                        <tbody>
+                        @endif
+
+                        <!--Reimb.-->
+                        @if($viewingAs === 'ADMIN' || $viewingAs === 'MCP')
+                            <th class="border-bottom-0 border-top v-sep-before">MCP</th>
+                        @endif
+                        @if($viewingAs === 'ADMIN' || $viewingAs === 'RMM')
+                            <th class="border-bottom-0 border-top {{$viewingAs === 'RMM' ? 'v-sep-before' : ''}}">RMM</th>
+                        @endif
+                        @if($viewingAs === 'ADMIN' || $viewingAs === 'RME')
+                            <th class="border-bottom-0 border-top {{$viewingAs === 'RME' ? 'v-sep-before' : ''}}">RME</th>
+                        @endif
+
+                        <!--Claim-->
+                        @if($viewingAs === 'ADMIN' && !(date('m') == $month && date('Y') == $year))
+                            <th class="border-bottom-0 border-top v-sep-before">4</th>
+                            <th class="border-bottom-0 border-top">7</th>
+                            <th class="border-bottom-0 border-top">8</th>
+                        @endif
+
+                        <th class="border-bottom-0 border-top">NV</th>
+                        <th class="border-bottom-0 border-top border-right-0"></th>
+                    </tr>
+                    </thead>
+                    <tbody>
+                    <?php
+                    $daysRemaining = date('t') - date('j');
+                    $index = $paginator->firstItem();
+                    ?>
+                    @foreach ($patients as $iPatient)
+                        @include('app.practice-management.rpm-manager.row', compact('iPatient', 'index', 'month', 'year', 'viewingAs', 'daysRemaining', 'specificDate'))
                         <?php
-                        $daysRemaining = date('t') - date('j');
-                        $index = $paginator->firstItem();
+                        $index++;
                         ?>
-                        @foreach ($patients as $iPatient)
-                            @include('app.practice-management.rpm-manager.row', compact('iPatient', 'index', 'month', 'year', 'viewingAs', 'daysRemaining'))
-                            <?php
-                            $index++;
-                            ?>
-                        @endforeach
-                        </tbody>
-                    </table>
-                </div>
-            </div>
-        </div>
-        <div class="stag-popup tall draggable resizable mcp-theme-1"
-             update-parent
-             stag-popup-key="rpm-manager-my-entries-popup">
-            <div class="stag-popup-content p-0">
-                <h3 class="stag-popup-title mb-0 mt-3 mx-3 pb-0 border-bottom-0">
-                    <span id="rpm-manager-my-entries-popup-title">xxx</span>
-                    <a href="#" class="ml-auto text-secondary" onclick="return closeStagPopup()">
-                        <i class="fa fa-times-circle"></i>
-                    </a>
-                </h3>
-                <div class="stag-popup-content-inner">
-                    <div class="popup-content-container px-3">
-                        <h3 class="m-0 font-size-16" id="rpm-manager-my-entries-caremonth"></h3>
-                        <table class="table table-condensed table-sm table-bordered mt-3 cm-tab" id="rpm-manager-my-entries-matrix">
-                            <thead>
-                            <tr>
-                                <th class="text-secondary text-sm">Date</th>
-                                <th class="text-secondary text-sm">Minutes</th>
-                                <th class="text-secondary text-sm">Communicated</th>
-                                <th class="text-secondary text-sm">Comments</th>
-                                <th class="text-secondary text-sm"></th>
-                            </tr>
-                            </thead>
-                            <tbody></tbody>
-                        </table>
-                    </div>
-                </div>
-            </div>
-        </div>
-        <div class="stag-popup tall draggable resizable mcp-theme-1"
-             update-parent
-             stag-popup-key="rpm-manager-other-entries-popup">
-            <div class="stag-popup-content p-0">
-                <h3 class="stag-popup-title mb-0 mt-3 mx-3 pb-0 border-bottom-0">
-                    <span id="rpm-manager-other-entries-popup-title">xxx</span>
-                    <a href="#" class="ml-auto text-secondary" onclick="return closeStagPopup()">
-                        <i class="fa fa-times-circle"></i>
-                    </a>
-                </h3>
-                <div class="stag-popup-content-inner">
-                    <div class="popup-content-container px-3">
-                        <h3 class="m-0 font-size-16" id="rpm-manager-other-entries-caremonth"></h3>
-                        <table class="table table-condensed table-sm table-bordered mt-3 cm-tab" id="rpm-manager-other-entries-matrix">
-                            <thead>
-                            <tr>
-                                <th class="text-secondary text-sm">Pro</th>
-                                <th class="text-secondary text-sm">Date</th>
-                                <th class="text-secondary text-sm">Minutes</th>
-                                <th class="text-secondary text-sm">Communicated</th>
-                                <th class="text-secondary text-sm">Comments</th>
-                            </tr>
-                            </thead>
-                            <tbody></tbody>
-                        </table>
-                    </div>
+                    @endforeach
+                    </tbody>
+                </table>
                 </div>
             </div>
         </div>
@@ -454,24 +494,6 @@
                         );
                         return false;
                     });
-
-                parent
-                    .off('click', '.btn-my-entries-popup')
-                    .on('click', '.btn-my-entries-popup', function() {
-                        showStagPopup('rpm-manager-my-entries-popup');
-                        prepareEntriesPopup($(this).attr('data-uid'), 'my');
-                        reInitMoes();
-                        return false;
-                    });
-
-                parent
-                    .off('click', '.btn-other-entries-popup')
-                    .on('click', '.btn-other-entries-popup', function() {
-                        showStagPopup('rpm-manager-other-entries-popup');
-                        prepareEntriesPopup($(this).attr('data-uid'), 'other');
-                        reInitMoes();
-                        return false;
-                    });
             }
 
             function prepareMeasurementsPopover(_careMonthUid, _type) {
@@ -497,42 +519,26 @@
                     let tr = $('<tr/>').attr('data-uid', m.uid);
 
                     // date, time
-                    $('<td/>').addClass('p-1 text-sm').text(m.date_display + ' ' + m.time_display).appendTo(tr);
+                    $('<td class="w-25 text-nowrap"/>').addClass('p-1 text-sm').text(m.date_display + ' ' + m.time_display).appendTo(tr);
 
                     // value
                     if(_type === 'bp') {
-                        $('<td/>').addClass('p-1 text-sm').text(m.sbpMmHg + '/' + m.dbpMmHg).appendTo(tr);
+                        $('<td class="pl-2"/>').addClass('p-1 text-sm').text(m.sbpMmHg + '/' + m.dbpMmHg).appendTo(tr);
                     }
                     else if(_type === 'weight') {
-                        $('<td/>').addClass('p-1 text-sm').text(m.numericValue).appendTo(tr);
+                        $('<td class="pl-2"/>').addClass('p-1 text-sm').text(m.numericValue).appendTo(tr);
                     }
 
                     // stamp
                     // MCPs and RMMs get stamp UI
                     let stamp = '';
                     @if($viewingAs === 'MCP')
-                    if(!m.hasBeenStampedByMcp) {
-                        $('<td/>').addClass('p-1')
-                            .append(
-                                $('<a/>').addClass('text-sm btn-quick-stamp c-pointer text-nowrap').attr('data-uid', m.uid).text('Stamp as normal')
-                            )
-                            .appendTo(tr);
-                    }
-                    else {
-                        $('<td/>').addClass('p-1')
-                            .append(
-                                $('<i/>').addClass('fa fa-check text-sm')
-                            )
-                            .append(
-                                $('<span/>').addClass('text-sm ml-1').text('Stamped')
-                            )
-                            .appendTo(tr);
-                    }
+                    {{-- nop --}}
                     @elseif($viewingAs === 'RMM')
                     if(!m.hasBeenStampedByRmm) {
                         $('<td/>').addClass('p-1')
                             .append(
-                                $('<a/>').addClass('text-sm btn-quick-stamp c-pointer text-nowrap').attr('data-uid', m.uid).text('Stamp as normal')
+                                $('<a/>').addClass('text-sm btn-quick-stamp c-pointer text-nowrap').attr('data-uid', m.uid).text('Stamp')
                             )
                             .appendTo(tr);
                     }
@@ -610,9 +616,13 @@
                             },*/
                         },
                         y: {
-                            show: false,
+                            show: true,
+                            tick: {
+                                count: 5,
+                                format: function (x) { return Math.ceil(x); }
+                            },
                             label: {
-                                text: 'Blood Pressure (mmHg)',
+                                text: 'BP',
                                 position: 'outer-middle'
                             },
                             min: 40,
@@ -658,9 +668,13 @@
                             },*/
                         },
                         y: {
-                            show: false,
+                            show: true,
+                            tick: {
+                                count: 5,
+                                format: function (x) { return Math.ceil(x); }
+                            },
                             label: {
-                                text: 'Weight (lbs)',
+                                text: 'Weight',
                                 position: 'outer-middle'
                             },
                             /*min: 70,

+ 133 - 38
resources/views/app/practice-management/rpm-manager/row.blade.php

@@ -1,5 +1,5 @@
 <tr data-client-uid="{{$iPatient->client_uid}}" data-care-month-uid="{{$iPatient->care_month_uid}}">
-    <td class="text-right">
+    <td class="text-right border-left-0 p-0">
         @if(@$updateModel)
             <?php
             if(!!$iPatient->entries_json) {
@@ -20,25 +20,34 @@
             if(!!$iPatient->measurements_json) {
                 $iPatient->measurements_json = json_decode($iPatient->measurements_json);
             }
+            else {
+                $iPatient->measurements_json = [];
+            }
             if(!!$iPatient->measurements_bp_json) {
                 $iPatient->measurements_bp_json = json_decode($iPatient->measurements_bp_json);
                 for ($i = 0; $i < count($iPatient->measurements_bp_json); $i++) {
                     $timestampInSec = floor($iPatient->measurements_bp_json[$i]->ts / 1000);
                     $iPatient->measurements_bp_json[$i]->date_display = friendly_date_time_short_with_tz_from_timestamp($timestampInSec, 'EASTERN', '-', 'm/d/y');
                     $iPatient->measurements_bp_json[$i]->date_standard = friendly_date_time_short_with_tz_from_timestamp($timestampInSec, 'EASTERN', '-', 'Y-m-d');
-                    $iPatient->measurements_bp_json[$i]->time_display = friendly_date_time_short_with_tz_from_timestamp($timestampInSec, 'EASTERN', '-', 'h:i A') . ' EST';
+                    $iPatient->measurements_bp_json[$i]->time_display = friendly_date_time_short_with_tz_from_timestamp($timestampInSec, 'EASTERN', '-', 'h:i A');
                 }
             }
+            else {
+                $iPatient->measurements_bp_json = [];
+            }
             if(!!$iPatient->measurements_weight_json) {
                 $iPatient->measurements_weight_json = json_decode($iPatient->measurements_weight_json);
                 for ($i = 0; $i < count($iPatient->measurements_weight_json); $i++) {
                     $timestampInSec = floor($iPatient->measurements_weight_json[$i]->ts / 1000);
                     $iPatient->measurements_weight_json[$i]->date_display = friendly_date_time_short_with_tz_from_timestamp($timestampInSec, 'EASTERN', '-', 'm/d/y');
                     $iPatient->measurements_weight_json[$i]->date_standard = friendly_date_time_short_with_tz_from_timestamp($timestampInSec, 'EASTERN', '-', 'Y-m-d');
-                    $iPatient->measurements_weight_json[$i]->time_display = friendly_date_time_short_with_tz_from_timestamp($timestampInSec, 'EASTERN', '-', 'h:i A') . ' EST';
+                    $iPatient->measurements_weight_json[$i]->time_display = friendly_date_time_short_with_tz_from_timestamp($timestampInSec, 'EASTERN', '-', 'h:i A');
                     $iPatient->measurements_weight_json[$i]->numericValue = round($iPatient->measurements_weight_json[$i]->numericValue, 1);
                 }
             }
+            else {
+                $iPatient->measurements_weight_json = [];
+            }
             $iPatient->month_display = friendly_month($iPatient->care_month_start_date);
             ?>
             <script>
@@ -54,13 +63,16 @@
                     viewingAs: '{{$viewingAs}}',
                     m: '{{request()->input('m')}}',
                     y: '{{request()->input('y')}}',
+                    specificDate: '{{request()->input('specificDate')}}',
                 }, _data => {
                     $('tr[data-care-month-uid="{{$iPatient->care_month_uid}}"]').replaceWith(_data);
                 })
             });
         </script>
         @endif
+        <div style="width: 40px; height: 28px; line-height: 28px; text-align: right; padding-right: 0.3rem;">
         {{$index}}
+        </div>
     </td>
     <td class="border-left-0">
         <a href="/mc/patients/view/{{ $iPatient->client_uid }}"
@@ -69,6 +81,19 @@
         >{{ $iPatient->client_name }}</a>
     </td>
     <td title="{{friendly_date($iPatient->dob)}}">{{$iPatient->age_in_years ?: '-'}}</span></td>
+    @if($viewingAs !== 'RME')
+        <td class="text-nowrap">
+            <?php
+            $reasons = [];
+            if($iPatient->rm_reason_icd1) $reasons[] = $iPatient->rm_reason_icd1;
+            if($iPatient->rm_reason_icd2) $reasons[] = $iPatient->rm_reason_icd2;
+            if($iPatient->rm_reason_icd3) $reasons[] = $iPatient->rm_reason_icd3;
+            if($iPatient->rm_reason_icd4) $reasons[] = $iPatient->rm_reason_icd4;
+            $reasons = count($reasons) ? implode(', ', $reasons) : '-';
+            ?>
+            {{$reasons}}
+        </td>
+    @endif
     @if($viewingAs === 'ADMIN')
         <td class="rmgr-name-column"><div class="rmgr-name-element" title="{{$iPatient->mcp_name ?: ''}}">{{$iPatient->mcp_last_name ?: '-'}}</div></td>
         <td class="rmgr-name-column"><div class="rmgr-name-element" title="{{$iPatient->rmm_name ?: ''}}">{{$iPatient->rmm_last_name ?: '-'}}</div></td>
@@ -124,19 +149,37 @@
             @endif
         @else
             @if($iPatient->most_recent_cellular_bp_sbp_mm_hg && $iPatient->most_recent_cellular_bp_dbp_mm_hg)
-                <div class="text-nowrap d-flex align-items-baseline flex-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_compact($iPatient->most_recent_cellular_bp_measurement_at)}}</span>
+                @if(!$specificDate)
+                    <div class="text-nowrap d-flex align-items-baseline flex-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_time($iPatient->most_recent_cellular_bp_measurement_at, false)}}</span>
+                        @endif
+                    </div>
+                @else
+                    <?php $hasM = false; ?>
+                    @if(!!$iPatient->measurements_bp_json)
+                        @for ($i = 0; $i < count($iPatient->measurements_bp_json); $i++)
+                            @if($iPatient->measurements_bp_json[$i]->date_standard === $specificDate)
+                                <div class="text-nowrap d-flex align-items-baseline flex-nowrap">
+                                    <span class="sort-data">{{$iPatient->measurements_bp_json[$i]->sbpMmHg}}</span>/{{$iPatient->measurements_bp_json[$i]->dbpMmHg}}
+                                    <span class="text-sm text-secondary text-nowrap ml-1">{{$iPatient->measurements_bp_json[$i]->time_display}}</span>
+                                </div>
+                                <?php $hasM = true; ?>
+                            @endif
+                        @endfor
                     @endif
-                </div>
+                    @if(!$hasM)
+                        <span class="text-secondary">-</span>
+                    @endif
+                @endif
             @else
                 <span class="text-danger opacity-60">Not used yet</span>
             @endif
         @endif
         @if($iPatient->has_cellular_bp_device && $iPatient->most_recent_cellular_bp_sbp_mm_hg && $iPatient->most_recent_cellular_bp_dbp_mm_hg)
-            <div class="position-absolute p-2 bg-white border rpm-manager-popover rpm-manager-bp-popover" id="rpm-manager-bp-popover-{{$iPatient->care_month_uid}}">
+            <div class="p-2 bg-white border rpm-manager-popover rpm-manager-bp-popover" id="rpm-manager-bp-popover-{{$iPatient->care_month_uid}}">
                 <div class="font-size-16">{{ $iPatient->client_name }} - BP Measurements</div>
                 <h3 class="my-2 font-size-16" id="rpm-manager-bp-caremonth-{{$iPatient->care_month_uid}}">Care Month:
                     <a href="/patients/view/{{ $iPatient->client_uid }}/care-months/view/{{$iPatient->care_month_uid}}"
@@ -170,19 +213,37 @@
             @endif
         @else
             @if($iPatient->most_recent_cellular_weight_value)
-                <div class="text-nowrap d-flex align-items-baseline flex-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 ml-1"
-                              title="{{friendly_date_time($iPatient->most_recent_cellular_weight_measurement_at)}}">{{friendly_date_est_compact($iPatient->most_recent_cellular_weight_measurement_at)}}</span>
+                @if(!$specificDate)
+                    <div class="text-nowrap d-flex align-items-baseline flex-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 ml-1"
+                                  title="{{friendly_date_time($iPatient->most_recent_cellular_weight_measurement_at)}}">{{friendly_date_time($iPatient->most_recent_cellular_weight_measurement_at, false, 'm/d')}}</span>
+                        @endif
+                    </div>
+                @else
+                    <?php $hasM = false; ?>
+                    @if(!!$iPatient->measurements_weight_json)
+                        @for ($i = 0; $i < count($iPatient->measurements_weight_json); $i++)
+                            @if($iPatient->measurements_weight_json[$i]->date_standard === $specificDate)
+                                <div class="text-nowrap d-flex align-items-baseline flex-nowrap">
+                                    <span class="sort-data">{{$iPatient->measurements_weight_json[$i]->numericValue}}</span>
+                                    <span class="text-sm text-secondary text-nowrap ml-1">{{$iPatient->measurements_weight_json[$i]->time_display}}</span>
+                                </div>
+                                <?php $hasM = true; ?>
+                            @endif
+                        @endfor
                     @endif
-                </div>
+                    @if(!$hasM)
+                        <span class="text-secondary">-</span>
+                    @endif
+                @endif
             @else
                 <span class="text-danger opacity-60">Not used yet</span>
             @endif
         @endif
         @if($iPatient->has_cellular_weight_scale_device && $iPatient->most_recent_cellular_weight_value)
-            <div class="position-absolute p-2 bg-white border rpm-manager-popover rpm-manager-weight-popover" id="rpm-manager-weight-popover-{{$iPatient->care_month_uid}}">
+            <div class="p-2 bg-white border rpm-manager-popover rpm-manager-weight-popover" id="rpm-manager-weight-popover-{{$iPatient->care_month_uid}}">
                 <div class="font-size-16">{{ $iPatient->client_name }} - Weight Measurements</div>
                 <h3 class="my-2 font-size-16" id="rpm-manager-weight-caremonth-{{$iPatient->care_month_uid}}">Care Month:
                     <a href="/patients/view/{{ $iPatient->client_uid }}/care-months/view/{{$iPatient->care_month_uid}}"
@@ -210,30 +271,64 @@
     @if($viewingAs !== 'RME')
         <td>
             @if(@$iPatient->myEntries && count($iPatient->myEntries))
-                <div class="d-flex align-items-baseline" title="Me: {{strip_tags($iPatient->myEntries[0]->contentText)}}">
-                    <span class="text-info mr-1">{{round($iPatient->myEntries[0]->timeInSeconds/60)}}m</span>
-                    <span class="flex-grow-1 max-width-200px text-ellipsis mr-1">{{strip_tags($iPatient->myEntries[0]->contentText)}}</span>
-                    @if(gettype($iPatient->myEntries[0]->effectiveDate) === 'string')
-                        <span class="text-secondary text-sm">{{friendly_date_est_compact($iPatient->myEntries[0]->effectiveDate)}}</span>
+                @if(!$specificDate)
+                    <div class="d-flex align-items-baseline" title="Me: {{strip_tags($iPatient->myEntries[0]->contentText)}}">
+                        <span class="text-info mr-1">{{round($iPatient->myEntries[0]->timeInSeconds/60)}}m</span>
+                        <span class="flex-grow-1 max-width-140px text-ellipsis mr-1">{{strip_tags($iPatient->myEntries[0]->contentText)}}</span>
+                        @if(gettype($iPatient->myEntries[0]->effectiveDate) === 'string')
+                            <span class="text-secondary text-sm">{{friendly_date_compact($iPatient->myEntries[0]->effectiveDate)}}</span>
+                        @endif
+                    </div>
+                @else
+                    <?php $hasM = false; ?>
+                    @for ($i = 0; $i < count($iPatient->myEntries); $i++)
+                        @if($iPatient->myEntries[$i]->effectiveDate === $specificDate)
+                            <div class="d-flex align-items-baseline" title="Me: {{strip_tags($iPatient->myEntries[$i]->contentText)}}">
+                                <span class="text-info mr-1">{{round($iPatient->myEntries[$i]->timeInSeconds/60)}}m</span>
+                                <span class="flex-grow-1 max-width-140px text-ellipsis">{{strip_tags($iPatient->myEntries[$i]->contentText)}}</span>
+                            </div>
+                            <?php $hasM = true; ?>
+                        @endif
+                    @endfor
+                    @if(!$hasM)
+                        <span class="text-secondary">-</span>
                     @endif
-                </div>
+                @endif
             @else
-                <span class="text-secondary">None</span>
+                <span class="text-secondary">-</span>
             @endif
         </td>
         <td>
             @if(@$iPatient->otherEntries && count($iPatient->otherEntries))
-                <div class="d-flex align-items-baseline" title="{{$iPatient->otherEntries[0]->proNameFirst}} {{$iPatient->otherEntries[0]->proNameLast}}: {{strip_tags($iPatient->otherEntries[0]->contentText)}}">
-                    @if($viewingAs === 'ADMIN')
-                        <span class="text-info mr-1">{{round($iPatient->otherEntries[0]->timeInSeconds/60)}}m</span>
-                    @endif
-                    <span class="flex-grow-1 max-width-200px text-ellipsis mr-1">{{strip_tags($iPatient->otherEntries[0]->contentText)}}</span>
-                    @if(gettype($iPatient->otherEntries[0]->effectiveDate) === 'string')
-                        <span class="text-secondary text-sm">{{friendly_date_est_compact($iPatient->otherEntries[0]->effectiveDate)}}</span>
+                @if(!$specificDate)
+                    <div class="d-flex align-items-baseline" title="{{$iPatient->otherEntries[0]->proNameFirst}} {{$iPatient->otherEntries[0]->proNameLast}}: {{strip_tags($iPatient->otherEntries[0]->contentText)}}">
+                        @if($viewingAs === 'ADMIN')
+                            <span class="text-info mr-1">{{round($iPatient->otherEntries[0]->timeInSeconds/60)}}m</span>
+                        @endif
+                        <span class="flex-grow-1 max-width-140px text-ellipsis mr-1">{{strip_tags($iPatient->otherEntries[0]->contentText)}}</span>
+                        @if(gettype($iPatient->otherEntries[0]->effectiveDate) === 'string')
+                            <span class="text-secondary text-sm">{{friendly_date_compact($iPatient->otherEntries[0]->effectiveDate)}}</span>
+                        @endif
+                    </div>
+                @else
+                    <?php $hasM = false; ?>
+                    @for ($i = 0; $i < count($iPatient->otherEntries); $i++)
+                        @if($iPatient->otherEntries[$i]->effectiveDate === $specificDate)
+                            <div class="d-flex align-items-baseline" title="{{$iPatient->otherEntries[$i]->proNameFirst}} {{$iPatient->otherEntries[$i]->proNameLast}}: {{strip_tags($iPatient->otherEntries[$i]->contentText)}}">
+                                @if($viewingAs === 'ADMIN')
+                                    <span class="text-info mr-1">{{round($iPatient->otherEntries[$i]->timeInSeconds/60)}}m</span>
+                                @endif
+                                <span class="flex-grow-1 max-width-140px text-ellipsis">{{strip_tags($iPatient->otherEntries[$i]->contentText)}}</span>
+                            </div>
+                            <?php $hasM = true; ?>
+                        @endif
+                    @endfor
+                    @if(!$hasM)
+                        <span class="text-secondary">-</span>
                     @endif
-                </div>
+                @endif
             @else
-                <span class="text-secondary">None</span>
+                <span class="text-secondary">-</span>
             @endif
         </td>
     @endif
@@ -304,7 +399,7 @@
                         @endif
                         @if($showAddEntry > 0)
                             <i class="ml-1 fa fa-hourglass text-danger opacity-60 text-sm"></i>
-                            <div class="ml-1" title="Total expected billing by end of today: {{$expectation}}">
+                            <div class="ml-1" title="Total expected billing by end of today: {{$expectation}}m">
                                 @include('app.practice-management.rpm-manager.rpm_manager_care_month_add_entry_form', [
                                     'right' => true,
                                     'defaultDate' => date('Y-m-d'),
@@ -389,7 +484,7 @@
 
     <!--Reimb.-->
     @if($viewingAs === 'ADMIN' || $viewingAs === 'MCP')
-        <td class="text-nowrap">
+        <td class="text-nowrap v-sep-before">
             @if($iPatient->mcp_paid)
                 <i class="mr-1 fas fa-dollar-sign text-success opacity-60" title="Paid"></i>
             @else
@@ -406,7 +501,7 @@
         </td>
     @endif
     @if($viewingAs === 'ADMIN' || $viewingAs === 'RMM')
-        <td class="text-nowrap">
+        <td class="text-nowrap {{$viewingAs === 'RMM' ? 'v-sep-before' : ''}}">
             @if($iPatient->rmm_paid)
                 <i class="mr-1 fas fa-dollar-sign text-success opacity-60" title="Paid"></i>
             @else
@@ -423,7 +518,7 @@
         </td>
     @endif
     @if($viewingAs === 'ADMIN' || $viewingAs === 'RME')
-        <td class="text-nowrap">
+        <td class="text-nowrap {{$viewingAs === 'RMM' ? 'v-sep-before' : ''}}">
             @if($iPatient->rme_paid)
                 <i class="mr-1 fas fa-dollar-sign text-success opacity-60" title="Paid"></i>
             @else
@@ -442,7 +537,7 @@
 
     <!--Claim-->
     @if($viewingAs === 'ADMIN' && !(date('m') == $month && date('Y') == $year))
-        <td>
+        <td class="v-sep-before">
             @if($iPatient->is_99454_claiming_waived)
                 <span title="{{$iPatient->why_claiming_99454_waived ?: ''}}">Waived</span>
             @else

+ 4 - 4
routes/web.php

@@ -381,15 +381,15 @@ 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('rpm-manager-row/{uid}', 'PracticeManagementController@rpmManagerRow')->name('rpm-manager-row');
-
             Route::get('claims-report', 'PracticeManagementController@claimsReport')->name('claims-report');
 
             Route::get('problems-report', 'PracticeManagementController@problemsReport')->name('problems-report');
         });
 
+        // rpm manager (new)
+        Route::get('rpm-manager', 'PracticeManagementController@rpmManager')->name('rpm-manager');
+        Route::get('rpm-manager-row/{uid}', 'PracticeManagementController@rpmManagerRow')->name('rpm-manager-row');
+
         Route::get('supply-orders/cancelled-but-unacknowledged', 'PracticeManagementController@supplyOrdersCancelledButUnacknowledged')->name('supply-orders-cancelled-but-unacknowledged');
         Route::get('supply-orders/unsigned', 'PracticeManagementController@supplyOrdersUnsigned')->name('supply-orders-unsigned');