dashboard-admin.blade.php 78 KB

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