patients.blade.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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. <th class="border-0">Account</th>
  55. <th class="border-0">Tags</th>
  56. </tr>
  57. </thead>
  58. <tbody>
  59. @foreach($patients as $patient)
  60. <tr>
  61. @if($pro->pro_type === 'ADMIN')
  62. <td>{{$loop->index + 1}}</td>
  63. @endif
  64. <td class="px-3">
  65. <a href="{{route('patients.view.dashboard', $patient)}}">
  66. {{$patient->chart_number}}
  67. </a>
  68. </td>
  69. <td>
  70. {{$patient->displayName()}}
  71. <div>{{ friendly_date_time($patient->dob, false) }}{{ $patient->sex === 'M' ? ', Male' : ($patient->sex === ', F' ? 'Female' : '') }}</div>
  72. </td>
  73. <td class="px-1">
  74. @if($patient->has_mcp_done_onboarding_visit !== 'YES')
  75. <span title="MCP Onboarding Visit Pending"><i class="fa fa-exclamation-triangle"></i></span>
  76. @else
  77. <i class="fa fa-check text-secondary on-hover-opaque"></i>
  78. @endif
  79. </td>
  80. <td>
  81. <?php $numSignedNotes = $patient->numSignedNotes(); ?>
  82. <span class="{{$numSignedNotes && $patient->has_mcp_done_onboarding_visit !== 'YES' ? 'font-weight-bold text-warning-mellow' : 'text-secondary'}}">
  83. {{$numSignedNotes ? $numSignedNotes :'-'}}
  84. </span>
  85. </td>
  86. <td>{{friendly_date_time_short_with_tz($patient->created_at, true, 'EASTERN')}}</td>
  87. <td>
  88. <?php
  89. $addressParts = [];
  90. if (!!$patient->mailing_address_line1) $addressParts[] = $patient->mailing_address_line1;
  91. if (!!$patient->mailing_address_line2) $addressParts[] = $patient->mailing_address_line2;
  92. $addressParts = implode(", ", $addressParts) . "<br/>";
  93. $addressPart2 = [];
  94. if (!!$patient->mailing_address_city) $addressPart2[] = $patient->mailing_address_city;
  95. if (!!$patient->mailing_address_state) $addressPart2[] = $patient->mailing_address_state;
  96. $addressParts .= implode(", ", $addressPart2);
  97. echo $addressParts;
  98. ?>
  99. </td>
  100. @if($showProgramsColumn)
  101. <td>
  102. <?php $programNumber = 0; ?>
  103. @foreach($patient->clientPrograms as $clientProgram)
  104. <?php
  105. if($pro->pro_type === 'ADMIN' ||
  106. in_array($pro->id, [$clientProgram->mcp_pro_id, $clientProgram->manager_pro_id])
  107. ) {
  108. // $program = $clientProgram->program;
  109. $programNumber++;
  110. ?>
  111. <div class="mb-1 text-nowrap">
  112. {{ $programNumber }}. {{ $clientProgram->title }}
  113. @if($clientProgram->has_mcp_done_onboarding_visit !== 'YES')
  114. <span title="Onboarding Pending" class="ml-1"><i class="fa fa-exclamation-triangle"></i></span>
  115. @else
  116. <span title="Onboarding Complete" class="ml-1 text-secondary"><i class="fa fa-check"></i></span>
  117. @endif
  118. </div>
  119. <?php } ?>
  120. @endforeach
  121. </td>
  122. @endif
  123. <td>
  124. @if($patient->was_medicare_validation_successful && $patient->is_part_b_primary == 'YES')
  125. Covered <span style="color:green"><i class="fa fa-check-circle"></i></span>
  126. @elseif($patient->was_medicare_validation_successful)
  127. <div>Valid Medicare Number</div>
  128. <div class="text-secondary">Not Medicare Part B</div>
  129. @if($patient->is_medicare_advantage == 'YES')
  130. <div class="text-secondary">Medicare Advantage: <b>{{$patient->medicare_advantage_plan}}</b></div>
  131. @endif
  132. @else
  133. @if($patient->mcn)
  134. <div>Invalid MCN</div>
  135. @else
  136. @if($patient->is_coverage_manually_verified)
  137. {{$patient->coverage_manual_verification_memo}} <span style="color:green"><i class="fa fa-check-circle">
  138. @else
  139. <div>No Info Provided</div>
  140. @endif
  141. @endif
  142. @endif
  143. </td>
  144. <td>
  145. {{ $patient->mcp ? $patient->mcp->displayName() : '-' }}
  146. </td>
  147. {{--<td>
  148. {{ $patient->rmm ? $patient->rmm->displayName() : '-' }}
  149. </td>--}}
  150. <td>
  151. <table class="table table-sm border-0 my-0">
  152. <tbody>
  153. <?php $numAppts = 0; ?>
  154. @foreach($patient->upcomingAppointments as $appointment)
  155. @if($appointment->status !== 'CANCELLED' && $appointment->status !== 'ABANDONED')
  156. <tr>
  157. <td class="text-black p-0 border-0">
  158. <div class="pb-0">
  159. {{ friendly_date_time($appointment->start_time, false) }}, {{ friendly_time($appointment->raw_start_time) }}
  160. <span class="d-inline-block text-secondary text-sm">({{ $appointment->timezone }})</span>
  161. &nbsp;/&nbsp;
  162. <b class="mr-1">{{$appointment->pro->displayName()}}</b>
  163. <span class="text-secondary text-sm">({{ $appointment->status }})</span>
  164. </div>
  165. </td>
  166. </tr>
  167. <?php $numAppts++; ?>
  168. @endif
  169. @endforeach
  170. @if(!$numAppts)
  171. <tr>
  172. <td class="text-secondary p-0 border-0">
  173. No upcoming appointments
  174. </td>
  175. </tr>
  176. @endif
  177. </tbody>
  178. </table>
  179. </td>
  180. <td>
  181. @if($patient->accountClient)
  182. <span class="font-weight-bold text-info"><i class="fa fa-check"></i></span>
  183. @else
  184. <span class="text-secondary">-</span>
  185. @endif
  186. </td>
  187. <td>
  188. @if($patient->tags)
  189. <?php
  190. $tags = explode("|", $patient->tags);
  191. $tags = array_filter($tags, function($_x) {
  192. return !empty($_x);
  193. });
  194. $tags = implode(", ", $tags);
  195. ?>
  196. {{ $tags }}
  197. @endif
  198. </td>
  199. </tr>
  200. @endforeach
  201. </tbody>
  202. </table>
  203. <div class="ml-2 mt-2">
  204. {{$patients->links()}}
  205. </div>
  206. </div>
  207. </div>
  208. </div>
  209. @endsection