Преглед изворни кода

Patients having birthday today: keyNumber + matrix

Vijayakrishnan пре 4 година
родитељ
комит
038b128f9f

+ 13 - 0
app/Http/Controllers/HomeController.php

@@ -256,6 +256,13 @@ class HomeController extends Controller
             ->where('is_cancellation_acknowledged', false)
             ->count();
 
+        // patientsHavingBirthdayToday
+        $queryClients = $this->performer()->pro->getAccessibleClientsQuery();
+        $keyNumbers['patientsHavingBirthdayToday'] = $queryClients
+            ->whereRaw('EXTRACT(DAY from dob) = ?', [date('d')])
+            ->whereRaw('EXTRACT(MONTH from dob) = ?', [date('m')])
+            ->count();
+
         $reimbursement = [];
         $reimbursement["currentBalance"] =  $performer->pro->balance;
         $reimbursement["nextPaymentDate"] = '--';
@@ -440,6 +447,12 @@ class HomeController extends Controller
                     });
                 break;
 
+            case 'having-birthday-today':
+                $query = $query
+                    ->whereRaw('EXTRACT(DAY from dob) = ?', [date('d')])
+                    ->whereRaw('EXTRACT(MONTH from dob) = ?', [date('m')]);
+                break;
+
                 // more cases can be added as needed
             default:
                 break;

+ 6 - 0
resources/views/app/dashboard.blade.php

@@ -51,6 +51,12 @@
                                         <a href="/practice-management/unacknowledged-cancelled-bills">Unacknowledged Cancelled Bills</a>
                                     </th>
                                 </tr>
+                                <tr>
+                                    <th class="px-2 text-center">{{$keyNumbers['patientsHavingBirthdayToday']}}</th>
+                                    <th class="pl-2">
+                                        <a href="/patients/having-birthday-today">Patients having birthday today</a>
+                                    </th>
+                                </tr>
                             </tbody>
                         </table>
                     </div>

+ 1 - 0
resources/views/app/patients.blade.php

@@ -34,6 +34,7 @@
             <select class="ml-auto max-width-300px form-control form-control-sm" onchange="fastLoad('/patients/' + this.value, true, false, false)">
                 <option value="" {{ $filter === '' ? 'selected' : '' }}>All patients</option>
                 <option value="not-yet-seen" {{ $filter === 'not-yet-seen' ? 'selected' : '' }}>Patients I have not seen yet</option>
+                <option value="having-birthday-today" {{ $filter === 'having-birthday-today' ? 'selected' : '' }}>Patients having birthday today</option>
             </select>
         </div>
         <div class="card-body p-0">