dashboard-admin.blade.php 71 KB

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