Bläddra i källkod

added dashboard links

= 3 år sedan
förälder
incheckning
442b4c6eff

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

@@ -135,6 +135,14 @@ class AdminController extends Controller
         return view('app.mcp.notes', compact('notes'));
     }
 
+    public function notes_pending_summary_suggestion(Request $request){
+        $pro = $this->performer->pro;
+        $data = [
+            'records' => $pro->get_notes_pending_summary_suggestion_as_admin()
+        ];
+        return view('app.admin.notes_pending_summary_suggestion', $data);
+    }
+
     public function appointments(Request $request)
     {
         $appointments = Appointment::paginate(5);

+ 9 - 0
app/Http/Controllers/McpController.php

@@ -286,6 +286,15 @@ class McpController extends Controller
         ];
         return view('app.mcp.notes_pending_signature', $data);
     }
+
+    public function notes_pending_summary_suggestion(Request $request){
+        $pro = $this->performer->pro;
+        $data = [
+            'records' => $pro->get_notes_pending_summary_suggestion_as_mcp()
+        ];
+        return view('app.mcp.notes_pending_summary_suggestion', $data);
+    }
+
     public function notes_pending_billing(Request $request){
         $data = [
             'records' => Note::where('hcp_pro_id', $this->performer->pro->id)

+ 41 - 0
app/Models/Pro.php

@@ -369,6 +369,47 @@ class Pro extends Model
             ->count();
     }
 
+    function get_notes_pending_summary_suggestion_as_mcp_query(){
+        $segmentsWithProposedSummarySuggestion = Segment::whereNotNull('proposed_segment_summary_suggestion_id')->get();
+        $noteIDs = [];
+        foreach($segmentsWithProposedSummarySuggestion as $seg){
+            $noteIDs[] = $seg->note_id;
+        }
+        return Note::where('hcp_pro_id', $this->id)
+            ->where('is_cancelled', '<>', true)
+            ->where('is_core_note', '<>', true)
+            ->where('is_signed_by_hcp', true)
+            ->whereIn('id', $noteIDs);
+    }
+
+    function get_notes_pending_summary_suggestion_count_as_mcp(){
+        return $this->get_notes_pending_summary_suggestion_as_mcp_query()->count();
+    }
+
+    function get_notes_pending_summary_suggestion_as_mcp(){
+        return $this->get_notes_pending_summary_suggestion_as_mcp_query()->get();
+    }
+
+    function get_notes_pending_summary_suggestion_as_admin_query(){
+        $segmentsWithProposedSummarySuggestion = Segment::whereNotNull('proposed_segment_summary_suggestion_id')->get();
+        $noteIDs = [];
+        foreach($segmentsWithProposedSummarySuggestion as $seg){
+            $noteIDs[] = $seg->note_id;
+        }
+        return Note::where('is_cancelled', '<>', true)
+            ->where('is_core_note', '<>', true)
+            ->where('is_signed_by_hcp', true)
+            ->whereIn('id', $noteIDs);
+    }
+
+    function get_notes_pending_summary_suggestion_count_as_admin(){
+        return $this->get_notes_pending_summary_suggestion_as_admin_query()->count();
+    }
+
+    function get_notes_pending_summary_suggestion_as_admin(){
+        return $this->get_notes_pending_summary_suggestion_as_admin_query()->get();
+    }
+
     function get_notes_pending_billing_count_as_mcp() {
         return Note::where('hcp_pro_id', $this->id)
             ->where('is_cancelled', '<>', true)

+ 47 - 0
resources/views/app/admin/notes_pending_summary_suggestion.blade.php

@@ -0,0 +1,47 @@
+<div class="p-3 mcp-theme-1">
+    <div class="card border-top-0">
+
+        <div class="card-header px-2 py-1 hide-inside-popup border-bottom-0">
+            <strong class="mr-4">
+                <i class="fas fa-sticky-note"></i>
+                Notes With Pending Summary Suggestion
+            </strong>
+        </div>
+
+        <div class="card-body p-0 border-top-0 pb-0">
+            <table class="table table-sm border-top table-striped mb-0">
+                <thead class="bg-light">
+                <tr>
+                    <th class="border-0">Date</th>
+                    <th class="border-0">Patient</th>
+                    <th class="border-0">ICD</th>
+                    <th class="border-0">Status</th>
+                </tr>
+                </thead>
+                <tbody>
+                @foreach($records as $row)
+                    <tr>
+                        <td>
+                            <a native target="_blank" href="/patients/view/{{ $row->client->uid }}/notes/view/{{ $row->uid }}?suggestion_mode=on">
+                                {{ friendlier_date($row->effective_dateest) }}
+                            </a>
+                        </td>
+                        <td>{{$row->client->displayName()}}</td>
+                        <td>
+                            @foreach($row->reasons as $reason)
+                                <span class="pr-2">{{$reason->code}}</span>
+                            @endforeach
+                            @if(!$row->reasons || !count($row->reasons))
+                                -
+                            @endif
+                        </td>
+                        <td>
+                            {{$row->overallStatus()}}
+                        </td>
+                    </tr>
+                @endforeach
+                </tbody>
+            </table>
+        </div>
+    </div>
+</div>

+ 12 - 0
resources/views/app/dashboard-admin.blade.php

@@ -36,6 +36,18 @@
                                     <th class="px-2 text-center">{{$pro->get_notes_pending_signature_count_as_mcp()}}</th>
                                     <th class="pl-2">Notes Pending Signature</th>
                                 </tr>
+                                <tr>
+                                    <th class="px-2 text-center">{{$pro->get_notes_pending_summary_suggestion_count_as_admin()}}</th>
+                                    <th class="pl-2">
+                                        <a href="{{ route('admin.notes_pending_summary_suggestion') }}"
+                                           native target="_blank"
+                                           open-in-stag-popup
+                                           popup-style="tall"
+                                           title="Notes With Pending Summary Suggestion">
+                                            Notes With Pending Summary Suggestion
+                                        </a>
+                                    </th>
+                                </tr>
                                 <tr>
                                     <th class="px-2 text-center">{{$pro->get_notes_pending_billing_count_as_mcp()}}</th>
                                     <th class="pl-2">Notes Pending Billing</th>

+ 12 - 0
resources/views/app/dashboard-mcp.blade.php

@@ -63,6 +63,18 @@
                                         </a>
                                     </th>
                                 </tr>
+                                <tr>
+                                    <th class="px-2 text-center">{{$pro->get_notes_pending_summary_suggestion_count_as_mcp()}}</th>
+                                    <th class="pl-2">
+                                        <a href="{{ route('mcp.notes_pending_summary_suggestion') }}"
+                                           native target="_blank"
+                                           open-in-stag-popup
+                                           popup-style="tall"
+                                           title="Notes With Pending Summary Suggestion">
+                                            Notes With Pending Summary Suggestion
+                                        </a>
+                                    </th>
+                                </tr>
                                 <tr>
                                     <th class="px-2 text-center">{{$pro->get_notes_pending_billing_count_as_mcp()}}</th>
                                     <th class="pl-2">

+ 47 - 0
resources/views/app/mcp/notes_pending_summary_suggestion.blade.php

@@ -0,0 +1,47 @@
+<div class="p-3 mcp-theme-1">
+    <div class="card border-top-0">
+
+        <div class="card-header px-2 py-1 hide-inside-popup border-bottom-0">
+            <strong class="mr-4">
+                <i class="fas fa-sticky-note"></i>
+                Notes With Pending Summary Suggestion
+            </strong>
+        </div>
+
+        <div class="card-body p-0 border-top-0 pb-0">
+            <table class="table table-sm border-top table-striped mb-0">
+                <thead class="bg-light">
+                <tr>
+                    <th class="border-0">Date</th>
+                    <th class="border-0">Patient</th>
+                    <th class="border-0">ICD</th>
+                    <th class="border-0">Status</th>
+                </tr>
+                </thead>
+                <tbody>
+                @foreach($records as $row)
+                    <tr>
+                        <td>
+                            <a native target="_blank" href="/patients/view/{{ $row->client->uid }}/notes/view/{{ $row->uid }}?suggestion_mode=on">
+                                {{ friendlier_date($row->effective_dateest) }}
+                            </a>
+                        </td>
+                        <td>{{$row->client->displayName()}}</td>
+                        <td>
+                            @foreach($row->reasons as $reason)
+                                <span class="pr-2">{{$reason->code}}</span>
+                            @endforeach
+                            @if(!$row->reasons || !count($row->reasons))
+                                -
+                            @endif
+                        </td>
+                        <td>
+                            {{$row->overallStatus()}}
+                        </td>
+                    </tr>
+                @endforeach
+                </tbody>
+            </table>
+        </div>
+    </div>
+</div>

+ 2 - 0
resources/views/app/patient/note/segment/suggestions_and_updates.blade.php

@@ -46,6 +46,7 @@
     <div class=" m-2 p-2">
         {!! $segment->proposedSegmentSummarySuggestion->summary_html !!}
         <div class="d-flex">
+            @if($note->hcp_pro_id == $performer->pro_id)
             <div class="d-block mt-1 mr-2" moe>
                 <form url="/api/segment/acceptProposedSegmentSummarySuggestion" show>
                     <input type="hidden" name="uid" value="{{$segment->uid}}">
@@ -62,6 +63,7 @@
                     </div>
                 </form>
             </div>
+            @endif
 
             <div class="d-block mt-1" moe>
                 <a class="btn btn-outline-primary btn-sm " start>Override proposed suggestion</a>

+ 2 - 0
routes/web.php

@@ -91,6 +91,7 @@ Route::middleware('pro.auth')->group(function () {
 
         Route::get('new-patients-awaiting-visit', 'McpController@new_patients_awaiting_visit')->name('new_patients_awaiting_visit');
         Route::get('notes-pending-signature', 'McpController@notes_pending_signature')->name('notes_pending_signature');
+        Route::get('notes-pending-summary-suggestion', 'McpController@notes_pending_summary_suggestion')->name('notes_pending_summary_suggestion');
         Route::get('notes-pending-billing', 'McpController@notes_pending_billing')->name('notes_pending_billing');
         Route::get('bills-pending-signature', 'McpController@bills_pending_signature')->name('bills_pending_signature');
         Route::get('reports-pending-signature', 'McpController@reports_pending_signature')->name('reports_pending_signature');
@@ -194,6 +195,7 @@ Route::middleware('pro.auth')->group(function () {
 
         Route::get('patients', 'AdminController@patients')->name('patients');
         Route::get('notes', 'AdminController@notes')->name('notes');
+        Route::get('notes-pending-summary-suggestion', 'AdminController@notes_pending_summary_suggestion')->name('notes_pending_summary_suggestion');
         Route::get('appointments', 'AdminController@appointments')->name('appointments');
         Route::get('bills', 'AdminController@bills')->name('bills');
         Route::get('erx-and-orders', 'AdminController@erx_and_orders')->name('erx_and_orders');