|
@@ -198,6 +198,29 @@ class HomeController extends Controller
|
|
})->count();
|
|
})->count();
|
|
$keyNumbers['patientsNotSeenYet'] = $patientNotSeenYet;
|
|
$keyNumbers['patientsNotSeenYet'] = $patientNotSeenYet;
|
|
|
|
|
|
|
|
+ // patientsPendingProgramOB
|
|
|
|
+ $proID = $this->performer()->pro->id;
|
|
|
|
+ if ($this->performer()->pro->pro_type === 'ADMIN') {
|
|
|
|
+ $query = Client::where('id', '>', 0);
|
|
|
|
+ } else {
|
|
|
|
+ $query = Client::where(function ($q) use ($proID) {
|
|
|
|
+ $q->where('mcp_pro_id', $proID)
|
|
|
|
+ ->orWhere('cm_pro_id', $proID)
|
|
|
|
+ ->orWhere('rmm_pro_id', $proID)
|
|
|
|
+ ->orWhere('rme_pro_id', $proID)
|
|
|
|
+ ->orWhereRaw('id IN (SELECT client_id FROM client_pro_access WHERE is_active AND pro_id = ?)', [$proID])
|
|
|
|
+ ->orWhereRaw('id IN (SELECT client_id FROM appointment WHERE pro_id = ?)', [$proID]);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ $query = $query->where(function ($_query) {
|
|
|
|
+ $_query->select(DB::raw('COUNT(id)'))
|
|
|
|
+ ->from('client_program')
|
|
|
|
+ ->whereColumn('client_id', 'client.id')
|
|
|
|
+ ->where('has_mcp_done_onboarding_visit', '!=', 'YES');
|
|
|
|
+ }, '>=', 1);
|
|
|
|
+ $keyNumbers['patientsPendingProgramOB'] = $query->count();
|
|
|
|
+
|
|
|
|
+
|
|
$pendingBillsToSign = Bill::where(function ($query) use ($performerProID) {
|
|
$pendingBillsToSign = Bill::where(function ($query) use ($performerProID) {
|
|
$query->where('hcp_pro_id', $performerProID)->where('is_signed_by_hcp', false)->where('is_cancelled', false);
|
|
$query->where('hcp_pro_id', $performerProID)->where('is_signed_by_hcp', false)->where('is_cancelled', false);
|
|
})
|
|
})
|