Преглед изворни кода

ERx / Orders nav tree & related

Vijayakrishnan пре 4 година
родитељ
комит
f789d6e5f4

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

@@ -337,10 +337,10 @@ class PatientController extends Controller
         return view('app.patient.vitals-graph', compact('patient', 'pros', 'filter'));
     }
 
-    public function tickets(Request $request, Client $patient) {
+    public function tickets(Request $request, Client $patient, $type = '') {
         $pros = $this->pros;
         $allPros = Pro::all();
-        return view('app.patient.tickets', compact('patient', 'pros', 'allPros'));
+        return view('app.patient.tickets', compact('patient', 'pros', 'allPros', 'type'));
     }
 
     public function appointments(Request $request, Client $patient, $forPro = 'all', $status = 'all') {

+ 1 - 1
public/css/style.css

@@ -65,7 +65,7 @@
     list-style: none;
 }
 .sidebar .nav-item .nav-child-list .nav-item .nav-link {
-    padding-left: 2.75rem;
+    padding-left: 2rem;
 }
 .sidebar .if-not-collapsed, .sidebar .if-collapsed {
     display: none;

+ 22 - 6
resources/views/app/patient/tickets.blade.php

@@ -53,8 +53,16 @@
     <script src="/select2/select2.min.js"></script>
     <div id="ticketsApp" v-cloak>
         <div class="d-flex align-items-end pb-0">
-            <h4 class="font-weight-bold m-0 font-size-14">Tickets</h4>
-            <select class="ml-auto max-width-300px form-control form-control-sm pr-2"
+            <h4 class="font-weight-bold m-0 font-size-16">ERx / Orders</h4>
+            <select class="ml-auto max-width-200px form-control form-control-sm pr-2"
+                    onchange="return fastLoad('/patients/view/{{$patient->uid}}/tickets/' + this.value, true, false, false)">
+                <option value="" {{$type === '' ? 'selected' : ''}}>All</option>
+                <option value="erx" {{$type === 'erx' ? 'selected' : ''}}>ERx</option>
+                <option value="lab" {{$type === 'lab' ? 'selected' : ''}}>Lab Orders</option>
+                <option value="imaging" {{$type === 'imaging' ? 'selected' : ''}}>Imaging Orders</option>
+                <option value="equipment" {{$type === 'equipment' ? 'selected' : ''}}>Equipment Orders</option>
+            </select>
+            <select class="ml-2 max-width-200px form-control form-control-sm pr-2"
                     v-model="statusFilter">
                 <option value="open">Open tickets (@{{ numOpen }})</option>
                 <option value="closed">Closed tickets (@{{ numClosed }})</option>
@@ -62,10 +70,18 @@
             </select>
         </div>
 
-        @include('app.patient.tickets.erx')
-        @include('app.patient.tickets.lab')
-        @include('app.patient.tickets.imaging')
-        @include('app.patient.tickets.equipment')
+        @if($type === '' || $type === 'erx')
+            @include('app.patient.tickets.erx')
+        @endif
+        @if($type === '' || $type === 'lab')
+            @include('app.patient.tickets.lab')
+        @endif
+        @if($type === '' || $type === 'imaging')
+            @include('app.patient.tickets.imaging')
+        @endif
+        @if($type === '' || $type === 'equipment')
+            @include('app.patient.tickets.equipment')
+        @endif
 
         @include('app.patient.tickets.ticket_send_fax_form')
     </div>

+ 24 - 2
resources/views/layouts/patient.blade.php

@@ -82,8 +82,30 @@
                             </ul>
                         </li> */ ?>
                         <li class="nav-item">
-                            <a class="nav-link {{ strpos($routeName, 'patients.view.tickets') === 0 ? 'active' : '' }}"
-                               href="{{ route('patients.view.patient-tickets', ['patient' => $patient]) }}">Tickets</a>
+                            <a class="nav-link {{ strpos($routeName, 'patients.view.patient-tickets') === 0 ? 'active' : '' }}"
+                               href="{{ route('patients.view.patient-tickets', ['patient' => $patient]) }}">ERx / Orders</a>
+                            <ul class="m-0 p-0 nav-child-list">
+                                <li class="nav-item">
+                                    <a class="nav-link {{ strpos($routeName, 'patients.view.patient-tickets') === 0 && @$type === '' ? 'active' : '' }}"
+                                       href="{{ route('patients.view.patient-tickets', ['patient' => $patient, 'type' => '']) }}">All</a>
+                                </li>
+                                <li class="nav-item">
+                                    <a class="nav-link {{ strpos($routeName, 'patients.view.patient-tickets') === 0 && @$type === 'erx' ? 'active' : '' }}"
+                                       href="{{ route('patients.view.patient-tickets', ['patient' => $patient, 'type' => 'erx']) }}">ERx</a>
+                                </li>
+                                <li class="nav-item">
+                                    <a class="nav-link {{ strpos($routeName, 'patients.view.patient-tickets') === 0 && @$type === 'lab' ? 'active' : '' }}"
+                                       href="{{ route('patients.view.patient-tickets', ['patient' => $patient, 'type' => 'lab']) }}">Lab</a>
+                                </li>
+                                <li class="nav-item">
+                                    <a class="nav-link {{ strpos($routeName, 'patients.view.patient-tickets') === 0 && @$type === 'imaging' ? 'active' : '' }}"
+                                       href="{{ route('patients.view.patient-tickets', ['patient' => $patient, 'type' => 'imaging']) }}">Imaging</a>
+                                </li>
+                                <li class="nav-item">
+                                    <a class="nav-link {{ strpos($routeName, 'patients.view.patient-tickets') === 0 && @$type === 'equipment' ? 'active' : '' }}"
+                                       href="{{ route('patients.view.patient-tickets', ['patient' => $patient, 'type' => 'equipment']) }}">Equipment</a>
+                                </li>
+                            </ul>
                         </li>
                         <li class="nav-item">
                             <a class="nav-link {{ strpos($routeName, 'patients.view.incoming-reports') === 0 ? 'active' : '' }}"

+ 1 - 1
routes/web.php

@@ -172,7 +172,7 @@ Route::middleware('pro.auth')->group(function () {
         Route::get('vitals-graph/{filter?}', 'PatientController@vitalsGraph')->name('vitals-graph');
 
         // tickets
-        Route::get('tickets', 'PatientController@tickets')->name('patient-tickets');
+        Route::get('tickets/{type?}', 'PatientController@tickets')->name('patient-tickets');
 
         // appointments
         Route::get('appointments/{forPro}/{status}', 'PatientController@appointments')->name('appointments');