ソースを参照

Main DB messages thread popup

Vijayakrishnan 3 年 前
コミット
23f8cb5781

+ 5 - 0
app/Http/Controllers/PatientController.php

@@ -272,6 +272,11 @@ class PatientController extends Controller
         return view('app.patient.memos-thread', compact('patient'));
     }
 
+    public function messagesThread(Request $request, Client $patient )
+    {
+        return view('app.patient.messages-thread', compact('patient'));
+    }
+
     public function sms(Request $request, Client $patient )
     {
         return view('app.patient.sms', compact('patient'));

+ 7 - 2
resources/views/app/mcp/dashboard/messages.blade.php

@@ -9,9 +9,14 @@
                     <a href="{{route('patients.view.sms', $msg->client_uid)}}">
                         {{$msg->client_name_first}} {{$msg->client_name_last}}
                     </a>
-                    <div class="text-secondary text-sm text-nowrap">
+                    <a class="text-sm text-nowrap d-block"
+                       href="/messages-thread/{{$msg->client_uid}}"
+                       native target="_blank"
+                       open-in-stag-popup
+                       popup-style="tall"
+                       title="Messages for {{$msg->client_name_first}} {{$msg->client_name_last}}">
                         {{friendlier_date_time($msg->created_at)}}
-                    </div>
+                    </a>
                 </td>
                 <td class="px-1">
                     {{$msg->body}}

+ 32 - 0
resources/views/app/patient/messages-thread.blade.php

@@ -0,0 +1,32 @@
+<div class="p-3 mt-3 border-top">
+    <table class="table table-striped table-sm table-bordered">
+        @if($patient->smses && count($patient->smses))
+            <thead>
+            <tr>
+                <th class="px-2 text-secondary border-bottom-0">Date &amp; Time</th>
+                <th class="px-2 text-secondary border-bottom-0 w-25">Type</th>
+                <th class="px-2 text-secondary border-bottom-0 w-25">From</th>
+                <th class="px-2 text-secondary border-bottom-0 w-25">To</th>
+                <th class="px-2 text-secondary border-bottom-0 w-50">Content</th>
+            </tr>
+            </thead>
+            <tbody>
+            @foreach($patient->smses as $sms)
+                <tr>
+                    <td class="px-2">{{ friendly_date_time($sms->created_at) }}</td>
+                    <td class="px-2">{{ ucwords($sms->incoming_or_outgoing) }}</td>
+                    <td class="px-2">{{ $sms->from_number }}</td>
+                    <td class="px-2">{{ $sms->to_number }}</td>
+                    <td class="px-2">{{ $sms->body }}</td>
+                </tr>
+            @endforeach
+            </tbody>
+        @else
+            <tbody>
+            <tr>
+                <td class="text-secondary p-3">No messages for this patient</td>
+            </tr>
+            </tbody>
+        @endif
+    </table>
+</div>

+ 1 - 0
routes/web.php

@@ -402,6 +402,7 @@ Route::middleware('pro.auth')->group(function () {
     Route::get('/allergies-center/{patient}/{note}', 'NoteController@allergiesCenter')->name('allergies-center');
     Route::get('/careteam-center/{patient}/{note}', 'NoteController@careteamCenter')->name('careteam-center');
     Route::get('/memos-thread/{patient}', 'PatientController@memosThread')->name('memos-thread');
+    Route::get('/messages-thread/{patient}', 'PatientController@messagesThread')->name('messages-thread');
 
     Route::get('/problems-quick-add/{patient}/{note}', 'NoteController@problemsQuickAdd')->name('problems-quick-add');