dashboard-admin.blade.php 73 KB

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