Samson Mutunga 1 год назад
Родитель
Сommit
44effb5eaa

+ 54 - 0
app/Http/Controllers/RdController.php

@@ -81,4 +81,58 @@ class RdController extends Controller
         $reviewRequests = ClientReviewRequest::where('pro_id', $pro->id)->where('is_active', true)->orderBy('created_at', 'DESC')->paginate(50);
         return view('app.rd.review-requests.list', compact('reviewRequests', 'hideTitle'));
     }
+
+    public function patientsAwaitingMcpVisit(Request $request){
+        $pro = $this->performer->pro; 
+        $records = $pro->patientsAwaitingMcpVisitRecordsAsRd();
+        return view('app.rd.dashboard.patients_awaiting_mcp_visit', compact('records'));
+    }
+
+    public function patientsWithoutAppointment(Request $request){
+        $pro = $this->performer->pro; 
+        $records = $pro->patientsWithoutAppointmentRecordsAsRd();
+        return view('app.rd.dashboard.patients_without_appointment', compact('records'));
+    }
+
+    public function encountersPendingMyReview(Request $request){
+        $pro = $this->performer->pro; 
+        $records = $pro->encountersPendingMyReviewRecordsAsRd();
+        return view('app.rd.dashboard.encounters_pending_my_review', compact('records'));
+    }
+
+    public function encountersInProgress(Request $request){
+        $pro = $this->performer->pro; 
+        $records = $pro->encountersInProgressRecordsAsRd();
+        return view('app.rd.dashboard.encounters_in_progress', compact('records'));
+    }
+
+    public function appointmentsPendingConfirmation(Request $request){
+        $pro = $this->performer->pro; 
+        $records = $pro->appointmentsPendingConfirmationRecordsAsRd();
+        return view('app.rd.dashboard.appointments_pending_confirmation', compact('records'));
+    }
+
+    public function cancelledAppointmentsPendingAck(Request $request){
+        $pro = $this->performer->pro; 
+        $records = $pro->cancelledAppointmentsPendingAckRecordsAsRd();
+        return view('app.rd.dashboard.cancelled_appointments_pending_ack', compact('records'));
+    }
+
+    public function reportsPendingAck(Request $request){
+        $pro = $this->performer->pro; 
+        $records = $pro->reportsPendingAckRecordsAsRd();
+        return view('app.rd.dashboard.reports_pending_ack', compact('records'));
+    }
+
+    public function supplyOrdersPendingMyAck(Request $request){
+        $pro = $this->performer->pro; 
+        $records = $pro->supplyOrdersPendingMyAckRecordsAsRd();
+        return view('app.rd.dashboard.supply_orders_pending_my_ack', compact('records'));
+    }
+
+    public function supplyOrdersPendingHcpApproval(Request $request){
+        $pro = $this->performer->pro; 
+        $records = $pro->supplyOrdersPendingHcpApprovalRecordsAsRd();
+        return view('app.rd.dashboard.supply_orders_pending_hcp_approval', compact('records'));
+    }
 }

+ 132 - 0
app/Models/Pro.php

@@ -1100,12 +1100,24 @@ WHERE
         return Client::where('default_na_pro_id', $this->id)->where('has_mcp_done_onboarding_visit', '<>', 'YES');
     }
 
+    private function patientsAwaitingMcpVisitQueryAsRd(){
+        // WHERE has_mcp_done_onboarding_visit <> 'YES'
+        return Client::where('rd_pro_id', $this->id)->where('has_mcp_done_onboarding_visit', '<>', 'YES');
+    }
+
     private function patientsWithoutAppointmentQueryAsDna(){
         // WHERE today_mcp_appointment_date IS NULL AND next_mcp_appointment_date IS NULL
         return Client::where('default_na_pro_id', $this->id)
                         ->whereNull('today_mcp_appointment_date')
                         ->whereNull('next_mcp_appointment_date');
     }
+
+    private function patientsWithoutAppointmentQueryAsRd(){
+        // WHERE today_mcp_appointment_date IS NULL AND next_mcp_appointment_date IS NULL
+        return Client::where('rd_pro_id', $this->id)
+                        ->whereNull('today_mcp_appointment_date')
+                        ->whereNull('next_mcp_appointment_date');
+    }
     
     private function encountersPendingMyReviewQueryAsDna(){
         // WHERE ally_pro_id = me.id AND is_cancelled IS NOT TRUE AND is_signed_by_hcp IS TRUE AND is_signed_by_ally IS NOT TRUE;
@@ -1115,6 +1127,14 @@ WHERE
             ->where('is_signed_by_ally','<>', true);
     }
 
+    private function encountersPendingMyReviewQueryAsRd(){
+        // WHERE ally_pro_id = me.id AND is_cancelled IS NOT TRUE AND is_signed_by_hcp IS TRUE AND is_signed_by_ally IS NOT TRUE;
+        return Note::where('ally_pro_id', $this->id)
+            ->where('is_cancelled', '<>', true)
+            ->where('is_signed_by_hcp', true)
+            ->where('is_signed_by_ally','<>', true);
+    }
+
     private function encountersInProgressQueryAsDna(){
         // SELECT * FROM note WHERE ally_pro_id = me.id AND is_cancelled IS NOT TRUE AND is_signed_by_hcp IS NOT TRUE ORDER BY effective_dateest DESC, created_at DESC;
         return Note::where('ally_pro_id', $this->id)
@@ -1122,6 +1142,13 @@ WHERE
                         ->where('is_signed_by_hcp', '<>', true);
     }
 
+    private function encountersInProgressQueryAsRd(){
+        // SELECT * FROM note WHERE ally_pro_id = me.id AND is_cancelled IS NOT TRUE AND is_signed_by_hcp IS NOT TRUE ORDER BY effective_dateest DESC, created_at DESC;
+        return Note::where('ally_pro_id', $this->id)
+                        ->where('is_cancelled', '<>', true)
+                        ->where('is_signed_by_hcp', '<>', true);
+    }
+
     private function appointmentsPendingConfirmationQueryAsDna(){
         // WHERE client_id IN (SELECT id FROM client WHERE default_na_pro_id = :me.id) AND status = 'PENDING'
         $myId = $this->id;
@@ -1129,6 +1156,14 @@ WHERE
             return $clientQuery->where('default_na_pro_id', $myId);
         })->where('status', 'PENDING');
     }
+
+    private function appointmentsPendingConfirmationQueryAsRd(){
+        // WHERE client_id IN (SELECT id FROM client WHERE default_na_pro_id = :me.id) AND status = 'PENDING'
+        $myId = $this->id;
+        return Appointment::whereHas('client', function($clientQuery) use ($myId) {
+            return $clientQuery->where('rd_pro_id', $myId);
+        })->where('status', 'PENDING');
+    }
     
     private function cancelledAppointmentsPendingAckQueryAsDna(){
         // WHERE client_id IN (SELECT id FROM client WHERE default_na_pro_id = :me.id) AND status = 'CANCELLED' AND is_status_acknowledgement_from_default_na_pending IS TRUE;
@@ -1138,6 +1173,15 @@ WHERE
         })->where('status', 'CANCELLED')
             ->where('is_status_acknowledgement_from_default_na_pending', true);
     }
+
+    private function cancelledAppointmentsPendingAckQueryAsRd(){
+        // WHERE client_id IN (SELECT id FROM client WHERE default_na_pro_id = :me.id) AND status = 'CANCELLED' AND is_status_acknowledgement_from_default_na_pending IS TRUE;
+        $myId = $this->id;
+        return Appointment::whereHas('client', function($clientQuery) use ($myId) {
+            return $clientQuery->where('rd_pro_id', $myId);
+        })->where('status', 'CANCELLED')
+            ->where('is_status_acknowledgement_from_default_na_pending', true);
+    }
     
     private function reportsPendingAckQueryAsDna(){
         // WHERE client_id IN (SELECT id FROM client WHERE default_na_pro_id = :me.id) AND has_na_pro_signed IS FALSE AND is_entry_error
@@ -1147,6 +1191,15 @@ WHERE
         })->where('has_na_pro_signed', '<>', true)
             ->where('is_entry_error','<>', true);
     }
+
+    private function reportsPendingAckQueryAsRd(){
+        // WHERE client_id IN (SELECT id FROM client WHERE default_na_pro_id = :me.id) AND has_na_pro_signed IS FALSE AND is_entry_error
+        $myId = $this->id;
+        return IncomingReport::whereHas('client',function($clientQuery) use ($myId) {
+            return $clientQuery->where('rd_pro_id', $myId);
+        })->where('has_na_pro_signed', '<>', true)
+            ->where('is_entry_error','<>', true);
+    }
     
     private function supplyOrdersPendingMyAckQueryAsDna(){
         // WHERE client_id IN (SELECT id FROM client WHERE default_na_pro_id = :me.id) AND has_na_pro_signed IS FALSE AND is_signed_by_pro IS TRUE AND is_cancelled IS NOT TRUE;
@@ -1158,6 +1211,16 @@ WHERE
             ->where('is_cancelled', '<>', true);
     }
 
+    private function supplyOrdersPendingMyAckQueryAsRd(){
+        // WHERE client_id IN (SELECT id FROM client WHERE default_na_pro_id = :me.id) AND has_na_pro_signed IS FALSE AND is_signed_by_pro IS TRUE AND is_cancelled IS NOT TRUE;
+        $myId = $this->id;
+        return SupplyOrder::whereHas('client',function($clientQuery) use ($myId) {
+            return $clientQuery->where('rd_pro_id', $myId);
+        })->where('has_na_pro_signed', '<>', true)
+            ->where('is_signed_by_pro', true)
+            ->where('is_cancelled', '<>', true);
+    }
+
     private function supplyOrdersPendingHcpApprovalQueryAsDna(){
         // WHERE client_id IN (SELECT id FROM client WHERE default_na_pro_id = :me.id) AND has_na_pro_signed IS TRUE AND is_signed_by_pro IS NOT TRUE AND is_cancelled IS NOT TRUE;
         $myId = $this->id;
@@ -1168,6 +1231,16 @@ WHERE
             ->where('is_cancelled', '<>', true);
     }
 
+    private function supplyOrdersPendingHcpApprovalQueryAsRd(){
+        // WHERE client_id IN (SELECT id FROM client WHERE default_na_pro_id = :me.id) AND has_na_pro_signed IS TRUE AND is_signed_by_pro IS NOT TRUE AND is_cancelled IS NOT TRUE;
+        $myId = $this->id;
+        return SupplyOrder::whereHas('client',function($clientQuery) use ($myId) {
+            return $clientQuery->where('rd_pro_id', $myId);
+        })->where('has_na_pro_signed', true)
+            ->where('is_signed_by_pro','<>', true)
+            ->where('is_cancelled', '<>', true);
+    }
+
     //counts
     public function patientsCountAsDna(){
         return $this->patientsQueryAsDna()->count();
@@ -1178,30 +1251,57 @@ WHERE
     public function patientsAwaitingMcpVisitCountAsDna(){
         return $this->patientsAwaitingMcpVisitQueryAsDna()->count();
     }
+    public function patientsAwaitingMcpVisitCountAsrd(){
+        return $this->patientsAwaitingMcpVisitQueryAsRd()->count();
+    }
     public function patientsWithoutAppointmentCountAsDna(){
         return $this->patientsWithoutAppointmentQueryAsDna()->count();
     }
+    public function patientsWithoutAppointmentCountAsRd(){
+        return $this->patientsWithoutAppointmentQueryAsRd()->count();
+    }
     public function encountersPendingMyReviewCountAsDna(){
         return $this->encountersPendingMyReviewQueryAsDna()->count();
     }
+    public function encountersPendingMyReviewCountAsRd(){
+        return $this->encountersPendingMyReviewQueryAsRd()->count();
+    }
     public function encountersInProgressCountAsDna(){
         return $this->encountersInProgressQueryAsDna()->count();
     }
+    public function encountersInProgressCountAsRd(){
+        return $this->encountersInProgressQueryAsRd()->count();
+    }
     public function appointmentsPendingConfirmationCountAsDna(){
         return $this->appointmentsPendingConfirmationQueryAsDna()->count();
     }
+    public function appointmentsPendingConfirmationCountAsRd(){
+        return $this->appointmentsPendingConfirmationQueryAsRd()->count();
+    }
     public function cancelledAppointmentsPendingAckCountAsDna(){
         return $this->cancelledAppointmentsPendingAckQueryAsDna()->count();
     }
+    public function cancelledAppointmentsPendingAckCountAsRd(){
+        return $this->cancelledAppointmentsPendingAckQueryAsRd()->count();
+    }
     public function reportsPendingAckCountAsDna(){
         return $this->reportsPendingAckQueryAsDna()->count();
     }
+    public function reportsPendingAckCountAsRd(){
+        return $this->reportsPendingAckQueryAsRd()->count();
+    }
     public function supplyOrdersPendingMyAckCountAsDna(){
         return $this->supplyOrdersPendingMyAckQueryAsDna()->count();
     }
+    public function supplyOrdersPendingMyAckCountAsRd(){
+        return $this->supplyOrdersPendingMyAckQueryAsRd()->count();
+    }
     public function supplyOrdersPendingHcpApprovalCountAsDna(){
         return $this->supplyOrdersPendingHcpApprovalQueryAsDna()->count();
     }
+    public function supplyOrdersPendingHcpApprovalCountAsRd(){
+        return $this->supplyOrdersPendingHcpApprovalQueryAsRd()->count();
+    }
 
     //records
     private $DNA_RESULTS_PAGE_SIZE = 50;
@@ -1212,33 +1312,65 @@ WHERE
     public function patientsAwaitingMcpVisitRecordsAsDna(){
         return $this->patientsAwaitingMcpVisitQueryAsDna()->paginate($this->DNA_RESULTS_PAGE_SIZE);
     }
+    public function patientsAwaitingMcpVisitRecordsAsRd(){
+        return $this->patientsAwaitingMcpVisitQueryAsRd()->paginate($this->DNA_RESULTS_PAGE_SIZE);
+    }
     public function patientsWithoutAppointmentRecordsAsDna(){
         return $this->patientsWithoutAppointmentQueryAsDna()->paginate($this->DNA_RESULTS_PAGE_SIZE);
     }
+    public function patientsWithoutAppointmentRecordsAsRd(){
+        return $this->patientsWithoutAppointmentQueryAsRd()->paginate($this->DNA_RESULTS_PAGE_SIZE);
+    }
     public function encountersPendingMyReviewRecordsAsDna(){
         return $this->encountersPendingMyReviewQueryAsDna()
                 ->orderBy('effective_dateest', 'desc')
                 ->orderBy('created_at', 'desc')
                 ->paginate($this->DNA_RESULTS_PAGE_SIZE);
     }
+    public function encountersPendingMyReviewRecordsAsRd(){
+        return $this->encountersPendingMyReviewQueryAsRd()
+                ->orderBy('effective_dateest', 'desc')
+                ->orderBy('created_at', 'desc')
+                ->paginate($this->DNA_RESULTS_PAGE_SIZE);
+    }
     public function encountersInProgressRecordsAsDna(){
         return $this->encountersInProgressQueryAsDna()->paginate($this->DNA_RESULTS_PAGE_SIZE);
     }
+
+    public function encountersInProgressRecordsAsRd(){
+        return $this->encountersInProgressQueryAsRd()->paginate($this->DNA_RESULTS_PAGE_SIZE);
+    }
+
     public function appointmentsPendingConfirmationRecordsAsDna(){
         return $this->appointmentsPendingConfirmationQueryAsDna()->paginate($this->DNA_RESULTS_PAGE_SIZE);
     }
+    public function appointmentsPendingConfirmationRecordsAsRd(){
+        return $this->appointmentsPendingConfirmationQueryAsRd()->paginate($this->DNA_RESULTS_PAGE_SIZE);
+    }
     public function cancelledAppointmentsPendingAckRecordsAsDna(){
         return $this->cancelledAppointmentsPendingAckQueryAsDna()->paginate($this->DNA_RESULTS_PAGE_SIZE);
     }
+    public function cancelledAppointmentsPendingAckRecordsAsRd(){
+        return $this->cancelledAppointmentsPendingAckQueryAsRd()->paginate($this->DNA_RESULTS_PAGE_SIZE);
+    }
     public function reportsPendingAckRecordsAsDna(){
         return $this->reportsPendingAckQueryAsDna()->paginate($this->DNA_RESULTS_PAGE_SIZE);
     }
+    public function reportsPendingAckRecordsAsRd(){
+        return $this->reportsPendingAckQueryAsRd()->paginate($this->DNA_RESULTS_PAGE_SIZE);
+    }
     public function supplyOrdersPendingMyAckRecordsAsDna(){
         return $this->supplyOrdersPendingMyAckQueryAsDna()->paginate($this->DNA_RESULTS_PAGE_SIZE);
     }
+    public function supplyOrdersPendingMyAckRecordsAsRd(){
+        return $this->supplyOrdersPendingMyAckQueryAsRd()->paginate($this->DNA_RESULTS_PAGE_SIZE);
+    }
     public function supplyOrdersPendingHcpApprovalRecordsAsDna(){
         return $this->supplyOrdersPendingHcpApprovalQueryAsDna()->paginate($this->DNA_RESULTS_PAGE_SIZE);
     }
+    public function supplyOrdersPendingHcpApprovalRecordsAsRd(){
+        return $this->supplyOrdersPendingHcpApprovalQueryAsRd()->paginate($this->DNA_RESULTS_PAGE_SIZE);
+    }
 
     public function measurementsPendingReviewAsDna(){
         //Measurements Pending Review 

+ 95 - 0
resources/views/app/rd/dashboard.blade.php

@@ -41,6 +41,101 @@
                                                     title="Patients ">Patients </a>
                                             </th>
                                         </tr>
+                                        <tr>
+                                            <th class="px-2 text-center">{{ $pro->patientsAwaitingMcpVisitCountAsRd() }}
+                                            <th>
+                                            <th class="pl-2">
+                                                <a class="font-weight-normal"
+                                                    href="{{ route('rd.patients_awaiting_mcp_visit') }}" native
+                                                    target="_blank" open-in-stag-popup popup-style="tall"
+                                                    title="Patients Awaiting MCP Visit">Patients Awaiting MCP Visit</a>
+                                            </th>
+                                        </tr>
+                                        <tr>
+                                            <th class="px-2 text-center">{{ $pro->patientsWithoutAppointmentCountAsRd() }}
+                                            <th>
+                                            <th class="pl-2">
+                                                <a class="font-weight-normal"
+                                                    href="{{ route('rd.patients_without_appointment') }}" native
+                                                    target="_blank" open-in-stag-popup popup-style="tall"
+                                                    title="Patients w/o Appointment ">Patients w/o Appointment </a>
+                                            </th>
+                                        </tr>
+                                        <tr>
+                                            <th class="px-2 text-center">{{ $pro->encountersPendingMyReviewCountAsRd() }}
+                                            <th>
+                                            <th class="pl-2">
+                                                <a class="font-weight-normal"
+                                                    href="{{ route('rd.encounters_pending_my_review') }}" native
+                                                    target="_blank" open-in-stag-popup popup-style="tall"
+                                                    title="Encounters Pending My Review ">Encounters Pending My Review </a>
+                                            </th>
+                                        </tr>
+                                        <tr>
+                                            <th class="px-2 text-center">{{ $pro->encountersInProgressCountAsRd() }}
+                                            <th>
+                                            <th class="pl-2">
+                                                <a class="font-weight-normal"
+                                                    href="{{ route('rd.encounters_in_progress') }}" native target="_blank"
+                                                    open-in-stag-popup popup-style="tall"
+                                                    title="Encounters In Progress">Encounters In Progress</a>
+                                            </th>
+                                        </tr>
+                                        <tr>
+                                            <th class="px-2 text-center">
+                                                {{ $pro->appointmentsPendingConfirmationCountAsRd() }}
+                                            <th>
+                                            <th class="pl-2">
+                                                <a class="font-weight-normal"
+                                                    href="{{ route('rd.appointments_pending_confirmation') }}" native
+                                                    target="_blank" open-in-stag-popup popup-style="tall"
+                                                    title="Appointments Pending Confirmation">Appointments Pending
+                                                    Confirmation</a>
+                                            </th>
+                                        </tr>
+                                        <tr>
+                                            <th class="px-2 text-center">
+                                                {{ $pro->cancelledAppointmentsPendingAckCountAsRd() }}
+                                            <th>
+                                            <th class="pl-2">
+                                                <a class="font-weight-normal"
+                                                    href="{{ route('rd.cancelled_appointments_pending_ack') }}" native
+                                                    target="_blank" open-in-stag-popup popup-style="tall"
+                                                    title="Cancelled Appointments Pending Ack.">Cancelled Appointments
+                                                    Pending Ack.</a>
+                                            </th>
+                                        </tr>
+                                        <tr>
+                                            <th class="px-2 text-center">{{ $pro->reportsPendingAckCountAsRd() }}
+                                            <th>
+                                            <th class="pl-2">
+                                                <a class="font-weight-normal" href="{{ route('rd.reports_pending_ack') }}"
+                                                    native target="_blank" open-in-stag-popup popup-style="tall"
+                                                    title="Reports Pending Ack.">Reports Pending Ack.</a>
+                                            </th>
+                                        </tr>
+                                        <tr>
+                                            <th class="px-2 text-center">{{ $pro->supplyOrdersPendingMyAckCountAsRd() }}
+                                            <th>
+                                            <th class="pl-2">
+                                                <a class="font-weight-normal"
+                                                    href="{{ route('rd.supply_orders_pending_my_ack') }}" native
+                                                    target="_blank" open-in-stag-popup popup-style="tall"
+                                                    title="Supply Orders Pending My Ack.">Supply Orders Pending My Ack.</a>
+                                            </th>
+                                        </tr>
+                                        <tr>
+                                            <th class="px-2 text-center">
+                                                {{ $pro->supplyOrdersPendingHcpApprovalCountAsRd() }}
+                                            <th>
+                                            <th class="pl-2">
+                                                <a class="font-weight-normal"
+                                                    href="{{ route('rd.supply_orders_pending_hcp_approval') }}" native
+                                                    target="_blank" open-in-stag-popup popup-style="tall"
+                                                    title="Supply Orders Pending HCP Approval">Supply Orders Pending HCP
+                                                    Approval</a>
+                                            </th>
+                                        </tr>
                                         <tr>
                                             <th class="px-2 text-center">{{ $pro->activeClientReviewRequests->count() }}
                                             <th>

+ 118 - 0
resources/views/app/rd/dashboard/appointments_pending_confirmation.blade.php

@@ -0,0 +1,118 @@
+@php
+$appointmentPendingConfirmation = $performer->pro->appointmentsPendingConfirmationRecordsAsRd();
+@endphp
+<div class="p-3">
+    <div class="card">
+        <div class="card-body p-0">
+            @if(@$appointmentPendingConfirmation && count($appointmentPendingConfirmation))
+            <table class="mb-0 table table-sm table-striped appointments">
+                <thead class="bg-light">
+                    <tr>
+                        <th class="border-0">Patient</th>
+                        <th class="border-0">Status</th>
+                        <th class="border-0">Coverage</th>
+                    </tr>
+                </thead>
+                @foreach($appointmentPendingConfirmation as $appointment)
+                <tr class="{{$appointment->bgColor}}">
+                    <td>
+                        <a native target="_blank" href="/patients/view/{{$appointment->clientUid}}" class="font-weight-bold d-block">
+                            {{$appointment->client->name_first }} {{$appointment->client->name_last }}
+                        </a>
+                        <div class="mt-1">
+                            <a native target="_blank" href="/patients/view/{{$appointment->clientUid}}/calendar/{{$appointment->uid}}">
+                                {{ friendly_date_time($appointment->start_time) }} - {{ friendly_date_time($appointment->end_time) }}</a>
+                            <span class="text-secondary">{{ friendly_timezone($appointment->timezone) }}</span>
+                        </div>
+                        @if($appointment->title)
+                        <span class="d-inline-block mt-1 text-secondary text-sm">
+                            {{ $appointment->title }}
+                        </span>
+                        @endif
+                    </td>
+                    <td>
+                        <div class="d-flex flex-column">
+                            <div class="d-flex align-items-baseline flex-nowrap">
+                                @if($appointment->status === 'PENDING')
+                                <div class="text-warning-mellow font-weight-bold text-nowrap">
+                                    <i class="fa fa-exclamation-triangle"></i>
+                                    Pending
+                                </div>
+                                @elseif($appointment->status === 'CONFIRMED')
+                                <div class="text-success font-weight-bold text-nowrap">
+                                    <i class="fa fa-check"></i>
+                                    Confirmed
+                                </div>
+                                @elseif($appointment->status === 'CANCELLED')
+                                <div class="text-danger font-weight-bold text-nowrap">
+                                    <i class="fa fa-stop"></i>
+                                    Cancelled
+                                </div>
+                                @elseif($appointment->status === 'COMPLETED')
+                                <div class="text-success font-weight-bold text-nowrap">
+                                    <i class="far fa-calendar-check"></i>
+                                    Completed
+                                </div>
+                                @endif
+                                <div class="ml-2" moe relative center>
+                                    <a href="#" start show><i class="fa fa-edit"></i></a>
+                                    <form url="/api/appointment/updateStatus" hook="refreshDashboardAppointments" center>
+                                        <input type="hidden" name="uid" value="{{$appointment->uid}}">
+                                        <p class="text-nowrap mb-3 font-weight-bold text-secondary">Change appointment status</p>
+                                        <div class="mb-3 border bg-light p-2">
+                                            <div class="d-flex align-items-baseline mb-1">
+                                                <span class="width-70px">Patient</span>
+                                                <b>{{$appointment->clientName }}</b>
+                                            </div>
+                                            <div class="d-flex align-items-baseline mb-1">
+                                                <span class="width-70px">Pro</span>
+                                                <b>{{$appointment->proName}}</b>
+                                            </div>
+                                            <div class="d-flex align-items-baseline mb-1">
+                                                <span class="width-70px">Date</span>
+                                                <b>{{friendly_date($appointment->raw_date)}}</b>
+                                            </div>
+                                            <div class="d-flex align-items-baseline mb-1">
+                                                <span class="width-70px">Time</span>
+                                                <span>
+                                                    <b>{{ $appointment->friendlyStartTime }}</b> - <b>{{ $appointment->friendlyEndTime }}</b>
+                                                    <span class="text-secondary">{{ friendly_timezone($appointment->timezone) }}</span>
+                                                </span>
+                                            </div>
+                                            <div class="d-flex align-items-baseline ">
+                                                <span class="width-70px">Status</span>
+                                                <b>{{ucwords(strtolower($appointment->status))}}</b>
+                                            </div>
+                                        </div>
+                                        <label for="" class="mb-2">New Status</label>
+                                        <select name="status" class="form-control form-control-sm input-sm bg-light mb-2">
+                                            <option value="PENDING" {{$appointment->status === 'PENDING' ? 'selected' : ''}}>PENDING</option>
+                                            <option value="CONFIRMED" {{$appointment->status === 'CONFIRMED' ? 'selected' : ''}}>CONFIRMED</option>
+                                            <option value="CANCELLED" {{$appointment->status === 'CANCELLED' ? 'selected' : ''}}>CANCELLED</option>
+                                            <option value="COMPLETED" {{$appointment->status === 'COMPLETED' ? 'selected' : ''}}>COMPLETED</option>
+                                        </select>
+                                        <div class="mb-0">
+                                            <button class="btn btn-primary btn-sm" submit>Submit</button>
+                                            <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                                        </div>
+                                    </form>
+                                </div>
+                            </div>
+
+                        </div>
+                    </td>
+                    <td>
+                        @include('app.patient.coverage_column_renderer', ['patient'=>$appointment->client])
+                    </td>
+                </tr>
+                @endforeach
+            </table>
+            @else
+            <div class="bg-light p-3 text-secondary">
+                <span>You have no appointments pending confirmation.</span>
+            </div>
+
+            @endif
+        </div>
+    </div>
+</div>

+ 123 - 0
resources/views/app/rd/dashboard/cancelled_appointments_pending_ack.blade.php

@@ -0,0 +1,123 @@
+@php
+$cancelledApptsPendingAck = $performer->pro->cancelledAppointmentsPendingAckRecordsAsRd();
+@endphp
+<div class="p-3">
+    <div class="card">
+        <div class="card-body p-0">
+            @if(@$cancelledApptsPendingAck && count($cancelledApptsPendingAck))
+            <table class="mb-0 table table-sm table-striped appointments">
+                <thead class="bg-light">
+                    <tr>
+                        <th class="border-0">Patient</th>
+                        <th class="border-0">Status</th>
+                        <th class="border-0">Coverage</th>
+                    </tr>
+                </thead>
+                @foreach($cancelledApptsPendingAck as $appointment)
+                <tr class="{{$appointment->bgColor}}">
+                    <td>
+                        <div class="d-flex align-items-baseline">
+                            <a native target="_blank" href="/patients/view/{{$appointment->client->uid}}" class="font-weight-bold d-block">
+                                {{$appointment->client->name_first }} {{$appointment->client->name_last }}
+                            </a>
+                            @if($appointment->pro)
+                                <span class="mx-2 text-secondary">•</span>
+                                <span class="text-secondary font-weight-normal">{{$appointment->pro->displayName()}}</span>
+                            @endif
+                        </div>
+                        <div class="mt-1">
+                            <a native target="_blank" href="/patients/view/{{$appointment->client->uid}}/calendar/{{$appointment->uid}}">
+                                {{ friendly_date_time($appointment->start_time) }} - {{ friendly_date_time($appointment->end_time) }}</a>
+                        </div>
+                        @if($appointment->title)
+                        <span class="d-inline-block mt-1 text-secondary text-sm">
+                            {{ $appointment->title }}
+                        </span>
+                        @endif
+                    </td>
+                    <td>
+                        <div class="d-flex flex-column">
+                            <div class="d-flex align-items-baseline flex-nowrap">
+                                @if($appointment->status === 'PENDING')
+                                <div class="text-warning-mellow font-weight-bold text-nowrap">
+                                    <i class="fa fa-exclamation-triangle"></i>
+                                    Pending
+                                </div>
+                                @elseif($appointment->status === 'CONFIRMED')
+                                <div class="text-success font-weight-bold text-nowrap">
+                                    <i class="fa fa-check"></i>
+                                    Confirmed
+                                </div>
+                                @elseif($appointment->status === 'CANCELLED')
+                                <div class="text-danger font-weight-bold text-nowrap">
+                                    <i class="fa fa-stop"></i>
+                                    Cancelled
+                                </div>
+                                @elseif($appointment->status === 'COMPLETED')
+                                <div class="text-success font-weight-bold text-nowrap">
+                                    <i class="far fa-calendar-check"></i>
+                                    Completed
+                                </div>
+                                @endif
+                                <div class="ml-2" moe relative center>
+                                    <a href="#" start show><i class="fa fa-edit"></i></a>
+                                    <form url="/api/appointment/updateStatus" hook="refreshDashboardAppointments" center>
+                                        <input type="hidden" name="uid" value="{{$appointment->uid}}">
+                                        <p class="text-nowrap mb-3 font-weight-bold text-secondary">Change appointment status</p>
+                                        <div class="mb-3 border bg-light p-2">
+                                            <div class="d-flex align-items-baseline mb-1">
+                                                <span class="width-70px">Patient</span>
+                                                <b>{{$appointment->clientName }}</b>
+                                            </div>
+                                            <div class="d-flex align-items-baseline mb-1">
+                                                <span class="width-70px">Pro</span>
+                                                <b>{{$appointment->proName}}</b>
+                                            </div>
+                                            <div class="d-flex align-items-baseline mb-1">
+                                                <span class="width-70px">Date</span>
+                                                <b>{{friendly_date($appointment->raw_date)}}</b>
+                                            </div>
+                                            <div class="d-flex align-items-baseline mb-1">
+                                                <span class="width-70px">Time</span>
+                                                <span>
+                                                    <b>{{ $appointment->friendlyStartTime }}</b> - <b>{{ $appointment->friendlyEndTime }}</b>
+                                                    <span class="text-secondary">{{ friendly_timezone($appointment->timezone) }}</span>
+                                                </span>
+                                            </div>
+                                            <div class="d-flex align-items-baseline ">
+                                                <span class="width-70px">Status</span>
+                                                <b>{{ucwords(strtolower($appointment->status))}}</b>
+                                            </div>
+                                        </div>
+                                        <label for="" class="mb-2">New Status</label>
+                                        <select name="status" class="form-control form-control-sm input-sm bg-light mb-2">
+                                            <option value="PENDING" {{$appointment->status === 'PENDING' ? 'selected' : ''}}>PENDING</option>
+                                            <option value="CONFIRMED" {{$appointment->status === 'CONFIRMED' ? 'selected' : ''}}>CONFIRMED</option>
+                                            <option value="CANCELLED" {{$appointment->status === 'CANCELLED' ? 'selected' : ''}}>CANCELLED</option>
+                                            <option value="COMPLETED" {{$appointment->status === 'COMPLETED' ? 'selected' : ''}}>COMPLETED</option>
+                                        </select>
+                                        <div class="mb-0">
+                                            <button class="btn btn-primary btn-sm" submit>Submit</button>
+                                            <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                                        </div>
+                                    </form>
+                                </div>
+                            </div>
+
+                        </div>
+                    </td>
+                    <td>
+                    @include('app.patient.coverage_column_renderer', ['patient'=>$appointment->client])
+                    </td>
+                </tr>
+                @endforeach
+            </table>
+            @else
+            <div class="bg-light p-3 text-secondary">
+                <span>You have no cancelled appointments.</span>
+            </div>
+
+            @endif
+        </div>
+    </div>
+</div>

+ 66 - 0
resources/views/app/rd/dashboard/encounters_in_progress.blade.php

@@ -0,0 +1,66 @@
+<div class="p-3">
+    @php
+    $encountersInProgress = $performer->pro->encountersInProgressRecordsAsRd();
+    @endphp
+    <div class="card">
+        <div class="card-body p-0">
+            @if($encountersInProgress && count($encountersInProgress))
+            <div class="table-responsive">
+                <table class="table table-sm table-striped mb-0">
+                    <thead class="bg-light">
+                        <tr>
+                            <th class="border-0">Chart #</th>
+                            <th class="border-0">Name</th>
+                            <th class="border-0">DOB</th>
+                            <th class="border-0">Gender</th>
+                            <th class="border-0">Insurance</th>
+                            <th class="border-0">HCP</th>
+                            <th class="border-0">Visit Date</th>
+                        </tr>
+                    </thead>
+                    <tbody>
+                        @foreach($encountersInProgress as $row)
+                        <tr>
+                            <td class="text-nowrap">
+                                {{$row->client->chart_number}}
+                            </td>
+                            <td>
+                                <a native target="_blank" href="{{ route('patients.view.dashboard', $row->client) }}">
+                                    {{$row->client->displayName()}}
+                                </a>
+                            </td>
+                            <td class="text-nowrap">
+                                {{friendly_date($row->client->dob)}}
+                            </td>
+                            <td class="text-nowrap">
+                                {{$row->client->sex}}
+                            </td>
+                            <td class="text-nowrap">
+                                @include('app.patient.coverage_column_renderer', ['patient'=>$row->client])
+                            </td>
+                            <td class="text-nowrap">
+                                {{$row->hcpPro->displayName()}}
+                            </td>
+                            <td class="text-nowrap">
+                                <a native target="_blank" href="{{ route('patients.view.notes.view.dashboard', ['patient' => $row->client, 'note' => $row]) }}">
+                                    {{friendly_date($row->effective_dateest)}}
+                                </a>
+                            </td>
+                        </tr>
+                        @endforeach
+                    </tbody>
+                </table>
+            </div>
+            @if($encountersInProgress->hasPages())
+            <div class="m-2">
+                {{ $encountersInProgress->onEachSide(0)->withQueryString()->links() }}
+            </div>
+            @endif
+            @else
+            <div class="p-3">
+                No encounters in progress
+            </div>
+            @endif
+        </div>
+    </div>
+</div>

+ 88 - 0
resources/views/app/rd/dashboard/encounters_pending_my_review.blade.php

@@ -0,0 +1,88 @@
+<div class="p-3">
+    @php
+    $encountersPendingMyReview = $performer->pro->encountersPendingMyReviewRecordsAsRd();
+    @endphp
+    <div class="card">
+        <div class="card-body p-0">
+        @if($encountersPendingMyReview && count($encountersPendingMyReview))
+        <div class="table-responsive">
+            <table class="table table-sm table-striped mb-0">
+                <thead class="bg-light">
+                    <tr>
+                        <th class="border-0">Chart#</th>
+                        <th class="border-0">Patient</th>
+                        <th class="border-0">Encounter</th>
+                        <th class="border-0">DOB</th>
+                        <th class="border-0">Gender</th>
+                        <th class="border-0">Coverage</th>
+                        <th class="border-0">MCP</th>
+                        <th class="border-0">Date</th>
+                        <th class="border-0"></th>
+                    </tr>
+                </thead>
+                <tbody>
+                    @foreach($encountersPendingMyReview as $row)
+                    <tr>
+                        <td class="text-nowrap">
+                            {{$row->client->chart_number}}
+                        </td>
+                        <td>
+                            <a native target="_blank" href="{{ route('patients.view.dashboard', $row->client) }}">
+                                {{$row->client->displayName()}}
+                            </a>
+                        </td>
+                        <td>
+                            <a native target="_blank" href="{{ route('patients.view.notes.view.dashboard', ['patient' => $row->client, 'note' => $row]) }}">
+                                {{friendly_date($row->effective_dateest)}}
+                            </a>
+                        </td>
+                        <td class="text-nowrap">
+                            {{friendly_date($row->client->dob)}}
+                        </td>
+                        <td class="text-nowrap">
+                            {{$row->client->sex}}
+                        </td>
+                        <td class="text-nowrap">
+                            @include('app.patient.coverage_column_renderer', ['patient'=>$row->client])
+                        </td>
+                        <td class="text-nowrap">
+                            {{$row->hcpPro->displayName()}}
+                        </td>
+                        <td class="text-nowrap">
+                            {{friendly_date($row->effective_dateest)}}
+                        </td>
+                        <td>
+                            @if(!$row->is_signed_by_ally)
+                            <div moe relative class="ml-auto">
+                                <form show url="/api/note/signAsAlly">
+                                    <input type="hidden" name="uid" value="{{ $row->uid }}">
+                                    <button submit class="bg-transparent border-0 p-0 text-primary">Ack.</button>
+                                </form>
+                            </div>
+                            @else
+                            <div moe relative class="ml-auto">
+                                <form show url="/api/note/undoSignAsAlly">
+                                    <input type="hidden" name="uid" value="{{ $row->uid }}">
+                                    <button submit class="bg-transparent border-0 p-0 text-primary">Ack.</button>
+                                </form>
+                            </div>    
+                            @endif
+                        </td>
+                    </tr>
+                    @endforeach
+                </tbody>
+            </table>
+        </div>
+        @if($encountersPendingMyReview->hasPages())
+            <div class="m-2">
+                {{ $encountersPendingMyReview->onEachSide(0)->withQueryString()->links() }}
+            </div>
+        @endif
+        @else
+        <div class="p-3">
+            No encounters pending review
+        </div>
+        @endif
+        </div>
+    </div>
+</div>

+ 59 - 0
resources/views/app/rd/dashboard/patients_awaiting_mcp_visit.blade.php

@@ -0,0 +1,59 @@
+<div class="p-3">
+    @php
+    $patientsAwaitingMcpVisit = $performer->pro->patientsAwaitingMcpVisitRecordsAsDna();
+    @endphp
+    <div class="card">
+        <div class="card-body p-0">
+        @if($patientsAwaitingMcpVisit && count($patientsAwaitingMcpVisit))
+        <table class="table table-sm table-striped mb-0">
+            <thead class="bg-light">
+            <tr>
+                <th class="border-0">Chart #</th>
+                <th class="border-0">Name</th>
+                <th class="border-0">DOB</th>
+                <th class="border-0">Gender</th>
+                <th class="border-0">Insurance</th>
+                <th class="border-0">HCP</th>
+            </tr>
+            </thead>
+            <tbody>
+            @foreach($patientsAwaitingMcpVisit as $row)
+                <tr>
+                    <td class="text-nowrap">
+                        {{$row->chart_number}}
+                    </td>
+                    <td class="pl-2">
+                        <a native target="_blank" href="{{ route('patients.view.dashboard', $row) }}">
+                            {{$row->displayName()}}
+                        </a>
+                    </td>
+                    <td class="text-nowrap">
+                        {{friendly_date($row->dob)}}
+                    </td>
+                    <td class="text-nowrap">
+                        {{$row->sex}}
+                    </td>
+                    <td class="text-nowrap">
+                        @include('app.patient.coverage_column_renderer', ['patient'=>$row])
+                    </td>
+                    <td class="text-nowrap">
+                        {{$row->mcp->name_display ?? '' }}
+                    </td>
+                
+                </tr>
+            @endforeach
+            </tbody>
+        </table>
+        @if($patientsAwaitingMcpVisit->hasPages())
+            <div class="m-2">
+                {{ $patientsAwaitingMcpVisit->onEachSide(0)->withQueryString()->links() }}
+            </div>
+        @endif
+    @else
+        <div class="p-3">
+            No patients awaiting mcp visit
+        </div>
+    @endif
+        </div>
+    </div>
+</div>

+ 60 - 0
resources/views/app/rd/dashboard/patients_without_appointment.blade.php

@@ -0,0 +1,60 @@
+<div class="p-3">
+    @php
+    $patientsWithoutAppointments = $performer->pro->patientsWithoutAppointmentRecordsAsRd();
+    @endphp
+    <div class="card">
+        <div class="card-body p-0">
+            @if($patientsWithoutAppointments && count($patientsWithoutAppointments))
+            <div class="table-responsive">
+                <table class="table table-sm table-striped mb-0">
+                    <thead class="bg-light">
+                        <tr>
+                            <th class="border-0">Chart #</th>
+                            <th class="border-0">Patient</th>
+                            <th class="border-0">DOB</th>
+                            <th class="border-0">Gender</th>
+                            <th class="border-0">Insurance</th>
+                            <th class="border-0">MCP</th>
+                        </tr>
+                    </thead>
+                    <tbody>
+                        @foreach($patientsWithoutAppointments as $row)
+                        <tr>
+                            <td class="text-nowrap">
+                                {{$row->chart_number}}
+                            </td>
+                            <td>
+                                <a native target="_blank" href="{{ route('patients.view.dashboard', $row) }}">
+                                    {{$row->displayName()}}
+                                </a>
+                            </td>
+                            <td class="text-nowrap">
+                                {{friendly_date($row->dob)}}
+                            </td>
+                            <td class="text-nowrap">
+                                {{$row->sex}}
+                            </td>
+                            <td class="text-nowrap">
+                                @include('app.patient.coverage_column_renderer', ['patient'=>$row])
+                            </td>
+                            <td class="text-nowrap">
+                                {{$row->mcp->name_display ?? '' }}
+                            </td>
+                        </tr>
+                        @endforeach
+                    </tbody>
+                </table>
+            </div>
+            @if($patientsWithoutAppointments->hasPages())
+            <div class="m-2">
+                {{ $patientsWithoutAppointments->onEachSide(0)->withQueryString()->links() }}
+            </div>
+            @endif
+            @else
+            <div class="p-3">
+                No patients without appointments
+            </div>
+            @endif
+        </div>
+    </div>
+</div>

+ 73 - 0
resources/views/app/rd/dashboard/reports_pending_ack.blade.php

@@ -0,0 +1,73 @@
+@php 
+    $reportsPendingAck = $performer->pro->reportsPendingAckRecordsAsRd();
+@endphp 
+<div class="p-3" id="patients-list">
+    <div class="card">
+        <div class="card-body p-0">            
+            <table class="table table-sm table-striped p-0 m-0">
+                <thead class="bg-light">
+                    <tr>
+                        <th class="border-0">Patient</th>
+                        <th class="border-0">Title</th>
+                        <th class="border-0">Category</th>
+                        <th class="border-0">Report Date</th>
+                        <th class="border-0">Sign</th>
+                        <th class="border-0"></th>
+                    </tr>
+                </thead>
+                <tbody>
+                    @foreach($reportsPendingAck as $report)
+                    <tr class="{{$report->is_entry_error ? 'entry-error' : ''}}">
+                        <td class="border-bottom-0">{{$report->client->displayName()}}</td>
+                        <td>
+                            <a native target="_blank" href="{{route('patients.view.incoming-reports', ['patient' => $report->client, 'currentReport' => $report])}}" class="{{@$currentReport->uid === $report->uid ? 'font-weight-bold' : ''}}">
+                                {{ $report->title ? $report->title : '(not set)' }}
+                            </a>
+                        </td>
+                        <td>{{ $report->category }}{{ $report->subcategory ? ' / ' . $report->subcategory : '' }}</td>
+                        <td>{{ friendly_date_time($report->report_date, false) }}</td>
+                        <td>
+                            @if(!$report->has_hcp_pro_signed)
+                            -
+                            @else
+                            <div class="text-success mb-1">
+                                <i class="fa fa-check"></i>
+                                Signed
+                            </div>
+                            @if($report->hcp)
+                            <div class="text-secondary">
+                                <div class="text-sm font-weight-bold">{{$report->hcp->displayName()}}</div>
+                                <div class="text-sm">{{friendlier_date_time($report->hcp_pro_signed_at)}}</div>
+                            </div>
+                            @endif
+                            @endif
+                        </td>
+                        <td>
+                            @if(!$report->has_na_pro_signed)
+                            <div moe relative class="ml-auto">
+                                <form show url="/api/incomingReport/signAsNaPro">
+                                    <input type="hidden" name="uid" value="{{ $report->uid }}">
+                                    <button submit class="bg-transparent border-0 p-0 text-primary">Ack.</button>
+                                </form>
+                            </div>
+                            @endif
+                        </td>
+                    </tr>
+                    @endforeach
+
+                    @if(count($reportsPendingAck) === 0)
+                    <tr>
+                        <td colspan="6">No records found!</td>
+                    </tr>
+                    @endif
+                </tbody>
+
+            </table>
+            @if($reportsPendingAck->hasPages())
+                <div class="ml-2 mt-2">
+                    {{ $reportsPendingAck->appends(request()->input())->links() }}
+                </div>
+            @endif
+        </div>
+    </div>
+</div>

+ 61 - 0
resources/views/app/rd/dashboard/supply_orders_pending_hcp_approval.blade.php

@@ -0,0 +1,61 @@
+@php
+$supplyOrdersPendingHcpApproval = $performer->pro->supplyOrdersPendingHcpApprovalRecordsAsRd();
+@endphp
+<div class="p-3" id="patients-list">
+    <div class="card">
+        <div class="card-body p-0">
+
+            <table class="table table-sm table-striped p-0 m-0">
+                <thead class="bg-light">
+                    <tr>
+                        <th class="border-0">Date</th>
+                        <th class="border-0">Patient</th>
+                        <th class="border-0">Product</th>
+                        <th class="border-0">Memo</th>
+                        <th class="border-0">Is Cancelled</th>
+                        <th class="border-0">Shipment</th>
+                    </tr>
+                </thead>
+                <tbody>
+                    @foreach($supplyOrdersPendingHcpApproval as $supplyOrder)
+                    <tr>
+                        <td>{{ friendlier_date_time($supplyOrder->created_at)}}</td>
+                        <td>{{ $supplyOrder->client->displayName() }} -</td>
+                        <td>{{ $supplyOrder->product->title }}</td>
+                        <td style="width: 300px;">{{ $supplyOrder->reason }}</td>
+                        <td>{{ $supplyOrder->is_cancelled ? 'Yes' : 'No' }}</td>
+                        <td>
+                            @if($supplyOrder->shipment_id)
+                            <i class="fa fa-building"></i>
+                            {{$supplyOrder->shipment->status ? $supplyOrder->shipment->status : 'CREATED'}}
+                            @elseif($supplyOrder->is_cleared_for_shipment)
+                            <span class="text-info">
+                                <i class="fa fa-user-nurse"></i>
+                                Cleared for shipment
+                            </span>
+                            @else
+                            <span class="text-warning-mellow">
+                                <i class="fa fa-user-nurse"></i>
+                                Not cleared for shipment
+                            </span>
+                            @endif
+                        </td>
+                    </tr>
+                    @endforeach
+
+                    @if(count($supplyOrdersPendingHcpApproval) === 0)
+                    <tr>
+                        <td colspan="6">No records found!</td>
+                    </tr>
+                    @endif
+                </tbody>
+
+            </table>
+            @if($supplyOrdersPendingHcpApproval->hasPages())
+            <div class="ml-2 mt-2">
+                {{ $supplyOrdersPendingHcpApproval->appends(request()->input())->links() }}
+            </div>
+            @endif
+        </div>
+    </div>
+</div>

+ 71 - 0
resources/views/app/rd/dashboard/supply_orders_pending_my_ack.blade.php

@@ -0,0 +1,71 @@
+@php
+$supplyOrdersPendingMyAck = $performer->pro->supplyOrdersPendingMyAckRecordsAsRd();
+@endphp
+<div class="p-3" id="patients-list">
+    <div class="card">
+        <div class="card-body p-0">
+            <table class="table table-sm table-striped p-0 m-0">
+                <thead class="bg-light">
+                    <tr>
+                        <th class="border-0">Date</th>
+                        <th class="border-0">Patient</th>
+                        <th class="border-0">Product</th>
+                        <th class="border-0">Memo</th>
+                        <th class="border-0">Is Cancelled</th>
+                        <th class="border-0">Shipment</th>
+                        <th class="border-0"></th>
+                    </tr>
+                </thead>
+                <tbody>
+                    @foreach($supplyOrdersPendingMyAck as $supplyOrder)
+                    <tr>
+                        <td>{{ friendlier_date_time($supplyOrder->created_at)}}</td>
+                        <td>{{ $supplyOrder->client->displayName() }} -</td>
+                        <td>{{ $supplyOrder->product->title }}</td>
+                        <td style="width: 300px;">{{ $supplyOrder->reason }}</td>
+                        <td>{{ $supplyOrder->is_cancelled ? 'Yes' : 'No' }}</td>
+                        <td>
+                            @if($supplyOrder->shipment_id)
+                            <i class="fa fa-building"></i>
+                            {{$supplyOrder->shipment->status ? $supplyOrder->shipment->status : 'CREATED'}}
+                            @elseif($supplyOrder->is_cleared_for_shipment)
+                            <span class="text-info">
+                                <i class="fa fa-user-nurse"></i>
+                                Cleared for shipment
+                            </span>
+                            @else
+                            <span class="text-warning-mellow">
+                                <i class="fa fa-user-nurse"></i>
+                                Not cleared for shipment
+                            </span>
+                            @endif
+                        </td>
+                        <td>
+                            @if(!$supplyOrder->has_na_pro_signed)
+                            <div moe relative class="ml-auto">
+                                <form show url="/api/supplyOrder/signAsNaPro">
+                                    <input type="hidden" name="uid" value="{{ $supplyOrder->uid }}">
+                                    <button submit class="bg-transparent border-0 p-0 text-primary">Ack.</button>
+                                </form>
+                            </div>
+                            @endif
+                        </td>
+                    </tr>
+                    @endforeach
+
+                    @if(count($supplyOrdersPendingMyAck) === 0)
+                    <tr>
+                        <td colspan="7">No records found!</td>
+                    </tr>
+                    @endif
+                </tbody>
+
+            </table>
+            @if($supplyOrdersPendingMyAck->hasPages())
+            <div class="ml-2 mt-2">
+                {{ $supplyOrdersPendingMyAck->appends(request()->input())->links() }}
+            </div>
+            @endif
+        </div>
+    </div>
+</div>

+ 9 - 1
routes/web.php

@@ -220,7 +220,15 @@ Route::middleware('pro.auth')->group(function () {
         Route::get('dashboard', [RdController::class, 'dashboard'])->name('dashboard');
         Route::get('client-review-requests', [RdController::class, 'clientReviewRequests'])->name('client-review-requests');
         Route::get('patients', [RdController::class, 'patients'])->name('patients');
-
+        Route::get('patients_awaiting_mcp_visit', [RdController::class, 'patientsAwaitingMcpVisit'])->name('patients_awaiting_mcp_visit');
+        Route::get('patients_without_appointment', [RdController::class, 'patientsWithoutAppointment'])->name('patients_without_appointment');
+        Route::get('encounters_pending_my_review', [RdController::class, 'encountersPendingMyReview'])->name('encounters_pending_my_review');
+        Route::get('encounters_in_progress', [RdController::class, 'encountersInProgress'])->name('encounters_in_progress');
+        Route::get('appointments_pending_confirmation', [RdController::class, 'appointmentsPendingConfirmation'])->name('appointments_pending_confirmation');
+        Route::get('cancelled_appointments_pending_ack', [RdController::class, 'cancelledAppointmentsPendingAck'])->name('cancelled_appointments_pending_ack');
+        Route::get('reports_pending_ack', [RdController::class, 'reportsPendingAck'])->name('reports_pending_ack');
+        Route::get('supply_orders_pending_my_ack', [RdController::class, 'supplyOrdersPendingMyAck'])->name('supply_orders_pending_my_ack');
+        Route::get('supply_orders_pending_hcp_approval', [RdController::class, 'supplyOrdersPendingHcpApproval'])->name('supply_orders_pending_hcp_approval');
 
     });