Procházet zdrojové kódy

Updated listing & filter for erx, lab, imaging

Vijayakrishnan před 4 roky
rodič
revize
3674164e42

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

@@ -43,34 +43,34 @@ class PatientController extends Controller
         return view('app.patient.action-items', compact('patient', 'facilities'));
     }
 
-    public function actionItemsErx(Request $request, Client $patient)
+    public function actionItemsErx(Request $request, Client $patient, $filter = 'open')
     {
         $facilities = Facility::where('is_active', true)->get();
-        return view('app.patient.action-items-erx', compact('patient', 'facilities'));
+        return view('app.patient.action-items-erx', compact('patient', 'facilities', 'filter'));
     }
 
-    public function actionItemsLab(Request $request, Client $patient)
+    public function actionItemsLab(Request $request, Client $patient, $filter = 'open')
     {
         $facilities = Facility::where('is_active', true)->get();
-        return view('app.patient.action-items-lab', compact('patient', 'facilities'));
+        return view('app.patient.action-items-lab', compact('patient', 'facilities', 'filter'));
     }
 
-    public function actionItemsImaging(Request $request, Client $patient)
+    public function actionItemsImaging(Request $request, Client $patient, $filter = 'open')
     {
         $facilities = Facility::where('is_active', true)->get();
-        return view('app.patient.action-items-imaging', compact('patient', 'facilities'));
+        return view('app.patient.action-items-imaging', compact('patient', 'facilities', 'filter'));
     }
 
-    public function actionItemsEquipment(Request $request, Client $patient)
+    public function actionItemsEquipment(Request $request, Client $patient, $filter = 'open')
     {
         $facilities = Facility::where('is_active', true)->get();
-        return view('app.patient.action-items-equipment', compact('patient', 'facilities'));
+        return view('app.patient.action-items-equipment', compact('patient', 'facilities', 'filter'));
     }
 
-    public function actionItemsOther(Request $request, Client $patient)
+    public function actionItemsOther(Request $request, Client $patient, $filter = 'open')
     {
         $facilities = Facility::where('is_active', true)->get();
-        return view('app.patient.action-items-other', compact('patient', 'facilities'));
+        return view('app.patient.action-items-other', compact('patient', 'facilities', 'filter'));
     }
 
     public function intake(Request $request, Client $patient )

+ 1 - 1
resources/views/app/patient/action-items-erx.blade.php

@@ -4,7 +4,7 @@
 ?>
 @section('inner-content')
 
-    <div class="mb-5">
+    <div class="mb-3">
 
     @include('app/patient/partials/erx')
 

+ 1 - 1
resources/views/app/patient/action-items-imaging.blade.php

@@ -4,7 +4,7 @@
 ?>
 @section('inner-content')
 
-    <div class="mb-5">
+    <div class="mb-3">
 
     @include('app/patient/partials/imaging')
 

+ 1 - 1
resources/views/app/patient/action-items-lab.blade.php

@@ -4,7 +4,7 @@
 ?>
 @section('inner-content')
 
-    <div class="mb-5">
+    <div class="mb-3">
 
     @include('app/patient/partials/lab')
 

+ 54 - 24
resources/views/app/patient/partials/erx.blade.php

@@ -3,42 +3,68 @@
         <h4 class="font-weight-bold m-0 font-size-14"><i class="fa fa-prescription mr-2"></i>ERx</h4>
         <span class="mx-2 text-secondary">|</span>
         <a class="py-0 font-weight-normal c-pointer" v-on:click.prevent="showPopup('erx-popup')">Add</a>
+        <select class="ml-auto max-width-300px form-control form-control-sm"
+                onchange="fastLoad('/patients/view/{{$patient->uid}}/action-items-erx/' + this.value, true, false, false)">
+            <option value="open" {{ $filter === 'open' ? 'selected' : '' }}>Open tickets</option>
+            <option value="closed" {{ $filter === 'closed' ? 'selected' : '' }}>Closed tickets</option>
+            <option value="all" {{ $filter === 'all' ? 'selected' : '' }}>All tickets</option>
+        </select>
     </div>
-    <table class="table table-sm table-bordered mb-0" style="table-layout: fixed">
+    <table class="table table-sm table-bordered mb-0">
         <thead>
         <tr class="bg-light">
             <th class="px-2 text-secondary border-bottom-0 width-30px">#</th>
             <th class="px-2 text-secondary border-bottom-0">Medication</th>
-            <th class="px-2 text-secondary border-bottom-0">Strength</th>
-            <th class="px-2 text-secondary border-bottom-0">Amount</th>
-            <th class="px-2 text-secondary border-bottom-0">Route</th>
-            <th class="px-2 text-secondary border-bottom-0">Frequency</th>
-            <th class="px-2 text-secondary border-bottom-0">Dispense</th>
-            <th class="px-2 text-secondary border-bottom-0">Refills</th>
-            <th class="px-2 text-secondary border-bottom-0">Purpose</th>
-            <th class="px-2 text-secondary border-bottom-0">Pharmacy</th>
-            <th class="px-2 text-secondary border-bottom-0">&nbsp;</th>
+            <th class="px-2 text-secondary border-bottom-0 width-200px">Pharmacy</th>
         </tr>
         </thead>
         <tbody>
-            <tr v-for="(item, index) in items" :class="item.is_open ? '' : 'opacity-60'">
+            <tr v-for="(item, index) in items" :class="item.is_open ? '' : 'opacity-60 bg-light'">
                 <td class="px-2">@{{ index + 1 }}</td>
-                <td class="px-2">@{{item.medication}}</td>
-                <td class="px-2">@{{item.strength}}</td>
-                <td class="px-2">@{{item.amount}}</td>
-                <td class="px-2">@{{item.route}}</td>
-                <td class="px-2">@{{item.frequency}}</td>
-                <td class="px-2">@{{item.dispense}} <span class="text-secondary" v-html="inWords(item.dispense)"></span></td>
-                <td class="px-2">@{{item.refills}}</td>
-                <td class="px-2">@{{item.purpose}}</td>
-                <td class="px-2">@{{item.pharmacy}}</td>
                 <td class="px-2">
+                    <div class="d-flex align-items-center flex-wrap">
+                        <a href="#" class="font-weight-bold">@{{item.medication}}</a>
+                        <span class="d-inline-flex align-items-center" v-if="item.strength">
+                            <span class="mx-2 text-secondary">•</span>
+                            <span>@{{item.strength}}</span>
+                        </span>
+                        <span class="d-inline-flex align-items-center" v-if="item.amount">
+                            <span class="mx-2 text-secondary">•</span>
+                            <span>@{{item.amount}}</span>
+                        </span>
+                        <span class="d-inline-flex align-items-center" v-if="item.route">
+                            <span class="mx-2 text-secondary">•</span>
+                            <span>@{{item.route}}</span>
+                        </span>
+                        <span class="d-inline-flex align-items-center" v-if="item.frequency">
+                            <span class="mx-2 text-secondary">•</span>
+                            <span>@{{item.frequency}}</span>
+                        </span>
+                        <span class="d-inline-flex align-items-center" v-if="item.dispense">
+                            <span>
+                                <span class="mx-2 text-secondary">•</span>
+                                <span>Dispense:</span> @{{item.dispense}}
+                                <span class="text-secondary ml-1" v-html="inWords(item.dispense)"></span>
+                            </span>
+                        </span>
+                        <span class="d-inline-flex align-items-center" v-if="item.refills">
+                            <span class="mx-2 text-secondary">•</span>
+                            <span><span>Refills:</span> @{{item.refills}}</span>
+                        </span>
+                        <span class="d-inline-flex align-items-center" v-if="item.purpose">
+                            <span class="mx-2 text-secondary">•</span>
+                            <span><span>Purpose:</span> @{{item.purpose}}</span>
+                        </span>
+                    </div>
+                </td>
+                <td class="px-2">@{{item.pharmacy ? item.pharmacy : '-'}}</td>
+                {{--<td class="px-2">
                     <a class="mr-2 c-pointer" v-on:click.prevent="showPopup('erx-popup', item)">Edit</a>
                     <a class="mr-2 c-pointer" v-if="item.is_open" v-on:click.prevent="closeItem(item)">Close</a>
                     <a class="mr-2 c-pointer" v-if="!item.is_open" v-on:click.prevent="openItem(item)">Open</a>
-                    
+
                     @include('app.patient.partials.ticket_action_links')
-                </td>
+                </td>--}}
             </tr>
         </tbody>
     </table>
@@ -162,8 +188,12 @@
 <script>
     (function() {
         <?php
-        $tickets = $patient->tickets->filter(function($_item) {
-            return $_item->category === 'erx';
+        $tickets = $patient->tickets->filter(function($_item) use ($filter) {
+            $match = $_item->category === 'erx';
+            if($filter !== 'all') {
+                $match = $match && ($filter === 'open' ? $_item->is_open : !$_item->is_open);
+            }
+            return $match;
         });
         $items = [];
         foreach ($tickets as $ticket) {

+ 31 - 11
resources/views/app/patient/partials/imaging.blade.php

@@ -3,30 +3,46 @@
         <h4 class="font-weight-bold m-0 font-size-14"><i class="fa fa-image mr-2"></i>Imaging</h4>
         <span class="mx-2 text-secondary">|</span>
         <a class="py-0 font-weight-normal c-pointer" v-on:click.prevent="showPopup('imaging-popup')">Add</a>
+        <select class="ml-auto max-width-300px form-control form-control-sm"
+                onchange="fastLoad('/patients/view/{{$patient->uid}}/action-items-imaging/' + this.value, true, false, false)">
+            <option value="open" {{ $filter === 'open' ? 'selected' : '' }}>Open tickets</option>
+            <option value="closed" {{ $filter === 'closed' ? 'selected' : '' }}>Closed tickets</option>
+            <option value="all" {{ $filter === 'all' ? 'selected' : '' }}>All tickets</option>
+        </select>
     </div>
-    <table class="table table-sm table-bordered mb-0" style="table-layout: fixed">
+    <table class="table table-sm table-bordered mb-0">
         <thead>
         <tr class="bg-light">
             <th class="px-2 text-secondary border-bottom-0 width-30px">#</th>
             <th class="px-2 text-secondary border-bottom-0">Tests</th>
-            <th class="px-2 text-secondary border-bottom-0">ICDs</th>
             <th class="px-2 text-secondary border-bottom-0">Memo</th>
-            <th class="px-2 text-secondary border-bottom-0">&nbsp;</th>
         </tr>
         </thead>
         <tbody>
-        <tr v-for="(item, index) in items" :class="item.is_open ? '' : 'opacity-60'">
+        <tr v-for="(item, index) in items" :class="item.is_open ? '' : 'opacity-60 bg-light'">
             <td class="px-2">@{{ index + 1 }}</td>
-            <td class="px-2" v-html="item.tests && Array.isArray(item.tests) ? item.tests.join('<br>') : item.tests"></td>
-            <td class="px-2" v-html="item.icds && Array.isArray(item.icds) ? item.icds.join('<br>') : item.icds"></td>
-            <td class="px-2">@{{item.memo}}</td>
             <td class="px-2">
+                <div class="d-flex align-items-center flex-wrap">
+                    <div>
+                        <span class="text-secondary">Tests:</span>
+                        <a v-html="item.tests && Array.isArray(item.tests) ? item.tests.join(', ') : '-'"
+                           href="#" class="font-weight-bold"></a>
+                    </div>
+                    <span class="mx-2 text-secondary">•</span>
+                    <div>
+                        <span class="text-secondary">ICDs:</span>
+                        <span v-html="item.tests && Array.isArray(item.icds) ? item.icds.join(', ') : '-'"></span>
+                    </div>
+                </div>
+            </td>
+            <td class="px-2">@{{item.memo ? item.memo : '-'}}</td>
+            {{--<td class="px-2">
                 <a class="mr-2 c-pointer" v-on:click.prevent="showPopup('imaging-popup', item)">Edit</a>
                 <a class="mr-2 c-pointer" v-if="item.is_open" v-on:click.prevent="closeItem(item)">Close</a>
                 <a class="mr-2 c-pointer" v-if="!item.is_open" v-on:click.prevent="openItem(item)">Open</a>
 
-                @include('app.patient.partials.ticket_action_links')        
-            </td>
+                @include('app.patient.partials.ticket_action_links')
+            </td>--}}
         </tr>
         </tbody>
     </table>
@@ -92,8 +108,12 @@
 <script>
     (function() {
         <?php
-        $tickets = $patient->tickets->filter(function($_item) {
-            return $_item->category === 'imaging';
+        $tickets = $patient->tickets->filter(function($_item) use ($filter) {
+            $match = $_item->category === 'imaging';
+            if($filter !== 'all') {
+                $match = $match && ($filter === 'open' ? $_item->is_open : !$_item->is_open);
+            }
+            return $match;
         });
         $items = [];
         foreach ($tickets as $ticket) {

+ 30 - 10
resources/views/app/patient/partials/lab.blade.php

@@ -3,31 +3,47 @@
         <h4 class="font-weight-bold m-0 font-size-14"><i class="fa fa-vials mr-2"></i>Lab</h4>
         <span class="mx-2 text-secondary">|</span>
         <a class="py-0 font-weight-normal c-pointer" v-on:click.prevent="showPopup('lab-popup')">Add</a>
+        <select class="ml-auto max-width-300px form-control form-control-sm"
+                onchange="fastLoad('/patients/view/{{$patient->uid}}/action-items-lab/' + this.value, true, false, false)">
+            <option value="open" {{ $filter === 'open' ? 'selected' : '' }}>Open tickets</option>
+            <option value="closed" {{ $filter === 'closed' ? 'selected' : '' }}>Closed tickets</option>
+            <option value="all" {{ $filter === 'all' ? 'selected' : '' }}>All tickets</option>
+        </select>
     </div>
-    <table class="table table-sm table-bordered mb-0" style="table-layout: fixed">
+    <table class="table table-sm table-bordered mb-0">
         <thead>
         <tr class="bg-light">
             <th class="px-2 text-secondary border-bottom-0 width-30px">#</th>
             <th class="px-2 text-secondary border-bottom-0">Tests</th>
-            <th class="px-2 text-secondary border-bottom-0">ICDs</th>
             <th class="px-2 text-secondary border-bottom-0">Memo</th>
-            <th class="px-2 text-secondary border-bottom-0">&nbsp;</th>
         </tr>
         </thead>
         <tbody>
-            <tr v-for="(item, index) in items" :class="item.is_open ? '' : 'opacity-60'">
+            <tr v-for="(item, index) in items" :class="item.is_open ? '' : 'opacity-60 bg-light'">
                 <td class="px-2">@{{ index + 1 }}</td>
-                <td class="px-2" v-html="item.tests && Array.isArray(item.tests) ? item.tests.join('<br>') : item.tests"></td>
-                <td class="px-2" v-html="item.icds && Array.isArray(item.icds) ? item.icds.join('<br>') : item.icds"></td>
-                <td class="px-2">@{{item.memo}}</td>
                 <td class="px-2">
+                    <div class="d-flex align-items-center flex-wrap">
+                        <div>
+                            <span class="text-secondary">Tests:</span>
+                            <a v-html="item.tests && Array.isArray(item.tests) ? item.tests.join(', ') : '-'"
+                               href="#" class="font-weight-bold"></a>
+                        </div>
+                        <span class="mx-2 text-secondary">•</span>
+                        <div>
+                            <span class="text-secondary">ICDs:</span>
+                            <span v-html="item.tests && Array.isArray(item.icds) ? item.icds.join(', ') : '-'"></span>
+                        </div>
+                    </div>
+                </td>
+                <td class="px-2">@{{item.memo ? item.memo : '-'}}</td>
+                {{--<td class="px-2">
                     <a class="mr-2 c-pointer" v-on:click.prevent="showPopup('lab-popup', item)">Edit</a>
                     <a class="mr-2 c-pointer" v-if="item.is_open" v-on:click.prevent="closeItem(item)">Close</a>
                     <a class="mr-2 c-pointer" v-if="!item.is_open" v-on:click.prevent="openItem(item)">Open</a>
 
                     @include('app.patient.partials.ticket_action_links')
 
-                </td>
+                </td>--}}
             </tr>
         </tbody>
     </table>
@@ -96,8 +112,12 @@
 <script>
     (function() {
         <?php
-        $tickets = $patient->tickets->filter(function($_item) {
-            return $_item->category === 'lab';
+        $tickets = $patient->tickets->filter(function($_item) use ($filter) {
+            $match = $_item->category === 'lab';
+            if($filter !== 'all') {
+                $match = $match && ($filter === 'open' ? $_item->is_open : !$_item->is_open);
+            }
+            return $match;
         });
         $items = [];
         foreach ($tickets as $ticket) {

+ 5 - 5
routes/web.php

@@ -101,11 +101,11 @@ Route::middleware('pro.auth')->group(function () {
         Route::get('immunizations', 'PatientController@immunizations')->name('immunizations');
         Route::get('allergies', 'PatientController@allergies')->name('allergies');
         Route::get('action-items', 'PatientController@actionItems')->name('action-items');
-        Route::get('action-items-erx', 'PatientController@actionItemsErx')->name('action-items-erx');
-        Route::get('action-items-lab', 'PatientController@actionItemsLab')->name('action-items-lab');
-        Route::get('action-items-imaging', 'PatientController@actionItemsImaging')->name('action-items-imaging');
-        Route::get('action-items-equipment', 'PatientController@actionItemsEquipment')->name('action-items-equipment');
-        Route::get('action-items-other', 'PatientController@actionItemsOther')->name('action-items-other');
+        Route::get('action-items-erx/{filter?}', 'PatientController@actionItemsErx')->name('action-items-erx');
+        Route::get('action-items-lab/{filter?}', 'PatientController@actionItemsLab')->name('action-items-lab');
+        Route::get('action-items-imaging/{filter?}', 'PatientController@actionItemsImaging')->name('action-items-imaging');
+        Route::get('action-items-equipment/{filter?}', 'PatientController@actionItemsEquipment')->name('action-items-equipment');
+        Route::get('action-items-other/{filter?}', 'PatientController@actionItemsOther')->name('action-items-other');
         Route::get('notes/{filter?}', 'PatientController@notes')->name('notes');
         Route::name('notes.view.')->prefix('notes/view/{note}')->group(function () {
             Route::get('', 'NoteController@dashboard')->name('dashboard');