Samson Mutunga 3 년 전
부모
커밋
9f52dfcb72

+ 3 - 4
app/Http/Controllers/HomeController.php

@@ -1395,11 +1395,10 @@ WHERE cl.shadow_pro_id IS NULL
             return $this->dashboard_MCP($request);
         }elseif($pro->is_hcp){
             return $this->dashboard_HCP($request); //TODO for HCP
-        }elseif($pro->is_considered_for_dna){
-            return $this->dashboard_DNA($request);
-        }else{
-            //check for physician supervisor here
+        }elseif($pro->is_considered_for_supervising_physician){
             return redirect()->route('ps.dashboard');
+        }else{
+            return $this->dashboard_DNA($request);
         }
     }
 

+ 7 - 1
app/Http/Controllers/PatientController.php

@@ -295,7 +295,13 @@ class PatientController extends Controller
     }
 
     public function reviewRequests(Request $request, Client $patient){
-        $reviewRequests = ClientReviewRequest::where('client_id', $patient->id)->orderBy('created_at', 'DESC')->paginate(50);
+        $pro = $this->performer->pro;
+
+        $reviewRequests = ClientReviewRequest::where('client_id', $patient->id);
+        if($pro->pro_type !== 'ADMIN'){
+            $reviewRequests = $reviewRequests->where('pro_id', $pro->id);
+        }
+        $reviewRequests = $reviewRequests->orderBy('created_at', 'DESC')->paginate(50);
         return view('app.patient.review-requests.list', compact('patient', 'reviewRequests'));
     }
 

+ 5 - 0
app/Models/Pro.php

@@ -1364,4 +1364,9 @@ ORDER BY cm.created_at DESC
     {
         return $this->hasMany(ClientReviewRequest::class, 'pro_id')->where('is_active', true);
     }
+
+    public function currentMonthClientReviewRequest($clientID){
+        return $this->activeClientReviewRequests->where('client_id', $clientID)->where('scoped_month_start_date', date('Y-m-01'))->first();
+
+    }
 }

+ 530 - 500
resources/views/app/patient/dashboard.blade.php

@@ -1,361 +1,393 @@
 @extends ('layouts.patient')
 
 @section('inner-content')
-    <?php
-    $shortCutsObject = [];
-    foreach ($pro->allShortcuts() as $shortcut) {
-
-        // %replaceables%
-        $shortcut->text = str_replace("%AGE%", $patient->age_in_years, $shortcut->text);
-        $shortcut->text = str_replace("%GENDER%", $patient->sex, $shortcut->text);
-        $shortcut->text = str_replace("%NAME%", $patient->displayName(), $shortcut->text);
-
-        $shortCutsObject[] = [
-            "name" => $shortcut->shortcut,
-            "value" => $shortcut->text
-        ];
-    }
-    ?>
-    <script>window.userShortcuts = <?= json_encode($shortCutsObject); ?>;</script>
-    <link href="/select2/select2.min.css" rel="stylesheet" />
-    <script src="/select2/select2.min.js"></script>
-    <div>
-
-        {{-- CARE PLAN START --}}
-        <?php $infoLines = json_decode($patient->info_lines);?>
-        <?php $infoLines = !$infoLines ? [] : $infoLines; ?>
-        <?php $vitalLabels = ['Ht. (in.)','Wt. (lbs.)','Temp. (F)','Pulse','Resp.','Pulse Ox.','SBP','DBP','Smoking Status', 'BMI']; ?>
-        <?php $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_create($patient->created_at))->invert === 1); ?>
-
-        <?php $nonCoreVisitNotes = $patient->nonCoreVisitNotes; ?>
-        <?php $disallowPointEdits = $nonCoreVisitNotes && count($nonCoreVisitNotes); ?>
-
-	    <div class="row client-single-dashboard">
-            <div class="col-6">
-
-                {{-- rpm summary for current caremonth --}}
-                @if($patient->is_enrolled_in_rm === 'YES')
-                    @if($patient->currentCareMonth())
-                        @include('app/patient/partials/caremonth-summary', ['careMonth' => $patient->currentCareMonth()])
-                    @else
-                        <div class="alert alert-info">No caremonth for this month.</div>
-                    @endif
+<?php
+$shortCutsObject = [];
+foreach ($pro->allShortcuts() as $shortcut) {
+
+    // %replaceables%
+    $shortcut->text = str_replace("%AGE%", $patient->age_in_years, $shortcut->text);
+    $shortcut->text = str_replace("%GENDER%", $patient->sex, $shortcut->text);
+    $shortcut->text = str_replace("%NAME%", $patient->displayName(), $shortcut->text);
+
+    $shortCutsObject[] = [
+        "name" => $shortcut->shortcut,
+        "value" => $shortcut->text
+    ];
+}
+?>
+<script>
+    window.userShortcuts = <?= json_encode($shortCutsObject); ?>;
+</script>
+<link href="/select2/select2.min.css" rel="stylesheet" />
+<script src="/select2/select2.min.js"></script>
+<div>
+
+    {{-- CARE PLAN START --}}
+    <?php $infoLines = json_decode($patient->info_lines); ?>
+    <?php $infoLines = !$infoLines ? [] : $infoLines; ?>
+    <?php $vitalLabels = ['Ht. (in.)', 'Wt. (lbs.)', 'Temp. (F)', 'Pulse', 'Resp.', 'Pulse Ox.', 'SBP', 'DBP', 'Smoking Status', 'BMI']; ?>
+    <?php $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_create($patient->created_at))->invert === 1); ?>
+
+    <?php $nonCoreVisitNotes = $patient->nonCoreVisitNotes; ?>
+    <?php $disallowPointEdits = $nonCoreVisitNotes && count($nonCoreVisitNotes); ?>
+
+    <div class="row client-single-dashboard">
+        <div class="col-6">
+            <?php
+            $myCurrentClientReviewRequest = $performer->pro->currentMonthClientReviewRequest($patient->id);
+            ?>
+            @if($myCurrentClientReviewRequest)
+            <div class="pt-2 mt-2">
+                <div class="d-flex align-items-center pb-2">
+                    <h6 class="my-0 font-weight-bold">Client Review Request - {{ friendly_date(date('Y-m-01')) }}</h6>
+                </div>
+                @if($myCurrentClientReviewRequest->status === 'PENDING')
+                <div class="alert alert-danger">
+                    <div class="d-flex align-items-center justify-content-between">
+                        <p class="mb-0">Please review this chart</p>
+                        <div>
+                            @include('app.patient.review-requests.partials.physician-update-status', ['record' =>$myCurrentClientReviewRequest ])
+                        </div>
+                    </div>
+                </div>
                 @endif
+                @if($myCurrentClientReviewRequest->status === 'DONE')
+                <div class="alert alert-success">
+                    <div class="d-flex align-items-center justify-content-between">
+                        <div>
+                            <p class="mb-1">You have already reviewed this chart.</p>
+                            @if($myCurrentClientReviewRequest->status_memo)
+                            <div class="d-flex align-items-start">
+                                <span class="mr-3"><i class="fas fa-calendar"></i> {{ friendly_date_time($myCurrentClientReviewRequest->status_updated_at) }}</span>
+                                <small class="text-muted">{{ $myCurrentClientReviewRequest->status_memo }}</small>
+                            </div>
 
-                {{-- appointments --}}
-                @include('app/patient/partials/appointments')
-
-                <?php $hasAllergiesInCanvas = $patient->hasDataInCanvas('allergies'); ?>
-
-                {{-- canvas based allergies --}}
-                @if($isOldClient && $hasAllergiesInCanvas)
-                <div class="pt-2 mt-2 border-top">
-                    <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold">Allergies</h6>
-                        <div class="px-2 font-weight-bold alert alert-warning text-sm my-0 ml-2 py-1">Deprecated</div>
-                    </div>
-                    <div class="bg-light border p-2 mb-3">
-                        @include('app.patient.canvas-sections.allergies.summary')
+                            @endif
+                        </div>
+                        <div>
+                            @include('app.patient.review-requests.partials.physician-update-status', ['record' =>$myCurrentClientReviewRequest, 'updateMemo' => true ])
+                        </div>
                     </div>
                 </div>
                 @endif
+            </div>
+            @endif
+            {{-- rpm summary for current caremonth --}}
+            @if($patient->is_enrolled_in_rm === 'YES')
+            @if($patient->currentCareMonth())
+            @include('app/patient/partials/caremonth-summary', ['careMonth' => $patient->currentCareMonth()])
+            @else
+            <div class="alert alert-info">No caremonth for this month.</div>
+            @endif
+            @endif
+
+            {{-- appointments --}}
+            @include('app/patient/partials/appointments')
+
+            <?php $hasAllergiesInCanvas = $patient->hasDataInCanvas('allergies'); ?>
+
+            {{-- canvas based allergies --}}
+            @if($isOldClient && $hasAllergiesInCanvas)
+            <div class="pt-2 mt-2 border-top">
+                <div class="d-flex align-items-center pb-2">
+                    <h6 class="my-0 font-weight-bold">Allergies</h6>
+                    <div class="px-2 font-weight-bold alert alert-warning text-sm my-0 ml-2 py-1">Deprecated</div>
+                </div>
+                <div class="bg-light border p-2 mb-3">
+                    @include('app.patient.canvas-sections.allergies.summary')
+                </div>
+            </div>
+            @endif
 
-                <!-- allergies - point -->
-                @include('app.patient.point-based-partials.allergies')
+            <!-- allergies - point -->
+            @include('app.patient.point-based-partials.allergies')
 
-                <?php $hasRxInCanvas = $patient->hasDataInCanvas('rx'); ?>
+            <?php $hasRxInCanvas = $patient->hasDataInCanvas('rx'); ?>
 
-                {{-- canvas based rx --}}
-                @if($isOldClient && $hasRxInCanvas)
-                <div class="pt-2 mt-2 border-top">
-                    <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold">Current Medications</h6>
-                        <div class="px-2 font-weight-bold alert alert-warning text-sm my-0 ml-2 py-1">Deprecated</div>
-                    </div>
-                    <div class="bg-light border p-2 mb-3">
-                        @include('app.patient.canvas-sections.rx.summary')
-                    </div>
+            {{-- canvas based rx --}}
+            @if($isOldClient && $hasRxInCanvas)
+            <div class="pt-2 mt-2 border-top">
+                <div class="d-flex align-items-center pb-2">
+                    <h6 class="my-0 font-weight-bold">Current Medications</h6>
+                    <div class="px-2 font-weight-bold alert alert-warning text-sm my-0 ml-2 py-1">Deprecated</div>
                 </div>
-                @endif
-
-                <!-- meds - point -->
-                @include('app.patient.point-based-partials.rx')
-
-                {{-- devices --}}
-                <?php
-                $availableDevices = count($devices);
-                $patientDeviceIDs = \App\Models\ClientBDTDevice::select('id')->where('client_id', $patient->id)->where('is_active', true)->get()->toArray();
-                $patientDeviceIDs = array_map(function($_x) {
-                    return $_x["id"];
-                }, $patientDeviceIDs);
-                ?>
-                <div class="mt-2 pb-1" id="patient-dashboard-devices">
-                    <div class="d-flex align-items-center mb-2 py-2 border-top border-bottom">
-                        <h6 class="my-0 font-weight-bold">Devices</h6>
-                        @if($availableDevices > 0 && $pro->pro_type === 'ADMIN')
-                        <span class="mx-2 text-secondary">|</span>
-                        <span moe>
-                            <a start show>Add</a>
-                            <form url="/api/clientBdtDevice/create" class="mcp-theme-1">
-                                <input type="hidden" name="clientUid" value="{{$patient->uid}}">
-                                <div class="mb-2">
-                                    <label class="text-secondary text-sm">Device</label>
-                                    <select name="deviceUid" class="form-control form-control-sm">
-                                        <option value=""> --select-- </option>
-                                        @foreach($devices as $device)
-                                            @if(!in_array($device->id, $patientDeviceIDs))
-                                            <option value="{{$device->uid}}">
-                                                {{$device->imei}} ({{$device->category}})
-                                            </option>
-                                            @endif
-                                        @endforeach
-                                    </select>
-                                </div>
-                                <div class="mb-2">
-                                    <label class="text-secondary text-sm">Instructions</label>
-                                    <input type="text" name="instructions" class="form-control form-control-sm">
-                                </div>
-                                <div class="mb-2">
-                                    <label class="text-secondary text-sm">Internal Memo</label>
-                                    <input type="text" name="internalMemo" class="form-control form-control-sm">
-                                </div>
-                                <div class="mb-2">
-                                    <label class="text-secondary text-sm">Status</label>
-                                    <input type="text" name="status" class="form-control form-control-sm">
-                                </div>
-                                <div class="mb-2">
-                                    <label class="text-secondary text-sm">Status Memo</label>
-                                    <input type="text" name="statusMemo" class="form-control form-control-sm">
-                                </div>
-                                <div>
-                                    <button submit class="btn btn-sm btn-primary mr-1">Submit</button>
-                                    <button cancel class="btn btn-sm btn-default border">Cancel</button>
-                                </div>
-                            </form>
-                        </span>
-                        @endif
-                    </div>
-                    <table class="table table-sm border-0 my-0 mx-2">
-                        <tbody>
+                <div class="bg-light border p-2 mb-3">
+                    @include('app.patient.canvas-sections.rx.summary')
+                </div>
+            </div>
+            @endif
+
+            <!-- meds - point -->
+            @include('app.patient.point-based-partials.rx')
+
+            {{-- devices --}}
+            <?php
+            $availableDevices = count($devices);
+            $patientDeviceIDs = \App\Models\ClientBDTDevice::select('id')->where('client_id', $patient->id)->where('is_active', true)->get()->toArray();
+            $patientDeviceIDs = array_map(function ($_x) {
+                return $_x["id"];
+            }, $patientDeviceIDs);
+            ?>
+            <div class="mt-2 pb-1" id="patient-dashboard-devices">
+                <div class="d-flex align-items-center mb-2 py-2 border-top border-bottom">
+                    <h6 class="my-0 font-weight-bold">Devices</h6>
+                    @if($availableDevices > 0 && $pro->pro_type === 'ADMIN')
+                    <span class="mx-2 text-secondary">|</span>
+                    <span moe>
+                        <a start show>Add</a>
+                        <form url="/api/clientBdtDevice/create" class="mcp-theme-1">
+                            <input type="hidden" name="clientUid" value="{{$patient->uid}}">
+                            <div class="mb-2">
+                                <label class="text-secondary text-sm">Device</label>
+                                <select name="deviceUid" class="form-control form-control-sm">
+                                    <option value=""> --select-- </option>
+                                    @foreach($devices as $device)
+                                    @if(!in_array($device->id, $patientDeviceIDs))
+                                    <option value="{{$device->uid}}">
+                                        {{$device->imei}} ({{$device->category}})
+                                    </option>
+                                    @endif
+                                    @endforeach
+                                </select>
+                            </div>
+                            <div class="mb-2">
+                                <label class="text-secondary text-sm">Instructions</label>
+                                <input type="text" name="instructions" class="form-control form-control-sm">
+                            </div>
+                            <div class="mb-2">
+                                <label class="text-secondary text-sm">Internal Memo</label>
+                                <input type="text" name="internalMemo" class="form-control form-control-sm">
+                            </div>
+                            <div class="mb-2">
+                                <label class="text-secondary text-sm">Status</label>
+                                <input type="text" name="status" class="form-control form-control-sm">
+                            </div>
+                            <div class="mb-2">
+                                <label class="text-secondary text-sm">Status Memo</label>
+                                <input type="text" name="statusMemo" class="form-control form-control-sm">
+                            </div>
+                            <div>
+                                <button submit class="btn btn-sm btn-primary mr-1">Submit</button>
+                                <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                            </div>
+                        </form>
+                    </span>
+                    @endif
+                </div>
+                <table class="table table-sm border-0 my-0 mx-2">
+                    <tbody>
                         @foreach($patient->devices as $device)
-                            <tr>
-                                <td class="text-black p-0 border-0">
-                                    <div class="pb-0">
-                                        <span relative moe>
-                                            <a class="on-hover-opaque" start show title="Update">
-                                                <i class="font-size-11 fa fa-edit text-primary"></i>
-                                            </a>
-                                            <form url="/api/clientBdtDevice/update">
-                                                <input type="hidden" name="uid" value="{{ $device->uid }}">
-                                                <div class="mb-2">
-                                                    <label class="text-secondary text-sm">Instructions</label>
-                                                    <input type="text" name="instructions"
-                                                           value="{{$device->instructions}}"
-                                                           class="form-control form-control-sm">
-                                                </div>
-                                                <div class="mb-2">
-                                                    <label class="text-secondary text-sm">Internal Memo</label>
-                                                    <input type="text" name="internalMemo"
-                                                           value="{{$device->internal_memo}}"
-                                                           class="form-control form-control-sm">
-                                                </div>
-                                                <div class="mb-2">
-                                                    <label class="text-secondary text-sm">Status</label>
-                                                    <input type="text" name="status"
-                                                           value="{{$device->status}}"
-                                                           class="form-control form-control-sm">
-                                                </div>
-                                                <div class="mb-2">
-                                                    <label class="text-secondary text-sm">Status Memo</label>
-                                                    <input type="text" name="statusMemo"
-                                                           value="{{$device->status_memo}}"
-                                                           class="form-control form-control-sm">
-                                                </div>
-                                                <div>
-                                                    <button submit class="btn btn-sm btn-primary mr-1">Submit</button>
-                                                    <button cancel class="btn btn-sm btn-default border">Cancel</button>
-                                                </div>
-                                            </form>
-                                        </span>
-                                        <b>{{$device->device->category}}</b>&nbsp;/&nbsp;IMEI: {{$device->device->imei}}
-                                    </div>
-                                </td>
-                            </tr>
+                        <tr>
+                            <td class="text-black p-0 border-0">
+                                <div class="pb-0">
+                                    <span relative moe>
+                                        <a class="on-hover-opaque" start show title="Update">
+                                            <i class="font-size-11 fa fa-edit text-primary"></i>
+                                        </a>
+                                        <form url="/api/clientBdtDevice/update">
+                                            <input type="hidden" name="uid" value="{{ $device->uid }}">
+                                            <div class="mb-2">
+                                                <label class="text-secondary text-sm">Instructions</label>
+                                                <input type="text" name="instructions" value="{{$device->instructions}}" class="form-control form-control-sm">
+                                            </div>
+                                            <div class="mb-2">
+                                                <label class="text-secondary text-sm">Internal Memo</label>
+                                                <input type="text" name="internalMemo" value="{{$device->internal_memo}}" class="form-control form-control-sm">
+                                            </div>
+                                            <div class="mb-2">
+                                                <label class="text-secondary text-sm">Status</label>
+                                                <input type="text" name="status" value="{{$device->status}}" class="form-control form-control-sm">
+                                            </div>
+                                            <div class="mb-2">
+                                                <label class="text-secondary text-sm">Status Memo</label>
+                                                <input type="text" name="statusMemo" value="{{$device->status_memo}}" class="form-control form-control-sm">
+                                            </div>
+                                            <div>
+                                                <button submit class="btn btn-sm btn-primary mr-1">Submit</button>
+                                                <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                                            </div>
+                                        </form>
+                                    </span>
+                                    <b>{{$device->device->category}}</b>&nbsp;/&nbsp;IMEI: {{$device->device->imei}}
+                                </div>
+                            </td>
+                        </tr>
                         @endforeach
                         @if(!$patient->devices || count($patient->devices) === 0)
-                            <tr>
-                                <td class="text-secondary p-0 border-0">
-                                    No devices
-                                </td>
-                            </tr>
+                        <tr>
+                            <td class="text-secondary p-0 border-0">
+                                No devices
+                            </td>
+                        </tr>
                         @endif
-                        </tbody>
-                    </table>
-                </div>
+                    </tbody>
+                </table>
+            </div>
 
-                {{-- device measurements --}}
-                {{-- @include('app/patient/partials/device-measurements') --}}
+            {{-- device measurements --}}
+            {{-- @include('app/patient/partials/device-measurements') --}}
 
-                {{-- measurements --}}
-                @include('app/patient/partials/measurements')
+            {{-- measurements --}}
+            @include('app/patient/partials/measurements')
 
-                {{-- vitals --}}
-                {{--@include('app/patient/partials/vitals')--}}
+            {{-- vitals --}}
+            {{--@include('app/patient/partials/vitals')--}}
 
-                <?php $hasVitalsInCanvas = $patient->hasDataInCanvas('vitals'); ?>
+            <?php $hasVitalsInCanvas = $patient->hasDataInCanvas('vitals'); ?>
 
-                {{-- canvas based vitals --}}
-                @if($isOldClient && $hasVitalsInCanvas)
-                <div class="pt-2 border-top">
-                    <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold">Vitals</h6>
-                        <div class="px-2 font-weight-bold alert alert-warning text-sm my-0 ml-2 py-1">Deprecated</div>
-                    </div>
-                    <div class="bg-light border p-2 mb-3">
-                        @include('app.patient.canvas-sections.vitals.summary')
-                    </div>
+            {{-- canvas based vitals --}}
+            @if($isOldClient && $hasVitalsInCanvas)
+            <div class="pt-2 border-top">
+                <div class="d-flex align-items-center pb-2">
+                    <h6 class="my-0 font-weight-bold">Vitals</h6>
+                    <div class="px-2 font-weight-bold alert alert-warning text-sm my-0 ml-2 py-1">Deprecated</div>
                 </div>
-                @endif
-
-                <!-- vitals - point -->
-                <?php $latestVitals = \App\Models\Point::where('client_id', $patient->id)->where('category', 'VITALS')->orderBy('id', 'DESC')->first(); ?>
-                <div class="pt-2 mt-2">
-                    <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold">Vitals
-                            @if(!!$latestVitals && $latestVitals->note && $latestVitals->note->effective_dateest)
-                                <span class="text-secondary font-weight-normal pl-1">(as on
-                                    <a href="{{route('patients.view.notes.view.dashboard', ['patient' => $patient, 'note' => $latestVitals->note])}}">{{friendlier_date($latestVitals->note->effective_dateest)}}</a>)
-                                </span>
-                            @endif
-                        </h6>
-                        @if($isOldClient && $hasVitalsInCanvas)
-                        <div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
-                        @endif
-                    </div>
-                    <div class="bg-light border p-2 mb-3">
-                        @if(!!$latestVitals)
-                            @include('app.patient.partials.latest-vitals', ['patient' => $patient, 'point' => $latestVitals])
-                        @else
-                            <div class="text-secondary">Nothing here yet</div>
+                <div class="bg-light border p-2 mb-3">
+                    @include('app.patient.canvas-sections.vitals.summary')
+                </div>
+            </div>
+            @endif
+
+            <!-- vitals - point -->
+            <?php $latestVitals = \App\Models\Point::where('client_id', $patient->id)->where('category', 'VITALS')->orderBy('id', 'DESC')->first(); ?>
+            <div class="pt-2 mt-2">
+                <div class="d-flex align-items-center pb-2">
+                    <h6 class="my-0 font-weight-bold">Vitals
+                        @if(!!$latestVitals && $latestVitals->note && $latestVitals->note->effective_dateest)
+                        <span class="text-secondary font-weight-normal pl-1">(as on
+                            <a href="{{route('patients.view.notes.view.dashboard', ['patient' => $patient, 'note' => $latestVitals->note])}}">{{friendlier_date($latestVitals->note->effective_dateest)}}</a>)
+                        </span>
                         @endif
-                    </div>
+                    </h6>
+                    @if($isOldClient && $hasVitalsInCanvas)
+                    <div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
+                    @endif
+                </div>
+                <div class="bg-light border p-2 mb-3">
+                    @if(!!$latestVitals)
+                    @include('app.patient.partials.latest-vitals', ['patient' => $patient, 'point' => $latestVitals])
+                    @else
+                    <div class="text-secondary">Nothing here yet</div>
+                    @endif
                 </div>
-
             </div>
-            <div class="col-6">
 
-                <?php $hasDxInCanvas = $patient->hasDataInCanvas('dx'); ?>
+        </div>
+        <div class="col-6">
 
-                {{-- canvas based dx --}}
-                @if($isOldClient)
-                    <div class="pt-2 mb-2 border-top">
-                        <div class="d-flex align-items-center pb-2">
-                            <h6 class="my-0 font-weight-bold">Current Problems / Focus Areas</h6>
-                            <div class="px-2 font-weight-bold alert alert-warning text-sm my-0 ml-2 py-1">Deprecated</div>
-                        </div>
-                        <div class="bg-light border p-2 mb-3">
-                            @include('app.patient.canvas-sections.dx.summary')
-                        </div>
-                    </div>
-                @endif
+            <?php $hasDxInCanvas = $patient->hasDataInCanvas('dx'); ?>
 
-                <!-- probs - point -->
-                @include('app.patient.point-based-partials.dx')
+            {{-- canvas based dx --}}
+            @if($isOldClient)
+            <div class="pt-2 mb-2 border-top">
+                <div class="d-flex align-items-center pb-2">
+                    <h6 class="my-0 font-weight-bold">Current Problems / Focus Areas</h6>
+                    <div class="px-2 font-weight-bold alert alert-warning text-sm my-0 ml-2 py-1">Deprecated</div>
+                </div>
+                <div class="bg-light border p-2 mb-3">
+                    @include('app.patient.canvas-sections.dx.summary')
+                </div>
+            </div>
+            @endif
 
-                <?php $hasCareTeamInCanvas = $patient->hasDataInCanvas('care-team'); ?>
+            <!-- probs - point -->
+            @include('app.patient.point-based-partials.dx')
 
-                {{-- canvas based careteam --}}
-                @if($isOldClient && $hasCareTeamInCanvas)
-                    <div class="pt-2 mt-2 border-top">
-                        <div class="d-flex align-items-center pb-2">
-                            <h6 class="my-0 font-weight-bold">Care Team</h6>
-                            <div class="px-2 font-weight-bold alert alert-warning text-sm my-0 ml-2 py-1">Deprecated</div>
-                        </div>
-                        <div class="bg-light border p-2 mb-3">
-                            @include('app.patient.canvas-sections.care-team.summary')
-                        </div>
-                    </div>
-                @endif
+            <?php $hasCareTeamInCanvas = $patient->hasDataInCanvas('care-team'); ?>
 
-                <!-- careteam - point -->
-                @include('app.patient.point-based-partials.care-team')
+            {{-- canvas based careteam --}}
+            @if($isOldClient && $hasCareTeamInCanvas)
+            <div class="pt-2 mt-2 border-top">
+                <div class="d-flex align-items-center pb-2">
+                    <h6 class="my-0 font-weight-bold">Care Team</h6>
+                    <div class="px-2 font-weight-bold alert alert-warning text-sm my-0 ml-2 py-1">Deprecated</div>
+                </div>
+                <div class="bg-light border p-2 mb-3">
+                    @include('app.patient.canvas-sections.care-team.summary')
+                </div>
+            </div>
+            @endif
 
-                <?php $hasPmhxInCanvas = $patient->hasDataInCanvas('pmhx'); ?>
+            <!-- careteam - point -->
+            @include('app.patient.point-based-partials.care-team')
 
-                {{-- history_medical --}}
-                @if($isOldClient && $hasPmhxInCanvas)
-                <div class="pt-2 mt-2 border-top">
-                    <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold">Medical History</h6>
-                        <div class="px-2 font-weight-bold alert alert-warning text-sm my-0 ml-2 py-1">Deprecated</div>
-                    </div>
-                    <div class="bg-light border p-2 mb-3">
-                        @include('app.patient.canvas-sections.pmhx.summary')
-                    </div>
+            <?php $hasPmhxInCanvas = $patient->hasDataInCanvas('pmhx'); ?>
+
+            {{-- history_medical --}}
+            @if($isOldClient && $hasPmhxInCanvas)
+            <div class="pt-2 mt-2 border-top">
+                <div class="d-flex align-items-center pb-2">
+                    <h6 class="my-0 font-weight-bold">Medical History</h6>
+                    <div class="px-2 font-weight-bold alert alert-warning text-sm my-0 ml-2 py-1">Deprecated</div>
                 </div>
-                @endif
+                <div class="bg-light border p-2 mb-3">
+                    @include('app.patient.canvas-sections.pmhx.summary')
+                </div>
+            </div>
+            @endif
 
-                <!-- pmhx - point -->
-                @include('app.patient.point-based-partials.pmhx')
+            <!-- pmhx - point -->
+            @include('app.patient.point-based-partials.pmhx')
 
-                <?php $hasPshxInCanvas = $patient->hasDataInCanvas('pshx'); ?>
+            <?php $hasPshxInCanvas = $patient->hasDataInCanvas('pshx'); ?>
 
-                {{-- history_surgical --}}
-                @if($isOldClient && $hasPshxInCanvas)
-                <div class="mt-2 border-top pt-2">
-                    <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold">Surgical History</h6>
-                        <div class="px-2 font-weight-bold alert alert-warning text-sm my-0 ml-2 py-1">Deprecated</div>
-                    </div>
-                    <div class="bg-light border p-2 mb-3">
-                        @include('app.patient.canvas-sections.pshx.summary')
-                    </div>
+            {{-- history_surgical --}}
+            @if($isOldClient && $hasPshxInCanvas)
+            <div class="mt-2 border-top pt-2">
+                <div class="d-flex align-items-center pb-2">
+                    <h6 class="my-0 font-weight-bold">Surgical History</h6>
+                    <div class="px-2 font-weight-bold alert alert-warning text-sm my-0 ml-2 py-1">Deprecated</div>
                 </div>
-                @endif
+                <div class="bg-light border p-2 mb-3">
+                    @include('app.patient.canvas-sections.pshx.summary')
+                </div>
+            </div>
+            @endif
 
-                <!-- pshx - point -->
-                @include('app.patient.point-based-partials.shx')
+            <!-- pshx - point -->
+            @include('app.patient.point-based-partials.shx')
 
-                <?php $hasFhxInCanvas = $patient->hasDataInCanvas('fhx'); ?>
+            <?php $hasFhxInCanvas = $patient->hasDataInCanvas('fhx'); ?>
 
-                {{-- history_family --}}
-                @if($isOldClient && $hasFhxInCanvas)
-                <div class="mt-2 border-top pt-2">
-                    <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold">Family History</h6>
-                        <div class="px-2 font-weight-bold alert alert-warning text-sm my-0 ml-2 py-1">Deprecated</div>
-                    </div>
-                    <div class="bg-light border p-2 mb-3">
-                        @include('app.patient.canvas-sections.fhx.summary')
-                    </div>
+            {{-- history_family --}}
+            @if($isOldClient && $hasFhxInCanvas)
+            <div class="mt-2 border-top pt-2">
+                <div class="d-flex align-items-center pb-2">
+                    <h6 class="my-0 font-weight-bold">Family History</h6>
+                    <div class="px-2 font-weight-bold alert alert-warning text-sm my-0 ml-2 py-1">Deprecated</div>
                 </div>
-                @endif
+                <div class="bg-light border p-2 mb-3">
+                    @include('app.patient.canvas-sections.fhx.summary')
+                </div>
+            </div>
+            @endif
 
-                <!-- fhx - point -->
-                @include('app.patient.point-based-partials.fhx')
+            <!-- fhx - point -->
+            @include('app.patient.point-based-partials.fhx')
 
-                <?php $hasSochxInCanvas = $patient->hasDataInCanvas('sochx'); ?>
+            <?php $hasSochxInCanvas = $patient->hasDataInCanvas('sochx'); ?>
 
-                {{-- history_social --}}
-                @if($isOldClient && $hasSochxInCanvas)
-                <div class="mt-2 border-top pt-2">
-                    <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold">Social History</h6>
-                        <div class="px-2 font-weight-bold alert alert-warning text-sm my-0 ml-2 py-1">Deprecated</div>
-                    </div>
-                    <div class="bg-light border p-2 mb-3">
-                        @include('app.patient.canvas-sections.sochx.summary')
-                    </div>
+            {{-- history_social --}}
+            @if($isOldClient && $hasSochxInCanvas)
+            <div class="mt-2 border-top pt-2">
+                <div class="d-flex align-items-center pb-2">
+                    <h6 class="my-0 font-weight-bold">Social History</h6>
+                    <div class="px-2 font-weight-bold alert alert-warning text-sm my-0 ml-2 py-1">Deprecated</div>
                 </div>
-                @endif
+                <div class="bg-light border p-2 mb-3">
+                    @include('app.patient.canvas-sections.sochx.summary')
+                </div>
+            </div>
+            @endif
 
-                <!-- sochx - point -->
-                @include('app.patient.point-based-partials.sochx')
+            <!-- sochx - point -->
+            @include('app.patient.point-based-partials.sochx')
 
 
-            </div>
         </div>
-        <?php /* <div class="row my-3">
+    </div>
+    <?php /* <div class="row my-3">
             <div class="col-12">
                 {{-- erx --}}
                 <div  class="mb-2 pt-3 pb-2 border-top">
@@ -526,211 +558,209 @@
             </div>
         </div> */ ?>
 
-        <div class="row my-3">
-            <div class="col-md-9">
-                {{-- memos --}}
-                <div  class="mb-2 pt-3 pb-2 border-top">
-                    <div class="">
-                        <div class="d-flex align-items-start pb-2">
-                            <h6 class="my-0 font-weight-bold">Client Memos</h6>
-                        </div>
-                        <div moe class="w-100 p-2 border mb-3">
-                            <form url="/api/clientMemo/create" show>
-                                <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                                <label class="text-secondary font-weight-bold">+ New Memo</label>
-                                <div class="mb-2">
-                                    <select class="form-control form-control-sm" name="category" required>
-                                        <option value="">-- select --</option>
-                                        <option value="Incoming Call">Incoming Call</option>
-                                        <option value="Outgoing Call">Outgoing Call</option>
-                                        <option value="Call Unspecified">Call Unspecified</option>
-                                        <option value="Other">Other</option>
-                                    </select>
-                                </div>
-                                <div class="mb-2">
-                                    <textarea class="form-control form-control-sm" rows="5" name="content" placeholder="Content"></textarea>
-                                </div>
+    <div class="row my-3">
+        <div class="col-md-9">
+            {{-- memos --}}
+            <div class="mb-2 pt-3 pb-2 border-top">
+                <div class="">
+                    <div class="d-flex align-items-start pb-2">
+                        <h6 class="my-0 font-weight-bold">Client Memos</h6>
+                    </div>
+                    <div moe class="w-100 p-2 border mb-3">
+                        <form url="/api/clientMemo/create" show>
+                            <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
+                            <label class="text-secondary font-weight-bold">+ New Memo</label>
+                            <div class="mb-2">
+                                <select class="form-control form-control-sm" name="category" required>
+                                    <option value="">-- select --</option>
+                                    <option value="Incoming Call">Incoming Call</option>
+                                    <option value="Outgoing Call">Outgoing Call</option>
+                                    <option value="Call Unspecified">Call Unspecified</option>
+                                    <option value="Other">Other</option>
+                                </select>
+                            </div>
+                            <div class="mb-2">
+                                <textarea class="form-control form-control-sm" rows="5" name="content" placeholder="Content"></textarea>
+                            </div>
+                            @if($performer->pro->pro_type === 'ADMIN')
+                            <div class="mb-2">
+                                <label for="" class="checkbox">
+                                    <input type="checkbox" name="isAdminOnly">
+                                    Admins only
+                                </label>
+                            </div>
+                            @endif
+                            <div class="d-flex align-items-center">
+                                <button class="btn btn-sm btn-primary mr-2" type="button" submit>Save</button>
+                            </div>
+                        </form>
+                    </div>
+                    <table class="table table-striped table-sm table-bordered mb-0">
+                        @if($patient->memos && count($patient->memos))
+                        <thead class="bg-light">
+                            <tr class="text-nowrap">
+                                <th class="border-0 text-secondary">Category</th>
+                                <th class="border-0 text-secondary w-50">Summary</th>
+                                <th class="border-0 text-secondary">Created</th>
                                 @if($performer->pro->pro_type === 'ADMIN')
-                                <div class="mb-2">
-                                    <label for="" class="checkbox">
-                                        <input type="checkbox" name="isAdminOnly">
-                                        Admins only
-                                    </label>
-                                </div>
+                                <th class="border-0 text-secondary">Admins Only</th>
                                 @endif
-                                <div class="d-flex align-items-center">
-                                    <button class="btn btn-sm btn-primary mr-2" type="button" submit>Save</button>
-                                </div>
-                            </form>
-                        </div>
-                        <table class="table table-striped table-sm table-bordered mb-0">
-                            @if($patient->memos && count($patient->memos))
-                                <thead class="bg-light">
-                                <tr class="text-nowrap">
-                                    <th class="border-0 text-secondary">Category</th>
-                                    <th class="border-0 text-secondary w-50">Summary</th>
-                                    <th class="border-0 text-secondary">Created</th>
-                                    @if($performer->pro->pro_type === 'ADMIN')
-                                    <th class="border-0 text-secondary">Admins Only</th>
+                                <th class="border-0 text-secondary">Ack. by MCP</th>
+                                <th class="border-0 text-secondary delete-column">&nbsp;</th>
+                            </tr>
+                        </thead>
+                        <tbody>
+                            @foreach($patient->memos as $memo)
+                            @if(!$memo->is_admin_only || ($memo->is_admin_only && $performer->pro->pro_type === 'ADMIN') )
+                            <tr>
+                                <td class="text-nowrap">{{ $memo->category }}</td>
+                                <td class="px-2">
+                                    <pre class="m-0 break-spaces">{{ $memo->content }}</pre>
+                                </td>
+                                <td class="text-nowrap">
+                                    @if($performer->pro->pro_type == 'ADMIN')
+                                    <strong>{{$memo->createdBy->proname_first}} {{$memo->createdBy->pro->name_last}}</strong><br />
                                     @endif
-                                    <th class="border-0 text-secondary">Ack. by MCP</th>
-                                    <th class="border-0 text-secondary delete-column">&nbsp;</th>
-                                </tr>
-                                </thead>
-                                <tbody>
-                                @foreach($patient->memos as $memo)
-                                    @if(!$memo->is_admin_only || ($memo->is_admin_only && $performer->pro->pro_type === 'ADMIN') )
-                                    <tr>
-                                        <td class="text-nowrap">{{ $memo->category }}</td>
-                                        <td class="px-2">
-                                            <pre class="m-0 break-spaces">{{ $memo->content }}</pre>
-                                        </td>
-                                        <td class="text-nowrap">
-                                            @if($performer->pro->pro_type == 'ADMIN')
-                                            <strong>{{$memo->createdBy->proname_first}} {{$memo->createdBy->pro->name_last}}</strong><br/>
-                                            @endif
-                                            {{ friendly_date_time($memo->created_at) }}
-                                        </td>
-                                        @if($performer->pro->pro_type === 'ADMIN' )
-                                        <td class="text-secondary">
-                                            @if($memo->is_admin_only)
-                                                <span class="text-success"><i class="fas fa-lock"></i> YES</span>
-                                            @else
-                                                <span><i class="fas fa-unlock"></i> NO</span>
-                                            @endif
-                                        </td>
-                                        @endif
-                                        <td>
-                                            @if($memo->mcp_stamp_id)
-                                            <span class="text-success">YES <i class="fas fa-info-circle c-pointer" data-toggle="tooltip" data-placement="bottom" title="{{ friendly_date_time($memo->stamp->created_at) }}"></i></span>
-                                            @else
-                                            <span class="text-secondary">NO</span>
-                                            @endif
-                                        </td>
-                                        <td class="text-center delete-column">
-                                            @if($performer->pro->pro_type == 'ADMIN')
-                                                <div moe relative bottom class="mr-2">
-                                                    <a start show><i class="fa fa-history"></i></a>
-                                                    <div action="" url right bottom>
-                                                        <table class="table table-condensed table-striped table-sm">
-                                                            <thead>
-                                                            <th>Category</th>
-                                                            <th>Summary</th>
-                                                            <th>Created</th>
-
-                                                            </thead>
-                                                            <tbody>
-                                                            @foreach($memo->updates as $update)
-                                                                <tr>
-                                                                    <td>{{$update->category}}</td>
-                                                                    <td>{{$update->content}}</td>
-                                                                    <td><strong>{{$update->createdBy->proname_first}} {{$update->createdBy->pro->name_last}}</strong><br/>{{ friendly_date_time($update->created_at) }}</td>
-
-                                                                </tr>
-                                                            @endforeach
-                                                            </tbody>
-                                                        </table>
-                                                    </div>
-                                                </div>
-                                            @endif
-                                            <div moe wide relative class="mr-2">
-                                                <a class="on-hover-opaque" start show title="Edit">
-                                                    <i class="font-size-11 fa fa-edit"></i>
-                                                </a>
-                                                <form url="/api/clientMemo/update" right>
-                                                    <input type="hidden" name="uid" value="{{ $memo->uid }}">
-                                                    <div class="mb-2">
-                                                        <select class="form-control form-control-sm" name="category" required>
-                                                            <option value="">-- select --</option>
-                                                            <option {{ $memo->category === "Incoming Call" ? "selected" : "" }} value="Incoming Call">Incoming Call</option>
-                                                            <option {{ $memo->category === "Outgoing Call" ? "selected" : "" }} value="Outgoing Call">Outgoing Call</option>
-                                                            <option {{ $memo->category === "Call Unspecified" ? "selected" : "" }} value="Call Unspecified">Call Unspecified</option>
-                                                            <option {{ $memo->category === "Other" ? "selected" : "" }} value="Other">Other</option>
-                                                        </select>
-                                                    </div>
-                                                    <div class="mb-2">
-                                                        <textarea class="form-control form-control-sm" name="content" rows="5"
-                                                            placeholder="Content"><?= $memo->content ?></textarea>
-                                                    </div>
-                                                    <div class="d-flex align-items-center">
-                                                        <button class="btn btn-sm btn-primary mr-2" type="button" submit>Save</button>
-                                                        <button class="btn btn-sm btn-default mr-2 border" type="button"
-                                                                cancel>Cancel</button>
-                                                    </div>
-                                                </form>
+                                    {{ friendly_date_time($memo->created_at) }}
+                                </td>
+                                @if($performer->pro->pro_type === 'ADMIN' )
+                                <td class="text-secondary">
+                                    @if($memo->is_admin_only)
+                                    <span class="text-success"><i class="fas fa-lock"></i> YES</span>
+                                    @else
+                                    <span><i class="fas fa-unlock"></i> NO</span>
+                                    @endif
+                                </td>
+                                @endif
+                                <td>
+                                    @if($memo->mcp_stamp_id)
+                                    <span class="text-success">YES <i class="fas fa-info-circle c-pointer" data-toggle="tooltip" data-placement="bottom" title="{{ friendly_date_time($memo->stamp->created_at) }}"></i></span>
+                                    @else
+                                    <span class="text-secondary">NO</span>
+                                    @endif
+                                </td>
+                                <td class="text-center delete-column">
+                                    @if($performer->pro->pro_type == 'ADMIN')
+                                    <div moe relative bottom class="mr-2">
+                                        <a start show><i class="fa fa-history"></i></a>
+                                        <div action="" url right bottom>
+                                            <table class="table table-condensed table-striped table-sm">
+                                                <thead>
+                                                    <th>Category</th>
+                                                    <th>Summary</th>
+                                                    <th>Created</th>
+
+                                                </thead>
+                                                <tbody>
+                                                    @foreach($memo->updates as $update)
+                                                    <tr>
+                                                        <td>{{$update->category}}</td>
+                                                        <td>{{$update->content}}</td>
+                                                        <td><strong>{{$update->createdBy->proname_first}} {{$update->createdBy->pro->name_last}}</strong><br />{{ friendly_date_time($update->created_at) }}</td>
+
+                                                    </tr>
+                                                    @endforeach
+                                                </tbody>
+                                            </table>
+                                        </div>
+                                    </div>
+                                    @endif
+                                    <div moe wide relative class="mr-2">
+                                        <a class="on-hover-opaque" start show title="Edit">
+                                            <i class="font-size-11 fa fa-edit"></i>
+                                        </a>
+                                        <form url="/api/clientMemo/update" right>
+                                            <input type="hidden" name="uid" value="{{ $memo->uid }}">
+                                            <div class="mb-2">
+                                                <select class="form-control form-control-sm" name="category" required>
+                                                    <option value="">-- select --</option>
+                                                    <option {{ $memo->category === "Incoming Call" ? "selected" : "" }} value="Incoming Call">Incoming Call</option>
+                                                    <option {{ $memo->category === "Outgoing Call" ? "selected" : "" }} value="Outgoing Call">Outgoing Call</option>
+                                                    <option {{ $memo->category === "Call Unspecified" ? "selected" : "" }} value="Call Unspecified">Call Unspecified</option>
+                                                    <option {{ $memo->category === "Other" ? "selected" : "" }} value="Other">Other</option>
+                                                </select>
                                             </div>
-                                            <div moe relative>
-                                                <a start show class="on-hover-opaque"><i class="fa fa-trash-alt text-danger"></i></a>
-                                                <form url="/api/clientMemo/cancel" right>
-                                                    <input type="hidden" name="uid" value="{{ $memo->uid }}">
-                                                    <p class="small">Are you sure you want to cancel this memo?</p>
-                                                    <div class="d-flex align-items-center">
-                                                        <button class="btn btn-sm btn-danger mr-2" submit>Delete</button>
-                                                        <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                                    </div>
-                                                </form>
+                                            <div class="mb-2">
+                                                <textarea class="form-control form-control-sm" name="content" rows="5" placeholder="Content"><?= $memo->content ?></textarea>
                                             </div>
-                                        </td>
-                                    </tr>
-                                    @endif
-                                @endforeach
-                                </tbody>
-                            @else
-                                <tbody>
-                                <tr>
-                                    <td class="text-secondary p-3">No memos have been created for this patient</td>
-                                </tr>
-                                </tbody>
+                                            <div class="d-flex align-items-center">
+                                                <button class="btn btn-sm btn-primary mr-2" type="button" submit>Save</button>
+                                                <button class="btn btn-sm btn-default mr-2 border" type="button" cancel>Cancel</button>
+                                            </div>
+                                        </form>
+                                    </div>
+                                    <div moe relative>
+                                        <a start show class="on-hover-opaque"><i class="fa fa-trash-alt text-danger"></i></a>
+                                        <form url="/api/clientMemo/cancel" right>
+                                            <input type="hidden" name="uid" value="{{ $memo->uid }}">
+                                            <p class="small">Are you sure you want to cancel this memo?</p>
+                                            <div class="d-flex align-items-center">
+                                                <button class="btn btn-sm btn-danger mr-2" submit>Delete</button>
+                                                <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
+                                            </div>
+                                        </form>
+                                    </div>
+                                </td>
+                            </tr>
                             @endif
-                        </table>
-                    </div>
+                            @endforeach
+                        </tbody>
+                        @else
+                        <tbody>
+                            <tr>
+                                <td class="text-secondary p-3">No memos have been created for this patient</td>
+                            </tr>
+                        </tbody>
+                        @endif
+                    </table>
                 </div>
             </div>
-            <div class="col-md-3">
-            <div  class="mb-2 pt-3 pb-2 border-top">
-                        @include('app.patient.intake-data.intake-data')
-            </div>    
+        </div>
+        <div class="col-md-3">
+            <div class="mb-2 pt-3 pb-2 border-top">
+                @include('app.patient.intake-data.intake-data')
             </div>
         </div>
-
     </div>
-    <script>
-        (function() {
-            function init() {
-                $('select[name="deviceUid"]').select2({
-                    width: '100%'
-                });
 
-                // refresh once ticket popup is closed
-                $('body').off('stag-popup-closed')
-                /*$('body').on('stag-popup-closed', function() {
-                    if($('#client-rx-container').length) {
-                        fastReload();
-                    }
-                });*/
-                // ticket-popup
-                $(document)
-                    .off('click', '.ticket-popup-trigger')
-                    .on('click', '.ticket-popup-trigger', function() {
-                        showMask();
-                        window.noMc = true;
-                        $.get(this.href, (_data) => {
-                            $('.ticket-popup').html(_data);
-                            showStagPopup('ticket-popup', true);
-                            // $('.ticket-popup .stag-popup.stag-slide').attr('close-all-with-self', 1);
-                            runMCInitializer('patient-tickets'); // run specific mc initer
-                            hideMask();
-                        });
-                        return false;
+</div>
+<script>
+    (function() {
+        function init() {
+            $('select[name="deviceUid"]').select2({
+                width: '100%'
+            });
+
+            // refresh once ticket popup is closed
+            $('body').off('stag-popup-closed')
+            /*$('body').on('stag-popup-closed', function() {
+                if($('#client-rx-container').length) {
+                    fastReload();
+                }
+            });*/
+            // ticket-popup
+            $(document)
+                .off('click', '.ticket-popup-trigger')
+                .on('click', '.ticket-popup-trigger', function() {
+                    showMask();
+                    window.noMc = true;
+                    $.get(this.href, (_data) => {
+                        $('.ticket-popup').html(_data);
+                        showStagPopup('ticket-popup', true);
+                        // $('.ticket-popup .stag-popup.stag-slide').attr('close-all-with-self', 1);
+                        runMCInitializer('patient-tickets'); // run specific mc initer
+                        hideMask();
                     });
-
-                addMCHook('onHxPopupClosure', function() {
-                    closeStagPopup();
+                    return false;
                 });
 
-            }
-            addMCInitializer('patient-dashboard-devices', init, '#patient-dashboard-devices');
+            addMCHook('onHxPopupClosure', function() {
+                closeStagPopup();
+            });
+
+        }
+        addMCInitializer('patient-dashboard-devices', init, '#patient-dashboard-devices');
 
-        }).call(window);
-    </script>
-@endsection
+    }).call(window);
+</script>
+@endsection

+ 15 - 5
resources/views/app/patient/review-requests/list.blade.php

@@ -3,7 +3,9 @@
 <div class="">
     <div class="d-flex align-items-center pb-2">
         <h4 class="font-weight-bold mb-0 mr-3">Review Requests</h4>
-        @include('app.patient.review-requests.partials.create')
+        @if($performer->pro->pro_type === 'ADMIN')
+            @include('app.patient.review-requests.partials.create')
+        @endif
     </div>
     <table class="table table-striped table-sm table-bordered">
         <thead class="bg-light">
@@ -35,14 +37,18 @@
                                 <i class="fas fa-info-circle text-muted" title="{{ $rr->reactivation_memo }}"></i>
                             @endif
                         </span>
-                        @include('app.patient.review-requests.partials.deactivate')
+                        @if($performer->pro->pro_type === 'ADMIN')
+                            @include('app.patient.review-requests.partials.deactivate')
+                        @endif
                     @else
                         <span class="text-secondary mr-2">NO
                         @if($rr->deactivation_memo)
                                 <i class="fas fa-info-circle text-muted" title="{{ $rr->deactivation_memo }}"></i>
                             @endif
                         </span>
-                        @include('app.patient.review-requests.partials.activate')
+                        @if($performer->pro->pro_type === 'ADMIN')
+                            @include('app.patient.review-requests.partials.activate')
+                        @endif
                     @endif
                 </td>
                 <td>
@@ -51,10 +57,14 @@
                             <i class="fas fa-info-circle text-muted" title="{{ $rr->status_memo }}"></i>
                         @endif
                     </span>
-                    @include('app.patient.review-requests.partials.update-status')
+                    @if($performer->pro->pro_type === 'ADMIN')
+                        @include('app.patient.review-requests.partials.update-status')
+                    @endif
                 </td>
                 <td>
-                @include('app.patient.review-requests.partials.edit')
+                    @if($performer->pro->pro_type === 'ADMIN')
+                        @include('app.patient.review-requests.partials.edit')
+                    @endif
                 </td>
             </tr>
             @endforeach

+ 22 - 0
resources/views/app/patient/review-requests/partials/physician-update-status.blade.php

@@ -0,0 +1,22 @@
+<div moe relative>
+    <a start show class="btn btn-primary btn-sm text-white">
+        @if(@$updateMemo)
+            Update Memo
+        @else
+            Mark as Reviewed
+        @endif
+    </a>
+    <form url="/api/clientReviewRequest/update-status" class="mcp-theme-1" right>
+        <input type="hidden" name="uid" value="{{ $record->uid }}">
+        <input type="hidden" name="status" value="DONE" />
+        <div class="mb-2">
+            <label class="mb-1">Memo</label>
+            <textarea name="memo" class="form-control">{{ @$updateMemo ? $record->status_memo : '' }}</textarea>
+        </div>
+
+        <div>
+            <button submit class="btn btn-sm btn-primary mr-1">Submit</button>
+            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+        </div>
+    </form>
+</div>

+ 2 - 2
resources/views/app/ps/dashboard/client-charts-pending-my-review.blade.php

@@ -12,7 +12,7 @@
         <thead class="bg-light">
             <tr>
                 <th class="border-0 text-secondary text-nowrap">Created</th>
-                <th class="border-0 text-secondary">Chart #</th>
+                <th class="border-0 text-secondary">Patient</th>
                 <th class="border-0 text-secondary">Scoped Month Start</th>
                 <th class="border-0 text-secondary">Access Start</th>
                 <th class="border-0 text-secondary">Access End</th>                
@@ -26,7 +26,7 @@
                 <td class="text-nowrap">{{ friendlier_date($rr->created_at) }}</td>
                 <td>
                 <a native target="_blank" href="{{route('patients.view.dashboard', $rr->client)}}">
-						{{$rr->client->chart_number}}
+						{{$rr->client->displayName()}}
 					</a>
                 </td>
                 <td>{{ friendlier_date($rr->scoped_month_start_date) }}</td>

+ 5 - 0
resources/views/app/ps/review-requests/list.blade.php

@@ -12,6 +12,7 @@
                 <tr>
                     <th class="border-0 text-secondary text-nowrap">Created At</th>
                     <th class="border-0 text-secondary text-nowrap">Chart #</th>
+                    <th class="border-0 text-secondary text-nowrap">Patient</th>
                     <th class="border-0 text-secondary">Scoped Month Start Date</th>
                     <th class="border-0 text-secondary">Access Start Date</th>
                     <th class="border-0 text-secondary">Access End Date</th>
@@ -30,6 +31,10 @@
 						{{$rr->client->chart_number}}
 					</a>
                     </td>
+                    <a native target="_blank" href="{{route('patients.view.dashboard', $rr->client)}}">
+						{{$rr->client->displayName()}}
+					</a>
+                    </td>
                     <td>{{ friendly_date($rr->scoped_month_start_date) }}</td>
                     <td>{{ friendly_date($rr->access_start_date) }}</td>
                     <td>{{ friendly_date($rr->access_end_date) }}</td>