Explorar o código

RPM matrix - single row refresh updates

Vijayakrishnan %!s(int64=3) %!d(string=hai) anos
pai
achega
8b9833b9fa

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

@@ -1136,7 +1136,7 @@ WHERE care_month.uid = '{$careMonthUid}' AND client.uid = '{$clientUid}'
 
         $patients = DB::select($query);
 
-        return view('app.practice-management.remote-monitoring-row', ['iPatient' => $patients[0]]);
+        return view('app.practice-management.remote-monitoring-row', ['iPatient' => $patients[0], 'trIndex' => $request->input('trIndex')]);
     }
 
     public function rpm_work_matrix(Request $request) {

+ 4 - 1
public/css/style.css

@@ -3083,4 +3083,7 @@ body.forced-masking #mask {
     font-weight: normal;
     padding: 1px 3px;
     z-index: 1;
-}
+}
+.post-refresh-highlight {
+    background: #cbf4f0 !important;
+}

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

@@ -75,6 +75,18 @@
             <div class="card-body p-0">
                 <div class="d-flex align-items-start m-0">
                     <div class="flex-grow-1 px-0 pt-2">
+                        <?php $trIndex = 0; ?>
+                        @foreach ($patients as $iPatient)
+                            <script>
+                                addMCHook(
+                                    'refresh-rpm-row-{{$trIndex}}',
+                                    function () {
+                                        refreshRpmRow({{$trIndex}});
+                                    }
+                                );
+                            </script>
+                            <?php $trIndex++; ?>
+                        @endforeach
                         <table class="table table-sm table-striped table-hover p-0 m-0 border-top" id="table-rm-matrix">
                             <thead class="bg-light">
                             <tr stag-title="Click to sort. Shift+Click to multi-sort.">
@@ -337,14 +349,6 @@
                                         @endif
                                     </td>
                                 </tr>
-                                <script>
-                                    addMCHook(
-                                        'refresh-rpm-row-{{$trIndex}}',
-                                        function () {
-                                            refreshRpmRow({{$trIndex}});
-                                        }
-                                    );
-                                </script>
                                 <?php $trIndex++; ?>
                             @endforeach
                             </tbody>
@@ -361,13 +365,17 @@
                 let tr = $('#table-rm-matrix tbody tr:eq(' + _index + ')');
                 if(!tr.length) return;
                 let clientUid = tr.attr('data-client-uid'), careMonthUid = tr.attr('data-care-month-uid');
-                $.get('/rpm-matrix-row?m={{$mStr}}&y={{$yStr}}&clientUid=' + clientUid + '&careMonthUid=' + careMonthUid, _data => {
+                $.get('/rpm-matrix-row?m={{$mStr}}&y={{$yStr}}&clientUid=' + clientUid + '&careMonthUid=' + careMonthUid + '&trIndex=' + _index, _data => {
                     let row = $(_data);
                     row.find('>td').each(function(_columnIndex) {
                         dataTableInst.cell(_index, _columnIndex).data(this.innerHTML); //.draw();
                     });
                     $('#practice-remote-monitoring [moe][initialized]').removeAttr('initialized');
                     initMoes();
+                    tr.addClass('post-refresh-highlight');
+                    setTimeout(function() {
+                        tr.removeClass('post-refresh-highlight');
+                    }, 1000);
                 });
             }
             function init() {