浏览代码

Patient > appointments > UI updates

Vijayakrishnan 4 年之前
父节点
当前提交
7b69e0cdac

+ 5 - 0
app/Models/Appointment.php

@@ -27,4 +27,9 @@ class Appointment extends Model
         return $this->hasMany(AppointmentConfirmationDecision::class, 'appointment_id', 'id')
             ->orderBy('created_at', 'desc');
     }
+
+    public function latestConfirmationDecision() {
+        return $this->hasOne(AppointmentConfirmationDecision::class, 'id', 'latest_confirmation_decision_id');
+    }
+
 }

+ 1 - 1
resources/views/app/patient/appointments.blade.php

@@ -40,7 +40,7 @@
                     <tr>
                         <td class="px-2">
                             <a href="/patients/view/{{$patient->uid}}/calendar/{{$appointment->uid}}" class="font-weight-bold">
-                                {{ $appointment->raw_date }}&nbsp;&nbsp;{{ $appointment->raw_start_time }}
+                                {{friendlier_date_time($appointment->raw_date . ' ' . $appointment->raw_start_time)}}
                             </a>
                         </td>
                         <td class="px-2">{{ $appointment->pro->displayName() }}</pre></td>

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

@@ -18,6 +18,11 @@ $cDecisions = $appointment->confirmationDecisions;
     @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) }}
+            @if($cDecision->memo)
+                <div class="text-sm">
+                    <i>{{$cDecision->memo}}</i>
+                </div>
+            @endif
         </div>
     @endforeach
 @endif

+ 9 - 3
resources/views/app/patient/partials/appointment-confirmation.blade.php

@@ -10,7 +10,7 @@
             @if($appointment->status === 'CONFIRMED')
                 <div class="text-nowrap">
                     <b class="text-success">{{ucwords($appointment->status)}}</b>
-                    <span class="text-secondary ml-1">on {{friendly_date_time($appointment->latest_confirmation_decision_at)}}</span>
+                    <span class="text-secondary ml-1">on {{friendlier_date_time(convertToTimezone($appointment->latest_confirmation_decision_at, 'US/Eastern'))}}</span>
                 </div>
                 <div>
                     @include('app.patient.partials.appointment-request-confirmation', ['label' => 'Re-request Confirmation'])
@@ -18,7 +18,7 @@
             @elseif($appointment->status === 'REJECTED')
                 <div class="text-nowrap">
                     <b class="text-warning-mellow">{{ucwords($appointment->status)}}</b>
-                    <span class="text-secondary ml-1">on {{friendly_date_time($appointment->latest_confirmation_decision_at)}}</span>
+                    <span class="text-secondary ml-1">on {{friendlier_date_time(convertToTimezone($appointment->latest_confirmation_decision_at, 'US/Eastern'))}}</span>
                 </div>
                 <div>
                     <a href="/patients/view/{{$patient->uid}}/calendar/{{$appointment->uid}}" class="font-weight-bold">
@@ -26,10 +26,16 @@
                     </a>
                 </div>
             @endif
+            @if($appointment->latestConfirmationDecision)
+                <div class="my-1 border text-sm px-2 py-1 bg-white max-width-300px">
+                    <b>Client feedback:</b><br>
+                    {{$appointment->latestConfirmationDecision->memo}}
+                </div>
+            @endif
         @elseif($appointment->latest_confirmation_request_at) {{-- requested but not confirmed yet --}}
             <div class="text-nowrap">
                 <b class="text-primary">Requested</b>
-                <span class="text-secondary ml-1">on {{friendly_date_time($appointment->latest_confirmation_request_at)}}</span>
+                <span class="text-secondary ml-1">on {{friendlier_date_time(convertToTimezone($appointment->latest_confirmation_request_at, 'US/Eastern'))}}</span>
             </div>
             <div>
                 @include('app.patient.partials.appointment-request-confirmation', ['label' => 'Re-request Confirmation'])