patients.blade.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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. <option value="having-birthday-today" {{ $filter === 'having-birthday-today' ? 'selected' : '' }}>Patients having birthday today</option>
  34. </select>
  35. </div>
  36. <div class="card-body p-0">
  37. <table class="table table-condensed p-0 m-0">
  38. <thead class="bg-light">
  39. <tr>
  40. @if($pro->pro_type === 'ADMIN')
  41. <th class="border-0"></th>
  42. @endif
  43. <th class="px-3 border-0">Chart #</th>
  44. <th class="border-0">Patient</th>
  45. <th class="border-0 px-1">OB</th>
  46. <th class="border-0">Signed<br>Notes</th>
  47. <th class="border-0">Created At</th>
  48. <th class="border-0">Address</th>
  49. @if($showProgramsColumn)<th class="border-0">Program(s)</th>@endif
  50. <th class="border-0">MCN</th>
  51. <th class="border-0">PCP</th>
  52. {{--<th class="border-0">RMM</th>--}}
  53. <th class="border-0">Appointments</th>
  54. </tr>
  55. </thead>
  56. <tbody>
  57. @foreach($patients as $patient)
  58. <tr>
  59. @if($pro->pro_type === 'ADMIN')
  60. <td>{{$loop->index + 1}}</td>
  61. @endif
  62. <td class="px-3">
  63. <a href="{{route('patients.view.dashboard', $patient)}}">
  64. {{$patient->chart_number}}
  65. </a>
  66. </td>
  67. <td>
  68. {{$patient->displayName()}}
  69. <div>{{ friendly_date_time($patient->dob, false) }}{{ $patient->sex === 'M' ? ', Male' : ($patient->sex === ', F' ? 'Female' : '') }}</div>
  70. </td>
  71. <td class="px-1">
  72. @if($patient->has_mcp_done_onboarding_visit !== 'YES')
  73. <span title="MCP Onboarding Visit Pending"><i class="fa fa-exclamation-triangle"></i></span>
  74. @else
  75. <i class="fa fa-check text-secondary on-hover-opaque"></i>
  76. @endif
  77. </td>
  78. <td>
  79. <?php $numSignedNotes = $patient->numSignedNotes(); ?>
  80. <span class="{{$numSignedNotes && $patient->has_mcp_done_onboarding_visit !== 'YES' ? 'font-weight-bold text-warning-mellow' : 'text-secondary'}}">
  81. {{$numSignedNotes ? $numSignedNotes :'-'}}
  82. </span>
  83. </td>
  84. <td>{{friendly_date_time_short_with_tz($patient->created_at, true, 'EASTERN')}}</td>
  85. <td>
  86. <?php
  87. $addressParts = [];
  88. if (!!$patient->mailing_address_line1) $addressParts[] = $patient->mailing_address_line1;
  89. if (!!$patient->mailing_address_line2) $addressParts[] = $patient->mailing_address_line2;
  90. $addressParts = implode(", ", $addressParts) . "<br/>";
  91. $addressPart2 = [];
  92. if (!!$patient->mailing_address_city) $addressPart2[] = $patient->mailing_address_city;
  93. if (!!$patient->mailing_address_state) $addressPart2[] = $patient->mailing_address_state;
  94. $addressParts .= implode(", ", $addressPart2);
  95. echo $addressParts;
  96. ?>
  97. </td>
  98. @if($showProgramsColumn)
  99. <td>
  100. <?php $programNumber = 0; ?>
  101. @foreach($patient->clientPrograms as $clientProgram)
  102. <?php
  103. if($pro->pro_type === 'ADMIN' ||
  104. in_array($pro->id, [$clientProgram->mcp_pro_id, $clientProgram->manager_pro_id])
  105. ) {
  106. // $program = $clientProgram->program;
  107. $programNumber++;
  108. ?>
  109. <div class="mb-1 text-nowrap">
  110. {{ $programNumber }}. {{ $clientProgram->title }}
  111. @if($clientProgram->has_mcp_done_onboarding_visit !== 'YES')
  112. <span title="Onboarding Pending" class="ml-1"><i class="fa fa-exclamation-triangle"></i></span>
  113. @else
  114. <span title="Onboarding Complete" class="ml-1 text-secondary"><i class="fa fa-check"></i></span>
  115. @endif
  116. </div>
  117. <?php } ?>
  118. @endforeach
  119. </td>
  120. @endif
  121. <td>
  122. @if($patient->was_medicare_validation_successful && $patient->is_part_b_primary == 'YES')
  123. Covered <span style="color:green"><i class="fa fa-check-circle"></i></span>
  124. @elseif($patient->was_medicare_validation_successful)
  125. <div>Valid Medicare Number</div>
  126. <div class="text-secondary">Not Medicare Part B</div>
  127. @if($patient->is_medicare_advantage == 'YES')
  128. <div class="text-secondary">Medicare Advantage: <b>{{$patient->medicare_advantage_plan}}</b></div>
  129. @endif
  130. @else
  131. @if($patient->mcn)
  132. <div>Invalid MCN</div>
  133. @else
  134. @if($patient->is_coverage_manually_verified)
  135. {{$patient->coverage_manual_verification_memo}} <span style="color:green"><i class="fa fa-check-circle">
  136. @else
  137. <div>No Info Provided</div>
  138. @endif
  139. @endif
  140. @endif
  141. </td>
  142. <td>
  143. {{ $patient->mcp ? $patient->mcp->displayName() : '-' }}
  144. </td>
  145. {{--<td>
  146. {{ $patient->rmm ? $patient->rmm->displayName() : '-' }}
  147. </td>--}}
  148. <td>
  149. <table class="table table-sm border-0 my-0">
  150. <tbody>
  151. <?php $numAppts = 0; ?>
  152. @foreach($patient->upcomingAppointments as $appointment)
  153. @if($appointment->status !== 'CANCELLED' && $appointment->status !== 'ABANDONED')
  154. <tr>
  155. <td class="text-black p-0 border-0">
  156. <div class="pb-0">
  157. {{ friendly_date_time($appointment->start_time, false) }}, {{ friendly_time($appointment->raw_start_time) }}
  158. <span class="d-inline-block text-secondary text-sm">({{ $appointment->timezone }})</span>
  159. &nbsp;/&nbsp;
  160. <b class="mr-1">{{$appointment->pro->displayName()}}</b>
  161. <span class="text-secondary text-sm">({{ $appointment->status }})</span>
  162. </div>
  163. </td>
  164. </tr>
  165. <?php $numAppts++; ?>
  166. @endif
  167. @endforeach
  168. @if(!$numAppts)
  169. <tr>
  170. <td class="text-secondary p-0 border-0">
  171. No upcoming appointments
  172. </td>
  173. </tr>
  174. @endif
  175. </tbody>
  176. </table>
  177. </td>
  178. </tr>
  179. @endforeach
  180. </tbody>
  181. </table>
  182. <div class="ml-2 mt-2">
  183. {{$patients->links()}}
  184. </div>
  185. </div>
  186. </div>
  187. </div>
  188. @endsection