patient.blade.php 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870
  1. @extends(request()->input('popupmode') ? 'layouts.empty' : 'layouts.template')
  2. <?php
  3. /** @var \App\Models\Client $patient */
  4. ?>
  5. <?php
  6. $trimLayout = true;
  7. $routeName = request()->route()->getName();
  8. $isVisitNote = ($routeName === 'patients.view.notes.view.dashboard' && @$note && !!$note->visitTemplate);
  9. $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_create($patient->created_at))->invert === 1);
  10. ?>
  11. <style media="screen">
  12. .pt-name {
  13. font-size: 1.5rem !important;
  14. }
  15. </style>
  16. @section('content')
  17. <div class="container-fluid h-100">
  18. <div class="main-row h-100 {{ !request()->input('popupmode') ? '' : 'px-0' }} {{$isVisitNote ? 'autohide-leftnav' : ''}}">
  19. @if(!request()->input('popupmode'))
  20. <nav id="sidebarMenu" class="d-block bg-light sidebar collapse px-0">
  21. <div class="sidebar-sticky pt-3">
  22. <ul class="nav flex-column mcp-theme-1">
  23. <li class="nav-item">
  24. <a class="nav-link {{ strpos($routeName, 'patients.view.dashboard') === 0 ? 'active' : '' }}"
  25. href="{{ route('patients.view.dashboard', ['patient' => $patient]) }}">Dashboard</a>
  26. </li>
  27. @if($performer->pro->pro_type == 'ADMIN')
  28. <li class="nav-item">
  29. <a class="nav-link {{ strpos($routeName, 'patients.view.migrate-canvas') === 0 ? 'active' : '' }}"
  30. href="{{ route('patients.view.migrate-canvas', ['patient' => $patient]) }}">Canvas Migrate</a>
  31. </li>
  32. <li class="nav-item">
  33. <a class="nav-link {{ strpos($routeName, 'patients.view.canvas') === 0 ? 'active' : '' }}"
  34. href="{{ route('patients.view.canvas', ['patient' => $patient]) }}">Canvas</a>
  35. </li>
  36. @endif
  37. <li class="nav-item">
  38. <a class="nav-link {{ strpos($routeName, 'patients.view.calendar') === 0 ? 'active' : '' }}"
  39. href="{{ route('patients.view.calendar', ['patient' => $patient]) }}">Calendar</a>
  40. </li>
  41. <li class="nav-item">
  42. <a class="nav-link {{ strpos($routeName, 'patients.view.appointments') === 0 ? 'active' : '' }}"
  43. href="{{ route('patients.view.appointments', ['patient' => $patient, 'forPro' => 'all', 'status' => 'all']) }}">Appointments</a>
  44. </li>
  45. {{--
  46. <li class="nav-item">
  47. <a class="nav-link {{ strpos($routeName, 'patients.view.programs') === 0 ? 'active' : '' }}"
  48. href="{{ route('patients.view.programs', ['patient' => $patient]) }}">Programs</a>
  49. </li>
  50. <li class="nav-item">
  51. <a class="nav-link {{ strpos($routeName, 'patients.view.flowsheets') === 0 ? 'active' : '' }}"
  52. href="{{ route('patients.view.flowsheets', ['patient' => $patient]) }}">Flowsheets</a>
  53. </li>
  54. --}}
  55. <li class="nav-item">
  56. <a class="nav-link {{ strpos($routeName, 'patients.view.vitals-settings') === 0 ? 'active' : '' }}"
  57. href="{{ route('patients.view.vitals-settings', ['patient' => $patient]) }}">Vitals Settings</a>
  58. </li>
  59. <li class="nav-item">
  60. <a class="nav-link {{ strpos($routeName, 'patients.view.vitals-graph') === 0 ? 'active' : '' }}"
  61. href="{{ route('patients.view.vitals-graph', ['patient' => $patient]) }}">Vitals Graph</a>
  62. </li>
  63. <li class="nav-item">
  64. <a class="nav-link {{ strpos($routeName, 'patients.view.care-months') === 0 ? 'active' : '' }}"
  65. href="{{ route('patients.view.care-months', ['patient' => $patient]) }}">Care Months</a>
  66. </li>
  67. <li class="nav-item">
  68. <a class="nav-link {{ strpos($routeName, 'patients.view.devices') === 0 ? 'active' : '' }}"
  69. href="{{ route('patients.view.devices', ['patient' => $patient]) }}">Devices</a>
  70. </li>
  71. <li class="nav-item">
  72. <a class="nav-link {{ strpos($routeName, 'patients.view.measurements') === 0 ? 'active' : '' }}"
  73. href="{{ route('patients.view.measurements', ['patient' => $patient]) }}">Measurements</a>
  74. </li>
  75. <li class="nav-item">
  76. <a class="nav-link {{ strpos($routeName, 'patients.view.notes') === 0 ? 'active' : '' }}"
  77. href="{{ route('patients.view.notes', ['patient' => $patient]) }}">Notes</a>
  78. </li>
  79. <li class="nav-item">
  80. <a class="nav-link {{ strpos($routeName, 'patients.view.generic-bills') === 0 ? 'active' : '' }}"
  81. href="{{ route('patients.view.generic-bills', ['patient' => $patient]) }}">Admin. Bills</a>
  82. </li>
  83. <li class="nav-item">
  84. <a class="nav-link {{ strpos($routeName, 'patients.view.handouts') === 0 ? 'active' : '' }}"
  85. href="{{ route('patients.view.handouts', ['patient' => $patient]) }}">Handouts</a>
  86. </li>
  87. <li class="nav-item">
  88. <a class="nav-link {{ strpos($routeName, 'patients.view.rm-setup') === 0 ? 'active' : '' }}"
  89. href="{{ route('patients.view.rm-setup', ['patient' => $patient]) }}">RM Setup</a>
  90. </li>
  91. <?php /* <li class="nav-item">
  92. <a class="nav-link d-flex align-items-center {{ strpos($routeName, 'patients.view.action-items') === 0 ? 'active' : '' }}"
  93. native onclick="return false">
  94. <span class="text-dark">ERx/Orders</span>
  95. </a>
  96. <ul class="m-0 p-0 nav-child-list">
  97. <li class="nav-item">
  98. <a class="nav-link {{ strpos($routeName, 'patients.view.action-items-erx') === 0 ? 'active' : '' }}"
  99. href="{{ route('patients.view.action-items-erx', ['patient' => $patient]) }}">ERx</a>
  100. </li>
  101. <li class="nav-item">
  102. <a class="nav-link {{ strpos($routeName, 'patients.view.action-items-lab') === 0 ? 'active' : '' }}"
  103. href="{{ route('patients.view.action-items-lab', ['patient' => $patient]) }}">Lab</a>
  104. </li>
  105. <li class="nav-item">
  106. <a class="nav-link {{ strpos($routeName, 'patients.view.action-items-imaging') === 0 ? 'active' : '' }}"
  107. href="{{ route('patients.view.action-items-imaging', ['patient' => $patient]) }}">Imaging</a>
  108. </li>
  109. <li class="nav-item">
  110. <a class="nav-link {{ strpos($routeName, 'patients.view.action-items-equipment') === 0 ? 'active' : '' }}"
  111. href="{{ route('patients.view.action-items-equipment', ['patient' => $patient]) }}">Equipment</a>
  112. </li>
  113. </ul>
  114. </li> */ ?>
  115. <li class="nav-item">
  116. <a class="nav-link {{ strpos($routeName, 'patients.view.patient-prescriptions') === 0 ? 'active' : '' }}"
  117. href="{{ route('patients.view.patient-prescriptions', ['patient' => $patient]) }}">ERx &amp; Orders</a>
  118. <?php /*
  119. <ul class="m-0 p-0 nav-child-list">
  120. <li class="nav-item">
  121. <a class="nav-link {{ strpos($routeName, 'patients.view.patient-erx') === 0 && @$type === '' ? 'active' : '' }}"
  122. href="{{ route('patients.view.patient-erx', ['patient' => $patient, 'type' => '']) }}">All</a>
  123. </li>
  124. <li class="nav-item">
  125. <a class="nav-link {{ strpos($routeName, 'patients.view.patient-erx') === 0 && @$type === 'erx' ? 'active' : '' }}"
  126. href="{{ route('patients.view.patient-erx', ['patient' => $patient, 'type' => 'erx']) }}">Drug</a>
  127. </li>
  128. <li class="nav-item">
  129. <a class="nav-link {{ strpos($routeName, 'patients.view.patient-erx') === 0 && @$type === 'lab' ? 'active' : '' }}"
  130. href="{{ route('patients.view.patient-erx', ['patient' => $patient, 'type' => 'lab']) }}">Lab</a>
  131. </li>
  132. <li class="nav-item">
  133. <a class="nav-link {{ strpos($routeName, 'patients.view.patient-erx') === 0 && @$type === 'imaging' ? 'active' : '' }}"
  134. href="{{ route('patients.view.patient-erx', ['patient' => $patient, 'type' => 'imaging']) }}">Imaging</a>
  135. </li>
  136. <li class="nav-item">
  137. <a class="nav-link {{ strpos($routeName, 'patients.view.patient-erx') === 0 && @$type === 'referral' ? 'active' : '' }}"
  138. href="{{ route('patients.view.patient-erx', ['patient' => $patient, 'type' => 'referral']) }}">Referral</a>
  139. </li>
  140. <li class="nav-item">
  141. <a class="nav-link {{ strpos($routeName, 'patients.view.patient-erx') === 0 && @$type === 'supply' ? 'active' : '' }}"
  142. href="{{ route('patients.view.patient-erx', ['patient' => $patient, 'type' => 'supply']) }}">Supply</a>
  143. </li>
  144. <li class="nav-item">
  145. <a class="nav-link {{ strpos($routeName, 'patients.view.patient-erx') === 0 && @$type === 'other' ? 'active' : '' }}"
  146. href="{{ route('patients.view.patient-erx', ['patient' => $patient, 'type' => 'other']) }}">Other</a>
  147. </li>
  148. </ul>
  149. */ ?>
  150. </li>
  151. @if($isOldClient)
  152. <li class="nav-item">
  153. <a class="nav-link {{ strpos($routeName, 'patients.view.patient-tickets') === 0 ? 'active' : '' }}"
  154. href="{{ route('patients.view.patient-tickets', ['patient' => $patient]) }}" title="Deprecated">ERx / Orders
  155. <span class="text-secondary text-sm pl-2">(dep)</span>
  156. </a>
  157. <ul class="m-0 p-0 nav-child-list">
  158. <li class="nav-item">
  159. <a class="nav-link {{ strpos($routeName, 'patients.view.patient-tickets') === 0 && @$type === '' ? 'active' : '' }}"
  160. href="{{ route('patients.view.patient-tickets', ['patient' => $patient, 'type' => '']) }}">All</a>
  161. </li>
  162. <li class="nav-item">
  163. <a class="nav-link {{ strpos($routeName, 'patients.view.patient-tickets') === 0 && @$type === 'erx' ? 'active' : '' }}"
  164. href="{{ route('patients.view.patient-tickets', ['patient' => $patient, 'type' => 'erx']) }}">ERx</a>
  165. </li>
  166. <li class="nav-item">
  167. <a class="nav-link {{ strpos($routeName, 'patients.view.patient-tickets') === 0 && @$type === 'lab' ? 'active' : '' }}"
  168. href="{{ route('patients.view.patient-tickets', ['patient' => $patient, 'type' => 'lab']) }}">Lab</a>
  169. </li>
  170. <li class="nav-item">
  171. <a class="nav-link {{ strpos($routeName, 'patients.view.patient-tickets') === 0 && @$type === 'imaging' ? 'active' : '' }}"
  172. href="{{ route('patients.view.patient-tickets', ['patient' => $patient, 'type' => 'imaging']) }}">Imaging</a>
  173. </li>
  174. <li class="nav-item">
  175. <a class="nav-link {{ strpos($routeName, 'patients.view.patient-tickets') === 0 && @$type === 'other' ? 'active' : '' }}"
  176. href="{{ route('patients.view.patient-tickets', ['patient' => $patient, 'type' => 'other']) }}">Other</a>
  177. </li>
  178. </ul>
  179. </li>
  180. @endif
  181. <li class="nav-item">
  182. <a class="nav-link {{ strpos($routeName, 'patients.view.supply-orders') === 0 ? 'active' : '' }}"
  183. href="{{ route('patients.view.supply-orders', ['patient' => $patient]) }}">Supply Orders</a>
  184. </li>
  185. <li class="nav-item">
  186. <a class="nav-link {{ strpos($routeName, 'patients.view.shipments') === 0 ? 'active' : '' }}"
  187. href="{{ route('patients.view.shipments', ['patient' => $patient]) }}">Shipments</a>
  188. </li>
  189. <li class="nav-item">
  190. <a class="nav-link {{ strpos($routeName, 'patients.view.incoming-reports') === 0 ? 'active' : '' }}"
  191. href="{{ route('patients.view.incoming-reports', ['patient' => $patient]) }}">Incoming Reports</a>
  192. </li>
  193. <li class="nav-item">
  194. <a class="nav-link {{ strpos($routeName, 'patients.view.allergies') === 0 ? 'active' : '' }}"
  195. href="{{ route('patients.view.allergies', ['patient' => $patient]) }}">Allergies</a>
  196. </li>
  197. <li class="nav-item">
  198. <a class="nav-link {{ strpos($routeName, 'patients.view.medications') === 0 ? 'active' : '' }}"
  199. href="{{ route('patients.view.medications', ['patient' => $patient]) }}">Medications</a>
  200. </li>
  201. <li class="nav-item">
  202. <a class="nav-link {{ strpos($routeName, 'patients.view.dx-and-focus-areas') === 0 ? 'active' : '' }}"
  203. href="{{ route('patients.view.dx-and-focus-areas', ['patient' => $patient]) }}">Dx and
  204. Focus Areas</a>
  205. </li>
  206. <li class="nav-item">
  207. <a class="nav-link {{ strpos($routeName, 'patients.view.care-team') === 0 ? 'active' : '' }}"
  208. href="{{ route('patients.view.care-team', ['patient' => $patient]) }}">Care Team</a>
  209. </li>
  210. <li class="nav-item">
  211. <a class="nav-link {{ strpos($routeName, 'patients.view.history') === 0 ? 'active' : '' }}"
  212. href="{{ route('patients.view.history', ['patient' => $patient]) }}">History</a>
  213. </li>
  214. <li class="nav-item">
  215. <a class="nav-link {{ strpos($routeName, 'patients.view.memos') === 0 ? 'active' : '' }}"
  216. href="{{ route('patients.view.memos', ['patient' => $patient]) }}">Memos</a>
  217. </li>
  218. <li class="nav-item">
  219. <a class="nav-link {{ $routeName === 'patients.view.sms' ? 'active' : '' }}"
  220. href="{{ route('patients.view.sms', ['patient' => $patient]) }}">SMS</a>
  221. </li>
  222. <li class="nav-item">
  223. <a class="nav-link {{ strpos($routeName, 'patients.view.sms-numbers') === 0 ? 'active' : '' }}"
  224. href="{{ route('patients.view.sms-numbers', ['patient' => $patient]) }}">SMS Numbers</a>
  225. </li>
  226. <li class="nav-item">
  227. <a class="nav-link {{ strpos($routeName, 'patients.view.documents') === 0 ? 'active' : '' }}"
  228. href="{{ route('patients.view.documents', ['patient' => $patient]) }}">Documents</a>
  229. </li>
  230. <li class="nav-item">
  231. <a class="nav-link {{ strpos($routeName, 'patients.view.settings') === 0 ? 'active' : '' }}"
  232. href="{{ route('patients.view.settings', ['patient' => $patient]) }}">Settings</a>
  233. </li>
  234. <li class="nav-item">
  235. <a class="nav-link {{ strpos($routeName, 'patients.view.sms-reminders') === 0 ? 'active' : '' }}"
  236. href="{{ route('patients.view.sms-reminders', ['patient' => $patient]) }}">SMS Reminders</a>
  237. </li>
  238. <li class="nav-item">
  239. <a class="nav-link {{ strpos($routeName, 'patients.view.measurement-confirmation-numbers') === 0 ? 'active' : '' }}"
  240. href="{{ route('patients.view.measurement-confirmation-numbers', ['patient' => $patient]) }}">Meas. Conf. Numbers</a>
  241. </li>
  242. <li class="nav-item">
  243. <a class="nav-link {{ strpos($routeName, 'patients.view.pros') === 0 ? 'active' : '' }}"
  244. href="{{ route('patients.view.pros', ['patient' => $patient]) }}">Pros</a>
  245. </li>
  246. @if($performer->pro->pro_type == 'ADMIN')
  247. <li class="nav-item">
  248. <a class="nav-link {{ strpos($routeName, 'patients.view.client-pro-access') === 0 ? 'active' : '' }}"
  249. href="{{ route('patients.view.client-pro-access', ['patient' => $patient]) }}">Client Pro Access</a>
  250. </li>
  251. @endif
  252. <li class="nav-item">
  253. <a class="nav-link" href="/patients/view/{{ $patient->uid }}/intake">Intake</a>
  254. </li>
  255. <li class="nav-item">
  256. <a class="nav-link {{ strpos($routeName, 'patients.view.primary-coverage') === 0 ? 'active' : '' }}"
  257. href="{{ route('patients.view.primary-coverage', $patient) }}">Primary Coverage</a>
  258. </li>
  259. @if($performer->pro->pro_type == 'ADMIN' || $performer->pro->id == $patient->default_na_pro_id)
  260. <li class="nav-item">
  261. <a class="nav-link {{ strpos($routeName, 'patients.view.mcp-requests') === 0 ? 'active' : '' }}"
  262. href="{{ route('patients.view.mcp-requests', $patient) }}">MCP Requests</a>
  263. </li>
  264. <li class="nav-item">
  265. <a class="nav-link {{ strpos($routeName, 'patients.view.eligible-refreshes') === 0 ? 'active' : '' }}"
  266. href="{{ route('patients.view.eligible-refreshes', $patient) }}">Eligible Refreshes</a>
  267. </li>
  268. <li class="nav-item">
  269. <a class="nav-link {{ strpos($routeName, 'patients.view.insurance-coverage') === 0 ? 'active' : '' }}"
  270. href="{{ route('patients.view.insurance-coverage', $patient) }}">Insurance Coverage</a>
  271. </li>
  272. <li class="nav-item">
  273. <a class="nav-link {{ strpos($routeName, 'patients.view.claims-resolver') === 0 ? 'active' : '' }}"
  274. href="{{ route('patients.view.claims-resolver', $patient) }}">Claims Resolver</a>
  275. </li>
  276. @endif
  277. <li class="nav-item">
  278. <a class="nav-link {{ strpos($routeName, 'patients.view.accounts') === 0 ? 'active' : '' }}"
  279. href="{{ route('patients.view.accounts', $patient) }}">Linked Accounts</a>
  280. </li>
  281. </ul>
  282. <div class="mt-3 mcp-theme-1">
  283. @yield('left-nav-content')
  284. </div>
  285. </div>
  286. </nav>
  287. @endif
  288. <main role="main" class="w-100 {{$trimLayout || $isVisitNote ? 'p-0' : ''}}">
  289. @if($pro->is_enrolled_as_mcp && !$patient->mcp)
  290. <div class="alert alert-info bg-white mt-3 mcp-theme-1 p-3 hide-inside-ticket-popup m-1">
  291. <div class="font-size-16">
  292. <i class="fa fa-exclamation-triangle text-warning-mellow"></i>
  293. This patient currently does not have an MCP assigned.
  294. </div>
  295. <div class="mt-3 d-flex align-items-center">
  296. <button class="btn btn-info" onclick="$('.in-conv-confirmed').removeClass('d-none').addClass('d-inline-flex')">I am currently seeing or talking to this patient</button>
  297. <div class="in-conv-confirmed d-none align-items-center">
  298. <i class="fa fa-chevron-right mx-3 text-secondary"></i>
  299. <div moe class=" hide-inside-popup">
  300. <a href="" start show class="btn btn-primary font-weight-bold text-white">
  301. Assign myself as the MCP for this patient
  302. </a>
  303. <form url="/api/client/putMcp" class="mcp-theme-1">
  304. <input type="hidden" name="uid" value="{{$patient->uid}}">
  305. <input type="hidden" name="mcpProUid" value="{{$pro->uid}}">
  306. <p>Are you sure?</p>
  307. <div>
  308. <button submit class="btn btn-sm btn-primary mr-2">
  309. Submit
  310. </button>
  311. <button cancel class="btn btn-sm btn-default border">
  312. Cancel
  313. </button>
  314. </div>
  315. </form>
  316. </div>
  317. </div>
  318. </div>
  319. </div>
  320. @endif
  321. @if($patient->has_mcp_done_onboarding_visit !== 'YES' && $patient->is_mcp_onboarding_active === 'NO')
  322. <div class="alert alert-warning mt-3 mcp-theme-1 p-3 hide-inside-ticket-popup">
  323. <div class="font-weight-bold text-dark font-size-16">MCP onboarding is not active for this patient.</div>
  324. <div class="text-secondary p-2 border mt-2 bg-light">
  325. <div class="font-weight-bold">{{$patient->why_is_mcp_onboarding_not_active_category}}</div>
  326. <div>{{$patient->why_is_mcp_onboarding_not_active_memo}}</div>
  327. </div>
  328. </div>
  329. @endif
  330. <div class="card {{$trimLayout || $isVisitNote ? 'card m-0 border-0 rounded-0' : 'my-3'}}" id="patient-header">
  331. <div id="patient-header-content">
  332. <div class="card-header @if($patient->client_engagement_status_category == 'DUMMY') alert-warning @endif py-1 hide-inside-ticket-popup">
  333. <?php
  334. $thumbnail = $patient->profile_picture_base64;
  335. $initials = !$thumbnail ? substr($patient->name_first, 0, 1) . substr($patient->name_last, 0, 1) : '';
  336. $online = $patient->is_online ? 'online' : '';
  337. $patientName = implode(', ', array_filter([$patient->name_last, $patient->name_first]));
  338. $confirmedCell = empty($patient->cell_number) ? '-' : $patient->cell_number;
  339. $confirmedEmail = empty($patient->email_address) ? '-' : $patient->email_address;
  340. $location = implode(', ', array_filter([$patient->home_address_city, $patient->home_address_state]));
  341. $location = empty($location) ? '-' : $location;
  342. $mcpName = $patient->mcp ? implode(', ', array_filter([$patient->mcp->name_last, $patient->mcp->name_first])) : null;
  343. $cmName = $patient->cm ? implode(', ', array_filter([$patient->cm->name_last, $patient->cm->name_first])) : null;
  344. $memberSince = date_diff(date_create($patient->created_at), date_create('now'))->days;
  345. if ($memberSince > 30) $memberSince = date('F, Y', strtotime($patient->created_at));
  346. else if ($memberSince > 1) $memberSince .= ' days ago';
  347. else if ($memberSince === 1) $memberSince = 'yesterday';
  348. else if ($memberSince === 0) $memberSince = 'today';
  349. ?>
  350. <div class=z>
  351. <div class=header>
  352. @if($patient->is_duplicate)
  353. <div class="alert alert-secondary border-dark mcp-theme-1 screen-only">
  354. <span class="text-dark">This chart is a duplicate of&nbsp;</span>
  355. <a class="font-weight-bold"
  356. href="/patients/view/{{ $patient->duplicateOf->uid }}">
  357. {{ $patient->duplicateOf->displayName() }}
  358. </a>
  359. </div>
  360. @endif
  361. <div class="hbox mr-auto">
  362. {{--<div>
  363. <div @if($patient->is_microphone_available)style="color:green" @else style="color:gray" @endif>
  364. <i class="fa fa-microphone"></i>
  365. </div>
  366. <div @if($patient->is_camera_available)style="color:green" @else style="color:gray" @endif>
  367. <i class="fa fa-video"></i>
  368. </div>
  369. </div>--}}
  370. <section>
  371. <div class="hbox">
  372. <h4 class="pt-name">{{$patientName}}</h4>
  373. <div class="screen-only mr-1 patient-presence-indicator thumbnail {{$online}}"
  374. data-patient-uid="{{$patient->uid}}"
  375. style="background-image:<?=$thumbnail?>"><?=$initials?></div>
  376. <div class="d-inline-flex align-items-baseline">
  377. <i class="chart mr-2">#{{$patient->chart_number}}</i>
  378. <span class="on-hover-show d-inline-block on-hover-opaque">
  379. <i class="fa fa-info-circle ml-1 text-primary"></i>
  380. <div class="on-hover-content py-2 pl-3 text-nowrap">
  381. Joined <?=$memberSince?>
  382. @if($pro->pro_type === 'ADMIN')
  383. <div class="mt-1">
  384. Created by <b>{{$patient->creator ? $patient->creator->displayName() : '-'}}</b>
  385. </div>
  386. <div class="mt-1">
  387. Created on <b>{{friendly_date_time($patient->created_at)}}</b>
  388. </div>
  389. @endif
  390. </div>
  391. </span>
  392. </div>
  393. </div>
  394. <div class=separators>
  395. <div>{{friendly_date($patient->dob, false,null, true)}} ({{$patient->age_in_years}}
  396. y.o {{$patient->sex}})
  397. </div>
  398. @if($patient->getPrimaryCoverage() && $patient->getPrimaryCoverageStatus() === 'YES')
  399. <div class="text-nowrap screen-only">
  400. {{$patient->getPrimaryCoverage()->insuranceDisplayName()}}
  401. <span class="on-hover-show d-inline-block on-hover-opaque">
  402. <i class="fa fa-check-circle text-success"></i>
  403. <div class="on-hover-content py-2 pl-3 text-nowrap">
  404. Covered
  405. </div>
  406. </span>
  407. </div>
  408. @endif
  409. <div class="screen-only">
  410. <label>Status:</label>
  411. <b>{{$patient->client_engagement_status_category ? ucwords(strtolower(str_replace('_', ' ', $patient->client_engagement_status_category == 'DUMMY' ? 'Test Chart' : $patient->client_engagement_status_category))) : '-'}}</b>
  412. </div>
  413. </div>
  414. <div class="screen-only">
  415. <div class=separators>
  416. <div>
  417. <label>MCP:</label> {{$mcpName}}
  418. @if($patient->has_mcp_done_onboarding_visit !== 'YES' && $pro->pro_type == 'ADMIN')
  419. <div moe class="ml-2 hide-inside-popup">
  420. <a start show><i class="fa fa-edit"></i></a>
  421. <form url="/api/client/putMcp" class="mcp-theme-1">
  422. <input type="hidden" name="uid" value="{{$patient->uid}}">
  423. <div class="mb-2">
  424. <label class="text-secondary text-sm">MCP Pro</label>
  425. <select name="mcpProUid" provider-search data-pro-uid="{{ @$patient->mcp->uid }}"
  426. class="form-control form-control-sm">
  427. <option value=""> --select--</option>
  428. @foreach($pros as $iPro)
  429. <option
  430. value="{{$iPro->uid}}" {{ $patient->mcp && $iPro->uid === $patient->mcp->uid ? 'selected' : '' }}>{{$iPro->displayName()}}</option>
  431. @endforeach
  432. </select>
  433. </div>
  434. <div>
  435. <button submit class="btn btn-sm btn-primary mr-1">
  436. Submit
  437. </button>
  438. <button cancel class="btn btn-sm btn-default border">
  439. Cancel
  440. </button>
  441. </div>
  442. </form>
  443. </div>
  444. @if($patient->mcp)
  445. <div moe class="ml-2 hide-inside-popup">
  446. <a start show><i class="fa fa-times"></i></a>
  447. <form url="/api/client/removeMcp" class="mcp-theme-1">
  448. <input type="hidden" name="uid" value="{{$patient->uid}}">
  449. <div class="mb-2">
  450. <label class="text-secondary text-sm">Remove MCP Pro</label>
  451. </div>
  452. <div>
  453. <button submit class="btn btn-sm btn-primary mr-1">Submit
  454. </button>
  455. <button cancel class="btn btn-sm btn-default border">
  456. Cancel
  457. </button>
  458. </div>
  459. </form>
  460. </div>
  461. @endif
  462. @endif
  463. </div>
  464. <div>
  465. @if($patient->has_mcp_done_onboarding_visit !== 'YES')
  466. <span class="text-dark d-inline-flex align-items-center">
  467. <span class="mr-2">
  468. <i class="fa fa-exclamation-triangle"></i>
  469. MCP Onboarding Visit Pending
  470. </span>
  471. </span>
  472. <span moe class="hide-inside-popup">
  473. <a start show><i class="fa fa-edit"></i></a>
  474. <form url="/api/client/updateMcpOnboardingVisitInfo" class="mcp-theme-1">
  475. <input type="hidden" name="uid" value="{{$patient->uid}}">
  476. <div class="mb-2">
  477. <select name="hasMcpDoneOnboardingVisit"
  478. class="form-control form-control-sm"
  479. onchange="toggleDisabledAsNeeded(this, 'YES', 'if-visit-done')">
  480. <option value="">-- Select Status --</option>
  481. <option value="YES" {{ $patient->has_mcp_done_onboarding_visit === 'YES' ? 'selected' : '' }}>YES</option>
  482. <option value="NO" {{ $patient->has_mcp_done_onboarding_visit === 'NO' ? 'selected' : '' }}>NO</option>
  483. <option value="UNKNOWN" {{ $patient->has_mcp_done_onboarding_visit === 'UNKNOWN' ? 'selected' : '' }}>UNKNOWN</option>
  484. </select>
  485. </div>
  486. <div class="mb-2">
  487. <input type="date"
  488. class="if-visit-done form-control form-control-sm" disabled
  489. name="mcpOnboardingVisitDate" value="{{ date('Y-m-d') }}"
  490. max="{{ date('Y-m-d') }}">
  491. </div>
  492. <div class="mb-2">
  493. <select name="mcpOnboardingVisitNoteUid" disabled
  494. class="form-control form-control-sm if-visit-done"
  495. onchange="if(this.value === '-- create --') createNewNote('{{$patient->uid}}', '{{$pro->uid}}', '{{date('Y-m-d')}}');">
  496. <option value="">-- Visit Note --</option>
  497. <?php $notes = \App\Models\Note::where('client_id', $patient->id)->get() ?>
  498. @foreach ($notes as $note)
  499. @if(!empty($note->title) && $note->client_id === $patient->id && !$note->is_cancelled)
  500. <option
  501. {{ $patient->mcp_onboarding_visit_note_id === $note->id ? 'selected' : '' }}
  502. value="{{$note->uid}}">{{$note->hcpPro->displayName()}} ({{friendly_date_time($note->effective_dateest, false)}})</option>
  503. @endif
  504. @endforeach
  505. {{--<option value="-- create --">-- Create Note --</option>--}}
  506. </select>
  507. </div>
  508. <div class="mb-2 if-note-outside-system">
  509. <textarea class="form-control form-control-sm"
  510. name="reasonOnboardingVisitNoteOutsideSystem"
  511. placeholder="Visit note outside the system reason"
  512. spellcheck="false" data-gramm="false"></textarea>
  513. </div>
  514. <div>
  515. <button submit class="btn btn-sm btn-primary mr-1">Submit</button>
  516. <button cancel class="btn btn-sm btn-default border">Cancel</button>
  517. </div>
  518. </form>
  519. </span>
  520. @else
  521. <span class="text-dark d-inline-flex align-items-center">
  522. <span class="mr-2 text-secondary">
  523. <i class="fa fa-check text-sm"></i>
  524. MCP Onboarding Visit Completed
  525. </span>
  526. </span>
  527. @endif
  528. </div>
  529. </div>
  530. <div>
  531. <label>CC:</label> {{$patient->defaultNaPro ? $patient->defaultNaPro->displayName() : '-' }}
  532. @if($pro->pro_type == 'ADMIN')
  533. <div moe class="ml-2 hide-inside-popup">
  534. <a start show><i class="fa fa-edit"></i></a>
  535. <form url="/api/client/putDefaultNaPro" class="mcp-theme-1">
  536. <input type="hidden" name="uid" value="{{$patient->uid}}">
  537. <div class="mb-2">
  538. <label class="text-secondary text-sm">Care Coordinator</label>
  539. <select provider-search data-pro-uid="{{ @$patient->defaultNaPro->uid }}"
  540. name="defaultNaProUid"
  541. class="form-control form-control-sm">
  542. <option value=""> --select--</option>
  543. @foreach($pros as $iPro)
  544. <option
  545. value="{{$iPro->uid}}" {{ $patient->pcp && $iPro->uid === $patient->pcp->uid ? 'selected' : '' }}>{{$iPro->displayName()}}</option>
  546. @endforeach
  547. </select>
  548. </div>
  549. <div>
  550. <button submit class="btn btn-sm btn-primary mr-1">Submit
  551. </button>
  552. <button cancel class="btn btn-sm btn-default border">
  553. Cancel
  554. </button>
  555. </div>
  556. </form>
  557. </div>
  558. @if($patient->pcp)
  559. <div moe class="ml-2 hide-inside-popup">
  560. <a start show><i class="fa fa-times"></i></a>
  561. <form url="/api/client/removeDefaultNaPro" class="mcp-theme-1">
  562. <input type="hidden" name="uid" value="{{$patient->uid}}">
  563. <div class="mb-2">
  564. <label class="text-secondary text-sm">Remove Care Coordinator</label>
  565. </div>
  566. <div>
  567. <button submit class="btn btn-sm btn-primary mr-1">Submit</button>
  568. <button cancel class="btn btn-sm btn-default border">Cancel</button>
  569. </div>
  570. </form>
  571. </div>
  572. @endif
  573. @endif
  574. </div>
  575. </div>
  576. </section>
  577. <section class="hide-inside-popup screen-only vbox mt-2 align-self-start ml-3 pl-3 border-left mcp-theme-1">
  578. <div>
  579. <div moe relative>
  580. <a href="#" start show class="d-flex align-items-baseline"><i class="fa fa-plus text-sm mr-1"></i><span>SMS</span></a>
  581. <form url="/api/clientSms/createOutgoing" right class="mcp-theme-1" noreload>
  582. <input type="hidden" name="uid" value="{{ $patient->uid }}">
  583. <div class="mb-2">
  584. <label for="" class="text-sm text-secondary mb-1">Cell
  585. Number</label>
  586. <input type="text" class="form-control form-control-sm"
  587. name="cellNumber" value="{{$patient->cell_number}}">
  588. </div>
  589. <div class="mb-2">
  590. <label for=""
  591. class="text-sm text-secondary mb-1">Message</label>
  592. <textarea type="text" class="form-control form-control-sm"
  593. name="message"></textarea>
  594. </div>
  595. <div class="d-flex align-items-center">
  596. <button class="btn btn-sm btn-primary mr-2" submit>Send</button>
  597. <button class="btn btn-sm btn-default mr-2 border" cancel>
  598. Cancel
  599. </button>
  600. </div>
  601. </form>
  602. </div>
  603. </div>
  604. <div>
  605. <span moe relative class="">
  606. <a href="#" start show class="d-flex align-items-baseline" title="SMS check-in link to the patient"><i class="fa fa-paper-plane text-sm mr-1"></i><span>Send</span></a>
  607. <form url="/api/client/sendCheckInTokenViaSmsOrEmail" right
  608. class="mcp-theme-1">
  609. <input type="hidden" name="uid" value="{{ $patient->uid }}">
  610. <p class="small min-width-200px mb-2">Send Check-In link to patient?</p>
  611. <div class="mb-2">
  612. <label for=""
  613. class="text-sm text-secondary mb-1">Cell Number</label>
  614. <input type="text" class="form-control input-sm" name="cellNumber"
  615. value="{{$patient->cell_number}}">
  616. </div>
  617. <div class="mb-2">
  618. <label for=""
  619. class="text-sm text-secondary mb-1">Email address</label>
  620. <input type="text" class="form-control input-sm" name="emailAddress"
  621. value="{{$patient->email_address}}">
  622. </div>
  623. <div class="d-flex align-items-center">
  624. <button class="btn btn-sm btn-primary mr-2" submit>Send</button>
  625. <button class="btn btn-sm btn-default mr-2 border"
  626. cancel>Cancel</button>
  627. </div>
  628. </form>
  629. </span>
  630. </div>
  631. @if($performer->pro->pro_type == 'ADMIN')
  632. <div>
  633. <a href="#" start show class="d-flex align-items-baseline" onclick="return openInRHS('/pro/check-video/{{ $patient->uid }}')"><i class="fa fa-video text-sm mr-1"></i><span>Check</span></a>
  634. </div>
  635. @endif
  636. <div>
  637. <a href="#" start show class="d-flex align-items-baseline" onclick="return openInRHS('/pro/meet/{{ $patient->uid }}')"><i class="fa fa-video text-sm mr-1"></i><span>Join</span></a>
  638. </div>
  639. </section>
  640. @if(!$patient->getPrimaryCoverage() || $patient->getPrimaryCoverageStatus() !== 'YES')
  641. <section class="hide-inside-popup screen-only vbox align-self-start mt-2 mx-2">
  642. @include('app.patient.coverage-status')
  643. </section>
  644. @endif
  645. <section class="mr-4 align-self-start mt-2 ml-auto">
  646. <div>
  647. <label>Sticky Note:</label> <span class="text-secondary">{{$patient->sticky_note ?? '-' }}</span>
  648. <div moe relative wide class="ml-2 hide-inside-popup">
  649. <a start show><i class="fa fa-edit"></i></a>
  650. <form url="/api/client/updateStickyNote" class="mcp-theme-1" right>
  651. <input type="hidden" name="uid" value="{{$patient->uid}}">
  652. <div class="mb-2">
  653. <label class="text-secondary text-sm">Sticky Note</label>
  654. <textarea name="stickyNote" class="form-control" rows="8" cols="80">{{$patient->sticky_note}}</textarea>
  655. </div>
  656. <div>
  657. <button submit class="btn btn-sm btn-primary mr-1">Submit
  658. </button>
  659. <button cancel class="btn btn-sm btn-default border">
  660. Cancel
  661. </button>
  662. </div>
  663. </form>
  664. </div>
  665. </div>
  666. @if($pro->pro_type === 'ADMIN')
  667. <div>
  668. <label>Intake Data: - </label> <span class="text-secondary"></span>
  669. @include('app.patient.intake-data.patient-intake-data-form')
  670. </div>
  671. @endif
  672. </section>
  673. <ul class="vbox mt-2 align-self-start patient-header-address ">
  674. <li class="d-flex align-items-start">
  675. <span class="aligned-icon">
  676. <i class="fa fa-map-marker-alt" aria-hidden="true"></i>
  677. </span>
  678. <div class="position-relative">
  679. <?php
  680. $addressParts = [];
  681. if (!!$patient->mailing_address_line1) $addressParts[] = $patient->mailing_address_line1;
  682. if (!!$patient->mailing_address_line2) $addressParts[] = $patient->mailing_address_line2;
  683. $addressParts = implode(", ", $addressParts) . "<br/>";
  684. $addressPart2 = [];
  685. if (!!$patient->mailing_address_city) $addressPart2[] = $patient->mailing_address_city;
  686. if (!!$patient->mailing_address_state) $addressPart2[] = $patient->mailing_address_state;
  687. $addressParts .= implode(", ", $addressPart2);
  688. echo $addressParts;
  689. ?>
  690. {{ $patient->mailing_address_zip ? $patient->mailing_address_zip : '' }}
  691. @if($patient->mailing_address_memo)
  692. <span class="position-relative c-pointer text-center stag-tooltip ml-2">
  693. <i class="fa fa-info-circle"></i>
  694. <div
  695. class="position-absolute bg-white border rounded p-2 stag-tooltip-content">
  696. <div class="text-left font-weight-bold pb-1">Special Instructions</div>
  697. <div
  698. class="text-left font-weight-normal">{{$patient->mailing_address_memo}}</div>
  699. </div>
  700. </span>
  701. @endif
  702. </div>
  703. </li>
  704. @if($patient->cell_number)
  705. <li>
  706. <span class="aligned-icon">
  707. <i class="fa fa-phone-alt" aria-hidden="true"></i>
  708. </span>
  709. {{$patient->cell_number}}
  710. <span class="small text-secondary ml-1">
  711. {{ $patient->cell_number_memo ? '(' . $patient->cell_number_memo . ')' : '' }}
  712. </span>
  713. </li>
  714. @endif
  715. @if($patient->phone_home)
  716. <li>
  717. <span class="aligned-icon"><i class="fa fa-home" aria-hidden="true"></i></span>
  718. {{$patient->phone_home}}
  719. </li>
  720. @endif
  721. <li class="d-flex align-items-baseline">
  722. <div class="{{empty($confirmedEmail) || $confirmedEmail === '-' ? 'screen-only' : ''}}">
  723. <span class="aligned-icon">
  724. <i class="fa fa-envelope" aria-hidden="true"></i>
  725. </span>
  726. {{$confirmedEmail}}
  727. </div>
  728. <div class="d-inline-flex screen-only">
  729. <span class="mx-2 text-secondary text-sm">|</span>
  730. <span class="aligned-icon text-primary">
  731. <i class="fa fa-link" aria-hidden="true"></i>
  732. </span>
  733. <?php $numLinkedAccounts = $patient->linkedAccounts ? count($patient->linkedAccounts) : 0; ?>
  734. <a href="{{route('patients.view.accounts', ['patient' => $patient])}}">
  735. Accounts ({{$numLinkedAccounts}})
  736. </a>
  737. </div>
  738. </li>
  739. <li class="d-flex align-items-baseline">
  740. <div class="d-inline-flex screen-only">
  741. @include('app.patient.send_email')
  742. </div>
  743. </li>
  744. </ul>
  745. </div>
  746. </div>
  747. </div> <!-- z -->
  748. </div>
  749. </div>
  750. @if($pro->pro_type === 'ADMIN')
  751. <div class="screen-only card-header py-2 d-flex align-items-center mcp-theme-1 bg-aliceblue hide-inside-popup">
  752. <b class="">Tags ({{count($patient->clientTags)}}):</b>
  753. @foreach($patient->clientTags as $tag)
  754. <div class="d-inline-flex align-items-center ml-2 py-1 px-2 rounded bg-aliceblue text-info">
  755. <span class="text-sm">{{$tag->tag}}</span>
  756. <div moe relative class="ml-2">
  757. <a href="" start show><i class="fa fa-times text-secondary on-hover-opaque"></i></a>
  758. <form url="/api/clientTag/cancel" class="mcp-theme-1 min-width-200px">
  759. <input type="hidden" name="uid" value="{{$tag->uid}}">
  760. <p class="text-nowrap text-dark">Cancel this tag?</p>
  761. <div>
  762. <button submit class="btn btn-sm btn-primary mr-2">Submit</button>
  763. <button cancel class="btn btn-sm btn-default border">Cancel</button>
  764. </div>
  765. </form>
  766. </div>
  767. </div>
  768. @endforeach
  769. <div moe relative class="ml-2">
  770. <a href="" start show class="text-sm">+ Add</a>
  771. <form url="/api/clientTag/create" class="mcp-theme-1">
  772. <input type="hidden" name="clientUid" value="{{$patient->uid}}">
  773. <div class="mb-2">
  774. <label class="text-secondary text-sm">Tag</label>
  775. <input type="text" class="form-control form-control-sm"
  776. name="tag"
  777. placeholder="Tag" required>
  778. </div>
  779. <div>
  780. <button submit class="btn btn-sm btn-primary mr-2">Submit</button>
  781. <button cancel class="btn btn-sm btn-default border">Cancel</button>
  782. </div>
  783. </form>
  784. </div>
  785. </div>
  786. @endif
  787. {{--<div class="text-container border-bottom d-flex align-items-center mcp-theme-1 px-3">
  788. @if($patient->mcp_pro_id !== $pro->id && $patient->active_mcp_request_id)
  789. <div moe relative class="ml-2">
  790. <a href="" start show class="btn btn-sm btn-success text-white font-weight-bold small">Claim as MCP</a>
  791. <form url="/api/mcpRequest/claim" class="mcp-theme-1" right>
  792. <input type="hidden" name="clientUid" value="{{$patient->uid}}">
  793. <p>Claim this patient?</p>
  794. <div>
  795. <button submit class="btn btn-sm btn-primary mr-2">Yes</button>
  796. <button cancel class="btn btn-sm btn-default border">Cancel</button>
  797. </div>
  798. </form>
  799. </div>
  800. @endif
  801. </div>--}}
  802. <div class="card-body {{$routeName === 'patients.view.notes.view.dashboard' ? 'p-0' : ''}}">
  803. {{--<h1 class="h3">@yield('section-title')</h1>--}}
  804. <div class="mcp-theme-1">
  805. @yield('inner-content')
  806. </div>
  807. </div>
  808. </div>
  809. </main>
  810. </div>
  811. </div>
  812. <script>
  813. (function() {
  814. function init() {
  815. $('.note-method-select').change(function() {
  816. let form = $(this).closest('form');
  817. if(this.value === 'IN_CLINIC') {
  818. form.find('.if-in-clinic').show();
  819. }
  820. else {
  821. form.find('.if-in-clinic').hide();
  822. }
  823. });
  824. $('.note-method-select').each(function() {
  825. let form = $(this).closest('form');
  826. if(this.value === 'IN_CLINIC') {
  827. form.find('.if-in-clinic').show();
  828. }
  829. else {
  830. form.find('.if-in-clinic').hide();
  831. }
  832. });
  833. }
  834. addMCInitializer('patient-add-note-popup', init, '#patient-header')
  835. }).call(window);
  836. </script>
  837. <script>
  838. (function() {
  839. function init() {
  840. $('#sidebarMenu')
  841. .off('scroll')
  842. .on('scroll', function() {
  843. localStorage.sidebarMenuScrollTop = $(this).scrollTop();
  844. });
  845. if(localStorage.sidebarMenuScrollTop) {
  846. $('#sidebarMenu').scrollTop(+localStorage.sidebarMenuScrollTop);
  847. }
  848. }
  849. addMCInitializer('sidebarMenu', init, '#sidebarMenu')
  850. }).call(window);
  851. </script>
  852. @endsection