瀏覽代碼

added where chart number ends with

= 3 年之前
父節點
當前提交
cca7047b49
共有 2 個文件被更改,包括 25 次插入0 次删除
  1. 8 0
      app/Http/Controllers/AdminController.php
  2. 17 0
      resources/views/app/admin/patients_filters.blade.php

+ 8 - 0
app/Http/Controllers/AdminController.php

@@ -94,6 +94,14 @@ class AdminController extends Controller
             }
         }
 
+        if ($request->input('chart_number_ends_with')) {
+            if($request->input('chart_number_ends_with') == 'ZERO'){
+                $patients = $patients->where('chart_number', 'ILIKE' , '%0');
+            }else{
+                $patients = $patients->where('chart_number', 'ILIKE' , '%'.$request->input('chart_number_ends_with'));
+            }
+        }
+
         $this->filterMultiQuery($request, $patients, 'age_in_years', 'age_category', 'age_value_1', 'age_value_2');
         $this->filterSimpleQuery($request, $patients, 'sex', 'sex');
         $this->filterMultiQuery($request, $patients, 'usual_bmi_max', 'bmi_category', 'bmi_value_1', 'bmi_value_2');

+ 17 - 0
resources/views/app/admin/patients_filters.blade.php

@@ -190,6 +190,23 @@
 	</div>
 	@endif
 
+	@if($performer->pro->pro_type == 'ADMIN')
+	<div class="sm-section">
+		<div class="">
+			<label>Chart # ends with:</label>
+			<select class="form-control"  name="chart_number_ends_with" v-model="filters.chart_number_ends_with">
+				@php 
+					$chartNumbers = [1,2,3,4,5,6,7,8,9]
+				@endphp
+				<option value="ZERO">0</option>
+				@foreach($chartNumbers as $chartNum)
+					<option value="{{$chartNum}}">{{$chartNum}}</option>
+				@endforeach
+			</select>
+		</div>
+	</div>
+	@endif
+
 	@if($performer->pro->pro_type == 'ADMIN')
 	<div class="sm-section">
 		<div class="">