Pārlūkot izejas kodu

Merge branch 'master' into dev-vj

Vijayakrishnan 3 gadi atpakaļ
vecāks
revīzija
001c01244c

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

@@ -93,7 +93,7 @@ class McpController extends Controller
                 break;
         }
 
-        $patients = $patients->orderBy('created_at', 'DESC')->paginate(20);
+        $patients = $patients->orderBy('created_at', 'DESC')->paginate(50);
         return view('app.mcp.patients', compact('patients', 'filters'));
     }
 
@@ -103,9 +103,9 @@ class McpController extends Controller
         $notes = Note::query();
         $notes = $notes->where('hcp_pro_id', $this->performer->pro->id);
         $this->filterMultiQuery($request, $notes, 'effective_time', 'date_category', 'date_value_1', 'date_value_2');
-        $this->filterSimpleQuery($request, $notes, 'new_or_fu_or_na', 'new_or_fu_or_na');   
+        $this->filterSimpleQuery($request, $notes, 'new_or_fu_or_na', 'new_or_fu_or_na');
         $notes = $notes->orderBy('created_at', 'DESC')->paginate(20);
-        
+
 
         return view('app.mcp.notes', compact('notes','filters'));
     }
@@ -136,7 +136,7 @@ class McpController extends Controller
 
     public function clients_bdt_devices(Request $request){
         $filters = $request->all();
-        
+
         $devices = ClientBDTDevice::select('client_bdt_device.*')
         ->join('client', 'client.id', '=', 'client_bdt_device.client_id')
         ->where('client.mcp_pro_id', $this->performer->pro->id);
@@ -154,7 +154,7 @@ class McpController extends Controller
 
     public function memos(Request $request){
         $filters = $request->all();
-        
+
         $memos = ClientMemo::select('client_memo.*')
         ->join('client', 'client.id', '=', 'client_memo.client_id')
         ->where('client.mcp_pro_id', $this->performer->pro->id);
@@ -198,7 +198,7 @@ class McpController extends Controller
         $filters = $request->all();
         $supplyOrders = SupplyOrder::select('supply_order.*')->where('supply_order.signed_by_pro_id', $this->performer->pro->id);
         $this->filterMultiQuery($request, $supplyOrders, 'created_at', 'date_category', 'date_value_1', 'date_value_2');
-        $status = $request->get('status');        
+        $status = $request->get('status');
         if($status){
             if($status == 'CLEARED_FOR_SHIPMENT'){
                 $supplyOrders = $supplyOrders->where('is_cleared_for_shipment', true);
@@ -207,16 +207,16 @@ class McpController extends Controller
             }elseif($status == 'CANCELLED'){
                 $supplyOrders = $supplyOrders->where('is_cancelled', true);
             }else{
-             $supplyOrders = $supplyOrders->join('shipment', 'shipment.id', '=', 'supply_order.shipment_id')->where('shipment.status', $status);   
+             $supplyOrders = $supplyOrders->join('shipment', 'shipment.id', '=', 'supply_order.shipment_id')->where('shipment.status', $status);
             }
-            
+
         }
         $supplyOrders = $supplyOrders->orderBy('created_at', 'DESC')->paginate(20);
         return view('app.mcp.supply_orders', compact('supplyOrders', 'filters'));
     }
 
     public function client_messages(Request $request)
-    {      
+    {
         $filters = $request->all();
 
         $clientMessages = ClientSMS::select('client_sms.*')

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

@@ -46,6 +46,17 @@ use Illuminate\Http\Request;
 class PracticeManagementController extends Controller
 {
 
+    public function rpmMatrix(Request $request)
+    {
+        $proID = $this->performer()->pro->id;
+        $isAdmin = $this->performer()->pro->pro_type == 'ADMIN';
+        $query = Client::whereNull('shadow_pro_id');
+        if(!$isAdmin) $query->where('mcp_pro_id', '=', $proID);
+        $clients = $query->orderByRaw('most_recent_cellular_measurement_at desc nulls last')
+            ->paginate(50);
+        return view ('app.practice-management.rpm-matrix', compact('clients'));
+    }
+
     public function mcCodeChecks(Request $request)
 	{
 		$checks = McCodeCheck::orderBy('next_eligible_date_professional', 'asc')->get();
@@ -2025,7 +2036,7 @@ ORDER BY c.name_last, c.name_first
 
     public function clientsBdtDevices(Request $request){
         $filters = $request->all();
-        
+
         $devices = ClientBDTDevice::select('client_bdt_device.*')
         ->join('client', 'client.id', '=', 'client_bdt_device.client_id');
 
@@ -2045,7 +2056,7 @@ ORDER BY c.name_last, c.name_first
 
     public function memos(Request $request){
         $filters = $request->all();
-        
+
         $memos = ClientMemo::select('client_memo.*')
         ->join('client', 'client.id', '=', 'client_memo.client_id');
 
@@ -2060,6 +2071,6 @@ ORDER BY c.name_last, c.name_first
         return view('app.practice-management.memos', compact('memos', 'filters'));
     }
 
-    
+
 
 }

+ 2 - 1
app/Models/Pro.php

@@ -56,7 +56,8 @@ class Pro extends Model
 
     public function isDefaultNA()
     {
-        return $this->is_considered_for_dna;
+        // TODO are we using this?
+        return true; // $this->is_considered_for_dna;
     }
 
     public function lastPayment() {

+ 73 - 31
resources/views/app/mcp/patients-table.blade.php

@@ -1,37 +1,56 @@
-<table class="table table-condensed p-0 m-0">
+<style>
+    td, th {
+        text-align: center !important;
+    }
+</style>
+
+<table class="table table-condensed p-0 m-0 table-sm table-bordered">
 	<thead class="bg-light">
 		<tr>
-			<th class="px-3 border-0">#</th>
-			<th class="px-3 border-0">Name</th>
-			<th class="px-3 border-0">DOB</th>
-			<th class="px-3 border-0">Age</th>
-			<th class="px-3 border-0">Sex</th>
-			<th class="px-3 border-0">BMI</th>
-			<th class="px-3 border-0">Insurance</th>
-			<th class="px-3 border-0">Last Visit</th>
-			<th class="px-3 border-0">Next Appt.</th>
-			<th class="px-3 border-0">Status</th>
-			<th class="px-3 border-0">CCM</th>
-			<th class="px-3 border-0">RPM</th>
-			<th class="px-3 border-0 d-none">Last Weight-In</th>
-			<th class="px-3 border-0 d-none">Last BP</th>
-			<th class="px-3 border-0">Assigned On</th>
+			<th class="px-3 border-0x">#</th>
+			<th class="px-3 border-0x">Name</th>
+			<th class="px-3 border-0x">DOB</th>
+			<th class="px-3 border-0x">Age</th>
+			<th class="px-3 border-0x">Sex</th>
+			<th class="px-3 border-0x">BMI</th>
+			<th class="px-3 border-0x">Insurance</th>
+			<th class="px-3 border-0x">Last Visit</th>
+			<th class="px-3 border-0x">Next Appt.</th>
+			<th class="px-3 border-0x">Status</th>
+
+            <th class="px-3 border-0x">BP</th>
+            <th class="px-3 border-0x"> <i class="fa fa-heartbeat"></i> </th>
+            <th class="px-3 border-0x">Pulse</th>
+            <th class="px-3 border-0x">BP/Pulse Timestamp</th>
+            <th class="px-3 border-0x">Weight</th>
+            <th class="px-3 border-0x">Weight Timestamp</th>
+
+{{--            <th>Scale <i class="fa fa-battery"></i></th>--}}
+            {{--			<th class="px-3 border-0x">RPM</th>--}}
+            {{--			<th class="px-3 border-0x">CCM</th>--}}
+{{--            <th class="px-3 border-0x d-none">Last Weight-In</th>--}}
+{{--            <th class="px-3 border-0x d-none">Last BP</th>--}}
+            <th class="px-3 border-0x">Assigned On</th>
+
+        @if($pro->pro_type == 'ADMIN')
+                <th class="px-3 border-0x">MCP</th>
+            @endif
 		</tr>
 	</thead>
 	<tbody>
 		@foreach($patients as $patient)
 		<tr>
-			<td class="px-3">
+			<td class="px-3 text-nowrap">
 				<a native target="_blank" href="{{route('patients.view.dashboard', $patient)}}">
 					{{$patient->chart_number}}
 				</a>
 			</td>
-			<td>{{$patient->displayName()}}</td>
+			<td class="text-nowrap">{{$patient->displayName()}}</td>
 			<td class="text-nowrap">{{ friendly_date_time($patient->dob, false) }}</td>
-			<td>{{ $patient->age_in_years ?  $patient->age_in_years : '-' }}</td>
-			<td>{{ $patient->sex }}</td>
-			<td>
-				<div class="d-flex flex-column">
+			<td class="text-nowrap">{{ $patient->age_in_years ?  $patient->age_in_years : '-' }}</td>
+			<td class="text-nowrap">{{ $patient->sex }}</td>
+			<td class="text-nowrap">
+				<div class="d-none d-dflex flex-column">
 					@if($patient->usual_bmi_min && $patient->usual_bmi_max)
 						<small class="text-muted">BMI (Usual): <b>{{ $patient->usual_bmi_min }}</b> {{ $patient->usual_bmi_min_category }} to <b>{{ $patient->usual_bmi_max }}</b> {{ $patient->usual_bmi_max_category }}</small>
 					@endif
@@ -40,7 +59,7 @@
 					@endif
 				</div>
 			</td>
-			<td>
+			<td class="text-nowrap">
 				<?php $coverageStatus = $patient->getPrimaryCoverageStatus(); ?>
 				<div class="text-nowrap">
 					@if($coverageStatus === 'YES')
@@ -56,20 +75,43 @@
 					@endif
 				</div>
 			</td>
-			<td>{{$patient->lastMcpAppointment ? friendly_date_time($patient->lastMcpAppointment->raw_date.' '.$patient->lastMcpAppointment->raw_start_time) : '-'}}</td>
-			<td>{{$patient->nextMcpAppointment ? friendly_date_time($patient->nextMcpAppointment->raw_date.' '.$patient->nextMcpAppointment->raw_start_time) : '-'}}</td>
-			<td>{{$patient->nextMcpAppointment ? $patient->nextMcpAppointment->status : '-'}}</td>
-			<td>{{$patient->is_enrolled_in_cm ? 'Yes' : 'No'}}</td>
-			<td>{{$patient->is_enrolled_in_rm ? 'Yes' : 'No'}}</td>
-			<td class="d-none">
+			<td class="text-nowrap">
+                {{ friendly_date($patient->most_recent_completed_mcp_note_date) }}
+{{--                {{$patient->lastMcpAppointment ? friendly_date_time($patient->lastMcpAppointment->raw_date.' '.$patient->lastMcpAppointment->raw_start_time) : '-'}}--}}
+            </td>
+			<td class="text-nowrap">{{$patient->nextMcpAppointment ? friendly_date_time($patient->nextMcpAppointment->raw_date.' '.$patient->nextMcpAppointment->raw_start_time) : '-'}}</td>
+			<td class="text-nowrap">{{$patient->nextMcpAppointment ? $patient->nextMcpAppointment->status : '-'}}</td>
+
+            <td class="text-nowrap">
+                @if($patient->most_recent_cellular_bp_measurement_at)
+                    {{ $patient->most_recent_cellular_bp_sbp_mm_hg }} / {{ $patient->most_recent_cellular_bp_dbp_mm_hg }}
+                @endif
+            </td>
+
+            <td class="text-nowrap"><?= $patient->most_recent_cellular_bp_value_irregular ? '<i class="fa fa-heartbeat"></i>' : '' ?></td>
+
+            <td class="text-nowrap">{{ $patient->most_recent_cellular_bp_value_pulse }}</td>
+
+            <td class="text-nowrap">{{ friendlier_date_time($patient->most_recent_cellular_bp_measurement_at, false) }}</td>
+
+            <td class="text-nowrap">{{ $patient->most_recent_cellular_weight_value ? round($patient->most_recent_cellular_weight_value, 2) : '--' }}</td>
+
+            <td class="text-nowrap">{{ friendlier_date_time($patient->most_recent_cellular_weight_measurement_at, false) }}</td>
+
+{{--			<td class=text-nowrap">{{$patient->is_enrolled_in_cm ? 'Yes' : 'No'}}</td>--}}
+{{--			<td class=text-nowrap">{{$patient->is_enrolled_in_rm ? 'Yes' : 'No'}}</td>--}}
+			<td class="d-none text-nowrap">
 				<?php $m = $patient->lastMeasurementOfType('Wt. (lbs.)'); ?>
 				{{$m && $m->value ? round($m->value, 2) : '-'}}
 			</td>
-			<td class="d-none">
+			<td class="d-none text-nowrap">
 				<?php $m = $patient->lastMeasurementOfType('BP'); ?>
 				{{$m && $m->value ? $m->value : '-'}}
 			</td>
-			<td>{{$patient->getMcpAssignedOn()}}</td>
+			<td class="text-nowrap"">{{$patient->getMcpAssignedOn()}}</td>
+            @if($pro->pro_type == 'ADMIN')
+                <td class="text-nowrap"">{{$patient->mcp->display_name ?? '--'}}</td>
+            @endif
 		</tr>
 		@endforeach
 

+ 4 - 1
resources/views/app/patients.blade.php

@@ -46,7 +46,7 @@
         </div>
 
         <div class="card-body p-0">
-            <table class="table table-condensed p-0 m-0">
+            <table class="table table-sm table-bordered p-0 m-0">
                 <thead class="bg-light">
                 <tr>
                     @if($pro->pro_type === 'ADMIN')
@@ -71,6 +71,9 @@
                     <th class="border-0">Appointments</th>
                     <th class="border-0">Account</th>
                     <th class="border-0">Tags</th>
+
+
+
                 </tr>
                 </thead>
                 <tbody>

+ 81 - 0
resources/views/app/practice-management/rpm-matrix.blade.php

@@ -0,0 +1,81 @@
+@extends ('layouts/template')
+
+@section('content')
+    <style>
+        td, th {
+            text-align: center !important;
+        }
+    </style>
+    <div class="p-3 mcp-theme-1">
+        <div class="card">
+            <div class="card-header p-3 d-flex align-items-center">
+                <strong class="mr-4">
+                    <i class="fas fa-chart-bar"></i>
+                    RPM Matrix
+                </strong>
+            </div>
+
+            <div class="card-body p-0">
+                <table class="table table-bordered table-sm table-condensed p-0 m-0" style="">
+                    <thead class="bg-light">
+                        <tr>
+                            <th>Chart #</th>
+                            <th>Name</th>
+                            <th>DOB</th>
+                            @if($pro->pro_type == 'ADMIN')
+                            <th>MCP</th>
+                            @endif
+                            <th>BP</th>
+                            <th> <i class="fa fa-heartbeat"></i> </th>
+                            <th>Pulse</th>
+                            <th>BP/Pulse Timestamp</th>
+                            <th>BP <i class="fa fa-car-battery"></i></th>
+                            <th>BP <i class="fa fa-broadcast-tower"></i></th>
+                            <th>Weight</th>
+                            <th>Weight Timestamp</th>
+                            <th>Scale <i class="fa fa-battery"></i></th>
+                            <th>Scale <i class="fa fa-broadcast-tower"></i></th>
+                        </tr>
+                    </thead>
+                    <tbody>
+                        @foreach($clients as $client)
+                            <tr>
+                                <td>
+                                    <a native target="_blank" href="{{route('patients.view.dashboard', $client)}}">
+                                        {{$client->chart_number}}
+                                    </a>
+                                </td>
+                                <td>
+                                    <a native target="_blank" href="{{route('patients.view.dashboard', $client)}}">
+                                        {{$client->name_last}}, {{$client->name_first}}
+                                    </a>
+                                </td>
+                                <td>{{ $client->dob }}</td>
+                                @if($pro->pro_type == 'ADMIN')
+                                <td>{{ $client->mcp->name_display ?? '--' }}</td>
+                                @endif
+                                <td>
+                                    @if($client->most_recent_cellular_bp_measurement_at)
+                                        {{ $client->most_recent_cellular_bp_sbp_mm_hg }} / {{ $client->most_recent_cellular_bp_dbp_mm_hg }}
+                                    @endif
+                                </td>
+                                <td><?= $client->most_recent_cellular_bp_value_irregular ? '<i class="fa fa-heartbeat"></i>' : '' ?></td>
+                                <td>{{ $client->most_recent_cellular_bp_value_pulse }}</td>
+                                <td>{{ friendlier_date_time($client->most_recent_cellular_bp_measurement_at) }}</td>
+                                <td>{{ $client->most_recent_cellular_bp_battery_voltage }}</td>
+                                <td>{{ $client->most_recent_cellular_bp_signal_strength }}</td>
+                                <td>{{ $client->most_recent_cellular_weight_value ? round($client->most_recent_cellular_weight_value, 2) : '--' }}</td>
+                                <td>{{ friendlier_date_time($client->most_recent_cellular_weight_measurement_at) }}</td>
+                                <td>{{ $client->most_recent_cellular_weight_battery_voltage }}</td>
+                                <td>{{ $client->most_recent_cellular_weight_signal_strength }}</td>
+                            </tr>
+                        @endforeach
+                    </tbody>
+                </table>
+            </div>
+        </div>
+        <div class="mt-2">
+            {{$clients->links()}}
+        </div>
+    </div>
+@endsection

+ 6 - 0
resources/views/layouts/template.blade.php

@@ -134,8 +134,12 @@
                     </a>
                     <div class="dropdown-menu mcp-theme-1 no-overflow-menu p-0" aria-labelledby="practice-management">
 
+
+
                         @if($pro->pro_type == 'ADMIN')
 
+                            <a class="dropdown-item" href="{{ route('practice-management.rpmMatrix') }}">RPM Matrix</a>
+
                             {{--<a class="dropdown-item" href="{{ route('practice-management.previousBills') }}">Previous Bills</a>--}}
                             <a class="dropdown-item" href="{{ route('practice-management.financialTransactions') }}">Financial Transactions</a>
                             <a class="dropdown-item" href="/practice-management/bills/not-yet-signed">Pending Bills to Sign</a>
@@ -193,6 +197,8 @@
                             <a class="dropdown-item" href="{{ route('practice-management.proCalendar') }}">Calendar</a>
                             <a class="dropdown-item" href="{{ route('practice-management.remoteMonitoringReport') }}">Remote Monitoring Report</a>
 
+                            <a class="dropdown-item" href="{{ route('practice-management.rpmMatrix') }}">RPM Matrix</a>
+
                             <a class="dropdown-item" href="{{ route('mcp.notes') }}">Notes</a>
                             <a class="dropdown-item" href="{{ route('mcp.memos') }}">Memos</a>
                             <a class="dropdown-item" href="{{ route('mcp.appointments') }}">Appointments</a>

+ 4 - 1
routes/web.php

@@ -140,6 +140,9 @@ Route::middleware('pro.auth')->group(function () {
     });
 
     Route::name('practice-management.')->prefix('practice-management')->group(function () {
+
+        Route::get('rpm-matrix', 'PracticeManagementController@rpmMatrix')->name('rpmMatrix');
+
         Route::get('remote-monitoring-report', 'PracticeManagementController@remoteMonitoringReport')->name('remoteMonitoringReport');
         Route::get('rates/{selectedProUid?}', 'PracticeManagementController@rates')->name('rates');
         Route::get('dashboard', 'PracticeManagementController@dashboard')->name('dashboard');
@@ -181,7 +184,7 @@ Route::middleware('pro.auth')->group(function () {
         Route::get('patients-accounts-invites', 'PracticeManagementController@patientsAccountsInvites')->name('patientsAccountsInvites');
         Route::get('clients-bdt-devices', 'PracticeManagementController@clientsBdtDevices')->name('clientsBdtDevices');
         Route::get('memos', 'PracticeManagementController@memos')->name('memos');
-        
+
         Route::middleware('pro.auth.admin')->group(function () {
 
             // BILLING REPORT