Kaynağa Gözat

Merge branch 'master' of rav.triplestart.com:jmudaka/stagfe2

= 3 yıl önce
ebeveyn
işleme
f3e168b2dc

+ 37 - 1
app/Http/Controllers/HomeController.php

@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
 
 use App\Lib\Backend;
 use App\Models\Appointment;
+use App\Models\AppointmentConfirmationDecision;
 use App\Models\AppSession;
 use App\Models\ClientMemo;
 use App\Models\ClientProChange;
@@ -393,6 +394,40 @@ class HomeController extends Controller
             ->whereNull('current_client_pro_change_decision_id')
             ->get();
 
+        $proApptUpdates = AppointmentConfirmationDecision
+            ::select('appointment_confirmation_decision.uid', 'client.name_first', 'client.name_last', 'appointment.start_time')
+            ->rightJoin('appointment', 'appointment.id', '=', 'appointment_confirmation_decision.appointment_id')
+            ->rightJoin('client', 'client.id', '=', 'appointment.client_id')
+            ->where('appointment_confirmation_decision.was_acknowledged_by_appointment_pro', false)
+            ->where('appointment.status', '!=', 'CREATED')
+            ->where('appointment.status', '!=', 'COMPLETED')
+            ->where('appointment.status', '!=', 'ABANDONED')
+            ->where('appointment.pro_id', $performerProID)
+            ->where('client.mcp_pro_id', $performerProID)
+            ->orderBy('appointment.start_time', 'DESC')
+            ->get();
+
+        $naApptUpdates = AppointmentConfirmationDecision
+            ::select('appointment_confirmation_decision.uid', 'client.name_first', 'client.name_last', 'pro.name_first as pro_name_first', 'pro.name_last as pro_name_last', 'appointment.start_time')
+            ->rightJoin('appointment', 'appointment.id', '=', 'appointment_confirmation_decision.appointment_id')
+            ->rightJoin('client', 'client.id', '=', 'appointment.client_id')
+            ->rightJoin('pro', 'pro.id', '=', 'appointment.pro_id')
+            ->where('appointment_confirmation_decision.was_acknowledged_by_client_default_na', false)
+            ->where('appointment.status', '!=', 'CREATED')
+            ->where('appointment.status', '!=', 'COMPLETED')
+            ->where('appointment.status', '!=', 'ABANDONED')
+            ->where('client.default_na_pro_id', $performerProID)
+            ->orderBy('appointment.start_time', 'DESC')
+            ->get();
+
+//        $naApptUpdates = AppointmentConfirmationDecision
+//            ::join('appointment', 'appointment.id', '=', 'appointment_confirmation_decision.appointment_id')
+//            ->join('client', 'client.id', '=', 'appointment.client_id')
+//            ->where('client.default_na_pro_id', $performerProID)
+//            ->where('appointment_confirmation_decision.was_acknowledged_by_client_default_na', false)
+//            ->orderBy('appointment.start_time DESC')
+//            ->get();
+
         // unstamped client memos
         // for mcp
         $mcpClientMemos = DB::select(
@@ -529,7 +564,8 @@ WHERE ((client.mcp_pro_id = {$performer->pro->id}) OR (client.rmm_pro_id = {$per
             'incomingReports', 'tickets', 'supplyOrders',
             'numERx', 'numLabs', 'numImaging', 'numSupplyOrders',
             'newMCPAssociations', 'newNAAssociations',
-            'mcpClientMemos', 'naClientMemos'));
+            'mcpClientMemos', 'naClientMemos',
+            'proApptUpdates', 'naApptUpdates'));
     }
 
     public function dashboardMeasurementsTab(Request $request, $page = 1) {

+ 1 - 1
app/Http/Controllers/PatientController.php

@@ -372,7 +372,7 @@ class PatientController extends Controller
         $pros = [];
 
         if($this->pro && $this->pro->pro_type != 'ADMIN') {
-            $accessiblePros = ProProAccess::where('owner_pro_id', $this->pro->id);
+            $accessiblePros = ProProAccess::where('owner_pro_id', $this->pro->id)->get();
             $accessibleProIds = [];
             foreach($accessiblePros as $accessiblePro){
                 $accessibleProIds[] = $accessiblePro->id;

+ 108 - 2
resources/views/app/dashboard.blade.php

@@ -203,13 +203,69 @@
 
                 <div class="row">
                     <div class="col-6">
+
+                        <!-- Appointment Updates -->
+                        @if(count($proApptUpdates))
+                            <div class="mb-3 border rounded px-3 py-2 ack-container">
+                                <p class="pt-1 mb-2"><b>Appointment Updates</b></p>
+                                <table class="table table-sm table-hover table-bordered mb-0">
+                                    <thead>
+                                    <tr>
+                                        <th>Client</th>
+                                        <th>Appt. Date/Time</th>
+                                        <th>Status</th>
+                                        <th></th>
+                                    </tr>
+                                    </thead>
+                                    <tbody>
+                                        @foreach($proApptUpdates as $update)
+                                            <tr>
+                                                <td>{{$update->name_first}} {{$update->name_last}}</td>
+                                                <td>{{friendlier_date_time($update->start_time)}}</td>
+                                                <td>{{$update->status}}</td>
+                                                <td><a href="#" class="ack-pro-appt-update" data-uid="{{$update->uid}}">Acknowledge</a></td>
+                                            </tr>
+                                        @endforeach
+                                    </tbody>
+                                </table>
+                            </div>
+                        @endif
+
+                        @if(count($naApptUpdates))
+                            <div class="mb-3 border rounded px-3 py-2 ack-container">
+                                <p class="pt-1 mb-2"><b>Appointment Updates</b></p>
+                                <table class="table table-sm table-hover table-bordered mb-0">
+                                    <thead>
+                                    <tr>
+                                        <th>Client</th>
+                                        <th>Pro</th>
+                                        <th>Appt. Date/Time</th>
+                                        <th>Status</th>
+                                        <th></th>
+                                    </tr>
+                                    </thead>
+                                    <tbody>
+                                    @foreach($naApptUpdates as $update)
+                                        <tr>
+                                            <td>{{$update->name_first}} {{$update->name_last}}</td>
+                                            <td>{{$update->pro_name_first}} {{$update->pro_name_last}}</td>
+                                            <td>{{friendlier_date_time($update->start_time)}}</td>
+                                            <td>{{$update->status}}</td>
+                                            <td><a href="#" class="ack-na-appt-update" data-uid="{{$update->uid}}">Acknowledge</a></td>
+                                        </tr>
+                                    @endforeach
+                                    </tbody>
+                                </table>
+                            </div>
+                        @endif
+
                         <!-- new associations -->
                         @if(count($newMCPAssociations))
                             <div class="mb-3 border rounded px-3 py-2 ack-container">
                                 <p class="pt-1 mb-2"><b>New Patients</b></p>
                                 @foreach($newMCPAssociations as $assoc)
                                     <div class="mb-1">You have been assigned as the MCP for
-                                        <a href="/patients/view/{{$assoc->patient->uid}}" class="d-inline-block width-150px">{{$assoc->patient->displayName()}}</a>.
+                                        <span class="d-inline-block width-150px"><a href="/patients/view/{{$assoc->patient->uid}}" class="">{{$assoc->patient->displayName()}}</a>.</span>
                                         <a href="#" class="ack-client-pro-change ml-3" data-uid="{{$assoc->uid}}">Stamp</a>
                                     </div>
                                 @endforeach
@@ -221,7 +277,7 @@
                                 <p class="pt-1 mb-2"><b>New Patients</b></p>
                                 @foreach($newNAAssociations as $assoc)
                                     <div class="mb-1">You have been assigned as the Care Coordinator for
-                                        <a href="/patients/view/{{$assoc->patient->uid}}" class="d-inline-block width-150px">{{$assoc->patient->displayName()}}</a>.
+                                        <span class="d-inline-block width-150px"><a href="/patients/view/{{$assoc->patient->uid}}" class="">{{$assoc->patient->displayName()}}</a>.</span>
                                         <a href="#" class="ack-client-pro-change ml-3" data-uid="{{$assoc->uid}}">Stamp</a>
                                     </div>
                                 @endforeach
@@ -781,6 +837,56 @@
                     }, 'json');
                     return false;
                 });
+
+            $(document)
+                .off('click', '.ack-pro-appt-update')
+                .on('click', '.ack-pro-appt-update', function() {
+                    let trigger = $(this).text('…');
+                    $.post('/api/appointmentConfirmationDecision/acknowledgeAsAppointmentPro', {
+                        uid: $(this).attr('data-uid')
+                    }, _data => {
+                        if(!hasResponseError(_data)) {
+                            trigger.hide();
+                            let doneElem = $('<i class="text-success fa fa-check"></i>');
+                            doneElem.insertAfter(trigger);
+                            setTimeout(() => {
+                                let ackContainer = trigger.closest('tbody');
+                                trigger.closest('tr').slideUp('fast', function() {
+                                    $(this).remove();
+                                    if(!ackContainer.find('>tr').length) {
+                                        ackContainer.remove();
+                                    }
+                                });
+                            }, 500);
+                        }
+                    }, 'json');
+                    return false;
+                });
+
+            $(document)
+                .off('click', '.ack-na-appt-update')
+                .on('click', '.ack-na-appt-update', function() {
+                    let trigger = $(this).text('…');
+                    $.post('/api/appointmentConfirmationDecision/acknowledgeAsClientDefaultNa', {
+                        uid: $(this).attr('data-uid')
+                    }, _data => {
+                        if(!hasResponseError(_data)) {
+                            trigger.hide();
+                            let doneElem = $('<i class="text-success fa fa-check"></i>');
+                            doneElem.insertAfter(trigger);
+                            setTimeout(() => {
+                                let ackContainer = trigger.closest('tbody');
+                                trigger.closest('tr').slideUp('fast', function() {
+                                    $(this).remove();
+                                    if(!ackContainer.find('>tr').length) {
+                                        ackContainer.remove();
+                                    }
+                                });
+                            }, 500);
+                        }
+                    }, 'json');
+                    return false;
+                });
         }
         addMCInitializer('pro-dashboard', init, '#pro-dashboard-container');
     })();

+ 21 - 21
resources/views/app/guest/appointment-confirmation.blade.php

@@ -25,13 +25,26 @@
                         </p>
                     </div>
 
-                    @if($appointment->status === 'CREATED')
-
-                        <div class="form-group">
-                            <p>Please confirm your appointment</p>
+                    @if(count($appointment->confirmationDecisions))
+                        <p class="mb-2 text-secondary font-weight-bold">Appointment status history</p>
+                        <div class="bg-light px-2 pt-2 border rounded mb-3">
+                            @foreach($appointment->confirmationDecisions as $decision)
+                                <div class="mb-2"><b>{{$decision->accepted_or_rejected_or_waived}}</b> on <b>{{friendlier_date_time($decision->created_at)}}</b>
+                                    @if($decision->session && $decision->session->pro)
+                                        by <b>{{$decision->session->pro->displayName()}}</b>
+                                    @elseif($decision->session && $decision->session->client)
+                                        by <b>{{$decision->session->client->displayName()}}</b>
+                                    @endif
+                                </div>
+                            @endforeach
                         </div>
+                        <p class="text-secondary font-weight-bold mb-2">Update appointment status</p>
+                    @else
+                        <p class="text-secondary font-weight-bold mb-2">Please confirm your appointment</p>
+                    @endif
 
-                        <div class="form-group">
+                    <div class="bg-light px-2 pt-2 border rounded mb-3">
+                        <div class="form-group mb-2">
                             <div class="check d-flex align-items-center mb-2">
                                 <input type="radio" required name="decision" value="ACCEPT" id="appointment_confirmation_accept" class="check-input my-0 mr-2">
                                 <label for="appointment_confirmation_accept" class="check-label my-0">Accept - <b>I confirm my availability at the above mentioned date/time</b></label>
@@ -42,27 +55,14 @@
                             </div>
                         </div>
 
-                        <div class="form-group">
+                        <div class="form-group mb-2">
                             <textarea name="memo" class="form-control form-control-sm" placeholder="Any additional information / reason in case you are rejecting the appointment"></textarea>
                         </div>
 
-                        <div class="form-group">
+                        <div class="form-group mb-2">
                             <button class="btn btn-primary">Submit</button>
                         </div>
-
-                    @else
-
-                        @foreach($appointment->confirmationDecisions as $decision)
-                            <div class="mb-2"><b>{{$decision->accepted_or_rejected}}</b> on <b>{{friendlier_date_time($decision->created_at)}}</b>
-                                @if($decision->session && $decision->session->pro)
-                                    by <b>{{$decision->session->pro->displayName()}}</b>
-                                @elseif($decision->session && $decision->session->client)
-                                    by <b>{{$decision->session->client->displayName()}}</b>
-                                @endif
-                            </div>
-                        @endforeach
-
-                    @endif
+                    </div>
 
                 </form>
                 @endif

+ 2 - 2
resources/views/app/patient/care-month/dashboard.blade.php

@@ -387,7 +387,7 @@
                         </div>
                     </div>
 
-                    <!-- <table class="table table-striped table-sm table-bordered mt-2 mb-0">
+                    <table class="table table-striped table-sm table-bordered mt-2 mb-0">
                         <thead>
                         <tr>
                             <th class="px-2 text-secondary">Effective Date</th>
@@ -517,7 +517,7 @@
                             </tr>
                         @endif
                         </tbody>
-                    </table> -->
+                    </table>
                 </div>
             </div>
         </div>

+ 1 - 1
resources/views/app/patient/partials/appointment-confirmation-history.blade.php

@@ -17,7 +17,7 @@ $cDecisions = $appointment->confirmationDecisions;
     <p class="my-2"><b>Decisions</b></p>
     @foreach($cDecisions as $cDecision)
         <div class="bg-light p-1 my-1 border border">
-            <b class="{{$cDecision->accepted_or_rejected === 'ACCEPTED' ? 'text-success' : 'text-warning-mellow'}}">{{$cDecision->accepted_or_rejected}}</b> on {{ friendly_date_time($cDecision->created_at) }}
+            <b class="{{$cDecision->accepted_or_rejected_or_waived === 'ACCEPTED' ? 'text-success' : 'text-warning-mellow'}}">{{$cDecision->accepted_or_rejected_or_waived}}</b> on {{ friendly_date_time($cDecision->created_at) }}
             @if($cDecision->memo)
                 <div class="text-sm">
                     <i>{{$cDecision->memo}}</i>

+ 2 - 5
resources/views/app/video/call-minimal.blade.php

@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<html lang="en">
+<html lang="en" class="h-100">
 <head>
     <meta name="viewport" content="width=device-width, initial-scale=1">
     <title>Leadership Health</title>
@@ -16,7 +16,7 @@
     <link href="/css/call-minimal.css?v={{config('app.asset_version')}}" rel="stylesheet">
 </head>
 
-<body class="p-0 m-0 has-mcp-queue">
+<body class="p-0 m-0 has-mcp-queue h-100">
 
 <div class="d-flex px-3 border-bottom">
     <div class="py-2 font-weight-normal mcp-theme-1 d-inline-flex align-items-center">
@@ -679,8 +679,5 @@
     }).call(window);
 </script>
 
-<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
-@include('app/patient/partials/mcp-queue')
-
 </body>
 </html>

+ 11 - 28
resources/views/app/video/check-video-minimal.blade.php

@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<html lang="en">
+<html lang="en" class="h-100">
 <head>
     <meta name="viewport" content="width=device-width, initial-scale=1">
     <title>Leadership Health</title>
@@ -16,7 +16,7 @@
     <link href="/css/call-minimal.css?v={{config('app.asset_version')}}" rel="stylesheet">
 </head>
 
-<body class="p-0 m-0">
+<body class="p-0 m-0 h-100">
 
 <div class="d-flex px-3 border-bottom">
     <div class="py-2 font-weight-normal mcp-theme-1 d-inline-flex align-items-center">
@@ -31,7 +31,6 @@
 
     {{-- check video button --}}
     <button id="btn-start-video"
-            onclick="window.StagVideo.init(); return false;"
             class="btn btn-primary px-4 font-weight-bold d-block mx-auto my-3">
         Check Video
     </button>
@@ -41,13 +40,13 @@
             <p><b>We were unable to access your microphone!</b></p>
             <p>To allow access, please tap the blocked media icon in your browser's address bar (indicated in the figure below).</p>
             <img src="/img/mic-access-chrome-desktop.png" class="mw-100 mx-auto mb-3 d-block">
-            <p class="mb-0">Once you have allowed access, please click <b>Start Video</b> again to retry.</p>
+            <p class="mb-0">Once you have allowed access, please click <b>Check Video</b> again to retry.</p>
         </div>
         <div class="cam-access-chrome-desktop border bg-light rounded m-3 px-3 pt-3 pb-2 d-none">
             <p><b>We were unable to access your camera!</b></p>
             <p>To allow access, please tap the blocked media icon in your browser's address bar (indicated in the figure below).</p>
             <img src="/img/mic-access-chrome-desktop.png" class="mw-100 mx-auto mb-3 d-block">
-            <p class="mb-0">Once you have allowed access, please click <b>Start Video</b> again to retry.</p>
+            <p class="mb-0">Once you have allowed access, please click <b>Check Video</b> again to retry.</p>
         </div>
     </div>
 
@@ -63,18 +62,6 @@
         <button class="btn btn-danger" id="btn-hang-up" title="End">
             <i class="fa fa-phone"></i>
         </button>
-<!--        <button class="ml-2 btn btn-default bg-light border" id="btn-stop-camera" title="Stop Camera">
-            <i class="fa fa-video"></i>
-        </button>
-        <button class="ml-2 btn btn-secondary d-none" id="btn-start-camera" title="Start Camera">
-            <i class="fa fa-video-slash"></i>
-        </button>
-        <button class="ml-2 btn btn-default bg-light border" id="btn-mute-audio" title="Mute">
-            <i class="fa fa-microphone"></i>
-        </button>
-        <button class="ml-2 btn btn-secondary d-none" id="btn-unmute-audio" title="Unmute">
-            <i class="fa fa-microphone-slash"></i>
-        </button>-->
     </div>
 
 </div>
@@ -157,16 +144,14 @@
                 this.$btnMuteAudio = $('#btn-mute-audio');
                 this.$btnUnmuteAudio = $('#btn-unmute-audio');
 
-                this.registerSocket(() => {
-                    this.initMedia();
-                });
+                this.registerSocket();
 
                 // event handlers
-                // $(document)
-                //     .off('click.start-video', '#btn-start-video')
-                //     .on('click.start-video', '#btn-start-video', () => {
-                //         this.initMedia();
-                //     });
+                $(document)
+                    .off('click.check-video', '#btn-start-video')
+                    .on('click.check-video', '#btn-start-video', () => {
+                        this.initMedia();
+                    });
 
                 $(document)
                     .off('click.hang-up', '#btn-hang-up')
@@ -222,8 +207,6 @@
                     */
 
                     this.initSocketEvents();
-
-                    _done.call(this);
                 });
             },
 
@@ -702,7 +685,7 @@
 
         };
 
-        // window.StagVideo.init();
+        window.StagVideo.init();
 
     }).call(window);
 </script>