patients.blade.php 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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. <th class="border-0"></th>
  40. <th class="px-3 border-0">#</th>
  41. <th class="border-0">Patient</th>
  42. <th class="border-0">Created At</th>
  43. @if($showProgramsColumn)<th class="border-0">Program(s)</th>@endif
  44. <th class="border-0">MCN</th>
  45. <th class="border-0">PCP</th>
  46. {{--<th class="border-0">RMM</th>--}}
  47. <th class="border-0">Upcoming Appointments</th>
  48. </tr>
  49. </thead>
  50. <tbody>
  51. @foreach($patients as $patient)
  52. <tr>
  53. <td>{{$loop->index + 1}}</td>
  54. <td class="px-3">
  55. <a href="{{route('patients.view.dashboard', $patient)}}">
  56. {{$patient->chart_number}}
  57. </a>
  58. </td>
  59. <td>
  60. {{$patient->displayName()}}
  61. @if($patient->has_mcp_done_onboarding_visit !== 'YES')
  62. <span title="MCP Onboarding Visit Pending"><i class="fa fa-exclamation-triangle"></i></span>
  63. @endif
  64. <div>{{ friendly_date_time($patient->dob, false) }}{{ $patient->sex === 'M' ? ', Male' : ($patient->sex === ', F' ? 'Female' : '') }}</div>
  65. </td>
  66. <td>{{friendly_date_time_short_with_tz($patient->created_at, true, 'EASTERN')}}</td>
  67. @if($showProgramsColumn)
  68. <td>
  69. <?php $programNumber = 0; ?>
  70. @foreach($patient->clientPrograms as $clientProgram)
  71. <?php
  72. if($pro->pro_type === 'ADMIN' ||
  73. in_array($pro->id, [$clientProgram->mcp_pro_id, $clientProgram->manager_pro_id])
  74. ) {
  75. // $program = $clientProgram->program;
  76. $programNumber++;
  77. ?>
  78. <div class="mb-1 text-nowrap">
  79. {{ $programNumber }}. {{ $clientProgram->title }}
  80. @if($clientProgram->has_mcp_done_onboarding_visit !== 'YES')
  81. <span title="Onboarding Pending" class="ml-1"><i class="fa fa-exclamation-triangle"></i></span>
  82. @else
  83. <span title="Onboarding Complete" class="ml-1 text-secondary"><i class="fa fa-check"></i></span>
  84. @endif
  85. </div>
  86. <?php } ?>
  87. @endforeach
  88. </td>
  89. @endif
  90. <td>
  91. @if($patient->was_medicare_validation_successful && $patient->is_part_b_primary == 'YES')
  92. Covered <span style="color:green"><i class="fa fa-check-circle"></i></span>
  93. @elseif($patient->was_medicare_validation_successful)
  94. <div>Valid Medicare Number</div>
  95. <div class="text-secondary">Not Medicare Part B</div>
  96. @if($patient->is_medicare_advantage == 'YES')
  97. <div class="text-secondary">Medicare Advantage: <b>{{$patient->medicare_advantage_plan}}</b></div>
  98. @endif
  99. @else
  100. @if($patient->mcn)
  101. <div>Invalid MCN</div>
  102. @else
  103. <div>No Info Provided</div>
  104. @endif
  105. @endif
  106. </td>
  107. <td>
  108. {{ $patient->mcp ? $patient->mcp->displayName() : '-' }}
  109. </td>
  110. {{--<td>
  111. {{ $patient->rmm ? $patient->rmm->displayName() : '-' }}
  112. </td>--}}
  113. <td>
  114. <table class="table table-sm border-0 my-0">
  115. <tbody>
  116. <?php $numAppts = 0; ?>
  117. @foreach($patient->upcomingAppointments as $appointment)
  118. @if($appointment->status !== 'CANCELLED' && $appointment->status !== 'ABANDONED')
  119. <tr>
  120. <td class="text-black p-0 border-0">
  121. <div class="pb-0">
  122. {{ friendly_date_time($appointment->start_time, false) }}, {{ friendly_time($appointment->raw_start_time) }}
  123. <span class="d-inline-block text-secondary text-sm">({{ $appointment->timezone }})</span>
  124. &nbsp;/&nbsp;
  125. <b class="mr-1">{{$appointment->pro->displayName()}}</b>
  126. <span class="text-secondary text-sm">({{ $appointment->status }})</span>
  127. </div>
  128. </td>
  129. </tr>
  130. <?php $numAppts++; ?>
  131. @endif
  132. @endforeach
  133. @if(!$numAppts)
  134. <tr>
  135. <td class="text-secondary p-0 border-0">
  136. No upcoming appointments
  137. </td>
  138. </tr>
  139. @endif
  140. </tbody>
  141. </table>
  142. </td>
  143. </tr>
  144. @endforeach
  145. </tbody>
  146. </table>
  147. <div class="ml-2 mt-2">
  148. {{$patients->links()}}
  149. </div>
  150. </div>
  151. </div>
  152. </div>
  153. @endsection