Эх сурвалжийг харах

added points filter/fixed insurance initial form

= 1 жил өмнө
parent
commit
190a92a6ca

+ 12 - 6
app/Http/Controllers/AdminController.php

@@ -738,28 +738,28 @@ class AdminController extends Controller
             ->where('category', '!=', 'REVIEW')
             ->where('category', '!=', 'PLAN');
 
+        $intentions = DB::select("SELECT intention, COUNT(intention) as count FROM point WHERE intention is not null and is_removed is not true  and category != 'REVIEW' and category != 'PLAN' GROUP BY intention ORDER BY intention ASC");
         $categories = [];
         $names = [];
 
-
-
         if ($request->input('mcp')) {
             $mcp = Pro::where('uid', trim($request->input('mcp')))->first();
             if ($mcp) {
-                $points = $points->where('created_by_pro_id', $mcp->id);
+              //  $points = $points->where('created_by_pro_id', $mcp->id);
             }
         }
 
+        $implodedIntentions = null;
         if ($request->input('intentions')) {
             $points = $points->whereIn('intention', $request->input('intentions'));
             $implodedIntentions = join("','", $request->input('intentions'));
-            $categories = DB::select("SELECT category, COUNT(category) as count FROM point WHERE intention in ('" . $implodedIntentions . "')  GROUP BY category ORDER BY category ASC");
+            $categories = DB::select("SELECT category, COUNT(id) as count FROM point WHERE intention in ('" . $implodedIntentions . "') and is_removed is not true  and category != 'REVIEW' and category != 'PLAN' GROUP BY category ORDER BY category ASC");
         }
 
         if ($request->input('categories')) {
             $points = $points->whereIn('category', $request->input('categories'));
             $implodedCategories = join("','", $request->input('categories'));
-            $names = DB::select("select (data::json)->>'name' as name, count(id) as count from point where category in ('".$implodedCategories."') group by 1 order by 1 asc");
+            $names = DB::select("select (data::json)->>'name' as name, count(id) as count from point where category in ('".$implodedCategories."') and is_removed is not true  and intention in ('".$implodedIntentions."')  and category != 'REVIEW' and category != 'PLAN' group by 1 order by 1 asc");
         }
 
         if ($request->input('names')){
@@ -773,11 +773,17 @@ class AdminController extends Controller
         $tableName = $_point->getTable();
         $columns = Schema::getColumnListing($tableName);
 
-        $intentions = DB::select("SELECT intention, COUNT(intention) as count FROM point WHERE intention is not null  GROUP BY intention ORDER BY intention ASC");
 
         return view('app.admin.points.index', compact('points', 'filters', 'columns', 'intentions', 'categories', 'names'));
     }
 
+    public function pointDetails(Request  $request, $uid){
+        $point = Point::where('uid', $uid)->first();
+        $tableName = $point->getTable();
+        $columns = Schema::getColumnListing($tableName);
+        return view('app.admin.points.record-details', compact('point', 'columns'));
+    }
+
     public function messages(Request $request)
     {
         $messages = InternalMessage::orderBy('created_at', 'desc')->paginate(50);

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 4 - 0
public/unpoly/unpoly.min.css


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
public/unpoly/unpoly.min.js


+ 38 - 36
resources/views/app/admin/points/filters.blade.php

@@ -26,7 +26,7 @@
         margin-bottom: 10px;
     }
 </style>
-<form id="admin-points-filters" method="GET" action="{{ route('admin.points') }}"  >
+<form id="admin-points-filters" method="GET" action="{{ route('admin.points') }}" up-autosubmit>
     <div class="">
         <fieldset name="Intentions">
             <legend>
@@ -35,7 +35,8 @@
             @foreach($intentions as $intention)
                 <div class="d-inline-block">
                     <label for="">
-                        <input type="checkbox" name="intentions[]"  value="{{$intention->intention}}" @if(isset($filters['intentions']) && in_array($intention->intention, $filters['intentions'])) checked @endif>
+                        <input type="checkbox" name="intentions[]" value="{{$intention->intention}}"
+                               @if(isset($filters['intentions']) && in_array($intention->intention, $filters['intentions'])) checked @endif>
                         {{$intention->intention}}({{$intention->count}})
                     </label>
                 </div>
@@ -44,59 +45,60 @@
     </div>
 
     @if(isset($categories) && count($categories))
-    <div class="">
-        <fieldset name="Categories">
-            <legend>
-                Categories
-            </legend>
-            @foreach($categories as $category)
-                <div class="d-inline-block">
-                    <label for="">
-                        <input type="checkbox" name="categories[]"  value="{{$category->category}}" @if(isset($filters['categories']) && in_array($category->category, $filters['categories'])) checked @endif>
-                        {{$category->category}}({{$category->count}})
-                    </label>
-                </div>
-            @endforeach
-        </fieldset>
-    </div>
-    @endif
-
-    @if(isset($names) && count($names))
         <div class="">
-            <fieldset name="Names">
+            <fieldset name="Categories">
                 <legend>
-                    Data
+                    Categories
                 </legend>
-                @foreach($names as $name)
                     <div class="d-inline-block">
-                        <label for="">
-                            <input type="checkbox" name="names[]"
-                                   value="{{$name->name}}"
-                                   @if(isset($filters['names']) && in_array($name->name, $filters['names'])) checked @endif>
-                            {{$name->name}}({{$name->count}})
-                        </label>
+                        <select class="select2" name="categories[]" multiple>
+                            <option value="">--select--</option>
+                            @foreach($categories as $category)
+                                <option value="{{$category->category}}"
+                                        @if(isset($filters['categories']) && in_array($category->category, $filters['categories'])) selected @endif>
+                                    {{$category->category}}({{$category->count}})
+                                </option>
+                            @endforeach
+                        </select>
+
                     </div>
-                @endforeach
             </fieldset>
         </div>
     @endif
 
-    <div class="">
+    @if(isset($names) && count($names))
         <div class="">
-            <label>Name:</label>
-            <input name="name" class="form-control input-sm" value=""  >
+            <fieldset name="Names">
+                <legend>
+                    Data
+                </legend>
+
+                <div class="d-inline-block">
+
+                    <select class="select2" name="names[]" multiple>
+                        <option value="">--select--</option>
+                        @foreach($names as $name)
+                            <option value="{{$name->name}}"
+                                    @if(isset($filters['names']) && in_array($name->name, $filters['names'])) selected @endif>
+                                {{$name->name}}({{$name->count}})
+                            </option>
+                        @endforeach
+                    </select>
+                </div>
+
+            </fieldset>
         </div>
-    </div>
+    @endif
 
 
     <div>
         <div class="">
             <label>&nbsp;</label>
             <div class=" d-flex">
-                <button  class="btn btn-primary btn-sm mr-2"><i
+                <button class="btn btn-primary btn-sm mr-2"><i
                         class="fas fa-filter"></i> Filter
                 </button>
-                <a href="#"
+                <a href="{{ route('admin.points') }}"
                    class="btn btn-link btn-sm text-danger">Clear</a>
             </div>
         </div>

+ 20 - 26
resources/views/app/admin/points/record-details.blade.php

@@ -1,30 +1,24 @@
-<div moe relative class="mt-1">
-    <a class="text-nowrap" href="" show start>View Details</a>
-    <form url="" right>
-        <div class="mb-2" style="width: 500px;">
-            <table class="table table-sm border w-100">
-                <tbody>
-                    @foreach($columns as $column)
-                    <tr>
-                        <th>{{ $column }}</th>
-                        <td class="text-wrap">
-                            @if($column === 'data')
-                            <?php
+<div>
+    <div class="mb-2" style="width: 500px;">
+        <table class="table table-sm border w-100">
+            <tbody>
+            @foreach($columns as $column)
+                <tr>
+                    <th>{{ $column }}</th>
+                    <td class="text-wrap">
+                        @if($column === 'data')
+                                <?php
                                 $__data = json_decode($point->{$column}, true);
                                 var_dump($__data);
 //                                parseRender($__data);
-                            ?>
-                            @else
-                            <?= $point->{$column} ?>
-                            @endif
-                        </td>
-                    </tr>
-                    @endforeach
-                </tbody>
-            </table>
-        </div>
-        <div>
-            <button class="btn btn-default border btn-sm" cancel>Close</button>
-        </div>
-    </form>
+                                ?>
+                        @else
+                                <?= $point->{$column} ?>
+                        @endif
+                    </td>
+                </tr>
+            @endforeach
+            </tbody>
+        </table>
+    </div>
 </div>

+ 1 - 1
resources/views/app/admin/points/table.blade.php

@@ -56,7 +56,7 @@
                     @endif
                 </td>
                 <td>
-                    @include('app.admin.points.record-details')
+                    <a class="text-nowrap" href="{{route('admin.points.view', $point->uid)}}" up-layer="new modal right" up-target show start>View Details</a>
                 </td>
             </tr>
             @endforeach

+ 7 - 6
resources/views/app/patient/partials/coverage-information.blade.php

@@ -3,6 +3,7 @@
         $cpc = $coverage;
         $latestCpc = $patient->latestClientPrimaryCoverage;
     @endphp
+
 </div>
     @if(!$cpc)
         <div class="alert alert-info">No coverage for this client</div>
@@ -12,15 +13,15 @@
             $creationStrategy = $cpc->creation_strategy ?? null;
             if($creationStrategy === 'NEW' || $creationStrategy === 'AUTO_REFRESH'){
                 if($cpc->plan_type === 'MEDICARE'){
-                   $cpc->auto_detail_json = json_decode($cpc->auto_medicare_detail_json ?? null); 
+                   $cpc->auto_detail_json = json_decode($cpc->auto_medicare_detail_json ?? null);
                 }
                 if($cpc->plan_type === 'MEDICID'){
-                    $cpc->auto_detail_json = json_decode($cpc->auto_medicaid_detail_json ?? null); 
+                    $cpc->auto_detail_json = json_decode($cpc->auto_medicaid_detail_json ?? null);
                 }
                 if($cpc->plan_type === 'COMMERCIAL'){
-                    $cpc->auto_detail_json = json_decode($cpc->auto_commercial_detail_json ?? null); 
+                    $cpc->auto_detail_json = json_decode($cpc->auto_commercial_detail_json ?? null);
                 }
-                
+
             }
         ?>
         <div class="d-flex align-items-center mb-2">
@@ -28,7 +29,7 @@
             <span class="mx-1 text-muted text-sm">|</span>
             @if($cpc->is_manually_determined)
                 <div>
-                    <span class="d-inline bg-warning px-2 py-1 rounded mr-1"><i class="fas fa-map-pin"></i> Manually Determined</span> 
+                    <span class="d-inline bg-warning px-2 py-1 rounded mr-1"><i class="fas fa-map-pin"></i> Manually Determined</span>
                     @if($cpc->is_cancelled)
                     <span class="mr-1 text-danger text-sm">Cancelled</span>
                     @else
@@ -36,7 +37,7 @@
                     @endif
                     <span class="mx-1 text-muted text-sm">|</span>
                 </div>
-                
+
             @else
 
             @endif

+ 5 - 5
resources/views/app/patient/primary-coverage-form.blade.php

@@ -35,19 +35,19 @@ $cpc = $patient->getPrimaryCoverage();
 				<div class="row" v-show="insuranceCardType == 'commercial'">
 					<div class="form-group col-md-6">
 						<label class="control-label">Insurance</label>
-						<input type="text" name="carrierFreeText" class="form-control input-sm">
+						<input type="text" name="carrierFreeText" class="form-control input-sm" value="{{$cpc->carrier_free_text}}">
 					</div>
 					<div class="form-group col-md-6">
 						<label class="control-label">ID Number</label>
-						<input type="text" name="commercialMemberIdentifier" class="form-control input-sm">
+						<input type="text" name="commercialMemberIdentifier" class="form-control input-sm" value="{{$cpc->commercial_member_identifier}}">
 					</div>
 					<div class="form-group col-md-6">
 						<label class="control-label">Group Number</label>
-						<input type="text" name="commercialGroupNumber" class="form-control input-sm">
+						<input type="text" name="commercialGroupNumber" class="form-control input-sm" value="{{$cpc->commercial_group_number}}">
 					</div>
 					<div class="form-group col-md-6">
 						<label class="control-label">Support Phone Number</label>
-						<input type="text" name="primaryInsurancePhoneNumberForHcps" class="form-control input-sm phone" stag-input-phone>
+						<input type="text" name="primaryInsurancePhoneNumberForHcps" class="form-control input-sm phone"  stag-input-phone value="{{$cpc->primary_insurance_phone_number_for_hcps}}">
 					</div>
 				</div>
 
@@ -393,7 +393,7 @@ $cpc = $patient->getPrimaryCoverage();
 						});
 					},
 					init: function() {
-						
+
 					}
 				},
 				mounted: function() {

+ 18 - 0
resources/views/layouts/template-simple.blade.php

@@ -14,7 +14,12 @@
 
     {{-- Quill RTE --}}
 
+    <script src="/js/jquery-3.5.1.min.js"></script>
+    <script src="/select2/select2.min.js"></script>
+
     <!-- <link href="{{ asset('bootstrap-4.5.0/css/bootstrap.css') }}" rel="stylesheet"> -->
+    <link rel="stylesheet" href="/unpoly/unpoly.min.css">
+    <link rel="stylesheet" href="/select2/select2.min.css">
     <link rel="stylesheet" href="/fontawesome-free-5.13.1-web/css/all.min.css">
     <link href="{{ asset('/css/app.css') }}?v={{config('app.asset_version')}}" rel="stylesheet">
     <link href="{{ asset('/css/style.css') }}?v={{config('app.asset_version')}}" rel="stylesheet">
@@ -53,9 +58,22 @@
     <!-- shortcut/suggest component -->
     <link href="/css/shortcut.css?v={{config('app.asset_version')}}" rel=stylesheet>
 
+    <script src="/unpoly/unpoly.min.js"></script>
+
+
+    <script>
+        up.compiler('.select2', function(element) {
+                $('.select2').select2({
+                    display: 'none'
+                });
 
+                $('.select2').on('change', function (e) {
+                    up.submit('form')
+                });
 
+        })
 
+    </script>
 </body>
 
 </html>

+ 1 - 0
routes/web.php

@@ -282,6 +282,7 @@ Route::middleware('pro.auth')->group(function () {
         Route::get('get-create-new-patient-script-template', 'AdminController@getCreateNewPatientScriptTemplate')->name('getCreateNewPatientScriptTemplate');
         Route::get('patients-missing-defult-settings', 'AdminController@patientsMissingDefasultSettings')->name('patientsMissingDefasultSettings');
         Route::get('points', 'AdminController@points')->name('points');
+        Route::get('/points/view/{uid}', 'AdminController@pointDetails')->name('points.view');
 //        Route::get('patients-notes-points-filter', 'AdminController@patientsNotesPointsFilter')->name('patients-notes-points-filter');
     });
     Route::middleware('pro.auth.admin')->group(function () {

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно