dashboard-admin.blade.php 79 KB

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