Browse Source

Allow MCPs to see orphan patients

Vijayakrishnan 3 years ago
parent
commit
88f91b7abf
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/Http/Controllers/HomeController.php

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

@@ -1725,7 +1725,7 @@ WHERE measurement.label NOT IN ('SBP', 'DBP')
 
 
         if(!($pro->pro_type === 'ADMIN' && $pro->can_see_any_client_via_search)) {
         if(!($pro->pro_type === 'ADMIN' && $pro->can_see_any_client_via_search)) {
             $clientQuery->where(function ($q) use ($pro) {
             $clientQuery->where(function ($q) use ($pro) {
-                if($pro->pro_type === 'ADMIN') {
+                if($pro->pro_type === 'ADMIN' || $pro->is_enrolled_as_mcp) {
                     $q->whereIn('id', $pro->getMyClientIds(true))->orWhereNull('mcp_pro_id');
                     $q->whereIn('id', $pro->getMyClientIds(true))->orWhereNull('mcp_pro_id');
                 }
                 }
                 else {
                 else {