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