dashboard-admin.blade.php 73 KB

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