|
@@ -4650,13 +4650,21 @@ ORDER BY c.name_last, c.name_first
|
|
|
$pro = $this->performer()->pro;
|
|
|
if($pro->pro_type !== 'ADMIN') {
|
|
|
if($pro->is_hcp){
|
|
|
- $patients = $patients->where('mcp_pro_id', $this->performer()->pro->id);
|
|
|
+ $patients = $patients->where('mcp_pro_id', $this->performer()->pro->id);
|
|
|
}
|
|
|
if($pro->is_considered_for_dna){
|
|
|
$patients = $patients->where('default_na_pro_id', $this->performer()->pro->id);
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ if ($request->input('name')) {
|
|
|
+ $name = trim($request->input('name'));
|
|
|
+ if ($name) {
|
|
|
+ $patients = $patients->where(function ($q) use ($name) {
|
|
|
+ $q->where('name_first', 'ILIKE', '%' . $name . '%')
|
|
|
+ ->orWhere('name_last', 'ILIKE', '%' . $name . '%');
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// filters
|