patients.blade.php 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. @extends ('layouts/template')
  2. @section('content')
  3. <?php
  4. $showProgramsColumn = false;
  5. foreach($patients as $patient) {
  6. if(count($patient->clientPrograms)) {
  7. if($pro->pro_type === 'ADMIN') {
  8. $showProgramsColumn = true;
  9. break;
  10. }
  11. else {
  12. foreach($patient->clientPrograms as $clientProgram) {
  13. if(in_array($pro->id, [$clientProgram->mcp_pro_id, $clientProgram->manager_pro_id])) {
  14. $showProgramsColumn = true;
  15. break;
  16. }
  17. }
  18. if($showProgramsColumn) break;
  19. }
  20. }
  21. }
  22. ?>
  23. <div class="p-3 mcp-theme-1">
  24. <div class="card">
  25. <div class="card-header px-3 py-2 d-flex align-items-center">
  26. <strong class="mr-4">
  27. <i class="fas fa-user-injured"></i>
  28. Patients
  29. </strong>
  30. <select class="ml-auto max-width-300px form-control form-control-sm" onchange="fastLoad('/patients/' + this.value, true, false, false)">
  31. <option value="" {{ $filter === '' ? 'selected' : '' }}>All patients</option>
  32. <option value="not-yet-seen" {{ $filter === 'not-yet-seen' ? 'selected' : '' }}>Patients I have not seen yet</option>
  33. </select>
  34. </div>
  35. <div class="card-body p-0">
  36. <table class="table table-condensed p-0 m-0">
  37. <thead class="bg-light">
  38. <tr>
  39. @if($pro->pro_type === 'ADMIN')
  40. <th class="border-0"></th>
  41. @endif
  42. <th class="px-3 border-0">Chart #</th>
  43. <th class="border-0">Patient</th>
  44. <th class="border-0">Created At</th>
  45. @if($showProgramsColumn)<th class="border-0">Program(s)</th>@endif
  46. <th class="border-0">MCN</th>
  47. <th class="border-0">PCP</th>
  48. {{--<th class="border-0">RMM</th>--}}
  49. <th class="border-0">Upcoming Appointments</th>
  50. </tr>
  51. </thead>
  52. <tbody>
  53. @foreach($patients as $patient)
  54. <tr>
  55. @if($pro->pro_type === 'ADMIN')
  56. <td>{{$loop->index + 1}}</td>
  57. @endif
  58. <td class="px-3">
  59. <a href="{{route('patients.view.dashboard', $patient)}}">
  60. {{$patient->chart_number}}
  61. </a>
  62. </td>
  63. <td>
  64. {{$patient->displayName()}}
  65. @if($patient->has_mcp_done_onboarding_visit !== 'YES')
  66. <span title="MCP Onboarding Visit Pending"><i class="fa fa-exclamation-triangle"></i></span>
  67. @endif
  68. <div>{{ friendly_date_time($patient->dob, false) }}{{ $patient->sex === 'M' ? ', Male' : ($patient->sex === ', F' ? 'Female' : '') }}</div>
  69. </td>
  70. <td>{{friendly_date_time_short_with_tz($patient->created_at, true, 'EASTERN')}}</td>
  71. @if($showProgramsColumn)
  72. <td>
  73. <?php $programNumber = 0; ?>
  74. @foreach($patient->clientPrograms as $clientProgram)
  75. <?php
  76. if($pro->pro_type === 'ADMIN' ||
  77. in_array($pro->id, [$clientProgram->mcp_pro_id, $clientProgram->manager_pro_id])
  78. ) {
  79. // $program = $clientProgram->program;
  80. $programNumber++;
  81. ?>
  82. <div class="mb-1 text-nowrap">
  83. {{ $programNumber }}. {{ $clientProgram->title }}
  84. @if($clientProgram->has_mcp_done_onboarding_visit !== 'YES')
  85. <span title="Onboarding Pending" class="ml-1"><i class="fa fa-exclamation-triangle"></i></span>
  86. @else
  87. <span title="Onboarding Complete" class="ml-1 text-secondary"><i class="fa fa-check"></i></span>
  88. @endif
  89. </div>
  90. <?php } ?>
  91. @endforeach
  92. </td>
  93. @endif
  94. <td>
  95. @if($patient->was_medicare_validation_successful && $patient->is_part_b_primary == 'YES')
  96. Covered <span style="color:green"><i class="fa fa-check-circle"></i></span>
  97. @elseif($patient->was_medicare_validation_successful)
  98. <div>Valid Medicare Number</div>
  99. <div class="text-secondary">Not Medicare Part B</div>
  100. @if($patient->is_medicare_advantage == 'YES')
  101. <div class="text-secondary">Medicare Advantage: <b>{{$patient->medicare_advantage_plan}}</b></div>
  102. @endif
  103. @else
  104. @if($patient->mcn)
  105. <div>Invalid MCN</div>
  106. @else
  107. <div>No Info Provided</div>
  108. @endif
  109. @endif
  110. </td>
  111. <td>
  112. {{ $patient->mcp ? $patient->mcp->displayName() : '-' }}
  113. </td>
  114. {{--<td>
  115. {{ $patient->rmm ? $patient->rmm->displayName() : '-' }}
  116. </td>--}}
  117. <td>
  118. <table class="table table-sm border-0 my-0">
  119. <tbody>
  120. <?php $numAppts = 0; ?>
  121. @foreach($patient->upcomingAppointments as $appointment)
  122. @if($appointment->status !== 'CANCELLED' && $appointment->status !== 'ABANDONED')
  123. <tr>
  124. <td class="text-black p-0 border-0">
  125. <div class="pb-0">
  126. {{ friendly_date_time($appointment->start_time, false) }}, {{ friendly_time($appointment->raw_start_time) }}
  127. <span class="d-inline-block text-secondary text-sm">({{ $appointment->timezone }})</span>
  128. &nbsp;/&nbsp;
  129. <b class="mr-1">{{$appointment->pro->displayName()}}</b>
  130. <span class="text-secondary text-sm">({{ $appointment->status }})</span>
  131. </div>
  132. </td>
  133. </tr>
  134. <?php $numAppts++; ?>
  135. @endif
  136. @endforeach
  137. @if(!$numAppts)
  138. <tr>
  139. <td class="text-secondary p-0 border-0">
  140. No upcoming appointments
  141. </td>
  142. </tr>
  143. @endif
  144. </tbody>
  145. </table>
  146. </td>
  147. </tr>
  148. @endforeach
  149. </tbody>
  150. </table>
  151. <div class="ml-2 mt-2">
  152. {{$patients->links()}}
  153. </div>
  154. </div>
  155. </div>
  156. </div>
  157. @endsection