Преглед изворни кода

RPM matrix for admin - last-meas-before filter

Vijayakrishnan пре 3 година
родитељ
комит
9bed8bce5f

+ 17 - 0
app/Http/Controllers/PracticeManagementController.php

@@ -1717,6 +1717,23 @@ WHERE
                 $conditions[] = "(client.is_assigned_cellular_weight_scale_device IS NULL OR client.is_assigned_cellular_weight_scale_device = FALSE)";
             }
         }
+        if(trim($request->input('f_lmb'))) {
+            $v = trim($request->input('f_lmb'));
+            switch($v) {
+                case '1':
+                    $conditions[] = "(GREATEST(client.most_recent_cellular_bp_measurement_at::DATE, client.most_recent_cellular_weight_measurement_at::DATE)::DATE < (NOW() - INTERVAL '1 DAY')::DATE)";
+                    break;
+                case '2':
+                    $conditions[] = "(GREATEST(client.most_recent_cellular_bp_measurement_at::DATE, client.most_recent_cellular_weight_measurement_at::DATE)::DATE < (NOW() - INTERVAL '2 DAYS')::DATE)";
+                    break;
+                case '3':
+                    $conditions[] = "(GREATEST(client.most_recent_cellular_bp_measurement_at::DATE, client.most_recent_cellular_weight_measurement_at::DATE)::DATE < (NOW() - INTERVAL '3 DAYS')::DATE)";
+                    break;
+                case '3+':
+                    $conditions[] = "(GREATEST(client.most_recent_cellular_bp_measurement_at::DATE, client.most_recent_cellular_weight_measurement_at::DATE)::DATE < (NOW() - INTERVAL '4 DAYS')::DATE)";
+                    break;
+            }
+        }
         if(trim($request->input('f_comm'))) {
             $v = trim($request->input('f_comm'));
             if($v === 'yes') {

+ 22 - 14
resources/views/app/practice-management/remote-monitoring-row-markup-for-admin.blade.php

@@ -16,22 +16,30 @@
     <td>{!! $iPatient->is_assigned_cellular_bp_device ? '<i class="fa fa-check text-success"></i>' : 'No' !!}</td>
     <td>{!! $iPatient->is_assigned_cellular_weight_scale_device ? '<i class="fa fa-check text-success"></i>' : 'No' !!}</td>
     <td>
-        <div class="text-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($iPatient->most_recent_cellular_bp_measurement_at)}})</span>
-            @endif
-        </div>
+        @if($iPatient->most_recent_cellular_bp_sbp_mm_hg && $iPatient->most_recent_cellular_bp_dbp_mm_hg)
+            <div class="text-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($iPatient->most_recent_cellular_bp_measurement_at)}})</span>
+                @endif
+            </div>
+        @else
+            -
+        @endif
     </td>
     <td>
-        <div class="text-nowrap">
-            <span class="sort-data">{{$iPatient->most_recent_cellular_weight_value ? 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($iPatient->most_recent_cellular_weight_measurement_at)}})</span>
-            @endif
-        </div>
+        @if($iPatient->most_recent_cellular_weight_value)
+            <div class="text-nowrap">
+                <span class="sort-data">{{$iPatient->most_recent_cellular_weight_value ? 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($iPatient->most_recent_cellular_weight_measurement_at)}})</span>
+                @endif
+            </div>
+        @else
+            -
+        @endif
     </td>
     
     <td>

+ 13 - 2
resources/views/app/practice-management/rpm-matrix-for-admin.blade.php

@@ -111,7 +111,7 @@
                             </div>
                         </div>
 
-                        <div>
+                        {{--<div>
                             <label class="mb-0 text-sm {{request()->input('f_rpm') && request()->input('f_rpm') !== 'any' ? 'font-weight-bold text-info' : 'text-secondary'}}">RPM</label>
                             <select name="f_rpm"
                                     class="mr-2 form-control form-control-sm min-width-unset width-70px pl-0">
@@ -119,7 +119,7 @@
                                 <option {{request()->input('f_rpm') === 'yes' ? 'selected' : ''}} value="yes">Yes</option>
                                 <option {{request()->input('f_rpm') === 'no' ? 'selected' : ''}} value="no">No</option>
                             </select>
-                        </div>
+                        </div>--}}
 
                         <div>
                             <label class="mb-0 text-sm {{request()->input('f_cell_bp') && request()->input('f_cell_bp') !== 'any' ? 'font-weight-bold text-info' : 'text-secondary'}}">Cell. BP</label>
@@ -141,6 +141,17 @@
                             </select>
                         </div>
 
+                        <div>
+                            <label class="mb-0 text-sm {{request()->input('f_lmb') && request()->input('f_lmb') !== 'ACTIVE' ? 'font-weight-bold text-info' : 'text-secondary'}}">LMB</label>
+                            <select name="f_lmb" class="mr-2 form-control form-control-sm min-width-unset width-70px pl-0">
+                                <option {{request()->input('f_lmb') === 'any' ? 'selected' : ''}} value="any">Any</option>
+                                <option {{request()->input('f_lmb') === '1' ? 'selected' : ''}} value="1">1 day</option>
+                                <option {{request()->input('f_lmb') === '2' ? 'selected' : ''}} value="2">2 days</option>
+                                <option {{request()->input('f_lmb') === '3' ? 'selected' : ''}} value="3">3 days</option>
+                                <option {{request()->input('f_lmb') === '3+' ? 'selected' : ''}} value="3+">3+ days</option>
+                            </select>
+                        </div>
+
                         <div>
                             <label class="mb-0 text-sm {{request()->input('f_comm') && request()->input('f_comm') !== 'any' ? 'font-weight-bold text-info' : 'text-secondary'}}">Comm.</label>
                             <select name="f_comm"