Ver Fonte

Process notes (wip)

Vijayakrishnan há 4 anos atrás
pai
commit
9286c7bad7

+ 20 - 0
app/Http/Controllers/PracticeManagementController.php

@@ -1251,6 +1251,26 @@ ORDER BY claim.created_at ASC
         return  view('app.practice-management.bad-notes', compact('counts', 'notes'));
     }
 
+    public function doneNotes(Request  $request) {
+        $counts = [
+            "unpicked" => Note::where('is_cancelled', false)
+                ->whereNull('current_note_pickup_for_processing_id')
+                ->count(),
+        ];
+        $notes = Note::where('is_cancelled', false)
+            ->where('is_signed_by_hcp', true)
+            ->whereRaw("((detail_json)::json->>'isBad' is null OR ((detail_json)::json->>'isBad')::text != 'true')")
+            ->whereNull('current_note_pickup_for_processing_id')
+            ->where('is_billing_marked_done', true)
+            ->where('is_bill_closed', true)
+            ->where('is_claim_closed', true)
+            ->whereRaw("(SELECT count(id) FROM claim WHERE note_id = note.id) > 0")
+            ->whereRaw("(SELECT count(id) FROM claim WHERE note_id = note.id AND is_cancelled IS FALSE AND status != 'CANCELLED' AND status != 'SUBMITTED') = 0")
+            ->orderBy('effective_dateest', 'ASC')
+            ->paginate();
+        return  view('app.practice-management.done-notes', compact('counts', 'notes'));
+    }
+
     public function currentMbClaim(Request $request, $claimUid) {
         $claim = Claim::where('uid', $claimUid)->first();
         return json_encode(MBClaim::where('claim_version_id', $claim->currentVersion->id)->first());

+ 67 - 0
resources/views/app/practice-management/done-notes.blade.php

@@ -0,0 +1,67 @@
+@extends ('layouts/template')
+
+@section('content')
+
+    <div class="p-3 mcp-theme-1">
+
+        <div class="d-flex align-items-baseline pb-3">
+            <h2 class="font-size-16 font-weight-bold m-0">Done Notes (all claims submitted)</h2>
+            <a class="ml-auto" href="{{route('practice-management.process-notes')}}">Process Notes ({{$counts['unpicked']}})</a>
+        </div>
+
+        <div class="card">
+
+            <div class="card-body p-0">
+
+                <table class="table table-sm table-condensed table-striped p-0 m-0">
+                    <thead class="bg-light">
+                    <tr>
+                        <th class="border-0">Effective Date</th>
+                        <th class="border-0">Patient</th>
+                        <th class="border-0 w-50">Picked Up By</th>
+                        <th class="border-0"></th>
+                    </tr>
+                    </thead>
+                    <tbody>
+                    @foreach ($notes as $note)
+                        <tr class="{{ $note->is_cancelled ? 'cancelled-item always-clickable' : '' }}">
+                            <td class="">
+                                <a href="/patients/view/{{ $note->client->uid }}/notes/view/{{ $note->uid }}" class="font-weight-bold text-nowrap">
+                                    {{ friendly_date_time($note->effective_dateest, false) }}
+                                </a>
+                                <span class="ml-1">{{ $note->is_cancelled ? '[cancelled]' : '' }}</span>
+                            </td>
+                            <td class="">
+                                <a href="/patients/view/{{ $note->client->uid }}" class="text-nowrap">{{ $note->client->displayName() }}</a>
+                            </td>
+                            <td class="text-nowrap">
+                                @if(@$note->currentNotePickupForProcessing->pro)
+                                    <b>{{ $note->currentNotePickupForProcessing->pro->displayName()}}</b>
+                                    <span class="text-sm mx-1">at</span>
+                                    <span class="text-secondary">{{ friendlier_date_time($note->currentNotePickupForProcessing->created_at)}}</span>
+                                @else
+                                -
+                                @endif
+                            </td>
+                            <td class="">
+                                <a native target="_blank"
+                                   open-in-stag-popup
+                                   update-parent
+                                   mc-initer="note-single"
+                                   title="Note Details"
+                                   href="/patients/view/{{ $note->client->uid }}/notes/view/{{ $note->uid }}">
+                                    View
+                                </a>
+                            </td>
+                        </tr>
+                    @endforeach
+                    </tbody>
+                </table>
+            </div>
+        </div>
+        <div class="mt-3">
+            {{$notes->links()}}
+        </div>
+    </div>
+
+@endsection

+ 2 - 0
resources/views/app/practice-management/process-notes.blade.php

@@ -17,6 +17,8 @@
             <a class="ml-auto" href="{{route('practice-management.picked-notes')}}">Picked Notes ({{$counts['picked']}})</a>
             <span class="mx-2 text-secondary">|</span>
             <a class="text-danger" href="{{route('practice-management.bad-notes')}}">Bad Notes ({{$counts['bad']}})</a>
+            <span class="mx-2 text-secondary">|</span>
+            <a class="" href="{{route('practice-management.done-notes')}}">Done Notes ({{$counts['mode-6']}})</a>
         </div>
         <div class="d-flex align-items-center border-bottom mb-3 pb-3">
             <span class="mr-3">Notes: </span>

+ 1 - 0
routes/web.php

@@ -98,6 +98,7 @@ Route::middleware('pro.auth')->group(function () {
         Route::get('process-notes', 'PracticeManagementController@processNotes')->name('process-notes');
         Route::get('picked-notes', 'PracticeManagementController@pickedNotes')->name('picked-notes');
         Route::get('bad-notes', 'PracticeManagementController@badNotes')->name('bad-notes');
+        Route::get('done-notes', 'PracticeManagementController@doneNotes')->name('done-notes');
         Route::get('get-next-note/{mode}', 'PracticeManagementController@getNextNote')->name('get-next-note');