Răsfoiți Sursa

Updated table

Samson Mutunga 3 ani în urmă
părinte
comite
400b938a5a

+ 19 - 0
app/Helpers/helpers.php

@@ -176,6 +176,25 @@ if(!function_exists('friendly_date_time')) {
     }
 }
 
+if(!function_exists('friendly_date_month_year')) {
+    function friendly_date_month_year($value, $default = '-', $long_year=true) {
+        if(!$value || empty($value)) return $default;
+        try {
+            $result = strtotime($value);
+                if($long_year){
+                    $result = date("m/Y", $result);
+                }else{
+                    $result = date("m/y", $result);
+                }
+                return $result;
+        }
+        catch (Exception $e) {
+            return $value;
+        }
+    }
+}
+
+
 if(!function_exists('friendlier_date_time')) {
     function friendlier_date_time($value, $includeTime = true, $default = '-') {
         return friendly_date_time($value, $includeTime, $default);

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

@@ -2822,11 +2822,16 @@ ORDER BY c.name_last, c.name_first
         $filters = $request->all();
     
         $careMonthStartDate = $request->get('care_month_start_date');
+        $careMonthYear = $request->get('care_month_year');
         
         if(!$careMonthStartDate){
             $careMonthStartDate = '2022-01-01';
         }
 
+        if($careMonthYear){
+            $careMonthStartDate = $careMonthYear . "-01";
+        }
+
         $lastDateOfMonth = new DateTime(date("Y-m-t", strtotime(get_current_date())));
         $today = new DateTime(get_current_date());
         $diff = $lastDateOfMonth->diff($today);
@@ -2880,6 +2885,12 @@ ORDER BY c.name_last, c.name_first
            
         }
 
+        $claimingClosed = $request->get('claiming_closed');
+        if($claimingClosed){
+            if($claimingClosed === 'YES') $cmQuery = $cmQuery->where('is_claim_closed', true);
+            if($claimingClosed === 'YES') $cmQuery = $cmQuery->where('is_claim_closed', false);
+        }
+
         $rows = $cmQuery->paginate(50);
 
         return view('app.practice-management.rm-action-report', compact('rows', 'filters', 'minRequiredMeasurements'));

+ 103 - 9
resources/views/app/practice-management/rm-action-report.blade.php

@@ -21,7 +21,7 @@
 		margin-right: 15px;
 	}
 	.sm-section {
-		width: 200px !important;
+		width: 250px !important;
 	}
 </style>
 <div id="rm-action-report" class="p-3 mcp-theme-1">
@@ -37,11 +37,28 @@
             <div class="m-2">
                 <form id="rm-action-report-filters" method="GET" action="{{ route('practice-management.rmActionReport') }}" class="filter-container" v-cloak>
                     <div class="sm-section">
+                        <div class="form-group">
+                            <label>Month/Year</label>
+                            <input name="care_month_year" type="month" class="form-control input-sm" v-model="filters.care_month_year">
+                        </div>
+                    </div>
+                    <!-- <div class="sm-section">
                         <div class="form-group">
                             <label>Care Month Start Date:</label>
                             <input name="care_month_start_date" type="date" class="form-control input-sm" v-model="filters.care_month_start_date">
                         </div>
+                    </div> -->
+                    <div class="sm-section">
+                        <div class="form-group">
+                            <label>Claiming Closed:</label>
+                            <select name="claiming_closed" class="form-control input-sm" v-model="filters.claiming_closed">
+                                <option value="">All</option>
+                                <option value="YES">Yes</option>
+                                <option value="NO">No</option>
+                            </select>
+                        </div>
                     </div>
+
                     <div class="sm-section">
                         <div class="form-group">
                             <label>Number Of Measurement Days:</label>
@@ -81,19 +98,35 @@
                             <label>&nbsp;</label>
                             <div class=" d-flex">
                                 <button type="button" v-on:click.prevent="doSubmit()" class="btn btn-primary btn-sm mr-2"><i class="fas fa-filter"></i> Filter</button>
-                                <a href="#" v-on:click.prevent="fastLoad('{{route('mcp.patients')}}')" class="btn btn-link btn-sm text-danger">Clear Filters</a>
+                                <a href="#" v-on:click.prevent="fastLoad('{{ route('practice-management.rmActionReport') }}')" class="btn btn-link btn-sm text-danger">Clear Filters</a>
                             </div>
                         </div>
                     </div>
                 </form>
             </div> 
-            <table class="table table-sm table-striped border-0 p-0 m-0 text-nowrap">
+            <table class="table table-sm table-striped table-bordered border-0 p-0 m-0 text-nowrap">
                 <thead class="bg-light">
                     <tr>
-                        <th>Patient</th>
                         <th>Care Month</th>
+                        <th>Patient</th>                        
                         <th>MCP</th>
+                        <th>RMM</th>
                         <th>Number of Measurement Days</th>
+                        <th>Most Recent Visit</th>
+                        <th>Most Recent Visit Days Before EOM</th>
+                        <th># Minutes Billed by MCP</th>
+                        <th># Minutes Billed by RMM</th>
+                        <th># Minutes Billed Total</th>
+                        <th>Has Admin interacted?</th>
+                        <th>Has MCP interacted?</th>
+                        <th>Is Payable to MCP?</th>
+                        <th>MCP Bill</th>
+                        <th>Is Payable to RMM?</th>
+                        <th>RMM Bill</th>
+                        <th>Guidance</th>
+                        <th>Claiming Closed?</th>
+                        <th>Claim</th>
+
                         <th>Has Been Spoken To This Month</th>
                         <th>Days Since Last Visit</th>
                         <th>Last Visit Date</th>
@@ -103,15 +136,15 @@
                     @foreach ($rows as $row)
                     <tr class="{{false ? 'bg-light' : ''}}">
                         <td class="text-nowrap border-left-0">
-                            <a href="/patients/view/{{$row->client->uid}}">
-                                {{$row->client->name_first}} {{$row->client->name_last}}
+                            <a href="/patients/view/{{$row->client->uid}}/care-months/view/{{$row->uid}}">
+                                {{friendly_date_month_year($row->start_date)}}
                             </a>
                         </td>
                         <td class="text-nowrap border-left-0">
-                            <a href="/patients/view/{{$row->client->uid}}/care-months/view/{{$row->uid}}">
-                                {{friendly_date($row->start_date)}}
+                            <a href="/patients/view/{{$row->client->uid}}">
+                                {{$row->client->name_first}} {{$row->client->name_last}}
                             </a>
-                        </td>
+                        </td>                        
                         <td>
                             @if($row->client->mcp)
                                 {{$row->client->mcp->name_first}} {{$row->client->mcp->name_last}}
@@ -119,9 +152,68 @@
                                 --
                             @endif
                         </td>
+                        <td>
+                            @if($row->client->rmm)
+                                {{$row->client->rmm->name_first}} {{$row->client->rmm->name_last}}
+                            @else 
+                                --
+                            @endif
+                        </td>
                         <td>
                             {{$row->number_of_days_with_remote_measurements}}
                         </td>
+                        <td>
+                            <!-- Most Recent Visit -->
+                        </td>
+                        <td>
+                            <!-- Most Recent Visit Days Before EOM -->
+                        </td>
+                        <td>
+                            <!-- # Minutes Billed by MCP -->
+                        </td>
+                        <td>
+                            <!-- # Minutes Billed by RMM -->
+                        </td>
+                        <td>
+                            <!-- # Minutes Billed Total -->
+                        </td>
+                        <td>
+                            <!-- Has Admin interacted? -->
+                        </td>
+                        <td>
+                            <!-- Has MCP interacted? -->
+                        </td>
+                        <td>
+                            <!-- Is Payable to MCP? -->
+                        </td>
+                        <td>
+                            <!-- MCP Bill -->
+                        </td>
+                        <td>
+                            <!-- Is Payable to RMM? -->
+                        </td>
+                        <td>
+                            <!-- RMM Bill -->
+                        </td>
+                        <td>
+                            {{--<div class="d-flex flex-column">
+                                <span>453: --</span>
+                                <span>454: --</span>
+                                <span>457: --</span>
+                                <span>458: --</span>
+                            </div>--}}
+                        </td>
+                        <td>
+                            <!-- Claiming Closed? -->
+                        </td>
+                        <td>
+                            {{--<div class="d-flex flex-column">
+                                <span>453: --</span>
+                                <span>454: --</span>
+                                <span>457: --</span>
+                                <span>458: --</span>
+                            </div>--}}
+                        </td>
                         <td>
                             {{$row->has_anyone_interacted_with_client_about_rm_outside_note? 'YES': 'NO'}}
                         </td>
@@ -162,6 +254,8 @@
 $loadedFilters = $filters;
 $allFilterKeys = [
 	'care_month_start_date',
+    'care_month_year',
+    'claiming_closed',
     'num_of_measurements',
     'has_recent_visit',
     'has_been_spoken_to',