dashboard-admin.blade.php 78 KB

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