فهرست منبع

Note > book appt. > default to note's mcp in the calendar popup

Vijayakrishnan 3 سال پیش
والد
کامیت
3abea256fd

+ 8 - 2
resources/views/app/patient/appointment-calendar.blade.php

@@ -685,6 +685,10 @@
             <?php
             $patient->nameStr = $patient->displayName();
             $clientObject = json_encode($patient);
+            $oPro = false;
+            if(request()->input('opUid')) {
+                $oPro = \App\Models\Pro::where('uid', request()->input('opUid'))->first();
+            }
             ?>
 
             function init() {
@@ -694,7 +698,7 @@
                         client: {!! json_encode($patient) !!},
                         eventTypes: '{{ $currentAppointment ? 'BOTH_ALL' : 'BOTH' }}',
                         calendar: null,
-                        proIds: ['{{ $currentAppointment ? $currentAppointment->pro_id : $pro->id }}'],
+                        proIds: ['{{ $currentAppointment ? $currentAppointment->pro_id : ($oPro ? $oPro->id : $pro->id) }}'],
                         timezone: '{{ $currentAppointment ? $currentAppointment->timezone : 'EASTERN' }}',
                         today: new Date('{{ date('Y-m-d 00:00:00') }}'),
 
@@ -1077,7 +1081,9 @@
                             let endTime = this.timeStr(this.selectedSlot.end);
                             this.newAppointment.clientUid = this.client.uid;
                             this.newAppointment.proUid = '';
-                            @if($pro->is_hcp && $pro->is_enrolled_as_mcp)
+                            @if($oPro)
+                                this.newAppointment.proUid = '{{$oPro->uid}}';
+                            @elseif($pro->is_hcp && $pro->is_enrolled_as_mcp)
                                 this.newAppointment.proUid = '{{$pro->uid}}';
                             @elseif($patient->mcp)
                                 this.newAppointment.proUid = '{{$patient->mcp->uid}}';

+ 1 - 1
resources/views/app/patient/note/dashboard.blade.php

@@ -415,7 +415,7 @@
                    mc-initer="patient-calendar-{{$patient->id}}"
                    title="Calendar: {{$patient->displayName()}}"
                    popup-style="medium-large"
-                   href="{{route('patients.view.calendar', ['patient' => $patient])}}">
+                   href="{{route('patients.view.calendar', ['patient' => $patient])}}?opUid={{$note->hcpPro ? $note->hcpPro->uid : ''}}">
                     <i class="fa fa-clock"></i>
                     Book Appointment
                 </a>