= 4 лет назад
Родитель
Сommit
bfcf3d261a

+ 18 - 3
app/Http/Controllers/PracticeManagementController.php

@@ -3,6 +3,7 @@
 namespace App\Http\Controllers;
 
 use App\Models\AppSession;
+use App\Models\ClaimEDI;
 use App\Models\Measurement;
 use App\Models\Bill;
 use App\Models\Claim;
@@ -591,10 +592,24 @@ class PracticeManagementController extends Controller
         return view('app.practice-management.bill-matrix', compact('bills', 'bClients', 'bHCPPros', 'filters'));
     }
 
-    public function claims(Request $request)
+    public function medicarePartBClaims(Request $request)
     {
-        $claims = Claim::where('was_submitted', false)->orWhere('was_submitted', null)->orderBy('created_at', 'desc')->paginate();
-        return view('app.practice-management.claims', compact('claims'));
+
+        $medicarePartBOnly  = $request->get("medicare_part_b");
+
+        $allClaims = Claim::where('was_submitted', false)->orWhere('was_submitted', null)->orderBy('created_at', 'desc')->paginate();
+
+        //Only medicare claims
+        $claims = [];
+        foreach ($allClaims as $claim){
+            if($claim->client != null && $claim->client->is_part_b_primary == 'YES' && !$claim->edi) {
+                $claims[] = $claim;
+            }
+        }
+
+        $claimEDIs = ClaimEDI::all();
+
+        return view('app.practice-management.medicare-partb-claims', compact('claims', 'claimEDIs'));
     }
 
     // Generate PDF

+ 8 - 0
app/Models/Claim.php

@@ -12,4 +12,12 @@ class Claim extends Model
     public function lines(){
         return $this->hasMany(ClaimLine::class, 'claim_id', 'id');
     }
+
+    public function client(){
+        return $this->hasOne(Client::class, 'id', 'client_id');
+    }
+
+    public function edi(){
+        return $this->hasOne(ClaimEDI::class, 'id', 'claim_edi_id');
+    }
 }

+ 16 - 0
app/Models/ClaimEDI.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+
+class ClaimEDI extends Model
+{
+
+    protected $table = 'claim_edi';
+
+    public function claims(){
+        return $this->hasMany(Claim::class, 'claim_edi_id', 'id');
+    }
+
+}

+ 0 - 59
resources/views/app/practice-management/claims.blade.php

@@ -1,59 +0,0 @@
-@extends ('layouts/template')
-
-@section('content')
-
-    <div class="p-3 mcp-theme-1">
-    <div class="card">
-
-        <div class="card-header px-3 py-2 d-flex align-items-center">
-            <strong class="mr-4">
-                <i class="fas fa-user-injured"></i>
-                Claims
-            </strong>
-            <a native href="{{route('practice-management.download-claims')}}" target="_blank">Download</a>
-        </div>
-        <div class="card-body p-0">
-            <table class="table table-sm table-condensed p-0 m-0">
-                <thead class="bg-light">
-                <tr>
-                    <th class="border-0">#</th>
-                    <th>Submitted?</th>
-                    <th class="border-0">Lines</th>
-                    <th class="px-3 border-0">Created</th>
-                </tr>
-                </thead>
-                <tbody>
-                @foreach ($claims as $claim)
-                    <tr>
-                        <td>{{$claim->iid}}</td>
-                        <td>{{$claim->was_submitted?'Yes':'No'}}</td>
-                        <td>
-                            <strong>Claim Lines</strong>
-                            <table class="table table-sm table-condensed table-striped">
-                                <tr>
-                                    <th>CPT</th>
-                                    <th>ICDs</th>
-                                    <th>Date of Service</th>
-                                </tr>
-                                @foreach($claim->lines as $claimLine)
-                                <tr>
-                                    <td>{{$claimLine->cpt}}</td>
-                                    <td>{{$claimLine->icds()}}</td>
-                                    <td>{{$claimLine->date_of_service}}</td>
-                                </tr>
-                                @endforeach
-                            </table>
-                        </td>
-                        <td>{{$claim->created_at}}</td>
-                    </tr>                               
-                @endforeach
-                </tbody>
-            </table>
-            <div>
-                {{$claims->links()}}
-            </div>
-        </div>
-    </div>
-    </div>
-
-@endsection

+ 134 - 0
resources/views/app/practice-management/medicare-partb-claims.blade.php

@@ -0,0 +1,134 @@
+@extends ('layouts/template')
+
+@section('content')
+
+    <div class="p-3 mcp-theme-1">
+        <div class="card">
+
+            <div class="card-header px-3 py-2 d-flex align-items-center">
+                <strong class="mr-4">
+                    <i class="fas fa-user-injured"></i>
+                    Claims
+                </strong>
+                <a native href="{{route('practice-management.download-claims')}}" target="_blank">Download</a>
+            </div>
+            <div class="card-body p-0" moe>
+                <form show url="/api/claimEDI/create">
+                    <div class="my-1 mx-1">
+                        <button submit class="btn bnt-sm btn-primary">Generate EDI</button>
+                    </div>
+                    <table class="table table-sm table-condensed p-0 m-0">
+                        <thead class="bg-light">
+                        <tr>
+                            <th></th>
+                            <th class="border-0">#</th>
+                            <th>Client</th>
+                            <th>Submitted?</th>
+                            <th class="border-0">Lines</th>
+                            <th class="px-3 border-0">Created</th>
+                        </tr>
+                        </thead>
+                        <tbody>
+
+                        @foreach ($claims as $claim)
+                            <tr>
+                                <td>
+                                    <input type="checkbox" name="claimUids[{{$loop->index}}]" value="{{$claim->uid}}">
+                                </td>
+                                <td>{{$claim->iid}}</td>
+                                <td>{{$claim->client->name_first}} {{$claim->client->name_last}}</td>
+                                <td>{{$claim->was_submitted?'Yes':'No'}}</td>
+                                <td>
+                                    <strong>Claim Lines</strong>
+                                    <table class="table table-sm table-condensed table-striped">
+                                        <tr>
+                                            <th>CPT</th>
+                                            <th>ICDs</th>
+                                            <th>Date of Service</th>
+                                        </tr>
+                                        @foreach($claim->lines as $claimLine)
+                                            <tr>
+                                                <td>{{$claimLine->cpt}}</td>
+                                                <td>{{$claimLine->icds()}}</td>
+                                                <td>{{$claimLine->date_of_service}}</td>
+                                            </tr>
+                                        @endforeach
+                                    </table>
+                                </td>
+                                <td>{{$claim->created_at}}</td>
+                            </tr>
+                        @endforeach
+                        </tbody>
+                    </table>
+                </form>
+
+            </div>
+        </div>
+        <div class="card">
+            <div class="card-header">Claim EDIs</div>
+            <div class="card-body">
+                <table class="table table-sm table-condensed table-striped">
+                    <thead>
+                    <tr>
+                        <th>Created At</th>
+                        <th>Claims</th>
+                        <th>EDI File</th>
+                    </tr>
+                    </thead>
+                    <tbody>
+                    @foreach($claimEDIs as $edi)
+                        <tr>
+                            <td>{{$edi->created_at}}</td>
+                            <td>
+                                <table class="table table-sm table-condensed p-0 m-0">
+                                    <thead class="bg-light">
+                                    <tr>
+                                        <th class="border-0">#</th>
+                                        <th>Client</th>
+                                        <th>Submitted?</th>
+                                        <th class="border-0">Lines</th>
+                                        <th class="px-3 border-0">Created</th>
+                                    </tr>
+                                    </thead>
+                                    <tbody>
+
+                                    @foreach ($edi->claims as $claim)
+                                        <tr>
+                                            <td>{{$claim->iid}}</td>
+                                            <td>{{$claim->client->name_first}} {{$claim->client->name_last}}</td>
+                                            <td>{{$claim->was_submitted?'Yes':'No'}}</td>
+                                            <td>
+                                                <strong>Claim Lines</strong>
+                                                <table class="table table-sm table-condensed table-striped">
+                                                    <tr>
+                                                        <th>CPT</th>
+                                                        <th>ICDs</th>
+                                                        <th>Date of Service</th>
+                                                    </tr>
+                                                    @foreach($claim->lines as $claimLine)
+                                                        <tr>
+                                                            <td>{{$claimLine->cpt}}</td>
+                                                            <td>{{$claimLine->icds()}}</td>
+                                                            <td>{{$claimLine->date_of_service}}</td>
+                                                        </tr>
+                                                    @endforeach
+                                                </table>
+                                            </td>
+                                            <td>{{$claim->created_at}}</td>
+                                        </tr>
+                                    @endforeach
+                                    </tbody>
+                                </table>
+                            </td>
+                            <td>
+                                <a href="/api/claimEDI/download/{{$edi->uid}}" target="_blank">Download EDI File</a>
+                            </td>
+                        </tr>
+                    @endforeach
+                    </tbody>
+                </table>
+            </div>
+        </div>
+    </div>
+
+@endsection

+ 1 - 1
resources/views/layouts/template.blade.php

@@ -122,7 +122,7 @@
                             <a class="dropdown-item" href="{{ route('practice-management.processingBillMatrix') }}">Processing Bills</a>
                             <a class="dropdown-item" href="{{ route('practice-management.cellularMeasurements') }}">Cellular Measurements</a>
                             <a class="dropdown-item" href="{{ route('practice-management.cellularDeviceManager') }}">Cellular Device Manager</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.claims') }}">Claims</a>
+                            <a class="dropdown-item" href="{{ route('practice-management.medicarePartBClaims') }}">Medicare Part B Claims</a>
                             <a class="dropdown-item" href="{{ route('practice-management.hcpBillMatrix') }}">HCP Bill Matrix</a>
                             <a class="dropdown-item" href="{{ route('practice-management.treatmentServiceUtil') }}">Treatment Service Util.</a>
                             <a class="dropdown-item" href="{{ route('practice-management.tickets') }}">Tickets</a>

+ 1 - 1
routes/web.php

@@ -103,7 +103,7 @@ Route::middleware('pro.auth')->group(function () {
             Route::get('bill-matrix/{proUid?}', 'PracticeManagementController@billMatrix')->name('billMatrix');
 
             Route::get('tickets', 'PracticeManagementController@tickets')->name('tickets');
-            Route::get('claims', 'PracticeManagementController@claims')->name('claims');
+            Route::get('medicare-partb-claims', 'PracticeManagementController@medicarePartBClaims')->name('medicarePartBClaims');
             Route::get('claims-download', 'PracticeManagementController@downloadClaims')->name('download-claims');
 
             Route::get('treatment-service-util', 'PracticeManagementController@treatmentServiceUtil')->name('treatmentServiceUtil');