Parcourir la source

Merge branch 'dev' of rav.triplestart.com:jmudaka/stagfe2 into dev

= il y a 3 ans
Parent
commit
0e27c36458

+ 10 - 4
app/Http/Controllers/AdminController.php

@@ -77,6 +77,11 @@ class AdminController extends Controller
         if ($request->input('next_appointment_category')) {
             if($request->input('next_appointment_category') == 'NONE'){
                 $patients = $patients->whereNull('next_mcp_appointment_id');
+            }else{
+                $self = $this;
+                $patients = $patients->whereHas('nextMcpAppointment', function($pQry) use ($request, $self){
+                    return $self->filterMultiQuery($request, $pQry, 'raw_date', 'next_appointment_category', 'next_appointment_value_1', 'next_appointment_value_2');
+                });
             }
         }
 
@@ -95,12 +100,13 @@ class AdminController extends Controller
             }
         }
 
-        $this->filterMultiQuery($request, $patients, 'age_in_years', 'age_category', 'age_value_1', 'age_value_2');
+        $this->filterMultiQuery($request, $patients, 'age_in_years', 'age_category', 'age_value_1', 'age_value_2', false);
         $this->filterSimpleQuery($request, $patients, 'sex', 'sex');
-        $this->filterMultiQuery($request, $patients, 'usual_bmi_max', 'bmi_category', 'bmi_value_1', 'bmi_value_2');
+        $this->filterMultiQuery($request, $patients, 'usual_bmi_max', 'bmi_category', 'bmi_value_1', 'bmi_value_2', false);
         $this->filterMultiQuery($request, $patients, 'most_recent_weight_at', 'last_weighed_in_category', 'last_weighed_in_value_1', 'last_weighed_in_value_2');
         $this->filterMultiQuery($request, $patients, 'most_recent_bp_at', 'last_bp_category', 'last_bp_value_1', 'last_bp_value_2');
         $this->filterMultiQuery($request, $patients, 'created_at', 'created_at', 'created_at_value_1', 'created_at_value_2');
+        $this->filterMultiQuery($request, $patients, 'most_recent_completed_mcp_note_date', 'last_visit_category', 'last_visit_value_1', 'last_visit_value_2');
 
         if($request->input('number_of_measurements')){
             $keyName = $request->input('number_of_measurements');
@@ -261,9 +267,9 @@ class AdminController extends Controller
             }
         }
 
-        $this->filterMultiQuery($request, $patients, 'age_in_years', 'age_category', 'age_value_1', 'age_value_2');
+        $this->filterMultiQuery($request, $patients, 'age_in_years', 'age_category', 'age_value_1', 'age_value_2', false);
         $this->filterSimpleQuery($request, $patients, 'sex', 'sex');
-        $this->filterMultiQuery($request, $patients, 'usual_bmi_max', 'bmi_category', 'bmi_value_1', 'bmi_value_2');
+        $this->filterMultiQuery($request, $patients, 'usual_bmi_max', 'bmi_category', 'bmi_value_1', 'bmi_value_2', false);
         $this->filterMultiQuery($request, $patients, 'most_recent_weight_at', 'last_weighed_in_category', 'last_weighed_in_value_1', 'last_weighed_in_value_2');
         $this->filterMultiQuery($request, $patients, 'most_recent_bp_at', 'last_bp_category', 'last_bp_value_1', 'last_bp_value_2');
 

+ 2 - 2
app/Http/Controllers/DnaController.php

@@ -62,9 +62,9 @@ class DnaController extends Controller
             }
         }
 
-        $this->filterMultiQuery($request, $patients, 'age_in_years', 'age_category', 'age_value_1', 'age_value_2');
+        $this->filterMultiQuery($request, $patients, 'age_in_years', 'age_category', 'age_value_1', 'age_value_2', false);
         $this->filterSimpleQuery($request, $patients, 'sex', 'sex');
-        $this->filterMultiQuery($request, $patients, 'usual_bmi_max', 'bmi_category', 'bmi_value_1', 'bmi_value_2');
+        $this->filterMultiQuery($request, $patients, 'usual_bmi_max', 'bmi_category', 'bmi_value_1', 'bmi_value_2', false);
         $this->filterMultiQuery($request, $patients, 'most_recent_completed_mcp_note_date', 'last_visit_category', 'last_visit_value_1', 'last_visit_value_2'); 
         $this->filterMultiQuery($request, $patients, 'next_mcp_appointment_date', 'next_appointment_category', 'next_appointment_value_1', 'next_appointment_value_2');
 

+ 14 - 2
app/Http/Controllers/McpController.php

@@ -93,11 +93,12 @@ class McpController extends Controller
             }
         }
 
-        $this->filterMultiQuery($request, $patients, 'age_in_years', 'age_category', 'age_value_1', 'age_value_2');
+        $this->filterMultiQuery($request, $patients, 'age_in_years', 'age_category', 'age_value_1', 'age_value_2', false);
         $this->filterSimpleQuery($request, $patients, 'sex', 'sex');
-        $this->filterMultiQuery($request, $patients, 'usual_bmi_max', 'bmi_category', 'bmi_value_1', 'bmi_value_2');
+        $this->filterMultiQuery($request, $patients, 'usual_bmi_max', 'bmi_category', 'bmi_value_1', 'bmi_value_2', false);
         $this->filterMultiQuery($request, $patients, 'most_recent_weight_at', 'last_weighed_in_category', 'last_weighed_in_value_1', 'last_weighed_in_value_2');
         $this->filterMultiQuery($request, $patients, 'most_recent_bp_at', 'last_bp_category', 'last_bp_value_1', 'last_bp_value_2');
+        $this->filterMultiQuery($request, $patients, 'most_recent_completed_mcp_note_date', 'last_visit_category', 'last_visit_value_1', 'last_visit_value_2');
 
         switch($request->input('status')) {
             case 'ACTIVE':
@@ -125,6 +126,17 @@ class McpController extends Controller
             });
         }
 
+        if ($request->input('next_appointment_category')) {
+            if($request->input('next_appointment_category') == 'NONE'){
+                $patients = $patients->whereNull('next_mcp_appointment_id');
+            }else{
+                $self = $this;
+                $patients = $patients->whereHas('nextMcpAppointment', function($pQry) use ($request, $self){
+                    return $self->filterMultiQuery($request, $pQry, 'raw_date', 'next_appointment_category', 'next_appointment_value_1', 'next_appointment_value_2');
+                });
+            }
+        }
+
 
         if ($request->input('chart_number')) {
             $patients = $patients->where('chart_number', 'ILIKE' , '%'.$request->input('chart_number').'%');

+ 1 - 1
resources/views/app/dashboard-mcp.blade.php

@@ -469,7 +469,7 @@
                                         Notifications
                                     </strong>
                                 </div>
-                                <div class="card-body px-3 py-2">
+                                <div class="card-body p-0">
                                     @include('app.mcp.dashboard.notifications')
                                 </div>
                             </div>

+ 11 - 5
resources/views/app/mcp/dashboard/notifications.blade.php

@@ -9,12 +9,16 @@
 
 ?>
 @if(!count($apptsPending['status']) && !count($apptsPending['decision'])/* && !count($apptsPending['time'])*/)
-    No appointment changes
+    <div class="px-2">
+        No appointment changes
+    </div>
 @endif
 @if(count($apptsPending['status']))
-    <b class="text-secondary my-2 d-block">Appointment Status Changes</b>
+    <div class="px-2">
+        <b class="text-secondary my-2 d-block">Appointment Status Changes</b>
+    </div>
     @foreach($apptsPending['status'] as $appt)
-        <div class="d-flex mb-1 border-bottom border-light" discardable-container>
+        <div class="d-flex mb-1 border-bottom px-2 pb-1" discardable-container>
             <div class="flex-grow-1 d-inline-flex align-items-baseline">
                 <div>
                     <a class="d-block" href="/patients/view/{{$appt->client->uid}}"><b>{{$appt->client->displayName()}}</b></a>
@@ -45,9 +49,11 @@
     @endforeach
 @endif
 @if(count($apptsPending['decision']))
-    <b class="text-secondary my-2 d-block">Appointment Confirmation Changes</b>
+    <div class="px-2">
+        <b class="text-secondary my-2 d-block">Appointment Confirmation Changes</b>
+    </div>
     @foreach($apptsPending['decision'] as $appt)
-        <div class="d-flex mb-1 border-bottom border-light" discardable-container>
+        <div class="d-flex mb-1 {{ $loop->last ? '':'border-bottom' }} px-2 pb-1" discardable-container>
             <div class="flex-grow-1 d-inline-flex align-items-baseline">
                 <div>
                     <a class="d-block" href="/patients/view/{{$appt->client->uid}}"><b>{{$appt->client->displayName()}}</b></a>

+ 4 - 4
resources/views/app/mcp/patients_filters.blade.php

@@ -76,10 +76,10 @@
 			</select>
 			<div v-show="filters.last_visit_category" class="mt-2">
 				<div>
-					<input  name="last_visit_value_1" v-model="filters.last_visit_value_1" type="number" class="form-control input-sm" :placeholder="(filters.last_visit_category === 'BETWEEN' || filters.last_visit_category === 'NOT_BETWEEN') ? 'From' : 'Last Visit'" />
+					<input  name="last_visit_value_1" v-model="filters.last_visit_value_1" type="date" class="form-control input-sm" :placeholder="(filters.last_visit_category === 'BETWEEN' || filters.last_visit_category === 'NOT_BETWEEN') ? 'From' : 'Last Visit'" />
 				</div>
 				<div v-show="filters.last_visit_category === 'BETWEEN' || filters.last_visit_category === 'NOT_BETWEEN'" class="mt-2">
-					<input name="last_visit_value_2" v-model="filters.last_visit_value_2" type="number" class="form-control input-sm" placeholder="To" />
+					<input name="last_visit_value_2" v-model="filters.last_visit_value_2" type="date" class="form-control input-sm" placeholder="To" />
 				</div>
 			</div>
 		</div>
@@ -99,10 +99,10 @@
 			</select>
 			<div v-show="filters.next_appointment_category" class="mt-2">
 				<div>
-					<input  name="next_appointment_value_1" v-model="filters.next_appointment_value_1" type="number" class="form-control input-sm" :placeholder="(filters.next_appointment_category === 'BETWEEN' || filters.next_appointment_category === 'NOT_BETWEEN') ? 'From' : 'Next Appt.'" />
+					<input  name="next_appointment_value_1" v-model="filters.next_appointment_value_1" type="date" class="form-control input-sm" :placeholder="(filters.next_appointment_category === 'BETWEEN' || filters.next_appointment_category === 'NOT_BETWEEN') ? 'From' : 'Next Appt.'" />
 				</div>
 				<div v-show="filters.next_appointment_category === 'BETWEEN' || filters.next_appointment_category === 'NOT_BETWEEN'" class="mt-2">
-					<input name="next_appointment_value_2" v-model="filters.next_appointment_value_2" type="number" class="form-control input-sm" placeholder="To" />
+					<input name="next_appointment_value_2" v-model="filters.next_appointment_value_2" type="date" class="form-control input-sm" placeholder="To" />
 				</div>
 			</div>
 		</div>

+ 6 - 0
resources/views/layouts/patient-header.blade.php

@@ -489,8 +489,14 @@ $addressParts .= implode(", ", $addressPart2);
           </div>
         </div>
         @if($patient->sticky_note)
+        <?php
+        $patientRecentStickyNote = App\Models\ClientStickyNote::where('client_id', $patient->id)->orderBy('created_at', 'DESC')->limit(1)->first();
+        ?>
         <div class="">
           <span class="d-block text-secondary">{{$patient->sticky_note ?? '-' }}</span>
+          <div>
+            <small class="text-muted">By: {{ $patientRecentStickyNote->createdBy->pro->displayName()  }} • At: {{ friendlier_date($patientRecentStickyNote->created_at) }}</small>
+          </div>
         </div>
         @endif
       </div>