소스 검색

RPM manager (wip)

Vijayakrishnan 2 년 전
부모
커밋
c4f02609af

+ 36 - 3
resources/views/app/practice-management/rpm-manager/row.blade.php

@@ -15,7 +15,40 @@
     <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>
+        <?php
+        $icon = '';
+        $label = '';
+        if($iPatient->number_of_days_with_remote_measurements>=16) {
+            $icon = '<i class="ml-1 fa fa-check text-success opacity-35"></i>';
+        }
+        else {
+            if(intval(date('m')) === intval(request()->input('m')) || !request()->input('m')) {
+                if($daysRemaining < 16 - $iPatient->number_of_days_with_remote_measurements) {
+                    $icon = '<i class="ml-1 fas fa-ban text-secondary opacity-35"></i>';
+                    $label = 'Not possible. Not enough days left to reach 16.';
+                }
+                elseif($daysRemaining > 16 - $iPatient->number_of_days_with_remote_measurements) {
+                    $icon = '<i class="ml-1 fa fa-bolt text-primary"></i>';
+                    $label = 'Possible. Ensure ' . (16 - $iPatient->number_of_days_with_remote_measurements) . ' days with measurements before the end of the month.';
+                }
+                elseif($daysRemaining === 16 - $iPatient->number_of_days_with_remote_measurements) {
+                    $icon = '<i class="ml-1 fa fa-exclamation-triangle text-danger"></i>';
+                    $label = 'Possible. Ensure a measurement every day for the rest of the month.';
+                }
+            }
+            else {
+                $icon = '<i class="ml-1 fas fa-ban text-secondary opacity-35"></i>';
+                $label = 'Not possible. Past month.';
+            }
+        }
+        ?>
+        <div class="d-flex align-items-baseline flex-nowrap" title="{{$label}}">
+            <?php $iPatient->number_of_days_with_remote_measurements = $iPatient->number_of_days_with_remote_measurements ?: 0; ?>
+            <span>{{$iPatient->number_of_days_with_remote_measurements}}</span>
+            {!! $icon !!}
+        </div>
+    </td>
     <td>{{$iPatient->number_of_days_with_remote_bp_measurements}}</td>
     <td>{{$iPatient->number_of_days_with_remote_weight_measurements}}</td>
 
@@ -28,10 +61,10 @@
             @endif
         @else
             @if($iPatient->most_recent_cellular_bp_sbp_mm_hg && $iPatient->most_recent_cellular_bp_dbp_mm_hg)
-                <div class="text-nowrap">
+                <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"
+                        <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>
                     @endif
                 </div>

+ 46 - 43
resources/views/app/practice-management/rpm-manager/table.blade.php

@@ -16,91 +16,94 @@
         <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-left-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>
+                <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>
+                <th class="border-top-0 border-bottom-0"></th>
+                <th class="border-top-0 border-bottom-0"></th>
+                <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 bg-aliceblue" colspan="2">Entries</th>
+                    <th class="border-top-0 border-bottom-0 bg-aliceblue" colspan="2">Entries</th>
                 @endif
-                <th class="border-top-0"></th>
+                <th class="border-top-0 border-bottom-0"></th>
                 @if($viewingAs !== 'RME')
-                    <th class="border-top-0 bg-aliceblue" colspan="{{$viewingAs === 'ADMIN' ? 3 : 1}}">Time</th>
+                    <th class="border-top-0 border-bottom-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>
+                <th class="border-top-0 border-bottom-0 bg-aliceblue" colspan="{{$viewingAs === 'ADMIN' ? 3 : 1}}">Reimbursement</th>
                 @if($viewingAs === 'ADMIN')
-                    <th class="border-top-0 bg-aliceblue" colspan="3">Claim</th>
+                    <th class="border-top-0 border-bottom-0 bg-aliceblue" colspan="3">Claim</th>
                 @endif
-                <th class="border-top-0"></th>
-                <th class="border-top-0 border-right-0"></th>
+                <th class="border-top-0 border-bottom-0"></th>
+                <th class="border-top-0 border-bottom-0 border-right-0"></th>
             </tr>
             <tr>
-                <th class="border-bottom-0 border-top-0 border-left-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>
+                <th class="border-bottom-0 border-top border-left-0">Name</th>
+                <th class="border-bottom-0 border-top">DOB</th>
+                <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>
+                <th class="border-bottom-0 border-top">DSLV</th>
 
                 <!--# Meas. Days-->
-                <th class="border-bottom-0 border-top-0">All</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">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-0">BP</th>
-                <th class="border-bottom-0 border-top-0">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-0">Mine</th>
-                    <th class="border-bottom-0 border-top-0">Others</th>
+                    <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-0">Comm.</th>
+                <th class="border-bottom-0 border-top">Comm.</th>
 
                 <!--Time-->
                 @if($viewingAs !== 'RME')
                     @if($viewingAs === 'ADMIN' || $viewingAs === 'MCP')
-                        <th class="border-bottom-0 border-top-0">MCP</th>
+                        <th class="border-bottom-0 border-top">MCP</th>
                     @endif
                     @if($viewingAs === 'ADMIN' || $viewingAs === 'RMM')
-                        <th class="border-bottom-0 border-top-0">RMM</th>
+                        <th class="border-bottom-0 border-top">RMM</th>
                     @endif
                     @if($viewingAs === 'ADMIN')
-                        <th class="border-bottom-0 border-top-0">Total</th>
+                        <th class="border-bottom-0 border-top">Total</th>
                     @endif
                 @endif
 
                 <!--Reimb.-->
                 @if($viewingAs === 'ADMIN' || $viewingAs === 'MCP')
-                    <th class="border-bottom-0 border-top-0">MCP</th>
+                    <th class="border-bottom-0 border-top">MCP</th>
                 @endif
                 @if($viewingAs === 'ADMIN' || $viewingAs === 'RMM')
-                    <th class="border-bottom-0 border-top-0">RMM</th>
+                    <th class="border-bottom-0 border-top">RMM</th>
                 @endif
                 @if($viewingAs === 'ADMIN' || $viewingAs === 'RME')
-                    <th class="border-bottom-0 border-top-0">RME</th>
+                    <th class="border-bottom-0 border-top">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>
+                    <th class="border-bottom-0 border-top">454</th>
+                    <th class="border-bottom-0 border-top">457</th>
+                    <th class="border-bottom-0 border-top">458</th>
                 @endif
 
-                <th class="border-bottom-0 border-top-0">Next</th>
-                <th class="border-bottom-0 border-top-0 border-right-0"></th>
+                <th class="border-bottom-0 border-top">Next</th>
+                <th class="border-bottom-0 border-top border-right-0"></th>
             </tr>
             </thead>
             <tbody>
-            <?php $trIndex = 0; ?>
+            <?php
+            $trIndex = 0;
+            $daysRemaining = date('t') - date('j');
+            ?>
             @foreach ($patients as $iPatient)
-                @include('app.practice-management.rpm-manager.row', compact('viewingAs'))
+                @include('app.practice-management.rpm-manager.row', compact('viewingAs', 'daysRemaining'))
                 <?php $trIndex++; ?>
             @endforeach
             </tbody>