浏览代码

fixed client pros

= 3 年之前
父节点
当前提交
892ee68f88

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

@@ -8,6 +8,7 @@ use App\Models\CareMonth;
 use App\Models\Client;
 use App\Models\ClientBDTDevice;
 use App\Models\ClientInfoLine;
+use App\Models\ClientProAccess;
 use App\Models\Erx;
 use App\Models\Facility;
 use App\Models\Handout;
@@ -619,4 +620,9 @@ class PatientController extends Controller
             'careMonth' => $careMonth,
         ]);
     }
+
+    public function clientProAccess(Request $request, Client $patient) {
+        $rows = ClientProAccess::where('client_id', $patient->id)->get();
+        return view('app.patient.client-pro-access', compact('patient', 'rows'));
+    }
 }

+ 2 - 2
app/Models/Client.php

@@ -521,13 +521,13 @@ class Client extends Model
         $pro = $this->rme;
         if ($pro && $pro->id) $pros[] = ["pro" => $pro->displayName(), "association" => 'RME'];
         $pro = $this->defaultNaPro;
-        if ($pro && $pro->id) $pros[] = ["pro" => $pro->displayName(), "association" => 'Nurse'];
+        if ($pro && $pro->id) $pros[] = ["pro" => $pro->displayName(), "association" => 'Care Coordinator'];
 
         // via client pro access
         $cpAccesses = ClientProAccess::where('client_id', $this->id)->where('is_active', true)->get();
         foreach ($cpAccesses as $cpAccess) {
             if (!$cpAccess->pro) continue;
-            $pros[] = ["pro" => $cpAccess->pro->displayName(), "association" => 'Via Client-Pro Access'];
+            $pros[] = ["pro" => $cpAccess->pro->displayName(), "association" => $cpAccess->reason_category. ' - Via Client Pro Access', 'isClientProAccess'=>true];
         }
 
         // via appointments

+ 59 - 0
resources/views/app/patient/client-pro-access.blade.php

@@ -0,0 +1,59 @@
+@extends ('layouts.patient')
+@section('inner-content')
+    <div class="">
+        <div class="d-flex align-items-center pb-2">
+            <h4 class="font-weight-bold m-0">Pros With Access</h4>
+            <div class="d-inline ml-2">
+                <div moe>
+                    <a href="" start>Add Client Pro Access</a>
+                    <form action="" url="/api/clientProAccess/create">
+                        <input type="hidden" value="{{$patient->uid}}" name="clientUid">
+                        <div class="form-group">
+                            <label for="" class="control-label">Pro</label>
+                            <select provider-search name="proUid" id="" class="form-control input-sm">
+                            </select>
+                        </div>
+                        <div class="form-group">
+                            <label for="" class="control-label">Reason category</label>
+                            <input type="text" name="reasonCategory" class="form-control input-sm">
+                        </div>
+                        <div class="form-group">
+                            <label for="" class="control-label">Reason memo</label>
+                            <textarea name="reasonMemo" class="form-control input-sm"></textarea>
+                        </div>
+                        <div class="form-group">
+                            <button class="btn btn-primary btn-sm" submit>Submit</button>
+                            <button class="btn btn-danger btn-sm" cancel>Cancel</button>
+                        </div>
+                    </form>
+                </div>
+            </div>
+        </div>
+        <table class="table table-striped table-sm table-bordered mb-0">
+            @if($rows && count($rows))
+                <thead class="bg-light">
+                <tr>
+                    <th class="border-0 text-secondary">Pro</th>
+                    <th class="border-0 text-secondary">Reason category</th>
+                    <th class="border-0 text-secondary">Reason memo</th>
+                </tr>
+                </thead>
+                <tbody>
+                @foreach($rows as $row)
+                    <tr>
+                        <td class="">{{ $row->pro->name_display }}</td>
+                        <td>{{ $row->reason_category}}</td>
+                        <td>{{ $row->reason_memo}}</td>
+                    </tr>
+                @endforeach
+                </tbody>
+            @else
+                <tbody>
+                    <tr>
+                        <td class="text-secondary p-3">No client pro access records.</td>
+                    </tr>
+                </tbody>
+            @endif
+        </table>
+    </div>
+@endsection

+ 25 - 0
resources/views/app/patient/pros.blade.php

@@ -3,6 +3,31 @@
     <div class="">
         <div class="d-flex align-items-center pb-2">
             <h4 class="font-weight-bold m-0">Pros With Access</h4>
+            <div class="d-inline ml-2">
+                <div moe>
+                    <a href="" start>Add Client Pro Access</a>
+                    <form action="" url="/api/clientProAccess/create">
+                        <input type="hidden" value="{{$patient->uid}}" name="clientUid">
+                        <div class="form-group">
+                            <label for="" class="control-label">Pro</label>
+                            <select provider-search name="proUid" id="" class="form-control input-sm">
+                            </select>
+                        </div>
+                        <div class="form-group">
+                            <label for="" class="control-label">Reason category</label>
+                            <input type="text" name="reasonCategory" class="form-control input-sm">
+                        </div>
+                        <div class="form-group">
+                            <label for="" class="control-label">Reason memo</label>
+                            <textarea name="reasonMemo" class="form-control input-sm"></textarea>
+                        </div>
+                        <div class="form-group">
+                            <button class="btn btn-primary btn-sm" submit>Submit</button>
+                            <button class="btn btn-danger btn-sm" cancel>Cancel</button>
+                        </div>
+                    </form>
+                </div>
+            </div>
         </div>
         <table class="table table-striped table-sm table-bordered mb-0">
             @php $prosWithAccess = $patient->prosWithAccess(); @endphp

+ 6 - 0
resources/views/layouts/patient.blade.php

@@ -243,6 +243,12 @@ $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_creat
 							<a class="nav-link {{ strpos($routeName, 'patients.view.pros') === 0 ? 'active' : '' }}"
 							   href="{{ route('patients.view.pros', ['patient' => $patient]) }}">Pros</a>
 						</li>
+						@if($performer->pro->pro_type == 'ADMIN')
+						<li class="nav-item">
+							<a class="nav-link {{ strpos($routeName, 'patients.view.client-pro-access') === 0 ? 'active' : '' }}"
+							   href="{{ route('patients.view.client-pro-access', ['patient' => $patient]) }}">Client Pro Access</a>
+						</li>
+						@endif
 						<li class="nav-item">
 							<a class="nav-link" href="/patients/view/{{ $patient->uid }}/intake">Intake</a>
 						</li>

+ 2 - 0
routes/web.php

@@ -399,6 +399,8 @@ Route::middleware('pro.auth')->group(function () {
         Route::get('patients/view/insurance-coverage/{patient}', 'PatientController@insuranceCoverage')->name('patients.view.insurance-coverage');
         Route::get('patients/view/client-primarycoverages/{patient}', 'PatientController@clientPrimaryCoverages')->name('patients.view.client-primary-coverages');
         Route::get('patients/view/primary-coverage/{patient}', 'PatientController@primaryCoverage')->name('patients.view.primary-coverage');
+        Route::get('patients/view/client-pro-access/{patient}', 'PatientController@clientProAccess')->name('patients.view.client-pro-access');
+
         Route::get('patients/view/primary-coverage-form/{patient}', 'PatientController@primaryCoverageForm')->name('patients.view.primary-coverage-form');
         Route::get('patients/view/primary-coverage-manual-determination-modal/{patient}', 'PatientController@primaryCoverageManualDeterminationModal')->name('patients.view.primary-coverage-manual-determination-modal');
     // });