dashboard-admin.blade.php 71 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169
  1. @extends ('layouts.template')
  2. @section('content')
  3. <style>
  4. tr.thin th, tr.thin td {
  5. padding: 0.25em;
  6. }
  7. </style>
  8. <div class="p-3">
  9. <div class="">
  10. <div class="row mcp-theme-1" id="pro-dashboard-container" v-cloak>
  11. <div class="col-md-3 mcp-theme-1">
  12. <div class="mb-4" v-show="tab==='appointments'">
  13. <div class="pro-dashboard-inline-calendar"></div>
  14. </div>
  15. <div class="card mb-4">
  16. <div class="card-header pl-2">
  17. <strong>
  18. Key Numbers
  19. </strong>
  20. </div>
  21. <div class="card-body p-0">
  22. <table class="table mb-0 dashboard-stats-table table-sm">
  23. <tbody>
  24. <tr>
  25. <th class="px-2 text-center">{{$pro->get_patients_count_as_admin()}}</th>
  26. <th class="pl-2 font-weight-normal">Patients</th>
  27. </tr>
  28. <tr>
  29. <th class="px-2 text-center">{{$pro->get_new_patients_awaiting_visit_count_as_admin()}}</th>
  30. <th class="pl-2 font-weight-normal">New Patients Awaiting Visit</th>
  31. </tr>
  32. <tr>
  33. <th class="px-2 text-center">{{$pro->get_notes_pending_signature_count_as_admin()}}</th>
  34. <th class="pl-2 font-weight-normal">Notes Pending Signature</th>
  35. </tr>
  36. <tr>
  37. <th class="px-2 text-center">{{$pro->get_notes_pending_summary_suggestion_count_as_admin()}}</th>
  38. <th class="pl-2 font-weight-normal">
  39. <a href="{{ route('admin.notes_pending_summary_suggestion') }}"
  40. native target="_blank"
  41. open-in-stag-popup
  42. popup-style="tall stag-popup-md"
  43. title="Notes With Pending Summary Suggestion">
  44. Notes With Pending Summary Suggestion
  45. </a>
  46. </th>
  47. </tr>
  48. <tr>
  49. <th class="px-2 text-center">{{$pro->get_notes_rejected_summary_suggestion_count_as_admin()}}</th>
  50. <th class="pl-2 font-weight-normal">
  51. <a href="{{ route('admin.notes_rejected_summary_suggestion') }}"
  52. native target="_blank"
  53. open-in-stag-popup
  54. popup-style="tall"
  55. title="Notes With Rejected Summary Suggestion">
  56. Notes With Rejected Summary Suggestion
  57. </a>
  58. </th>
  59. </tr>
  60. <tr>
  61. <th class="px-2 text-center">{{$pro->get_notes_pending_billing_count_as_admin()}}</th>
  62. <th class="pl-2 font-weight-normal">Notes Pending Billing</th>
  63. </tr>
  64. <tr>
  65. <th class="px-2 text-center">{{$pro->get_incoming_reports_pending_signature_count_as_admin()}}</th>
  66. <th class="pl-2 font-weight-normal">Reports Pending Signature</th>
  67. </tr>
  68. <tr>
  69. <th class="px-2 text-center">{{$pro->get_patients_without_appointment_count_as_admin()}}</th>
  70. <th class="pl-2 font-weight-normal">Patients w/o Appointments</th>
  71. </tr>
  72. <tr>
  73. <th class="px-2 text-center">{{$pro->get_patients_not_seen_in_45_days_count_as_mcp()}}</th>
  74. <th class="pl-2 font-weight-normal">Patients Not Seen in 45 Days</th>
  75. </tr>
  76. <tr>
  77. <th class="px-2 text-center">{{$pro->get_cancelled_appointments_pending_acknowledgement_count_as_mcp()}}</th>
  78. <th class="pl-2 font-weight-normal">Cancelled Appts. Pending Review</th>
  79. </tr>
  80. <tr>
  81. <th class="px-2 text-center">{{$pro->get_cancelled_bills_awaiting_review_count_as_mcp()}}</th>
  82. <th class="pl-2 font-weight-normal">Cancelled Bills Pending Review</th>
  83. </tr>
  84. <tr>
  85. <th class="px-2 text-center">{{$pro->get_cancelled_supply_orders_awaiting_review_count_as_mcp()}}</th>
  86. <th class="pl-2 font-weight-normal">Cancelled Supply Orders</th>
  87. </tr>
  88. <tr>
  89. <th class="px-2 text-center">{{$pro->get_erx_and_orders_awaiting_signature_count_as_mcp()}}</th>
  90. <th class="pl-2 font-weight-normal">ERx & Orders Pending Signature</th>
  91. </tr>
  92. <tr>
  93. <th class="px-2 text-center">{{$pro->get_supply_orders_awaiting_signature_count_as_mcp()}}</th>
  94. <th class="pl-2 font-weight-normal">Supply Orders Pending Signature</th>
  95. </tr>
  96. <tr>
  97. <th class="px-2 text-center">{{$pro->get_open_tickets_count_as_mcp()}}</th>
  98. <th class="pl-2 font-weight-normal">
  99. <a href="{{ route('practice-management.myTickets') }}">
  100. Open Ticket{{$pro->get_open_tickets_count_as_mcp() !== 1 ? 's' : ''}}
  101. </a>
  102. </th>
  103. </tr>
  104. <tr>
  105. <th class="px-2 text-center">{{ $pro->myNotesPendingSupervisorPhysicianStamping() }}</th>
  106. <th class="pl-2 font-weight-normal">
  107. <a href="{{ route('practice-management.notes-pending-physician-supervisor-stamping', ['hideTitle' => true]) }}"
  108. native target="_blank"
  109. open-in-stag-popup
  110. popup-style="tall stag-popup-md"
  111. title="Notes Pending Physician Supervisor Stamping">
  112. Notes Pending Physician Supervisor Stamping
  113. </a>
  114. </th>
  115. </tr>
  116. <!-- new -->
  117. <tr>
  118. <th class="px-2 text-center">
  119. <?php
  120. $count = \App\Models\Client::whereNull('shadow_pro_id')
  121. ->where('is_active', true)
  122. ->where(function ($q) {
  123. $q->whereNull('client_engagement_status_category')
  124. ->orWhere('client_engagement_status_category', 'DUMMY');
  125. })
  126. ->whereRaw('(default_mcp_company_pro_payer_id IS NULL OR default_mcp_company_location_id IS NULL)')
  127. ->count();
  128. ?>
  129. {{$count}}
  130. </th>
  131. <th class="pl-2 font-weight-normal">
  132. <a href="{{ route('practice-management.clients-without-default-company-pro-payer') }}"
  133. native target="_blank"
  134. open-in-stag-popup
  135. popup-style=""
  136. title="Clients without default company pro payer">
  137. Clients without default company location / pro payer
  138. </a>
  139. </th>
  140. </tr>
  141. <tr>
  142. <th class="px-2 text-center">
  143. <?php
  144. $count = \App\Models\Note::where('is_cancelled', false)
  145. ->where('is_core_note', false)
  146. ->where('is_signed_by_hcp', true)
  147. ->whereNull('hcp_company_pro_payer_id')
  148. ->count();
  149. ?>
  150. {{$count}}
  151. </th>
  152. <th class="pl-2 font-weight-normal">
  153. <a href="{{ route('practice-management.notes-without-hcp-company-pro-payer') }}"
  154. native target="_blank"
  155. open-in-stag-popup
  156. popup-style=""
  157. title="Notes without HCP company pro payer">
  158. Notes without HCP company pro payer
  159. </a>
  160. </th>
  161. </tr>
  162. <tr>
  163. <th class="px-2 text-center">
  164. <?php
  165. $count = \App\Models\Bill::where('bill_service_type', 'NOTE')
  166. ->where('is_cancelled', false)
  167. ->whereNotNull('hcp_pro_id')
  168. ->whereNull('hcp_company_pro_id')
  169. ->where('has_hcp_been_paid', false)
  170. ->count();
  171. ?>
  172. {{$count}}
  173. </th>
  174. <th class="pl-2 font-weight-normal">
  175. Note HCP bills without company pro
  176. </th>
  177. </tr>
  178. <tr>
  179. <th class="px-2 text-center">
  180. <?php
  181. $count = \App\Models\Bill::where('bill_service_type', 'GENERIC')
  182. ->where('is_cancelled', false)
  183. ->whereNotNull('generic_pro_id')
  184. ->whereNull('generic_company_pro_id')
  185. ->where('has_generic_pro_been_paid', false)
  186. ->where('code', 'RM MCP')
  187. ->count();
  188. ?>
  189. {{$count}}
  190. </th>
  191. <th class="pl-2 font-weight-normal">
  192. RPM MCP bills without company pro
  193. </th>
  194. </tr>
  195. <tr>
  196. <th class="px-2 text-center">
  197. <?php
  198. $count = \App\Models\Bill::where('bill_service_type', 'GENERIC')
  199. ->where('is_cancelled', false)
  200. ->whereNotNull('generic_pro_id')
  201. ->whereNull('generic_company_pro_id')
  202. ->where('has_generic_pro_been_paid', false)
  203. ->where('code', 'RM RMM')
  204. ->count();
  205. ?>
  206. {{$count}}
  207. </th>
  208. <th class="pl-2 font-weight-normal">
  209. RPM RMM bills without company pro
  210. </th>
  211. </tr>
  212. </tbody>
  213. </table>
  214. </div>
  215. </div>
  216. <div class="card mb-4">
  217. <div class="card-header pl-2">
  218. <strong>
  219. Remote Monitoring: {{friendly_month(date('Y-m-d'))}}
  220. </strong>
  221. </div>
  222. <div class="card-body p-0">
  223. <table class="table mb-0 dashboard-stats-table">
  224. <tbody>
  225. <tr>
  226. <th class="px-2 text-center">{{$pro->get_measurements_awaiting_review_count_as_mcp() ?? '-'}}</th>
  227. <th class="pl-2 font-weight-normal">Measurements Pending Review</th>
  228. </tr>
  229. <tr>
  230. <th class="px-2 text-center">{{$pro->get_patients_without_remote_measurement_in_48_hours_count_as_mcp() ?? '-'}}</th>
  231. <th class="pl-2 font-weight-normal">Patients w/o Measurement in 48 hrs.</th>
  232. </tr>
  233. </tbody>
  234. </table>
  235. </div>
  236. </div>
  237. <div class="card mb-4">
  238. <div class="card-header pl-2">
  239. <strong>
  240. Practice Management
  241. </strong>
  242. </div>
  243. <div class="card-body p-0">
  244. <table class="table mb-0 dashboard-stats-table">
  245. <tbody>
  246. <tr>
  247. <th colspan="2">Revenue Cycle Management</th>
  248. </tr>
  249. <tr class="thin">
  250. <th class="font-weight-normal px-2 pl-4">
  251. ${{friendly_money($reimbursement['currentBalance'])}}</th>
  252. <th class="font-weight-normal pl-2 w-100"><a
  253. href="/practice-management/financial-transactions">Current balance</a></th>
  254. </tr>
  255. <!-- <tr>
  256. <th class="px-2">{{friendly_date_time($reimbursement['nextPaymentDate'], false)}}</th>
  257. <th class="pl-2 font-weight-normal">Next Payment Date</th>
  258. </tr> -->
  259. <tr class="thin">
  260. <th class="font-weight-normal px-2 pl-4">${{friendly_money($reimbursement['nextPaymentAmount'])}}</th>
  261. <th class="font-weight-normal pl-2"><a
  262. href="/practice-management/bills-under-processing">Processing</a></th>
  263. </tr>
  264. <tr class="thin">
  265. <th class="font-weight-normal px-2 pl-5">${{friendly_money($reimbursement['nextPaymentAmount'])}}</th>
  266. <th class="font-weight-normal pl-2"><a
  267. href="/practice-management/bills-under-processing">Treatment Services</a></th>
  268. </tr>
  269. <tr class="thin">
  270. <th class="font-weight-normal px-2 pl-5">${{friendly_money($reimbursement['nextPaymentAmount'])}}</th>
  271. <th class="font-weight-normal pl-2"><a
  272. href="/practice-management/bills-under-processing">Remote Monitoring</a></th>
  273. </tr>
  274. <tr class="thin">
  275. <th class="font-weight-normal px-2 pl-5">${{friendly_money($reimbursement['nextPaymentAmount'])}}</th>
  276. <th class="font-weight-normal pl-2"><a
  277. href="/practice-management/bills-under-processing">Other Services</a></th>
  278. </tr>
  279. {{--
  280. <tr>
  281. <th class="px-2">{{$reimbursement['lastPayment']}}</th>
  282. <th class="pl-2 font-weight-normal"><a href="/practice-management/financial-transactions">Last payment</a></th>
  283. </tr>
  284. <tr>
  285. <th class="px-2">{{friendly_date_time($reimbursement['lastPaymentDate'], false)}}</th>
  286. <th class="pl-2 font-weight-normal"><a href="/practice-management/financial-transactions">Last payment date</a></th>
  287. </tr>
  288. --}}
  289. </tbody>
  290. </table>
  291. </div>
  292. </div>
  293. @if($pro->pro_type === 'ADMIN')
  294. <div class="card mb-4">
  295. <div class="card-header pl-2">
  296. <strong>
  297. Bills &amp; Claims
  298. </strong>
  299. </div>
  300. <div class="card-body p-0">
  301. <table class="table mb-0 dashboard-stats-table">
  302. <tbody>
  303. <tr>
  304. <th class="border-top-1 px-2 text-center">{{$businessNumbers['notesWithBillsToResolve']}}</th>
  305. <th class="border-top-1 pl-2">
  306. <a href="/practice-management/billing-manager">Notes with bills to
  307. resolve</a>
  308. </th>
  309. </tr>
  310. <tr>
  311. <th class="border-top-1 px-2 text-center">{{$businessNumbers['notesPendingBillingClosure']}}</th>
  312. <th class="border-top-1 pl-2">
  313. <a href="/practice-management/billing-manager">Notes pending billing
  314. closure</a>
  315. </th>
  316. </tr>
  317. </tbody>
  318. </table>
  319. </div>
  320. </div>
  321. @endif
  322. </div>
  323. <div class="col-md-9">
  324. <ul class="nav nav-tabs">
  325. <li class="nav-item">
  326. <a native data-tab="appointments" class="nav-link"
  327. :class="tab == 'appointments' ? 'active' : ''" href="#"
  328. v-on:click.prevent="tab='appointments'; initLoadAppointments();">
  329. Appointments
  330. </a>
  331. </li>
  332. <li class="nav-item">
  333. <a native data-tab="rpm" class="nav-link"
  334. :class="tab == 'rpm' ? 'active' : ''" href="#"
  335. v-on:click.prevent="tab='rpm';">
  336. RPM
  337. </a>
  338. </li>
  339. <li class="nav-item">
  340. <a native data-tab="measurements" class="nav-link"
  341. :class="tab == 'measurements' ? 'active' : ''" href="#"
  342. v-on:click.prevent="tab='measurements'; loadMeasurements();">
  343. Measurements
  344. </a>
  345. </li>
  346. <li class="nav-item">
  347. <a native data-tab="incoming_reports"
  348. class="nav-link {{count($incomingReports) ? 'text-danger font-weight-bold' : ''}}"
  349. :class="tab == 'incoming_reports' ? 'active' : ''" href="#"
  350. v-on:click.prevent="tab='incoming_reports'">
  351. Incoming Reports ({{count($incomingReports)}})
  352. </a>
  353. </li>
  354. <li class="nav-item">
  355. <a native data-tab="erx" class="nav-link {{$numERx ? 'text-danger font-weight-bold' : ''}}"
  356. :class="tab == 'erx' ? 'active' : ''" href="#"
  357. v-on:click.prevent="tab='erx'">
  358. ERx ({{$numERx}})
  359. </a>
  360. </li>
  361. <li class="nav-item">
  362. <a native data-tab="labs"
  363. class="nav-link {{$numLabs ? 'text-danger font-weight-bold' : ''}}"
  364. :class="tab == 'labs' ? 'active' : ''" href="#"
  365. v-on:click.prevent="tab='labs'">
  366. Labs ({{$numLabs}})
  367. </a>
  368. </li>
  369. <li class="nav-item">
  370. <a native data-tab="imaging"
  371. class="nav-link {{$numImaging ? 'text-danger font-weight-bold' : ''}}"
  372. :class="tab == 'imaging' ? 'active' : ''" href="#"
  373. v-on:click.prevent="tab='imaging'">
  374. Imaging ({{$numImaging}})
  375. </a>
  376. </li>
  377. <li class="nav-item">
  378. <a native data-tab="supply_orders"
  379. class="nav-link {{$numSupplyOrders ? 'text-danger font-weight-bold' : ''}}"
  380. :class="tab == 'supply_orders' ? 'active' : ''" href="#"
  381. v-on:click.prevent="tab='supply_orders'">
  382. Supply Orders ({{$numSupplyOrders}})
  383. </a>
  384. </li>
  385. </ul>
  386. <div class="border-left border-right border-bottom p-3">
  387. <div v-show="tab==='appointments'" class="appointments-tab">
  388. <div v-show="selectedDate">
  389. <div class="d-flex align-items-baseline mb-3">
  390. <b class="large"><span class="text-secondary">Today:</span> @{{ selectedDate }}</b>
  391. <div v-if="events && events.length" class="d-inline-flex align-items-baseline flex-grow-1">
  392. <label class="my-0 ml-4 mr-1">Pro:</label>
  393. <select v-if="events && events.length" class="form-control form-control-sm max-width-300px" v-model="filterPro">
  394. <option value="">All</option>
  395. <option v-for="(p, uid) in appointmentCountsByPro" :value="uid">@{{ p.name + ' (' + p.appointments + '/' + numEventsForDate + ')' }}</option>
  396. </select>
  397. <div class="ml-auto d-inline-flex align-items-center">
  398. <label class="text-secondary mr-2 my-0 text-nowrap">Filter by status:</label>
  399. <select v-model="filterStatus"
  400. class="form-control form-control-sm">
  401. <option value="">All</option>
  402. <option value="PENDING">Pending</option>
  403. <option value="CONFIRMED">Confirmed</option>
  404. <option value="CANCELLED">Cancelled</option>
  405. <option value="COMPLETED">Completed</option>
  406. </select>
  407. </div>
  408. </div>
  409. </div>
  410. <div v-for="event in events" class="align-items-end p-3 border rounded mb-3"
  411. v-if="!filterPro || filterPro === event.proUid"
  412. :class="(event.dateYMD === selectedDate && (filterStatus === '' || filterStatus === event.status) ? 'd-flex' : 'd-none') + ' ' + (event.isClientShadowOfPro ? 'training-event' : '')">
  413. <div class="patient-avatar mr-3 align-self-center">
  414. <i v-if="event.isClientShadowOfPro" class="fa fa-graduation-cap training-icon"
  415. :title="event.proInitials"></i>
  416. <span v-else class="">@{{ event.proInitials }}</span>
  417. </div>
  418. <div>
  419. <div class="pb-1">
  420. <b class="text-info">@{{ event.proName }}</b>
  421. &nbsp;/&nbsp;
  422. @{{ event.friendlyStartTime }} - @{{ event.friendlyEndTime }} <span
  423. class="text-secondary">@{{ event.timezone }}</span>
  424. &nbsp;/&nbsp;
  425. <span class="d-inline-block ml- 2 text-secondary font-weight-bold">@{{ event.title }}</span>
  426. </div>
  427. <div class="pb-1">
  428. <a :href="'/patients/view/' + event.clientUid" class="font-weight-bold">@{{
  429. event.clientName }}</a>
  430. <span class="small d-inline-block pl-2 text-secondary font-weight-normal">@{{ event.clientSummary }}</span>
  431. </div>
  432. <div class="d-flex align-items-baseline">
  433. <div v-if="event.status === 'PENDING'"
  434. class="text-warning-mellow font-weight-bold">
  435. <i class="fa fa-exclamation-triangle"></i>
  436. Confirmation pending
  437. </div>
  438. <div v-else-if="event.status === 'CONFIRMED'"
  439. class="text-success font-weight-bold">
  440. <i class="fa fa-check"></i>
  441. Confirmed by the patient
  442. </div>
  443. <div v-else class="text-secondary">
  444. Status: <b>@{{ event.status }}</b>
  445. </div>
  446. <span class="mx-2 text-secondary">|</span>
  447. <a :href="'/patients/view/' + event.clientUid + '/calendar/' + event.uid">
  448. <i class="fa fa-edit"></i>
  449. Edit Appointment
  450. </a>
  451. </div>
  452. <div class="mt-1"
  453. :class="event.coverage !== 'YES' ? (event.coverage === 'NO' ? 'text-danger' : 'text-warning-mellow') : 'text-success'">
  454. Coverage Status: <b>@{{ event.coverage }}</b>
  455. </div>
  456. </div>
  457. <div class="ml-auto">
  458. <select v-model="event.newStatus"
  459. class="form-control form-control-sm bg-light"
  460. v-on:change="updateStatus(event)">
  461. <option value="PENDING">PENDING</option>
  462. <option value="CONFIRMED">CONFIRMED</option>
  463. <option value="CANCELLED">CANCELLED</option>
  464. <option value="COMPLETED">COMPLETED</option>
  465. </select>
  466. <div v-if="selectedDate === '{{ date('Y-m-d') }}'"
  467. class="pt-1 text-right"
  468. :class="event.started ? 'text-danger': 'text-secondary'">
  469. @{{ event.inHowManyHours }}
  470. </div>
  471. </div>
  472. </div>
  473. <div v-if="numEventsForDate === 0" class="bg-light p-3 text-secondary border bounded">
  474. <span
  475. v-if="filterStatus === ''">You have no appointments on <b>@{{ selectedDate }}</b></span>
  476. <span
  477. v-if="filterStatus !== ''">You have no appointments on <b>@{{ selectedDate }}</b> with status <b>@{{ filterStatus }}</b></span>
  478. </div>
  479. </div>
  480. <div v-show="!selectedDate" class="bg-light p-3 text-secondary border bounded">
  481. Please select a date from the calendar on the left
  482. </div>
  483. </div>
  484. <div v-show="tab==='rpm'">
  485. <div id="rpm-tab">
  486. <div class="card mb-4">
  487. <div class="card-header pl-2">
  488. <strong>
  489. Remote Monitoring: {{friendly_month(date('Y-m-d'))}}
  490. </strong>
  491. </div>
  492. <div class="card-body p-1">
  493. @include('app.practice-management.remote-monitoring-admin-tree')
  494. </div>
  495. </div>
  496. </div>
  497. </div>
  498. <div v-show="tab==='measurements'">
  499. <div id="measurements-tab">Loading...</div>
  500. </div>
  501. <div v-show="tab==='incoming_reports'">
  502. @include('app.dashboard.incoming_reports')
  503. </div>
  504. <div v-show="tab==='erx'">
  505. @include('app.dashboard.erx')
  506. </div>
  507. <div v-show="tab==='labs'">
  508. @include('app.dashboard.labs')
  509. </div>
  510. <div v-show="tab==='imaging'">
  511. @include('app.dashboard.imaging')
  512. </div>
  513. <div v-show="tab==='supply_orders'">
  514. @include('app.dashboard.supply_orders')
  515. </div>
  516. </div>
  517. <div class="row mt-3">
  518. <div class="col-6">
  519. <div class="mb-3">
  520. <p class="mb-2 font-weight-bold text-secondary">Follow ups scheduled for today</p>
  521. <?php $fus = $pro->followupsScheduledForToday(); ?>
  522. @if(count($fus))
  523. <table class="table table-sm table-striped">
  524. <thead>
  525. <tr>
  526. <th>Client</th>
  527. <th>Assigned To</th>
  528. <th>Reason</th>
  529. <th>Status</th>
  530. </tr>
  531. </thead>
  532. <tbody>
  533. @foreach($fus as $fu)
  534. <tr>
  535. <td><a href="/patients/view/{{$fu->client_uid}}">{{$fu->client_name}}</a></td>
  536. <td>{{$fu->pro_first_name}} {{$fu->pro_last_name}}</td>
  537. <td>{{$fu->next_follow_up_reason}}</td>
  538. <td>{{$fu->status}}</td>
  539. </tr>
  540. @endforeach
  541. </tbody>
  542. </table>
  543. @else
  544. <span class="text-secondary">No follow ups scheduled for today!</span>
  545. @endif
  546. </div>
  547. </div>
  548. <div class="col-6">
  549. @if(request()->input('mcpas'))
  550. @if(count($newMCPAssociations))
  551. <div class="mb-3 border rounded px-3 py-2 ack-container">
  552. <div class="d-flex align-items-baseline pt-1 mb-2">
  553. <p class=""><b>New Patients</b></p>
  554. <a href="/" class="ml-auto">Close</a>
  555. </div>
  556. @foreach($newMCPAssociations as $assoc)
  557. <div class="d-flex align-items-start bg-light mb-2 px-2 py-1">
  558. <div class="flex-grow-1">
  559. You are now the MCP for
  560. <a href="/patients/view/{{$assoc->patient->uid}}"
  561. class="">{{$assoc->patient->displayName()}}</a>
  562. <?php $nextAppt = $assoc->patient->nextAppointment(); ?>
  563. @if($nextAppt)
  564. <div class="font-size-11">
  565. <span class="text-secondary font-size-11">Appt.</span>
  566. {{$nextAppt->pro->displayName()}}
  567. <span class="text-secondary font-size-11">on</span>
  568. {{friendlier_date_time($nextAppt->raw_date . ' ' . $nextAppt->raw_start_time)}}
  569. </div>
  570. @if($nextAppt->status === 'PENDING') {{-- WIP: ALIX overhaul --}}
  571. <div
  572. class="text-warning-mellow font-weight-bold font-size-11 mt-1">
  573. <i class="fa fa-exclamation-triangle"></i>
  574. Confirmation pending
  575. </div>
  576. @endif
  577. @if($nextAppt->status === 'CONFIRMED')
  578. <div class="text-success font-weight-bold font-size-11 mt-1">
  579. <i class="fa fa-check"></i>
  580. Confirmed by the patient
  581. </div>
  582. @endif
  583. @if($nextAppt->status === 'CANCELLED')
  584. <div class="text-danger font-weight-bold font-size-11 mt-1">
  585. <i class="fa fa-stop"></i>
  586. Cancelled
  587. </div>
  588. @endif
  589. @endif
  590. </div>
  591. <a href="#" class="ack-client-pro-change ml-3" data-uid="{{$assoc->uid}}">Ack.</a>
  592. </div>
  593. @endforeach
  594. </div>
  595. @endif
  596. @else
  597. @if(!!$newMCPAssociations)
  598. <a href="/?mcpas=1" class="d-block mb-2">You have <b>{{$newMCPAssociations}}</b> new MCP association{{$newMCPAssociations === 1 ? '' : 's'}}</a>
  599. @endif
  600. @endif
  601. @if(request()->input('naas'))
  602. @if(count($newNAAssociations))
  603. <div class="mb-3 border rounded px-3 py-2 ack-container">
  604. <div class="d-flex align-items-baseline pt-1 mb-2">
  605. <p class=""><b>New Patients</b></p>
  606. <a href="/" class="ml-auto">Close</a>
  607. </div>
  608. @foreach($newNAAssociations as $assoc)
  609. <div class="d-flex align-items-start bg-light mb-2 px-2 py-1">
  610. <div class="flex-grow-1">
  611. You are now the Care Coordinator for
  612. <a href="/patients/view/{{$assoc->patient->uid}}"
  613. class="">{{$assoc->patient->displayName()}}</a>
  614. <?php $nextAppt = $assoc->patient->nextAppointment(); ?>
  615. @if($nextAppt)
  616. <div class="font-size-11">
  617. <span class="text-secondary font-size-11">Appt.</span>
  618. {{$nextAppt->pro->displayName()}}
  619. <span class="text-secondary font-size-11">on</span>
  620. {{friendlier_date_time($nextAppt->raw_date . ' ' . $nextAppt->raw_start_time)}}
  621. </div>
  622. @if($nextAppt->status === 'PENDING') {{-- WIP: ALIX overhaul --}}
  623. <div
  624. class="text-warning-mellow font-weight-bold font-size-11 mt-1">
  625. <i class="fa fa-exclamation-triangle"></i>
  626. Confirmation pending
  627. </div>
  628. @endif
  629. @if($nextAppt->status === 'CONFIRMED')
  630. <div class="text-success font-weight-bold font-size-11 mt-1">
  631. <i class="fa fa-check"></i>
  632. Confirmed by the patient
  633. </div>
  634. @endif
  635. @if($nextAppt->status === 'CANCELLED')
  636. <div class="text-danger font-weight-bold font-size-11 mt-1">
  637. <i class="fa fa-stop"></i>
  638. Cancelled
  639. </div>
  640. @endif
  641. @endif
  642. </div>
  643. <a href="#" class="ack-client-pro-change"
  644. data-uid="{{$assoc->uid}}">Ack.</a>
  645. </div>
  646. @endforeach
  647. </div>
  648. @endif
  649. @else
  650. @if(!!$newNAAssociations)
  651. <a href="/?naas=1" class="d-block">You have <b>{{$newNAAssociations}}</b> new NA association{{$newNAAssociations === 1 ? '' : 's'}}</a>
  652. @endif
  653. @endif
  654. @if(request()->input('mcpcm'))
  655. @if(count($mcpClientMemos))
  656. <div class="mb-3 border rounded px-3 py-2 ack-container table-responsive">
  657. <div class="d-flex align-items-baseline pt-1 mb-2">
  658. <p class=""><b>New Patients Memos (MCP)</b></p>
  659. <a href="/" class="ml-auto">Close</a>
  660. </div>
  661. <table class="table table-sm table-hover table-striped table-bordered">
  662. <thead class="bg-light">
  663. <tr>
  664. <th class="border-bottom-0">Patient</th>
  665. <th class="border-bottom-0">Memo</th>
  666. <th class="border-bottom-0">Created</th>
  667. <th class="border-bottom-0"></th>
  668. </tr>
  669. </thead>
  670. <tbody>
  671. @foreach($mcpClientMemos as $memo)
  672. <tr>
  673. <td class="">
  674. <a href="/patients/view/{{$memo->client_uid}}">{{$memo->name_first}} {{$memo->name_last}}</a>
  675. </td>
  676. <td>{!! $memo->content !!}</td>
  677. <td class="text-nowrap">{{friendlier_date_time($memo->created_at)}}</td>
  678. <td><a href="#" class="ack-client-memo"
  679. data-uid="{{$memo->uid}}">Ack.</a></td>
  680. </tr>
  681. @endforeach
  682. </tbody>
  683. </table>
  684. </div>
  685. @endif
  686. @else
  687. @if($mcpClientMemos[0]->count)
  688. <a href="/?mcpcm=1" class="d-block mb-2">You have <b>{{$mcpClientMemos[0]->count}}</b> new MCP client memo{{$mcpClientMemos[0]->count === 1 ? '' : 's'}}</a>
  689. @endif
  690. @endif
  691. @if(request()->input('nacm'))
  692. @if(count($naClientMemos))
  693. <div class="mb-3 border rounded px-3 py-2 ack-container table-responsive">
  694. <div class="d-flex align-items-baseline pt-1 mb-2">
  695. <p class=""><b>New Patients Memos (NA)</b></p>
  696. <a href="/" class="ml-auto">Close</a>
  697. </div>
  698. <table class="table table-sm table-hover table-striped table-bordered">
  699. <thead class="bg-light">
  700. <tr>
  701. <th class="border-bottom-0">Patient</th>
  702. <th class="border-bottom-0">Memo</th>
  703. <th class="border-bottom-0">Created</th>
  704. <th class="border-bottom-0"></th>
  705. </tr>
  706. </thead>
  707. <tbody>
  708. @foreach($naClientMemos as $memo)
  709. <tr>
  710. <td class="">
  711. <a href="/patients/view/{{$memo->client_uid}}">{{$memo->name_first}} {{$memo->name_last}}</a>
  712. </td>
  713. <td>{!! $memo->content !!}</td>
  714. <td class="text-nowrap">{{friendlier_date_time($memo->created_at)}}</td>
  715. <td><a href="#" class="ack-client-memo"
  716. data-uid="{{$memo->uid}}">Ack.</a></td>
  717. </tr>
  718. @endforeach
  719. </tbody>
  720. </table>
  721. </div>
  722. @endif
  723. @else
  724. @if($naClientMemos[0]->count)
  725. <a href="/?nacm=1" class="d-block mb-2">You have <b>{{$naClientMemos[0]->count}}</b> new MCP client memo{{$naClientMemos[0]->count === 1 ? '' : 's'}}</a>
  726. @endif
  727. @endif
  728. </div>
  729. </div>
  730. </div>
  731. </div>
  732. </div>
  733. </div>
  734. <div class="stag-popup stag-popup-md ticket-popup mcp-theme-1" stag-popup-key="ticket-popup"></div>
  735. <script>
  736. (function () {
  737. function init() {
  738. window.apapp = new Vue({
  739. el: '#pro-dashboard-container',
  740. delimiters: ['@{{', '}}'],
  741. data: {
  742. tab: '{{ request()->input('tab') ? request()->input('tab') : 'measurements' }}',
  743. datesWithEvents: [],
  744. selectedDate: '{{ date('Y-m-d') }}',
  745. selectedStatus: 'PENDING',
  746. events: [],
  747. numEventsForDate: 0,
  748. filterStatus: '',
  749. calendarElem: null,
  750. currentMonth: null,
  751. currentYear: null,
  752. measurementFilterStatus: 'ALL',
  753. measurements: {!! $pro->pro_type === 'ADMIN' ? '[]' : json_encode($pro->getMeasurements()) !!},
  754. appointmentsLoaded: false,
  755. appointmentCountsByPro: [],
  756. filterPro: '',
  757. },
  758. methods: {
  759. formatDate: function (date) {
  760. let d = new Date(date),
  761. month = '' + (d.getMonth() + 1),
  762. day = '' + d.getDate(),
  763. year = d.getFullYear();
  764. if (month.length < 2)
  765. month = '0' + month;
  766. if (day.length < 2)
  767. day = '0' + day;
  768. return [year, month, day].join('-');
  769. },
  770. onDateChange: function (_newDate) {
  771. let self = this;
  772. window.setTimeout(() => {
  773. // let dayValue = $('.pro-dashboard-inline-calendar td.day.active').first().text();
  774. // if(dayValue.length === 1) dayValue = '0' + dayValue;
  775. // self.selectedDate = _newDate.substr(0, 8) + dayValue;
  776. self.selectedDate = _newDate;
  777. showMask();
  778. self.loadEvents(self.selectedDate, function () {
  779. hideMask();
  780. Vue.nextTick(() => {
  781. // self.highlightDatesWithEvents(self.datesWithEvents);
  782. initFastLoad($('.appointments-tab'));
  783. });
  784. });
  785. }, 25);
  786. },
  787. selectToday: function () {
  788. $('.pro-dashboard-inline-calendar table td[data-date]').removeClass('active');
  789. $('.pro-dashboard-inline-calendar table td[data-date="{{ $milliseconds }}"]')
  790. .addClass('active');
  791. // this.onDateChange('{{ date('Y-m-d') }}');
  792. },
  793. highlightDatesWithEvents: function (_dates) {
  794. $('.pro-dashboard-inline-calendar table td[data-date]').removeAttr('has-events');
  795. for (let i = 0; i < _dates.length; i++) {
  796. $('.pro-dashboard-inline-calendar table td[data-date="' + _dates[i] + '"]')
  797. .attr('has-events', 1);
  798. }
  799. },
  800. updateStatus: function (_event) {
  801. $.post('/api/appointment/updateStatus', {
  802. uid: _event.uid,
  803. status: _event.newStatus
  804. }, function (_data) {
  805. if (!_data) {
  806. toastr.error('Unable to update appointment status!');
  807. } else {
  808. if (!_data.success) {
  809. toastr.error(_data.message);
  810. } else {
  811. _event.status = _event.newStatus;
  812. toastr.success('The appointment has been updated');
  813. }
  814. }
  815. }, 'json')
  816. },
  817. showEditForm: function (_trigger) {
  818. let form = $(_trigger).closest('[moe]').find('form').first();
  819. showMoeFormMask();
  820. form.show();
  821. setTimeout(function () {
  822. initPrimaryForm(form);
  823. }, 0);
  824. },
  825. submitEditForm: function (_trigger) {
  826. let form = $(_trigger).closest('[moe]').find('form').first();
  827. if (!form[0].checkValidity()) {
  828. form[0].reportValidity();
  829. return;
  830. }
  831. $.post(form.attr('url'), form.serialize(), function (_data) {
  832. if (_data && _data.success) {
  833. fastReload();
  834. } else {
  835. if (_data.message) {
  836. toastr.error(_data.message);
  837. } else {
  838. toastr.error('Unable to update the appointment');
  839. }
  840. }
  841. });
  842. },
  843. cancelEditForm: function (_trigger) {
  844. let form = $(_trigger).closest('[moe]').find('form').first();
  845. hideMoeFormMask();
  846. form.hide();
  847. },
  848. loadEventDates: function (_refDate = false) {
  849. let today = new Date(_refDate ? _refDate : '{{date('Y-m-d')}}'),
  850. firstOfMonth = new Date(today.getFullYear(), today.getMonth(), 1),
  851. lastOfMonth = new Date(today.getFullYear(), today.getMonth() + 1, 0);
  852. this.selectedDate = null;
  853. $('td.day.active').removeClass('active');
  854. $.get('/pro-dashboard-event-dates/' +
  855. this.formatDate(firstOfMonth) + '/' +
  856. this.formatDate(lastOfMonth), (_data) => {
  857. this.datesWithEvents = _data;
  858. console.log(this.datesWithEvents);
  859. this.calendarElem.datepicker('refresh');
  860. // this.highlightDatesWithEvents(this.datesWithEvents);
  861. this.currentMonth = firstOfMonth.getMonth();
  862. this.currentYear = firstOfMonth.getFullYear();
  863. if (!_refDate && $('td.day[data-date="{{$milliseconds}}"]:visible').length) {
  864. $('td.day[data-date="{{$milliseconds}}"]:visible').first().click();
  865. }
  866. this.appointmentsLoaded = true;
  867. }, 'json');
  868. },
  869. loadEvents: function (_date, _callback) {
  870. let self = this;
  871. $.get('/pro-dashboard-events/' + _date + '/' + _date, function (_data) {
  872. self.events = _data;
  873. self.numEventsForDate = (_data && _data.length) ? _data.length : 0;
  874. // fill appointmentCountsByPro
  875. self.appointmentCountsByPro = {};
  876. if(_data && _data.length) {
  877. for (let i = 0; i < _data.length; i++) {
  878. if(!self.appointmentCountsByPro[_data[i].proUid]) {
  879. self.appointmentCountsByPro[_data[i].proUid] = {
  880. name: _data[i].proName,
  881. appointments: 1
  882. };
  883. }
  884. else {
  885. self.appointmentCountsByPro[_data[i].proUid].appointments++;
  886. }
  887. }
  888. }
  889. _callback.call(self);
  890. }, 'json');
  891. },
  892. updateMeasurements: function () {
  893. $.get('/pro-dashboard-measurements/' + this.measurementFilterStatus, (_data) => {
  894. this.measurements = _data;
  895. Vue.nextTick(() => {
  896. // this.initCMRTE();
  897. $('#pro-dashboard-container').find('[moe][initialized]').removeAttr('initialized');
  898. initMoes();
  899. });
  900. }, 'json');
  901. },
  902. setMeasurementStatus: function (_uid, _status) {
  903. $.post('/api/measurement/updateStatus', {
  904. uid: _uid,
  905. status: _status
  906. }, (_data) => {
  907. this.updateMeasurements();
  908. }, 'json');
  909. },
  910. initCMRTE: function () {
  911. $('#pro-dashboard-container [cm-rte]').each(function () {
  912. $(this).wrap(
  913. $('<div class="border-left border-right rte-holder"/>')
  914. .attr('data-shortcuts', '')
  915. );
  916. // give a unique id to this editor instance
  917. var editorID = Math.ceil(Math.random() * 99999), fieldName = $(this).attr('data-name');
  918. var el = this;
  919. var existingContent = $(el).attr('data-content');
  920. var quill = new Quill(el, {
  921. theme: 'snow',
  922. modules: stagQuillConfig
  923. });
  924. var toolbar = $(quill.container).prev('.ql-toolbar');
  925. // add button for new shortcut
  926. var newSCButton = $('<button class="btn bg-white btn-sm btn-default text-primary w-auto px-2 border py-0 ' +
  927. 'text-sm add-shortcut" data-editor-id="' + editorID + '">+ Shortcut</button>');
  928. toolbar.append(newSCButton);
  929. quill.root.innerHTML = existingContent;
  930. $('<input type="hidden" name="' + fieldName + '">').val(existingContent).insertAfter(el);
  931. quill.on('text-change', function (delta, oldDelta, source) {
  932. $(el).next('[name="' + fieldName + '"]').val(quill.root.innerHTML);
  933. });
  934. $(quill.container)
  935. .find('.ql-editor[contenteditable]')
  936. .attr('data-field', fieldName)
  937. .attr('data-editor-id', editorID)
  938. .attr('with-shortcuts', 1);
  939. })
  940. },
  941. initLoadAppointments: function () {
  942. if (this.appointmentsLoaded) return false;
  943. this.loadEventDates();
  944. },
  945. loadMeasurements: function () {
  946. $('#measurements-tab').load('/pro-dashboard-measurements-tab', () => {
  947. initMoes();
  948. initFastLoad($('#measurements-tab'));
  949. });
  950. }
  951. },
  952. mounted: function () {
  953. let self = this;
  954. this.calendarElem = $('.pro-dashboard-inline-calendar');
  955. this.calendarElem.datepicker({
  956. dateFormat: 'yy-mm-dd',
  957. onSelect: function (_date) {
  958. self.onDateChange(_date);
  959. },
  960. onChangeMonthYear: function (_year, _month) {
  961. let date = _year + '-' + (_month < 10 ? '0' : '') + _month + '-05';
  962. self.loadEventDates(date);
  963. },
  964. beforeShowDay: function (d) {
  965. if (self.datesWithEvents && self.datesWithEvents.indexOf(self.formatDate(d)) !== -1) {
  966. return [true, 'has-events'];
  967. }
  968. return [true, 'no-events'];
  969. }
  970. });
  971. // this.calendarElem
  972. // .on('changeDate', function () {
  973. // self.onDateChange(self.calendarElem.datepicker('getFormattedDate'));
  974. // })
  975. // .on('changeMonth', function () {
  976. // window.setTimeout(function() {
  977. // let ts = $('td.day[data-date]').first().closest('tr').find('td.day[data-date]').last().attr('data-date');
  978. // if(ts) {
  979. // self.loadEventDates(ts);
  980. // }
  981. // }, 10);
  982. // });
  983. $('#pro-dashboard-container').find('[moe][initialized]').removeAttr('initialized');
  984. initMoes();
  985. // init fast load
  986. initFastLoad($('#pro-dashboard-container'));
  987. $(document)
  988. .off('click', '.dashboard-measurements.pagination a.page-link')
  989. .on('click', '.dashboard-measurements.pagination a.page-link', function () {
  990. $('#measurements-tab').text('Loading...').load('/pro-dashboard-measurements-tab/' + $(this).attr('data-target-page'), () => {
  991. initMoes();
  992. initFastLoad($('#measurements-tab'));
  993. });
  994. return false;
  995. });
  996. this.loadMeasurements();
  997. }
  998. });
  999. /*// refresh once ticket popup is closed
  1000. $('body').off('stag-popup-closed')
  1001. $('body').on('stag-popup-closed', function() {
  1002. if($('#pro-dashboard-container').length) {
  1003. let activeTab = $('.nav-link.active[data-tab]').attr('data-tab');
  1004. if(activeTab) {
  1005. fastLoad('/?tab=' + activeTab);
  1006. }
  1007. }
  1008. });*/
  1009. // ticket-popup
  1010. $(document)
  1011. .off('click', '.ticket-popup-trigger')
  1012. .on('click', '.ticket-popup-trigger', function () {
  1013. showMask();
  1014. window.noMc = true;
  1015. $.get(this.href, (_data) => {
  1016. $('.ticket-popup').html(_data);
  1017. showStagPopup('ticket-popup');
  1018. $('.ticket-popup .stag-popup.stag-slide').attr('close-all-with-self', 1);
  1019. runMCInitializer('patient-tickets'); // run specific mc initer
  1020. hideMask();
  1021. });
  1022. return false;
  1023. });
  1024. $(document)
  1025. .off('click', '.ack-client-pro-change')
  1026. .on('click', '.ack-client-pro-change', function () {
  1027. let trigger = $(this).text('…');
  1028. $.post('/api/clientProChange/accept', {
  1029. uid: $(this).attr('data-uid')
  1030. }, _data => {
  1031. if (!hasResponseError(_data)) {
  1032. trigger.hide();
  1033. let doneElem = $('<i class="text-success fa fa-check"></i>');
  1034. doneElem.insertAfter(trigger);
  1035. setTimeout(() => {
  1036. let ackContainer = trigger.closest('.ack-container');
  1037. trigger.closest('div').slideUp('fast', function () {
  1038. $(this).remove();
  1039. if (!ackContainer.find('>div').length) {
  1040. ackContainer.remove();
  1041. }
  1042. });
  1043. }, 500);
  1044. }
  1045. }, 'json');
  1046. return false;
  1047. });
  1048. $(document)
  1049. .off('click', '.ack-client-memo')
  1050. .on('click', '.ack-client-memo', function () {
  1051. let trigger = $(this).text('…');
  1052. $.post('/api/clientMemo/stamp', {
  1053. uid: $(this).attr('data-uid')
  1054. }, _data => {
  1055. if (!hasResponseError(_data)) {
  1056. trigger.hide();
  1057. let doneElem = $('<i class="text-success fa fa-check"></i>');
  1058. doneElem.insertAfter(trigger);
  1059. setTimeout(() => {
  1060. let tbody = trigger.closest('tbody');
  1061. trigger.closest('tr').remove();
  1062. if (!tbody.find('>tr').length) {
  1063. tbody.closest('.ack-container').remove();
  1064. }
  1065. }, 500);
  1066. }
  1067. }, 'json');
  1068. return false;
  1069. });
  1070. $(document)
  1071. .off('click', '.ack-pro-appt-update')
  1072. .on('click', '.ack-pro-appt-update', function () {
  1073. let trigger = $(this).text('…');
  1074. $.post('/api/appointmentConfirmationDecision/acknowledgeAsAppointmentPro', {
  1075. uid: $(this).attr('data-uid')
  1076. }, _data => {
  1077. if (!hasResponseError(_data)) {
  1078. trigger.hide();
  1079. let doneElem = $('<i class="text-success fa fa-check"></i>');
  1080. doneElem.insertAfter(trigger);
  1081. setTimeout(() => {
  1082. let ackContainer = trigger.closest('tbody');
  1083. trigger.closest('tr').slideUp('fast', function () {
  1084. $(this).remove();
  1085. if (!ackContainer.find('>tr').length) {
  1086. ackContainer.remove();
  1087. }
  1088. });
  1089. }, 500);
  1090. }
  1091. }, 'json');
  1092. return false;
  1093. });
  1094. $(document)
  1095. .off('click', '.ack-na-appt-update')
  1096. .on('click', '.ack-na-appt-update', function () {
  1097. let trigger = $(this).text('…');
  1098. $.post('/api/appointmentConfirmationDecision/acknowledgeAsClientDefaultNa', {
  1099. uid: $(this).attr('data-uid')
  1100. }, _data => {
  1101. if (!hasResponseError(_data)) {
  1102. trigger.hide();
  1103. let doneElem = $('<i class="text-success fa fa-check"></i>');
  1104. doneElem.insertAfter(trigger);
  1105. setTimeout(() => {
  1106. let ackContainer = trigger.closest('tbody');
  1107. trigger.closest('tr').slideUp('fast', function () {
  1108. $(this).remove();
  1109. if (!ackContainer.find('>tr').length) {
  1110. ackContainer.remove();
  1111. }
  1112. });
  1113. }, 500);
  1114. }
  1115. }, 'json');
  1116. return false;
  1117. });
  1118. }
  1119. addMCInitializer('pro-dashboard', init, '#pro-dashboard-container');
  1120. })();
  1121. </script>
  1122. @endsection