Browse Source

Allow MCPs to see orphan patients

Vijayakrishnan 3 years ago
parent
commit
b04e1a3af0
1 changed files with 2 additions and 1 deletions
  1. 2 1
      app/Models/Pro.php

+ 2 - 1
app/Models/Pro.php

@@ -585,7 +585,8 @@ WHERE mcp_pro_id = :pro_id
         $canAccess = Client::select('uid')
             ->where('uid', $_patientUid)
             ->where(function ($q) use ($proID) {
-                $q->where('mcp_pro_id', $proID)
+                $q->whereNull('mcp_pro_id')
+                    ->orWhere('mcp_pro_id', $proID)
                     ->orWhere('cm_pro_id', $proID)
                     ->orWhere('rmm_pro_id', $proID)
                     ->orWhere('rme_pro_id', $proID)