Pārlūkot izejas kodu

RPM matrix updates

Vijayakrishnan 3 gadi atpakaļ
vecāks
revīzija
49fbdc2f7c

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

@@ -1046,6 +1046,7 @@ SELECT client.name_first, client.name_last,
        client.is_enrolled_in_rm,
        client.most_recent_completed_mcp_note_date,
        client.most_recent_completed_mcp_note_id,
+       mrnote.uid as most_recent_completed_mcp_note_uid,
        client.cell_number,
        client.is_assigned_cellular_bp_device,
        client.is_assigned_cellular_weight_scale_device,
@@ -1072,7 +1073,7 @@ SELECT client.name_first, client.name_last,
        client.most_recent_cellular_bp_measurement_at,      
        client.most_recent_cellular_weight_value,
        client.most_recent_cellular_weight_measurement_at
-FROM care_month join client on care_month.client_id = client.id
+FROM care_month join client on care_month.client_id = client.id join note mrnote on client.most_recent_completed_mcp_note_id = mrnote.id
 WHERE
       (care_month.mcp_pro_id = {$performer->pro->id} OR care_month.rmm_pro_id = {$performer->pro->id})
       AND EXTRACT(MONTH from care_month.start_date) = " . ($request->input('m') ?: 'EXTRACT(MONTH from now())') . "

+ 1 - 1
config/app.php

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

+ 17 - 0
public/css/style.css

@@ -3064,4 +3064,21 @@ body.forced-masking {
 }
 body.forced-masking #mask {
     display: block !important;
+}
+[stag-title] {
+    position: relative;
+}
+[stag-title]:hover:after {
+    content: attr(stag-title);
+    position: absolute;
+    bottom: 100%;
+    left: 0;
+    width: 100%;
+    background: #eee;
+    border: 1px solid #ccc;
+    color: #777;
+    font-size: 80%;
+    font-weight: normal;
+    padding: 1px 3px;
+    z-index: 1;
 }

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

@@ -27,8 +27,6 @@
                 </span>
                 <?php
 
-                use App\Models\Note;
-
                 $mStr = request()->input('m') ? request()->input('m') : date('m');
                 $yStr = request()->input('y') ? request()->input('y') : date('Y');
                 $rcmStartDate = $yStr . '-' . $mStr . '-' . '01';
@@ -80,19 +78,19 @@
                         <table class="table table-sm table-striped table-hover p-0 m-0 border-top" id="table-rm-matrix">
                             <thead class="bg-light">
                             <tr>
-                                <th class="border-0 pl-2">Name</th>
-                                <th class="border-0">DOB</th>
-                                <th class="border-0">RPM?</th>
-                                <th class="border-0">Cell. BP?</th>
-                                <th class="border-0">Cell. Scale?</th>
-                                <th class="border-0">Last BP</th>
-                                <th class="border-0">Last Wt</th>
-                                <th class="border-0">Last Visit</th>
-                                <th class="border-0">Interacted?</th>
-                                <th class="border-0">#Meas. Days</th>
-                                <th class="border-0">#Unstamped</th>
-                                <th class="border-0">#RPM Mins.</th>
-                                <th class="border-0">Billable</th>
+                                <th class="border-0 pl-2" stag-title="Click to sort. Shift+Click to multi-sort.">Name</th>
+                                <th class="border-0" stag-title="Click to sort. Shift+Click to multi-sort.">DOB</th>
+                                <th class="border-0" stag-title="Click to sort. Shift+Click to multi-sort.">RPM?</th>
+                                <th class="border-0" stag-title="Click to sort. Shift+Click to multi-sort.">Cell. BP?</th>
+                                <th class="border-0" stag-title="Click to sort. Shift+Click to multi-sort.">Cell. Scale?</th>
+                                <th class="border-0" stag-title="Click to sort. Shift+Click to multi-sort.">Last BP</th>
+                                <th class="border-0" stag-title="Click to sort. Shift+Click to multi-sort.">Last Wt</th>
+                                <th class="border-0" stag-title="Click to sort. Shift+Click to multi-sort.">Last Visit</th>
+                                <th class="border-0" stag-title="Click to sort. Shift+Click to multi-sort.">Interacted?</th>
+                                <th class="border-0" stag-title="Click to sort. Shift+Click to multi-sort.">#Meas. Days</th>
+                                <th class="border-0" stag-title="Click to sort. Shift+Click to multi-sort.">#Unstamped</th>
+                                <th class="border-0" stag-title="Click to sort. Shift+Click to multi-sort.">#RPM Mins.</th>
+                                <th class="border-0" stag-title="Click to sort. Shift+Click to multi-sort.">Billable</th>
                             </tr>
                             </thead>
                             <tbody>
@@ -100,12 +98,10 @@
                                 <?php
 
                                 $daysDiff = -1;
-                                $mostRecentCompletedMcpNote = null;
                                 if($iPatient->most_recent_completed_mcp_note_date) {
                                     $careMonthLastDay = date_add(date_create($rcmStartDate), date_interval_create_from_date_string("1 month"));
                                     $careMonthLastDay = date_sub($careMonthLastDay, date_interval_create_from_date_string("1 day"));
                                     $daysDiff = date_diff($careMonthLastDay, date_create($iPatient->most_recent_completed_mcp_note_date))->days;
-                                    $mostRecentCompletedMcpNote = Note::where('id', $iPatient->most_recent_completed_mcp_note_id)->first();
                                 }
                                 $lastVisitWithin90Days = ($daysDiff !== -1 && $daysDiff <= 90);
 
@@ -152,12 +148,12 @@
                                     <td>
                                         <div class="d-flex align-items-baseline">
                                             <i class="mr-1 text-sm fa {{$lastVisitWithin90Days ? 'fa-check text-success' : 'fa-exclamation-triangle text-danger'}}"></i>
-                                            @if($mostRecentCompletedMcpNote)
-                                                <a href = "{{route('patients.view.notes.view.dashboard', ['patient' => $iPatient->client_uid, 'note' => $mostRecentCompletedMcpNote])}}">
-                                                    <span>{{$iPatient->most_recent_completed_mcp_note_date ? friendly_date($iPatient->most_recent_completed_mcp_note_date) : '-'}}</span>
+                                            @if($iPatient->most_recent_completed_mcp_note_uid)
+                                                <a href = "/patients/view/{{$iPatient->client_uid}}/notes/view/{{$iPatient->most_recent_completed_mcp_note_uid}}">
+                                                    <span class="sort-data">{{$iPatient->most_recent_completed_mcp_note_date ? friendly_date($iPatient->most_recent_completed_mcp_note_date) : '-'}}</span>
                                                 </a>
                                             @else
-                                                <span>-</span>
+                                                <span class="sort-data">-</span>
                                             @endif
                                         </div>
                                         {{--@if(!$lastVisitWithin90Days)
@@ -230,7 +226,7 @@
                                     <td>
                                         <div class="d-flex align-items-baseline">
                                             <i class="mr-1 text-sm fa {{$iPatient->number_of_days_with_remote_measurements >= 16 ? 'fa-check text-success' : 'fa-exclamation-triangle text-danger'}}"></i>
-                                            <span>{{$iPatient->number_of_days_with_remote_measurements ?: 0}}</span>
+                                            <span class="sort-data">{{$iPatient->number_of_days_with_remote_measurements ?: 0}}</span>
                                             @if($iPatient->number_of_days_with_remote_measurements < 16)
                                                 <div moe relative class="ml-2">
                                                     <a href="#" start show class="text-sm">SMS</a>
@@ -259,7 +255,7 @@
                                     <td>
                                         <div class="d-flex align-items-baseline">
                                             @if($performerRole === 'MCP')
-                                                <span>{{$iPatient->rm_num_measurements_not_stamped_by_mcp}}</span>
+                                                <span class="sort-data">{{$iPatient->rm_num_measurements_not_stamped_by_mcp}}</span>
                                                 @if($iPatient->rm_num_measurements_not_stamped_by_mcp)
                                                     <a href="{{ route('practice-management.rpm_work_matrix') }}?patientUid={{$iPatient->client_uid}}&careMonthUid={{$iPatient->care_month_uid}}"
                                                        native target="_blank"
@@ -273,7 +269,7 @@
                                                     </a>
                                                 @endif
                                             @elseif($performerRole === 'RMM')
-                                                <span>{{$iPatient->rm_num_measurements_not_stamped_by_rmm}}</span>
+                                                <span class="sort-data">{{$iPatient->rm_num_measurements_not_stamped_by_rmm}}</span>
                                                 @if($iPatient->rm_num_measurements_not_stamped_by_rmm)
                                                     <a href="{{ route('practice-management.rpm_work_matrix') }}?patientUid={{$iPatient->client_uid}}&careMonthUid={{$iPatient->care_month_uid}}"
                                                        native target="_blank"
@@ -294,6 +290,7 @@
                                             <div class="d-flex align-items-baseline">
                                                 <i class="mr-1 text-sm fa {{$iPatient->rm_total_time_in_seconds_by_mcp >= 1200 ? 'fa-check text-success' : 'fa-exclamation-triangle text-danger'}}"></i>
                                                 <span class="text-nowrap">{{round($iPatient->rm_total_time_in_seconds_by_mcp / 60)}}m {{round($iPatient->rm_total_time_in_seconds_by_mcp % 60)}}s</span>
+                                                <span class="sort-data d-none">{{$iPatient->rm_total_time_in_seconds_by_mcp}}</span>
                                             </div>
                                             {{--@if($iPatient->rm_total_time_in_seconds_by_mcp < 1200)
                                                 <div class="text-sm font-italic text-secondary">Entry mins. < 20</div>
@@ -302,6 +299,7 @@
                                             <div class="d-flex align-items-baseline">
                                                 <i class="mr-1 text-sm fa {{$iPatient->rm_total_time_in_seconds_by_rmm_pro >= 1200 ? 'fa-check text-success' : 'fa-exclamation-triangle text-danger'}}"></i>
                                                 <span class="text-nowrap">{{round($iPatient->rm_total_time_in_seconds_by_rmm_pro / 60)}}m {{round($iPatient->rm_total_time_in_seconds_by_rmm_pro % 60)}}s</span>
+                                                <span class="sort-data d-none">{{$iPatient->rm_total_time_in_seconds_by_rmm_pro}}</span>
                                             </div>
                                             {{--@if($iPatient->rm_total_time_in_seconds_by_rmm_pro < 1200)
                                                 <div class="text-sm font-italic text-secondary">Entry mins. < 20</div>
@@ -345,7 +343,32 @@
     <script>
         (function() {
             function init() {
-                $('#table-rm-matrix').DataTable();
+                $('#table-rm-matrix').DataTable({
+                    paging: false,
+                    columnDefs: [
+                        {targets: 1, type: 'date'},
+                        {
+                            targets: 7,
+                            type: 'date',
+                            render: function (data, type, row, meta) {
+                                if(type === 'sort') {
+                                    return $(data).find('.sort-data').first().text();
+                                }
+                                return data;
+                            },
+                        },
+                        {
+                            targets: [9, 10, 11],
+                            type: 'num',
+                            render: function (data, type, row, meta) {
+                                if(type === 'sort') {
+                                    return +($(data).find('.sort-data').first().text());
+                                }
+                                return data;
+                            },
+                        },
+                    ]
+                });
                 $('#practice-remote-monitoring').removeAttr('v-cloak');
             }
             addMCInitializer('practice-remote-monitoring', init, '#practice-remote-monitoring');