Przeglądaj źródła

Process notes (wip)

Vijayakrishnan 4 lat temu
rodzic
commit
295e6eb6ac

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

@@ -1099,6 +1099,85 @@ ORDER BY claim.created_at ASC
         return  view('app.practice-management.process-claims', compact('claims', 'status'));
     }
 
+    public function processNotes(Request  $request) {
+
+        $mode = $request->input('mode') ? $request->input('mode') : '1';
+        if($mode < 1 || $mode > 5) $mode = 1;
+
+        $counts = [
+            "mode-1" => Note::where('is_cancelled', false)
+                ->where('is_signed_by_hcp', false)
+                ->whereRaw("((detail_json)::json->>'isBad' is null OR ((detail_json)::json->>'isBad')::text != 'true')")
+                ->whereNull('current_note_pickup_for_processing_id')
+                ->count(),
+            "mode-2" => 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', false)
+                ->count(),
+            "mode-3" => 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', false)
+                ->count(),
+            "mode-4" => 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', false)
+                ->count(),
+            "mode-5" => 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 AND is_cancelled IS FALSE AND status != 'CANCELLED' AND status != 'SUBMITTED') > 0")
+                ->count(),
+            "mode-6" => 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")
+                ->count(),
+            "mode-7" => Note::where('is_cancelled', false)
+                ->whereRaw("(detail_json)::json->>'isBad' = 'true'")
+                ->count(),
+        ];
+
+        /*$notes = Note::where('is_cancelled', false);
+
+        $mode = $request->input('mode') ? $request->input('mode') : '1';
+        if($mode < 1 || $mode > 5) $mode = 1;
+
+        switch (+$mode) {
+            case 1:
+                break;
+            case 2:
+                break;
+            case 3:
+                break;
+            case 4:
+                break;
+            case 5:
+                break;
+        }
+
+        $notes = $notes->orderBy('effective_dateest', 'ASC')->skip(0)->take(1)->get();*/
+
+        return  view('app.practice-management.process-notes', compact('mode', 'counts'));
+    }
+
     public function currentMbClaim(Request $request, $claimUid) {
         $claim = Claim::where('uid', $claimUid)->first();
         return json_encode(MBClaim::where('claim_version_id', $claim->currentVersion->id)->first());

+ 31 - 0
public/css/style.css

@@ -1788,4 +1788,35 @@ form.non-interactive .form-content * {
 [data-type="prescribed today"] {
     font-weight: bold;
     color: #2ea745
+}
+.process-notes-badge {
+    border: 1px solid #ddd;
+    cursor: pointer;
+    padding: 0.35rem 0.6rem;
+    border-radius: 4px;
+    text-decoration: none !important;
+}
+.process-notes-badge:hover {
+    color: #000 !important;
+    border-color: #349caf;
+}
+.process-notes-badge.active {
+    /*font-weight: bold;*/
+    color: #fff !important;
+    background: #349caf;
+    border-color: #349caf;
+}
+.process-notes-badge.success {
+    font-weight: bold;
+    color: #fff !important;
+    background: #31b574;
+    border-color: #31b574;
+    cursor: auto;
+}
+.process-notes-badge.error {
+    font-weight: bold;
+    color: #fff !important;
+    background: #a72132;
+    border-color: #a72132;
+    cursor: auto;
 }

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

@@ -0,0 +1,54 @@
+@extends ('layouts/template')
+
+@section('content')
+
+    <div class="p-3 mcp-theme-1">
+        <h2 class="font-size-16 font-weight-bold pb-3 border-bottom mb-3">Process Notes</h2>
+        <div class="d-flex align-items-center border-bottom mb-3 pb-3">
+            <span class="mr-3">Notes: </span>
+            <a href="{{route('practice-management.process-notes')}}?mode=1"
+               class="process-notes-badge mr-3 {{$mode === '1' ? 'active' : ''}}" data-index="1">
+                <div class="text-nowrap">Not Yet Signed</div>
+                <div class="text-right font-size-16 font-weight-bold">{{$counts["mode-1"]}}</div>
+            </a>
+            <a href="{{route('practice-management.process-notes')}}?mode=2"
+               class="process-notes-badge mr-3 {{$mode === '2' ? 'active' : ''}}" data-index="2">
+                <div class="text-nowrap">Billing Not Marked Done</div>
+                <div class="text-right font-size-16 font-weight-bold">{{$counts["mode-2"]}}</div>
+            </a>
+            <a href="{{route('practice-management.process-notes')}}?mode=3"
+               class="process-notes-badge mr-3 {{$mode === '3' ? 'active' : ''}}" data-index="3">
+                <div class="text-nowrap">Billing Not Closed</div>
+                <div class="text-right font-size-16 font-weight-bold">{{$counts["mode-3"]}}</div>
+            </a>
+            <a href="{{route('practice-management.process-notes')}}?mode=4"
+               class="process-notes-badge mr-3 {{$mode === '4' ? 'active' : ''}}" data-index="4">
+                <div class="text-nowrap">Claiming Not Closed</div>
+                <div class="text-right font-size-16 font-weight-bold">{{$counts["mode-4"]}}</div>
+            </a>
+            <a href="{{route('practice-management.process-notes')}}?mode=5"
+               class="process-notes-badge mr-3 {{$mode === '5' ? 'active' : ''}}" data-index="5">
+                <div class="text-nowrap">Has Unsubmitted Claims</div>
+                <div class="text-right font-size-16 font-weight-bold">{{$counts["mode-5"]}}</div>
+            </a>
+            <div class="ml-auto process-notes-badge success" data-index="6">
+                <div class="text-nowrap">
+                    <i class="fa fa-check"></i>&nbsp;
+                    All Claims Submitted
+                </div>
+                <div class="text-right font-size-16 font-weight-bold">{{$counts["mode-6"]}}</div>
+            </div>
+            <div class="process-notes-badge ml-3 error" data-index="7">
+                <div class="text-nowrap">
+                    <i class="fa fa-exclamation-triangle"></i>&nbsp;
+                    Bad
+                </div>
+                <div class="text-right font-size-16 font-weight-bold">{{$counts["mode-7"]}}</div>
+            </div>
+        </div>
+
+        Hello
+
+    </div>
+
+@endsection

+ 1 - 0
routes/web.php

@@ -95,6 +95,7 @@ Route::middleware('pro.auth')->group(function () {
         Route::get('cellular-device-manager/{proUid?}', 'PracticeManagementController@cellularDeviceManager')->name('cellularDeviceManager');
 
         Route::get('process-claims', 'PracticeManagementController@processClaims')->name('process-claims');
+        Route::get('process-notes', 'PracticeManagementController@processNotes')->name('process-notes');
 
 
         Route::middleware('pro.auth.admin')->group(function(){