Ver código fonte

Patient-suggest > show unclaimed patients as well (with highlight)

Vijayakrishnan 4 anos atrás
pai
commit
cf19b1de37

+ 5 - 2
app/Http/Controllers/HomeController.php

@@ -407,8 +407,11 @@ class HomeController extends Controller
                 ->orWhere('cell_number', 'ILIKE', '%' . $term . '%');
         });
 
-        if($pro->pro_type != 'ADMIN'){
-            $clientQuery->whereIn('id', $pro->getMyClientIds());
+        if($pro->pro_type != 'ADMIN') {
+            $clientQuery->where(function ($q) use ($pro) {
+                $q->whereIn('id', $pro->getMyClientIds())
+                    ->orWhereNull('mcp_pro_id');
+            });
         }
 
         $clients = $clientQuery->get();

+ 10 - 0
public/css/style.css

@@ -1522,4 +1522,14 @@ th.only-screen, td.only-screen {
     .only-screen {
         display: none !important;
     }
+}
+
+.suggest-item.patient-suggest>img {
+    width: 10px;
+    height: 10px;
+    opacity: 0.75;
+}
+.suggest-item.patient-suggest>img.claimed {
+    filter: grayscale(100%);
+    opacity: 0.5;
 }

BIN
public/img/bluecircle.png


+ 2 - 1
resources/views/app/patient-suggest.blade.php

@@ -4,7 +4,8 @@
 <?php $activeSet = false; ?>
 @foreach($clients as $client)
     <a class="d-block suggest-item patient-suggest text-nowrap {{ $activeSet ? '' : 'active'  }}"
-       href="" data-target-uid="{{$client->uid}}">
+       href="" data-target-uid="{{$client->uid}}" {!! $client->mcp ? '' : 'title="Unclaimed Patient"' !!}>
+        <img src="/img/bluecircle.png" alt="Unclaimed Patient" class="mr-1 {{$client->mcp ? 'claimed' : 'unclaimed'}}">
         {{$client->displayName()}}
         {!! $client->cell_number ? '<span class="text-sm text-secondary ml-1">(' . $client->cell_number . ')</span>' : '' !!}
     </a>