Browse Source

RPM manager - meas popup - update single row after stamp

Vijayakrishnan 2 years ago
parent
commit
4c09837b11
1 changed files with 20 additions and 8 deletions
  1. 20 8
      resources/views/app/practice-management/rpm-manager/index.blade.php

+ 20 - 8
resources/views/app/practice-management/rpm-manager/index.blade.php

@@ -593,11 +593,6 @@
                 let careMonth = careMonths[_careMonthUid],
                     measurements = careMonth['measurements_' + _type + '_json'];
 
-                addMCHook('refresh-' + _careMonthUid + '_' + _type, function () {
-                    prepareMeasurementsPopup(_careMonthUid, _type);
-                    return false;
-                });
-
                 // misc
                 $('#rpm-manager-' + _type + '-popup-title').text(careMonth.client_name + ' (' + careMonth.dob + ')');
                 $('#rpm-manager-' + _type + '-caremonth').text('Care Month of: ' + careMonth.month_display + '  |  ' + (_type === 'bp' ? 'Blood Pressure' : 'Weight'));
@@ -639,6 +634,15 @@
                     let stamp = '';
                     @if($viewingAs === 'MCP')
                     if(!m.hasBeenStampedByMcp) {
+                        addMCHook('refresh-measurement-' + m.uid, function () {
+                            $('tr[data-uid="' + m.uid + '"] td:eq(3)').html('' +
+                                '<div class="d-flex align-items-baseline text-secondary">' +
+                                '<i class="fa fa-check"></i>' +
+                                '<span class="ml-1">Stamped</span>' +
+                                '</div>'
+                            );
+                            return false;
+                        });
                         stamp = $($('#stamp-moe-template').html());
                         stamp.find('[name="uid"]').val(m.uid);
                         stamp.find('.stamp-moe-type').text(m.bdtDeviceCategory);
@@ -649,7 +653,7 @@
                             stamp.find('.stamp-moe-value').text(m.numericValue + ' lbs');
                         }
                         stamp.find('.stamp-moe-date-time').text(m.date_display + ' ' + m.time_display);
-                        stamp.find('form').attr('hook', 'refresh-' + _careMonthUid + '_' + _type);
+                        stamp.find('form').attr('hook', 'refresh-measurement-' + m.uid);
                     }
                     else {
                         stamp = $('<div class="d-flex align-items-baseline text-secondary" />');
@@ -658,6 +662,15 @@
                     }
                     @elseif($viewingAs === 'RMM')
                     if(!m.hasBeenStampedByRmm) {
+                        addMCHook('refresh-measurement-' + m.uid, function () {
+                            $('tr[data-uid="' + m.uid + '"] td:eq(3)').html('' +
+                                '<div class="d-flex align-items-baseline text-secondary">' +
+                                '<i class="fa fa-check"></i>' +
+                                '<span class="ml-1">Stamped</span>' +
+                                '</div>'
+                            );
+                            return false;
+                        });
                         stamp = $($('#stamp-moe-template').html());
                         stamp.find('[name="uid"]').val(m.uid);
                         stamp.find('.stamp-moe-type').text(m.bdtDeviceCategory);
@@ -668,7 +681,7 @@
                             stamp.find('.stamp-moe-value').text(m.numericValue + ' lbs');
                         }
                         stamp.find('.stamp-moe-date-time').text(m.date_display + ' ' + m.time_display);
-                        stamp.find('form').attr('hook', 'refresh-' + _careMonthUid + '_' + _type);
+                        stamp.find('form').attr('hook', 'refresh-measurement-' + m.uid);
                     }
                     else {
                         stamp = $('<div class="d-flex align-items-baseline text-secondary" />');
@@ -697,7 +710,6 @@
 
                     tr.appendTo(tbody);
                 }
-                initMoes();
             }
 
             function filterLatestMeasurementEachDay(_measurements) {