= 3 жил өмнө
parent
commit
5d72b467d8

+ 2 - 781
app/Http/Controllers/HomeController.php

@@ -194,778 +194,6 @@ class HomeController extends Controller
         }
     }
 
-    public function dashboard_MCP(Request $request){
-
-
-        $keyNumbers = [];
-
-        // Patients // SELECT * FROM client WHERE mcp_pro_id = :me.id;
-        // New Patients Awaiting Visit // SELECT * FROM client WHERE mcp_pro_id = :me.id AND hasMcpDoneOnboardingVisit != 'YES';
-        // Notes Pending Signature // SELECT * FROM note WHERE hcp_pro_id = :me.id AND is_cancelled IS NOT TRUE AND has_hcp_signed IS NOT TRUE;
-        // Notes Pending Billing // SELECT * FROM note WHERE hcp_pro_id = :me.id AND is_cancelled IS NOT TRUE AND has_hcp_signed IS TRUE AND is_billing_marked_done IS FALSE;
-        // Reports Pending Signature // SELECT * FROM incoming_report WHERE hcp_pro_id = :me.id AND isEntryError IS NOT TRUE AND hasHcpProSigned IS NOT TRUE;
-        // Patients w/o Appointments // SELECT * FROM client WHERE mcp_pro_id = :me.id AND client.next_mcp_appointment_date < today();
-        // Patients Overdue for Visit // SELECT * FROM client WHERE mcp_pro_id = :me.id AND client.next_expected_mcp_visit_date < today();
-        // Cancelled Appts. Pending Review // SELECT * FROM appointment WHERE hcp_pro_id = :me.id AND status = 'REJECTED' AND wasAcknowledgedByAppointmentPro IS NOT TRUE;
-        // Cancelled Bills Pending Review // SELECT * FROM bill WHERE bill_service_type = 'NOTE' AND is_cancelled IS TRUE AND isCancellationAcknowledged IS FALSE;
-        // Cancelled Supply Orders Pending Review // SELECT * FROM supply_order WHERE signed_by_pro_id = :me.id AND is_cancelled IS TRUE AND isCancellationAcknowledged IS NOT TRUE;
-        // ERx & Orders Pending Signature // SELECT * FROM erx WHERE hcp_pro_id = :me.id AND pro_declared_status <> 'CANCELLED' AND hasHcpProSigned IS NOT TRUE;
-        // Supply Orders Pending Signature // SELECT supply_order.id FROM supply_order WHERE signed_by_pro_id IS NOT TRUE AND is_cancelled IS NOT TRUE AND created_by_pro_id = :me.id;
-
-        $performer = $this->performer();
-        $pro = $performer->pro;
-        $performerProID = $performer->pro->id;
-
-        $keyNumbers  = [];
-
-        $queryClients = $this->performer()->pro->getAccessibleClientsQuery();
-
-        $pendingNotesToSign = Note
-            ::where(function ($query) use ($performerProID) {
-                $query->where('hcp_pro_id', $performerProID)->where('is_signed_by_hcp', false)->where('is_cancelled', false)->where('is_core_note', false);
-            })
-            ->orWhere(function ($query) use ($performerProID) {
-                $query->where('ally_pro_id', $performerProID)->where('is_signed_by_ally', false)->where('is_cancelled', false)->where('is_core_note', false);
-            })
-            ->count();
-        $keyNumbers['pendingNotesToSign'] = $pendingNotesToSign;
-
-        // notes pending mcp sign (applicable to dnas only)
-        $pendingNotesToSignMCP = Note
-            ::where(function ($query) use ($performerProID) {
-                $query->where('ally_pro_id', $performerProID)->where('is_signed_by_hcp', false)->where('is_cancelled', false)->where('is_core_note', false);
-            })
-            ->count();
-        $keyNumbers['$pendingNotesToSignMCP'] = $pendingNotesToSignMCP;
-
-        $pendingNotesToSignAllySigned = Note::where(function ($query) use ($performerProID) {
-            $query->where('hcp_pro_id', $performerProID)->where('is_signed_by_hcp', false)->where('is_signed_by_ally', true)->where('is_cancelled', false)->where('is_core_note', false);;
-        })->count();
-        $keyNumbers['pendingNotesToSignAllySigned'] = $pendingNotesToSignAllySigned;
-
-
-        $signedNotesWithoutBills = Note::where(function ($query) use ($performerProID) {
-            $query->where('hcp_pro_id', $performerProID)->where('is_signed_by_hcp', true)->where('is_cancelled', false);
-        })->whereDoesntHave('bills')->count();
-
-        $keyNumbers['signedNotesWithoutBills'] = $signedNotesWithoutBills;
-
-        // open tickets
-        $keyNumbers['numOpenTickets'] = Ticket::where('is_open', true)
-            ->where(function ($q) use ($performerProID) {
-                $q->where('assigned_pro_id', $performerProID)
-                    ->orWhere('manager_pro_id', $performerProID)
-                    ->orWhere('ordering_pro_id', $performerProID)
-                    ->orWhere('initiating_pro_id', $performerProID);
-            })
-            ->count();
-
-        // unacknowledged cancelled bills for authed pro
-        $keyNumbers['unacknowledgedCancelledBills'] = Bill::where('hcp_pro_id', $performerProID)
-            ->where('is_cancelled', true)
-            ->where('is_cancellation_acknowledged', false)
-            ->count();
-
-        // unacknowledged cancelled supply orders for authed pro
-        $keyNumbers['unacknowledgedCancelledSupplyOrders'] = SupplyOrder::where('signed_by_pro_id', $performerProID)
-            ->where('is_cancelled', true)
-            ->where('is_cancellation_acknowledged', false)
-            ->count();
-
-        // unsigned supply orders created by authed pro
-        $keyNumbers['unsignedSupplyOrders'] = SupplyOrder
-            ::where('is_cancelled', false)
-            ->where('is_signed_by_pro', false)
-            ->whereRaw('created_by_session_id IN (SELECT id FROM app_session WHERE pro_id = ?)', [$performerProID])
-            ->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"] = '--';
-        $lastPayment = ProTransaction::where('pro_id', $performerProID)->where('plus_or_minus', 'PLUS')->orderBy('created_at', 'DESC')->first();
-        if ($lastPayment) {
-            $reimbursement["lastPayment"] =  $lastPayment->amount;
-            $reimbursement["lastPaymentDate"] = $lastPayment->created_at;
-        } else {
-            $reimbursement["lastPayment"] = '--';
-            $reimbursement["lastPaymentDate"] = '--';
-        }
-
-        //if today is < 15th, next payment is 15th, else nextPayment is
-        $today = strtotime(date('Y-m-d'));
-        $todayDate = date('j', $today);
-
-        $todayMonth =  date('m', $today);
-        $todayYear = date('Y', $today);
-        if ($todayDate < 15) {
-            $nextPaymentDate = new DateTime();
-            $nextPaymentDate->setDate($todayYear, $todayMonth, 15);
-            $reimbursement['nextPaymentDate'] = $nextPaymentDate->format('m/d/Y');
-        } else {
-            $nextPaymentDate = new \DateTime();
-            $lastDayOfMonth = date('t', $today);
-            $nextPaymentDate->setDate($todayYear, $todayMonth, $lastDayOfMonth);
-            $reimbursement['nextPaymentDate'] = $nextPaymentDate->format('m/d/Y');
-        }
-
-        //expectedPay
-        $expectedForHcp = DB::select(DB::raw("SELECT coalesce(SUM(hcp_expected_payment_amount),0) as expected_pay FROM bill WHERE hcp_pro_id = :performerProID  AND has_hcp_been_paid = false AND is_signed_by_hcp IS TRUE AND is_cancelled = false"), ['performerProID' => $performerProID])[0]->expected_pay;
-        $expectedForCm = DB::select(DB::raw("SELECT coalesce(SUM(cm_expected_payment_amount),0) as expected_pay  FROM bill WHERE cm_pro_id = :performerProID  AND has_cm_been_paid = false AND is_signed_by_cm IS TRUE AND is_cancelled = false"), ['performerProID' => $performerProID])[0]->expected_pay;
-        $expectedForRme = DB::select(DB::raw("SELECT coalesce(SUM(rme_expected_payment_amount),0) as expected_pay  FROM bill WHERE rme_pro_id = :performerProID  AND has_rme_been_paid = false AND is_signed_by_rme IS TRUE AND is_cancelled = false"), ['performerProID' => $performerProID])[0]->expected_pay;
-        $expectedForRmm = DB::select(DB::raw("SELECT coalesce(SUM(rmm_expected_payment_amount),0) as expected_pay  FROM bill WHERE rmm_pro_id = :performerProID  AND has_rmm_been_paid = false AND is_signed_by_rmm IS TRUE AND is_cancelled = false"), ['performerProID' => $performerProID])[0]->expected_pay;
-        $expectedForNa = DB::select(DB::raw("SELECT coalesce(SUM(generic_pro_expected_payment_amount),0) as expected_pay  FROM bill WHERE generic_pro_id = :performerProID  AND has_generic_pro_been_paid = false AND is_signed_by_generic_pro IS TRUE AND is_cancelled = false"), ['performerProID' => $performerProID])[0]->expected_pay;
-
-        $totalExpectedAmount =  $expectedForHcp + $expectedForCm + $expectedForRme + $expectedForRmm + $expectedForNa;
-        $reimbursement['nextPaymentAmount'] =  $totalExpectedAmount;
-
-        $milliseconds = strtotime(date('Y-m-d')) . '000';
-
-        // bills & claims
-        $businessNumbers = [];
-
-        // Notes with bills to resolve
-        $businessNumbers['notesWithBillsToResolve'] = Note::where('is_cancelled', '!=', true)
-            ->where('is_bill_closed', '!=', true)
-            ->whereRaw('(SELECT count(id) FROM bill WHERE note_id = note.id AND is_cancelled = false AND is_verified = false) > 0')
-            ->count();
-
-        // Notes pending bill closure
-        $businessNumbers['notesPendingBillingClosure'] = Note::where('is_cancelled', '!=', true)
-            ->where('is_bill_closed', '!=', true)
-            ->whereRaw('(SELECT count(id) FROM bill WHERE note_id = note.id AND (is_cancelled = true OR is_verified = true)) = 0')
-            ->count();
-
-        // incoming reports not signed
-        $incomingReports = IncomingReport::where('hcp_pro_id', $performerProID)
-            ->where('has_hcp_pro_signed', false)
-            ->where('is_entry_error', false)
-            ->orderBy('created_at', 'ASC')
-            ->get();
-        // erx, labs & imaging that are not closed
-        $tickets = Ticket::where('ordering_pro_id', $performerProID)
-            ->where('is_entry_error', false)
-            ->where('is_open', true)
-            ->orderBy('created_at', 'ASC')
-            ->get();
-        $supplyOrders = SupplyOrder::where('is_cleared_for_shipment', false)
-            ->where('is_cancelled', false)
-            ->whereRaw('created_by_session_id IN (SELECT id FROM app_session where pro_id = ?)', [$performer->pro->id])
-            ->orderBy('created_at', 'ASC')
-            ->get();
-
-        $numERx = Ticket::where('ordering_pro_id', $performerProID)
-            ->where('category', 'erx')
-            ->where('is_entry_error', false)
-            ->where('is_open', true)
-            ->count();
-        $numLabs = Ticket::where('ordering_pro_id', $performerProID)
-            ->where('category', 'lab')
-            ->where('is_entry_error', false)
-            ->where('is_open', true)
-            ->count();
-        $numImaging = Ticket::where('ordering_pro_id', $performerProID)
-            ->where('category', 'imaging')
-            ->where('is_entry_error', false)
-            ->where('is_open', true)
-            ->count();
-        $numSupplyOrders = SupplyOrder::where('is_cleared_for_shipment', false)
-            ->where('is_cancelled', false)
-            ->whereRaw('created_by_session_id IN (SELECT id FROM app_session where pro_id = ?)', [$performer->pro->id])
-            ->count();
-
-        $newMCPAssociations = ClientProChange
-            ::where('new_pro_id', $performerProID)
-            ->where('responsibility_type', 'MCP')
-            ->whereNull('current_client_pro_change_decision_id')
-            ->get();
-
-        $newNAAssociations = ClientProChange
-            ::where('new_pro_id', $performerProID)
-            ->where('responsibility_type', 'DEFAULT_NA')
-            ->whereNull('current_client_pro_change_decision_id')
-            ->get();
-
-        // unstamped client memos
-        // for mcp
-        $mcpClientMemos = DB::select(
-            DB::raw("
-SELECT c.uid as client_uid, c.name_first, c.name_last,
-       cm.uid, cm.content, cm.created_at
-FROM client c join client_memo cm on c.id = cm.client_id
-WHERE
-      c.mcp_pro_id = {$performerProID} AND
-      cm.mcp_stamp_id IS NULL
-      AND (is_admin_only IS FALSE OR is_admin_only IS NULL)
-ORDER BY cm.created_at DESC
-OFFSET 0 LIMIT 10
-            ")
-        );
-        $mcpClientMemosCount = DB::select(
-            DB::raw("
-SELECT count(c.uid)
-FROM client c join client_memo cm on c.id = cm.client_id
-WHERE
-      c.mcp_pro_id = {$performerProID} AND
-      cm.mcp_stamp_id IS NULL
-      AND (is_admin_only IS FALSE OR is_admin_only IS NULL)
-            ")
-        );
-        if($mcpClientMemosCount && count($mcpClientMemosCount)) {
-            $mcpClientMemosCount = $mcpClientMemosCount[0]->count;
-        }
-
-        // for na
-        $naClientMemos = DB::select(
-            DB::raw("
-SELECT c.uid as client_uid, c.name_first, c.name_last,
-       cm.uid, cm.content, cm.created_at
-FROM client c join client_memo cm on c.id = cm.client_id
-WHERE
-      c.default_na_pro_id = {$performerProID} AND
-      cm.default_na_stamp_id IS NULL
-ORDER BY cm.created_at DESC
-            ")
-        );
-
-        $keyNumbers['rmBillsToSign'] = Bill
-            ::where('is_cancelled', false)
-            ->where('cm_or_rm', 'RM')
-            ->where(function ($q) use ($performerProID) {
-                $q
-                    ->where(function ($q2) use ($performerProID) {
-                        $q2->where('hcp_pro_id', $performerProID)->where('is_signed_by_hcp', false);
-                    })
-                    ->orWhere(function ($q2) use ($performerProID) {
-                        $q2->where('rme_pro_id', $performerProID)->where('is_signed_by_rme', false);
-                    })
-                    ->orWhere(function ($q2) use ($performerProID) {
-                        $q2->where('rmm_pro_id', $performerProID)->where('is_signed_by_rmm', false);
-                    })
-                    ->orWhere(function ($q2) use ($performerProID) {
-                        $q2->where('generic_pro_id', $performerProID)->where('is_signed_by_generic_pro', false);
-                    });
-            })
-            ->count();
-
-        $count = DB::select(
-            DB::raw(
-                "
-SELECT count(client.id) as cnt FROM client join care_month on care_month.client_id = client.id
-WHERE ((client.mcp_pro_id = {$performer->pro->id}) OR (client.rmm_pro_id = {$performer->pro->id})
-          OR (client.rme_pro_id = {$performer->pro->id}) OR (client.default_na_pro_id = {$performer->pro->id}))
-  AND EXTRACT(MONTH from care_month.start_date) = EXTRACT(MONTH from now())
-  AND EXTRACT(YEAR from care_month.start_date) = EXTRACT(YEAR from now())
-  AND (care_month.number_of_days_with_remote_measurements < 16 OR care_month.number_of_days_with_remote_measurements IS NULL)
-"
-            )
-        );
-        $keyNumbers['rmPatientsWithLT16MD'] = $count[0]->cnt;
-
-        $count = DB::select(
-            DB::raw(
-                "
-SELECT count(client.id) as cnt FROM client join care_month on care_month.client_id = client.id
-WHERE ((client.mcp_pro_id = {$performer->pro->id}) OR (client.rmm_pro_id = {$performer->pro->id})
-          OR (client.rme_pro_id = {$performer->pro->id}) OR (client.default_na_pro_id = {$performer->pro->id}))
-  AND EXTRACT(MONTH from care_month.start_date) = EXTRACT(MONTH from now())
-  AND EXTRACT(YEAR from care_month.start_date) = EXTRACT(YEAR from now())
-  AND (care_month.number_of_days_with_remote_measurements >= 16 AND care_month.number_of_days_with_remote_measurements IS NOT NULL)
-"
-            )
-        );
-        $keyNumbers['rmPatientsWithGTE16MD'] = $count[0]->cnt;
-
-        $count = DB::select(
-            DB::raw(
-                "
-SELECT count(client.id) as cnt FROM client join care_month on care_month.client_id = client.id
-WHERE ((client.mcp_pro_id = {$performer->pro->id}) OR (client.rmm_pro_id = {$performer->pro->id})
-          OR (client.rme_pro_id = {$performer->pro->id}) OR (client.default_na_pro_id = {$performer->pro->id}))
-  AND EXTRACT(MONTH from care_month.start_date) = EXTRACT(MONTH from now())
-  AND EXTRACT(YEAR from care_month.start_date) = EXTRACT(YEAR from now())
-  AND (care_month.has_anyone_interacted_with_client_about_rm_outside_note = TRUE AND care_month.has_anyone_interacted_with_client_about_rm_outside_note IS NOT NULL)
-"
-            )
-        );
-        $keyNumbers['rmPatientsWithWhomCommDone'] = $count[0]->cnt;
-
-        $count = DB::select(
-            DB::raw(
-                "
-SELECT count(client.id) as cnt FROM client join care_month on care_month.client_id = client.id
-WHERE ((client.mcp_pro_id = {$performer->pro->id}) OR (client.rmm_pro_id = {$performer->pro->id})
-          OR (client.rme_pro_id = {$performer->pro->id}) OR (client.default_na_pro_id = {$performer->pro->id}))
-  AND EXTRACT(MONTH from care_month.start_date) = EXTRACT(MONTH from now())
-  AND EXTRACT(YEAR from care_month.start_date) = EXTRACT(YEAR from now())
-  AND (care_month.has_anyone_interacted_with_client_about_rm_outside_note = FALSE OR care_month.has_anyone_interacted_with_client_about_rm_outside_note IS NULL)
-"
-            )
-        );
-        $keyNumbers['rmPatientsWithWhomCommNotDone'] = $count[0]->cnt;
-
-        // num measurements that need stamping
-        $keyNumbers['measurementsToBeStamped'] = $this->performer()->pro->getUnstampedMeasurementsFromCurrentMonth(true, null, null);
-
-        if($performer->pro->pro_type === 'ADMIN') {
-
-            // patients without coverage information
-            $keyNumbers['patientsWithoutCoverageInformation'] = DB::select(DB::raw("
-SELECT count(DISTINCT (cl.id)) as cnt
-FROM client cl
-WHERE cl.shadow_pro_id IS NULL AND cl.latest_client_primary_coverage_id IS NULL -- no coverage record"
-            ))[0]->cnt;
-
-            // patients pending coverage verification
-            $keyNumbers['patientsPendingCoverageVerification'] = DB::select(DB::raw("
-SELECT count(DISTINCT (cl.id)) as cnt
-FROM client cl
-         LEFT JOIN client_primary_coverage cpc ON cl.latest_client_primary_coverage_id = cpc.id
-WHERE cl.shadow_pro_id IS NULL
-    AND (cl.latest_client_primary_coverage_id IS NOT NULL -- coverage exists, but status is null or unknown
-    AND (
-               (cpc.plan_type = 'MEDICARE' AND (cpc.is_partbprimary = 'UNKNOWN' OR cpc.is_partbprimary IS NULL))
-               OR
-               (cpc.plan_type != 'MEDICARE' AND
-                (cpc.manual_determination_category = 'UNKNOWN' OR cpc.manual_determination_category IS NULL))
-           ))"
-            ))[0]->cnt;
-
-        }
-
-        $incomingSmsMessagesPendingReply = DB::select("
-            SELECT cs.* ,c.uid as client_uid, c.name_first as client_name_first, c.name_last as client_name_last FROM client_sms cs LEFT JOIN client c ON c.id = cs.client_id
-            WHERE cs.is_reply_needed = 'YES' AND c.mcp_pro_id = :mcp_pro_id AND incoming_or_outgoing = 'INCOMING'
-            AND (cs.created_at > c.last_sms_sent_to_client_at OR c.last_sms_sent_to_client_at IS NULL)
-            ORDER BY created_at DESC
-        ", ['mcp_pro_id' => $performer->pro->id]);
-
-        $careMonthsWithMeasurementsPendingStamping = CareMonth::select('id')
-            ->where('mcp_pro_id', $this->performer->pro->id)
-            ->where('rm_num_measurements_not_stamped_by_mcp', '>', 0)
-            ->whereNotNull('rm_num_measurements_not_stamped_by_mcp')
-            ->orderBy('created_at', 'DESC')
-            ->get()
-            ->map(function($_x) {
-                return $_x->id;
-            })
-            ->toArray();
-
-        $measurementsPendingStamping = Measurement::whereIn('care_month_id', $careMonthsWithMeasurementsPendingStamping)
-            ->orderBy('created_at', 'DESC')
-            ->whereNotNull('ts')
-            ->whereNotIn('label', ['SBP', 'DBP'])
-            ->where('is_cellular_zero', '<>', true)
-            ->where('is_active', true)
-            ->where('has_been_stamped_by_mcp', false)
-            ->whereNotNull('client_bdt_measurement_id')
-            ->paginate(15);
-
-        return view('app/dashboard-mcp', compact('keyNumbers', 'reimbursement', 'milliseconds',
-            'businessNumbers',
-            'incomingReports', 'tickets', 'supplyOrders',
-            'numERx', 'numLabs', 'numImaging', 'numSupplyOrders',
-            'newMCPAssociations', 'newNAAssociations',
-            'measurementsPendingStamping', 'careMonthsWithMeasurementsPendingStamping',
-            'mcpClientMemos', 'mcpClientMemosCount', 'naClientMemos', 'incomingSmsMessagesPendingReply'));
-    }
-
-    public function dashboard_HCP(Request $request){
-        //TODO provide hcp specific data. Currently is based on MCP context
-        $keyNumbers = [];
-
-        // Patients // SELECT * FROM client WHERE mcp_pro_id = :me.id;
-        // New Patients Awaiting Visit // SELECT * FROM client WHERE mcp_pro_id = :me.id AND hasMcpDoneOnboardingVisit != 'YES';
-        // Notes Pending Signature // SELECT * FROM note WHERE hcp_pro_id = :me.id AND is_cancelled IS NOT TRUE AND has_hcp_signed IS NOT TRUE;
-        // Notes Pending Billing // SELECT * FROM note WHERE hcp_pro_id = :me.id AND is_cancelled IS NOT TRUE AND has_hcp_signed IS TRUE AND is_billing_marked_done IS FALSE;
-        // Reports Pending Signature // SELECT * FROM incoming_report WHERE hcp_pro_id = :me.id AND isEntryError IS NOT TRUE AND hasHcpProSigned IS NOT TRUE;
-        // Patients w/o Appointments // SELECT * FROM client WHERE mcp_pro_id = :me.id AND client.next_mcp_appointment_date < today();
-        // Patients Overdue for Visit // SELECT * FROM client WHERE mcp_pro_id = :me.id AND client.next_expected_mcp_visit_date < today();
-        // Cancelled Appts. Pending Review // SELECT * FROM appointment WHERE hcp_pro_id = :me.id AND status = 'REJECTED' AND wasAcknowledgedByAppointmentPro IS NOT TRUE;
-        // Cancelled Bills Pending Review // SELECT * FROM bill WHERE bill_service_type = 'NOTE' AND is_cancelled IS TRUE AND isCancellationAcknowledged IS FALSE;
-        // Cancelled Supply Orders Pending Review // SELECT * FROM supply_order WHERE signed_by_pro_id = :me.id AND is_cancelled IS TRUE AND isCancellationAcknowledged IS NOT TRUE;
-        // ERx & Orders Pending Signature // SELECT * FROM erx WHERE hcp_pro_id = :me.id AND pro_declared_status <> 'CANCELLED' AND hasHcpProSigned IS NOT TRUE;
-        // Supply Orders Pending Signature // SELECT supply_order.id FROM supply_order WHERE signed_by_pro_id IS NOT TRUE AND is_cancelled IS NOT TRUE AND created_by_pro_id = :me.id;
-
-        $performer = $this->performer();
-        $pro = $performer->pro;
-        $performerProID = $performer->pro->id;
-
-        $keyNumbers  = [];
-
-        $queryClients = $this->performer()->pro->getAccessibleClientsQuery();
-
-        $pendingNotesToSign = Note
-            ::where(function ($query) use ($performerProID) {
-                $query->where('hcp_pro_id', $performerProID)->where('is_signed_by_hcp', false)->where('is_cancelled', false)->where('is_core_note', false);
-            })
-            ->orWhere(function ($query) use ($performerProID) {
-                $query->where('ally_pro_id', $performerProID)->where('is_signed_by_ally', false)->where('is_cancelled', false)->where('is_core_note', false);
-            })
-            ->count();
-        $keyNumbers['pendingNotesToSign'] = $pendingNotesToSign;
-
-        // notes pending mcp sign (applicable to dnas only)
-        $pendingNotesToSignMCP = Note
-            ::where(function ($query) use ($performerProID) {
-                $query->where('ally_pro_id', $performerProID)->where('is_signed_by_hcp', false)->where('is_cancelled', false)->where('is_core_note', false);
-            })
-            ->count();
-        $keyNumbers['$pendingNotesToSignMCP'] = $pendingNotesToSignMCP;
-
-        $pendingNotesToSignAllySigned = Note::where(function ($query) use ($performerProID) {
-            $query->where('hcp_pro_id', $performerProID)->where('is_signed_by_hcp', false)->where('is_signed_by_ally', true)->where('is_cancelled', false)->where('is_core_note', false);;
-        })->count();
-        $keyNumbers['pendingNotesToSignAllySigned'] = $pendingNotesToSignAllySigned;
-
-
-        $signedNotesWithoutBills = Note::where(function ($query) use ($performerProID) {
-            $query->where('hcp_pro_id', $performerProID)->where('is_signed_by_hcp', true)->where('is_cancelled', false);
-        })->whereDoesntHave('bills')->count();
-
-        $keyNumbers['signedNotesWithoutBills'] = $signedNotesWithoutBills;
-
-        // open tickets
-        $keyNumbers['numOpenTickets'] = Ticket::where('is_open', true)
-            ->where(function ($q) use ($performerProID) {
-                $q->where('assigned_pro_id', $performerProID)
-                    ->orWhere('manager_pro_id', $performerProID)
-                    ->orWhere('ordering_pro_id', $performerProID)
-                    ->orWhere('initiating_pro_id', $performerProID);
-            })
-            ->count();
-
-        // unacknowledged cancelled bills for authed pro
-        $keyNumbers['unacknowledgedCancelledBills'] = Bill::where('hcp_pro_id', $performerProID)
-            ->where('is_cancelled', true)
-            ->where('is_cancellation_acknowledged', false)
-            ->count();
-
-        // unacknowledged cancelled supply orders for authed pro
-        $keyNumbers['unacknowledgedCancelledSupplyOrders'] = SupplyOrder::where('signed_by_pro_id', $performerProID)
-            ->where('is_cancelled', true)
-            ->where('is_cancellation_acknowledged', false)
-            ->count();
-
-        // unsigned supply orders created by authed pro
-        $keyNumbers['unsignedSupplyOrders'] = SupplyOrder
-            ::where('is_cancelled', false)
-            ->where('is_signed_by_pro', false)
-            ->whereRaw('created_by_session_id IN (SELECT id FROM app_session WHERE pro_id = ?)', [$performerProID])
-            ->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"] = '--';
-        $lastPayment = ProTransaction::where('pro_id', $performerProID)->where('plus_or_minus', 'PLUS')->orderBy('created_at', 'DESC')->first();
-        if ($lastPayment) {
-            $reimbursement["lastPayment"] =  $lastPayment->amount;
-            $reimbursement["lastPaymentDate"] = $lastPayment->created_at;
-        } else {
-            $reimbursement["lastPayment"] = '--';
-            $reimbursement["lastPaymentDate"] = '--';
-        }
-
-        //if today is < 15th, next payment is 15th, else nextPayment is
-        $today = strtotime(date('Y-m-d'));
-        $todayDate = date('j', $today);
-
-        $todayMonth =  date('m', $today);
-        $todayYear = date('Y', $today);
-        if ($todayDate < 15) {
-            $nextPaymentDate = new DateTime();
-            $nextPaymentDate->setDate($todayYear, $todayMonth, 15);
-            $reimbursement['nextPaymentDate'] = $nextPaymentDate->format('m/d/Y');
-        } else {
-            $nextPaymentDate = new \DateTime();
-            $lastDayOfMonth = date('t', $today);
-            $nextPaymentDate->setDate($todayYear, $todayMonth, $lastDayOfMonth);
-            $reimbursement['nextPaymentDate'] = $nextPaymentDate->format('m/d/Y');
-        }
-
-        //expectedPay
-        $expectedForHcp = DB::select(DB::raw("SELECT coalesce(SUM(hcp_expected_payment_amount),0) as expected_pay FROM bill WHERE hcp_pro_id = :performerProID  AND has_hcp_been_paid = false AND is_signed_by_hcp IS TRUE AND is_cancelled = false"), ['performerProID' => $performerProID])[0]->expected_pay;
-        $expectedForCm = DB::select(DB::raw("SELECT coalesce(SUM(cm_expected_payment_amount),0) as expected_pay  FROM bill WHERE cm_pro_id = :performerProID  AND has_cm_been_paid = false AND is_signed_by_cm IS TRUE AND is_cancelled = false"), ['performerProID' => $performerProID])[0]->expected_pay;
-        $expectedForRme = DB::select(DB::raw("SELECT coalesce(SUM(rme_expected_payment_amount),0) as expected_pay  FROM bill WHERE rme_pro_id = :performerProID  AND has_rme_been_paid = false AND is_signed_by_rme IS TRUE AND is_cancelled = false"), ['performerProID' => $performerProID])[0]->expected_pay;
-        $expectedForRmm = DB::select(DB::raw("SELECT coalesce(SUM(rmm_expected_payment_amount),0) as expected_pay  FROM bill WHERE rmm_pro_id = :performerProID  AND has_rmm_been_paid = false AND is_signed_by_rmm IS TRUE AND is_cancelled = false"), ['performerProID' => $performerProID])[0]->expected_pay;
-        $expectedForNa = DB::select(DB::raw("SELECT coalesce(SUM(generic_pro_expected_payment_amount),0) as expected_pay  FROM bill WHERE generic_pro_id = :performerProID  AND has_generic_pro_been_paid = false AND is_signed_by_generic_pro IS TRUE AND is_cancelled = false"), ['performerProID' => $performerProID])[0]->expected_pay;
-
-        $totalExpectedAmount =  $expectedForHcp + $expectedForCm + $expectedForRme + $expectedForRmm + $expectedForNa;
-        $reimbursement['nextPaymentAmount'] =  $totalExpectedAmount;
-
-        $milliseconds = strtotime(date('Y-m-d')) . '000';
-
-        // bills & claims
-        $businessNumbers = [];
-
-        // Notes with bills to resolve
-        $businessNumbers['notesWithBillsToResolve'] = Note::where('is_cancelled', '!=', true)
-            ->where('is_bill_closed', '!=', true)
-            ->whereRaw('(SELECT count(id) FROM bill WHERE note_id = note.id AND is_cancelled = false AND is_verified = false) > 0')
-            ->count();
-
-        // Notes pending bill closure
-        $businessNumbers['notesPendingBillingClosure'] = Note::where('is_cancelled', '!=', true)
-            ->where('is_bill_closed', '!=', true)
-            ->whereRaw('(SELECT count(id) FROM bill WHERE note_id = note.id AND (is_cancelled = true OR is_verified = true)) = 0')
-            ->count();
-
-        // incoming reports not signed
-        $incomingReports = IncomingReport::where('hcp_pro_id', $performerProID)
-            ->where('has_hcp_pro_signed', false)
-            ->where('is_entry_error', false)
-            ->orderBy('created_at', 'ASC')
-            ->get();
-        // erx, labs & imaging that are not closed
-        $tickets = Ticket::where('ordering_pro_id', $performerProID)
-            ->where('is_entry_error', false)
-            ->where('is_open', true)
-            ->orderBy('created_at', 'ASC')
-            ->get();
-        $supplyOrders = SupplyOrder::where('is_cleared_for_shipment', false)
-            ->where('is_cancelled', false)
-            ->whereRaw('created_by_session_id IN (SELECT id FROM app_session where pro_id = ?)', [$performer->pro->id])
-            ->orderBy('created_at', 'ASC')
-            ->get();
-
-        $numERx = Ticket::where('ordering_pro_id', $performerProID)
-            ->where('category', 'erx')
-            ->where('is_entry_error', false)
-            ->where('is_open', true)
-            ->count();
-        $numLabs = Ticket::where('ordering_pro_id', $performerProID)
-            ->where('category', 'lab')
-            ->where('is_entry_error', false)
-            ->where('is_open', true)
-            ->count();
-        $numImaging = Ticket::where('ordering_pro_id', $performerProID)
-            ->where('category', 'imaging')
-            ->where('is_entry_error', false)
-            ->where('is_open', true)
-            ->count();
-        $numSupplyOrders = SupplyOrder::where('is_cleared_for_shipment', false)
-            ->where('is_cancelled', false)
-            ->whereRaw('created_by_session_id IN (SELECT id FROM app_session where pro_id = ?)', [$performer->pro->id])
-            ->count();
-
-        $newMCPAssociations = ClientProChange
-            ::where('new_pro_id', $performerProID)
-            ->where('responsibility_type', 'MCP')
-            ->whereNull('current_client_pro_change_decision_id')
-            ->get();
-
-        $newNAAssociations = ClientProChange
-            ::where('new_pro_id', $performerProID)
-            ->where('responsibility_type', 'DEFAULT_NA')
-            ->whereNull('current_client_pro_change_decision_id')
-            ->get();
-
-        // unstamped client memos
-        // for mcp
-        $mcpClientMemos = DB::select(
-            DB::raw("
-SELECT c.uid as client_uid, c.name_first, c.name_last,
-       cm.uid, cm.content, cm.created_at
-FROM client c join client_memo cm on c.id = cm.client_id
-WHERE
-      c.mcp_pro_id = {$performerProID} AND
-      cm.mcp_stamp_id IS NULL
-      AND (is_admin_only IS FALSE OR is_admin_only IS NULL)
-ORDER BY cm.created_at DESC
-OFFSET 0 LIMIT 10
-            ")
-        );
-        $mcpClientMemosCount = DB::select(
-            DB::raw("
-SELECT count(c.uid)
-FROM client c join client_memo cm on c.id = cm.client_id
-WHERE
-      c.mcp_pro_id = {$performerProID} AND
-      cm.mcp_stamp_id IS NULL
-      AND (is_admin_only IS FALSE OR is_admin_only IS NULL)
-            ")
-        );
-        if($mcpClientMemosCount && count($mcpClientMemosCount)) {
-            $mcpClientMemosCount = $mcpClientMemosCount[0]->count;
-        }
-
-        // for na
-        $naClientMemos = DB::select(
-            DB::raw("
-SELECT c.uid as client_uid, c.name_first, c.name_last,
-       cm.uid, cm.content, cm.created_at
-FROM client c join client_memo cm on c.id = cm.client_id
-WHERE
-      c.default_na_pro_id = {$performerProID} AND
-      cm.default_na_stamp_id IS NULL
-ORDER BY cm.created_at DESC
-            ")
-        );
-
-        $keyNumbers['rmBillsToSign'] = Bill
-            ::where('is_cancelled', false)
-            ->where('cm_or_rm', 'RM')
-            ->where(function ($q) use ($performerProID) {
-                $q
-                    ->where(function ($q2) use ($performerProID) {
-                        $q2->where('hcp_pro_id', $performerProID)->where('is_signed_by_hcp', false);
-                    })
-                    ->orWhere(function ($q2) use ($performerProID) {
-                        $q2->where('rme_pro_id', $performerProID)->where('is_signed_by_rme', false);
-                    })
-                    ->orWhere(function ($q2) use ($performerProID) {
-                        $q2->where('rmm_pro_id', $performerProID)->where('is_signed_by_rmm', false);
-                    })
-                    ->orWhere(function ($q2) use ($performerProID) {
-                        $q2->where('generic_pro_id', $performerProID)->where('is_signed_by_generic_pro', false);
-                    });
-            })
-            ->count();
-
-        $count = DB::select(
-            DB::raw(
-                "
-SELECT count(client.id) as cnt FROM client join care_month on care_month.client_id = client.id
-WHERE ((client.mcp_pro_id = {$performer->pro->id}) OR (client.rmm_pro_id = {$performer->pro->id})
-          OR (client.rme_pro_id = {$performer->pro->id}) OR (client.default_na_pro_id = {$performer->pro->id}))
-  AND EXTRACT(MONTH from care_month.start_date) = EXTRACT(MONTH from now())
-  AND EXTRACT(YEAR from care_month.start_date) = EXTRACT(YEAR from now())
-  AND (care_month.number_of_days_with_remote_measurements < 16 OR care_month.number_of_days_with_remote_measurements IS NULL)
-"
-            )
-        );
-        $keyNumbers['rmPatientsWithLT16MD'] = $count[0]->cnt;
-
-        $count = DB::select(
-            DB::raw(
-                "
-SELECT count(client.id) as cnt FROM client join care_month on care_month.client_id = client.id
-WHERE ((client.mcp_pro_id = {$performer->pro->id}) OR (client.rmm_pro_id = {$performer->pro->id})
-          OR (client.rme_pro_id = {$performer->pro->id}) OR (client.default_na_pro_id = {$performer->pro->id}))
-  AND EXTRACT(MONTH from care_month.start_date) = EXTRACT(MONTH from now())
-  AND EXTRACT(YEAR from care_month.start_date) = EXTRACT(YEAR from now())
-  AND (care_month.number_of_days_with_remote_measurements >= 16 AND care_month.number_of_days_with_remote_measurements IS NOT NULL)
-"
-            )
-        );
-        $keyNumbers['rmPatientsWithGTE16MD'] = $count[0]->cnt;
-
-        $count = DB::select(
-            DB::raw(
-                "
-SELECT count(client.id) as cnt FROM client join care_month on care_month.client_id = client.id
-WHERE ((client.mcp_pro_id = {$performer->pro->id}) OR (client.rmm_pro_id = {$performer->pro->id})
-          OR (client.rme_pro_id = {$performer->pro->id}) OR (client.default_na_pro_id = {$performer->pro->id}))
-  AND EXTRACT(MONTH from care_month.start_date) = EXTRACT(MONTH from now())
-  AND EXTRACT(YEAR from care_month.start_date) = EXTRACT(YEAR from now())
-  AND (care_month.has_anyone_interacted_with_client_about_rm_outside_note = TRUE AND care_month.has_anyone_interacted_with_client_about_rm_outside_note IS NOT NULL)
-"
-            )
-        );
-        $keyNumbers['rmPatientsWithWhomCommDone'] = $count[0]->cnt;
-
-        $count = DB::select(
-            DB::raw(
-                "
-SELECT count(client.id) as cnt FROM client join care_month on care_month.client_id = client.id
-WHERE ((client.mcp_pro_id = {$performer->pro->id}) OR (client.rmm_pro_id = {$performer->pro->id})
-          OR (client.rme_pro_id = {$performer->pro->id}) OR (client.default_na_pro_id = {$performer->pro->id}))
-  AND EXTRACT(MONTH from care_month.start_date) = EXTRACT(MONTH from now())
-  AND EXTRACT(YEAR from care_month.start_date) = EXTRACT(YEAR from now())
-  AND (care_month.has_anyone_interacted_with_client_about_rm_outside_note = FALSE OR care_month.has_anyone_interacted_with_client_about_rm_outside_note IS NULL)
-"
-            )
-        );
-        $keyNumbers['rmPatientsWithWhomCommNotDone'] = $count[0]->cnt;
-
-        // num measurements that need stamping
-        $keyNumbers['measurementsToBeStamped'] = $this->performer()->pro->getUnstampedMeasurementsFromCurrentMonth(true, null, null);
-
-        if($performer->pro->pro_type === 'ADMIN') {
-
-            // patients without coverage information
-            $keyNumbers['patientsWithoutCoverageInformation'] = DB::select(DB::raw("
-SELECT count(DISTINCT (cl.id)) as cnt
-FROM client cl
-WHERE cl.shadow_pro_id IS NULL AND cl.latest_client_primary_coverage_id IS NULL -- no coverage record"
-            ))[0]->cnt;
-
-            // patients pending coverage verification
-            $keyNumbers['patientsPendingCoverageVerification'] = DB::select(DB::raw("
-SELECT count(DISTINCT (cl.id)) as cnt
-FROM client cl
-         LEFT JOIN client_primary_coverage cpc ON cl.latest_client_primary_coverage_id = cpc.id
-WHERE cl.shadow_pro_id IS NULL
-    AND (cl.latest_client_primary_coverage_id IS NOT NULL -- coverage exists, but status is null or unknown
-    AND (
-               (cpc.plan_type = 'MEDICARE' AND (cpc.is_partbprimary = 'UNKNOWN' OR cpc.is_partbprimary IS NULL))
-               OR
-               (cpc.plan_type != 'MEDICARE' AND
-                (cpc.manual_determination_category = 'UNKNOWN' OR cpc.manual_determination_category IS NULL))
-           ))"
-            ))[0]->cnt;
-
-        }
-
-        $incomingSmsMessagesPendingReply = DB::select("
-            SELECT cs.* ,c.uid as client_uid, c.name_first as client_name_first, c.name_last as client_name_last FROM client_sms cs LEFT JOIN client c ON c.id = cs.client_id
-            WHERE cs.is_reply_needed = 'YES' AND c.mcp_pro_id = :mcp_pro_id AND incoming_or_outgoing = 'INCOMING'
-            AND (cs.created_at > c.last_sms_sent_to_client_at OR c.last_sms_sent_to_client_at IS NULL)
-            ORDER BY created_at DESC
-        ", ['mcp_pro_id' => $performer->pro->id]);
-
-        $careMonthsWithMeasurementsPendingStamping = CareMonth::select('id')
-            ->where('mcp_pro_id', $this->performer->pro->id)
-            ->where('rm_num_measurements_not_stamped_by_mcp', '>', 0)
-            ->whereNotNull('rm_num_measurements_not_stamped_by_mcp')
-            ->orderBy('created_at', 'DESC')
-            ->get()
-            ->map(function($_x) {
-                return $_x->id;
-            })
-            ->toArray();
-
-        $measurementsPendingStamping = Measurement::whereIn('care_month_id', $careMonthsWithMeasurementsPendingStamping)
-            ->orderBy('created_at', 'DESC')
-            ->whereNotNull('ts')
-            ->whereNotIn('label', ['SBP', 'DBP'])
-            ->where('is_cellular_zero', '<>', true)
-            ->where('is_active', true)
-            ->where('has_been_stamped_by_mcp', false)
-            ->whereNotNull('client_bdt_measurement_id')
-            ->paginate(15);
-
-        return view('app/dashboard-hcp', compact('keyNumbers', 'reimbursement', 'milliseconds',
-            'businessNumbers',
-            'incomingReports', 'tickets', 'supplyOrders',
-            'numERx', 'numLabs', 'numImaging', 'numSupplyOrders',
-            'newMCPAssociations', 'newNAAssociations',
-            'measurementsPendingStamping', 'careMonthsWithMeasurementsPendingStamping',
-            'mcpClientMemos', 'mcpClientMemosCount', 'naClientMemos', 'incomingSmsMessagesPendingReply'));
-    }
-
-    public function dashboard_DNA(Request $request){
-        $performer = $this->performer();
-        $pro = $performer->pro;
-        $performerProID = $performer->pro->id;
-
-        $milliseconds = strtotime(date('Y-m-d')) . '000'; //required by the calendar
-        return view('app/dashboard-dna', compact( 'milliseconds'));
-    }
-
     public function dashboard_ADMIN(Request $request){
         $keyNumbers = [];
 
@@ -1341,15 +569,8 @@ WHERE cl.shadow_pro_id IS NULL
         $performer = $this->performer();
         $pro = $performer->pro;
        
-        if($pro->pro_type === 'ADMIN'){
-            return $this->dashboard_ADMIN($request);
-        }elseif($pro->is_enrolled_as_mcp && $pro->is_considered_for_mcp_assignment) {
-            return $this->dashboard_MCP($request);
-        }elseif($pro->is_hcp){
-            return $this->dashboard_HCP($request); //TODO for HCP
-        }else{
-            return $this->dashboard_DNA($request);
-        }
+        return $this->dashboard_ADMIN($request);
+       
     }
 
 

+ 10 - 111
resources/views/layouts/template.blade.php

@@ -97,123 +97,22 @@
 
         <div class="collapse navbar-collapse" id="navBar">
             <ul class="navbar-nav mr-auto">
-                @if($pro->pro_type == 'ADMIN')
-                    <li class="nav-item"><a class="nav-link" href="{{ route('admin.dashboard') }}"><i class="mr-1 fas fa-home"></i> Home</a> </li>
-                    <li class="nav-item"><a class="nav-link" href="{{ route('admin.patients') }}"><i class="mr-1 fas fa-user"></i> Patients</a> </li>
-                @elseif($pro->is_enrolled_as_mcp && $pro->is_considered_for_mcp_assignment)
-                    <li class="nav-item"><a class="nav-link" href="{{ route('mcp.dashboard') }}"><i class="mr-1 fas fa-home"></i> Home</a> </li>
-                    <li class="nav-item"><a class="nav-link" href="{{ route('mcp.patients') }}"><i class="mr-1 fas fa-user"></i> Patients</a> </li>
-
-                    <li class="nav-item"><a class="nav-link" href="{{ route('mcp.appointments') }}">
-                            <i class="mr-1 fas fa-calendar-alt"></i> Appointments
-                        </a>
-                    </li>
-                @else
-                    <li class="nav-item"><a class="nav-link" href="{{ route('dna.dashboard') }}"><i class="mr-1 fas fa-home"></i> Home</a> </li>
-                    <li class="nav-item"><a class="nav-link" href="{{ route('dna.patients') }}"><i class="mr-1 fas fa-user"></i> Patients</a> </li>
-                @endif
-
-
-                @if($pro && ($pro->can_add_patients || $pro->pro_type== 'ADMIN'))
-                  <li class="nav-item"><a class="nav-link" href="{{ route('new-patient') }}"><i class="mr-1 fas fa-user-plus"></i> New Patient</a> </li>
-                @endif
+                <li class="nav-item"><a class="nav-link" href="{{ route('admin.dashboard') }}"><i class="mr-1 fas fa-home"></i> Home</a> </li>
+                <li class="nav-item"><a class="nav-link" href="{{ route('admin.patients') }}"><i class="mr-1 fas fa-user"></i> Patients</a> </li>
 
                 <li class="nav-item dropdown">
                     <a class="nav-link dropdown-toggle" href="#" id="practice-management" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                         <i class="mr-1 fas fa-tasks"></i> Practice
                     </a>
                     <div class="dropdown-menu mcp-theme-1 no-overflow-menu p-0" aria-labelledby="practice-management">
-                        @if($pro->pro_type !== 'ADMIN')
-                            <a class="dropdown-item" href="{{ route('practice-management.remote-monitoring') }}">Remote Monitoring</a>
-                        @else
-                            <a class="dropdown-item" href="{{ route('practice-management.remote-monitoring-admin') }}">Remote Monitoring (admin)</a>
-                        @endif
-                        @if($pro->pro_type == 'ADMIN')
-                            <a class="dropdown-item" href="{{ route('practice-management.rpmMatrix') }}">RPM Matrix</a>
-                            {{--<a class="dropdown-item" href="{{ route('practice-management.previousBills') }}">Previous Bills</a>--}}
-                            <a class="dropdown-item" href="{{ route('practice-management.financialTransactions') }}">Financial Transactions</a>
-                            <a class="dropdown-item" href="/practice-management/bills/not-yet-signed">Pending Bills to Sign</a>
-                            <a class="dropdown-item" href="/practice-management/notes/not-yet-signed">Pending Notes to Sign</a>
-                            <a class="dropdown-item" href="/practice-management/notes/not-yet-signed-but-ally-signed">Pending Notes to Sign (Ally Signed)</a>
-                            <a class="dropdown-item" href="{{ route('pro-care-month-report') }}">Care Month Report</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.rm-bills-to-sign') }}">RM Bills to Sign</a>
-                            <a class="dropdown-item" href="{{ route('unmapped-sms') }}">Unmapped SMS</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.myTickets') }}">My Tickets</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.myTextShortcuts') }}">My Text Shortcuts</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.myFavorites') }}">My Favorites</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.proAvailability') }}">Pro Availability</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.proCalendar') }}">Pro Calendar</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.remoteMonitoringReport') }}">Remote Monitoring Report</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.rm-launch-and-clean') }}">RM: Launch &amp; Clean</a>
-
-                            <a class="dropdown-item" href="{{ route('practice-management.billingManager') }}">Billing Manager</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.billing-report') }}">Billing Report</a>
-
-                            <a class="dropdown-item" href="{{ route('practice-management.processingBillMatrix') }}">Processing Bills</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.pro-financials') }}">Pro Financials</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.cellularMeasurements') }}">Cellular Measurements</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.cellularDeviceManager') }}">Cellular Device Manager</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.medicarePartBClaims') }}">Medicare Part B Claims</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.patientClaimSummary') }}">Patient Claim Summary</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.claims') }}">Claim Matrix</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.process-claims') }}">Process Claims</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.process-notes') }}">Process Notes</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.notes-processing-center') }}">Notes Processing Center</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.client-ccm-rm-status') }}">Client CCM/RM Status</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.rmActionReport') }}">RM Action Report</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.hcp-note-activity') }}">HCP Note Activity</a>
-                            
-                            @if($pro->id == '1' || $pro->id == '16')
-                                <a class="dropdown-item" href="{{ route('practice-management.treatmentServiceUtil') }}">Treatment Service Util.</a>
-                            @endif
-                            <a class="dropdown-item" href="{{ route('practice-management.tickets') }}">Tickets</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.supply-orders') }}">Supply Orders</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.shipments') }}">Shipments</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.packs-multi-print') }}">Print Pack Labels</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.handouts') }}">Handouts</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.generic-bills') }}">Admin. Bills</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.mc-code-checks') }}">MC Code Checks</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.clauses.list') }}">Clauses</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.statTrees.list') }}">Stat Trees</a>
-
-                            <a class="dropdown-item" href="/practice-management/rates/all">Payment Rates</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.patientsAccountsInvites') }}">Patients Accounts Invites</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.clientsBdtDevices') }}">Clients BDT Devices</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.memos') }}">Memos</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.segmentTemplates') }}">Segment Templates</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.visitTemplates') }}">Visit Templates</a>
-                        @elseif($pro->is_enrolled_as_mcp && $pro->is_considered_for_mcp_assignment)
-
-                            <a class="dropdown-item" href="{{ route('practice-management.financialTransactions') }}">Financial Transactions</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.myTextShortcuts') }}">Text Shortcuts</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.myFavorites') }}">Favorites</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.proAvailability') }}">Availability</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.proCalendar') }}">Calendar</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.remoteMonitoringReport') }}">Remote Monitoring Report</a>
-
-                            <a class="dropdown-item" href="{{ route('practice-management.rpmMatrix') }}">RPM Matrix</a>
-
-                            <a class="dropdown-item" href="{{ route('mcp.notes') }}">Notes</a>
-                            <a class="dropdown-item" href="{{ route('mcp.memos') }}">Memos</a>
-                            <a class="dropdown-item" href="{{ route('mcp.appointments') }}">Appointments</a>
-                            <a class="dropdown-item" href="{{ route('mcp.bills') }}">Bills</a>
-                            <a class="dropdown-item" href="{{ route('mcp.erx_and_orders') }}">ERx & Orders</a>
-                            <a class="dropdown-item" href="{{ route('mcp.reports') }}">Reports</a>
-                            <a class="dropdown-item" href="{{ route('mcp.supply_orders') }}">Supply Orders</a>
-                            <a class="dropdown-item" href="{{ route('mcp.client_messages') }}">Messages</a>
-                            <a class="dropdown-item" href="{{ route('mcp.patients_accounts_invites') }}">Patients Accounts Invites</a>
-                            <a class="dropdown-item" href="{{ route('mcp.clients_bdt_devices') }}">Clients BDT Devices</a>
-                        @elseif($pro && $pro->isDefaultNA())
-
-                            <a class="dropdown-item" href="/practice-management/my-teams">My Teams</a>
-                            <a class="dropdown-item" href="{{ route('dna.encounters') }}">Encounters</a>
-                            <a class="dropdown-item" href="{{ route('dna.appointments') }}">Appointments</a>
-                            <a class="dropdown-item" href="{{ route('dna.careMonths') }}">Care Months</a>
-                            <a class="dropdown-item" href="{{ route('dna.financialTransactions') }}">Financial Transactions</a>
-                            <a class="dropdown-item" href="{{ route('dna.myBills') }}">My Bills</a>
-                            <a class="dropdown-item" href="{{ route('dna.myClinicalTeams') }}">My Clinical Teams</a>
-                        @endif
-
+                        <a class="dropdown-item" href="{{ route('practice-management.myTickets') }}">My Tickets</a>
+                        <a class="dropdown-item" href="{{ route('practice-management.myTextShortcuts') }}">My Text Shortcuts</a>
+                        <a class="dropdown-item" href="{{ route('practice-management.myFavorites') }}">My Favorites</a>
+                        <a class="dropdown-item" href="{{ route('practice-management.proAvailability') }}">Pro Availability</a>
+                        <a class="dropdown-item" href="{{ route('practice-management.proCalendar') }}">Pro Calendar</a>
+                        <a class="dropdown-item" href="{{ route('practice-management.tickets') }}">Tickets</a>
+                        <a class="dropdown-item" href="{{ route('practice-management.handouts') }}">Handouts</a>      
+                       
                     </div>
                 </li>
             </ul>