瀏覽代碼

MCP patients list - show patients

Vijayakrishnan 3 年之前
父節點
當前提交
644aca8cd1
共有 2 個文件被更改,包括 36 次插入18 次删除
  1. 4 4
      app/Http/Controllers/McpController.php
  2. 32 14
      resources/views/app/mcp/patients.blade.php

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

@@ -37,8 +37,10 @@ class McpController extends Controller
 
     public function patients(Request $request)
     {
-        $patients = Client::paginate(5);
-        // SELECT * FROM client WHERE mcp_pro_id = :me.id
+        $patients = Client::whereNull('shadow_pro_id')
+            ->where('mcp_pro_id', $this->performer->pro->id)
+            ->orderBy('created_at', 'DESC')
+            ->get();
         return view('app.mcp.patients', compact('patients'));
     }
 
@@ -87,8 +89,6 @@ class McpController extends Controller
         return view('app.mcp.client_messages', compact('clientMessages'));
     }
 
-
-
     public function new_patients_awaiting_visit(Request $request){
         $data = [
             'records' => Client::where('mcp_pro_id', $this->performer->pro->id)

+ 32 - 14
resources/views/app/mcp/patients.blade.php

@@ -44,17 +44,38 @@
                         </td>
                         <td>{{$patient->displayName()}}</td>
                         <td>{{ friendly_date_time($patient->dob, false) }}</td>
-                        <td>{{ $patient->sex === 'M' ? ', Male' : ($patient->sex === ', F' ? 'Female' : '') }}</td>
-                        <td>{{-- BMI --}} - </td>
-                        <td>{{-- Insurance --}} - </td>
-                        <td>{{-- Last Visit --}} - </td>
-                        <td>{{-- Next Appt. --}} - </td>
-                        <td>{{-- Status --}} - </td>
-                        <td>{{-- CCM --}} - </td>
-                        <td>{{-- RPM --}} - </td>
-                        <td>{{-- Last Weight-In --}} - </td>
-                        <td>{{-- Last BP --}} - </td>
-                        <td>{{-- Assigned On --}} - </td>
+                        <td>{{ $patient->sex }}</td>
+                        <td>{{ $patient->usual_bmi }}</td>
+                        <td>
+                            <?php $coverageStatus = $patient->getPrimaryCoverageStatus(); ?>
+                            @if($coverageStatus === 'YES')
+                                <div class="text-nowrap">Covered <i class="fa fa-check-circle text-success"></i>
+                                </div>
+                            @elseif($coverageStatus === 'NO')
+                                <div class="text-nowrap">Not Covered <i class="fa fa-times text-danger"></i></div>
+                            @else
+                                <div class="text-nowrap">Unknown <i
+                                            class="fa fa-exclamation-triangle text-warning-mellow"></i></div>
+                            @endif
+                            <?php $coverage = $patient->getPrimaryCoverage(); ?>
+                            @if($coverage)
+                                {{$coverage->toString()}}
+                            @endif
+                        </td>
+                        <td>{{$patient->lastMcpAppointment() ? $patient->lastMcpAppointment()->start_date : '-'}}</td>
+                        <td>{{$patient->nextMcpAppointment() ? $patient->nextMcpAppointment()->start_date : '-'}}</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>
+                            <?php $m = $patient->lastMeasurementOfType('Wt. (lbs.)'); ?>
+                            {{$m && $m->value ? round($m->value, 2) : '-'}}
+                        </td>
+                        <td>
+                            <?php $m = $patient->lastMeasurementOfType('BP'); ?>
+                            {{$m && $m->value ? $m->value : '-'}}
+                        </td>
+                        <td>{{$patient->getMcpAssignedOn()}}</td>
                     </tr>
                     @endforeach
 
@@ -66,9 +87,6 @@
                 </tbody>
 
             </table>
-            <div class="ml-2 mt-2">
-                {{ $patients->appends(request()->input())->links() }}
-            </div>
         </div>
     </div>
 </div>