dashboard-mcp.blade.php 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740
  1. @extends ('layouts.template')
  2. @section('content')
  3. <style>
  4. tr.thin th, tr.thin td, .dashboard-stats-table tr td, .dashboard-stats-table tr th {
  5. padding: 0.25em;
  6. font-weight: normal;
  7. }
  8. table.appointments tr td {
  9. vertical-align: middle;
  10. }
  11. </style>
  12. <div class="p-3">
  13. <div class="">
  14. <div class="row mcp-theme-1" id="pro-dashboard-container" v-cloak>
  15. <div class="col-md-3 mcp-theme-1">
  16. <div class="mb-4">
  17. <div class="pro-dashboard-inline-calendar"></div>
  18. </div>
  19. <div class="card mb-4">
  20. <div class="card-header pl-2">
  21. <strong>
  22. Key Numbers
  23. </strong>
  24. </div>
  25. <div class="card-body p-0">
  26. <table class="table table-sm mb-0 dashboard-stats-table">
  27. <tbody>
  28. <tr>
  29. <th class="px-2 text-center">{{$pro->get_patients_count_as_mcp()}}</th>
  30. <th class="pl-2">
  31. <a href="{{ route('mcp.patients') }}">Patients</a>
  32. </th>
  33. </tr>
  34. <tr>
  35. <th class="px-2 text-center">{{$pro->get_new_patients_awaiting_visit_count_as_mcp()}}</th>
  36. <th class="pl-2">
  37. <a href="{{ route('mcp.new_patients_awaiting_visit') }}"
  38. native target="_blank"
  39. open-in-stag-popup
  40. popup-style="tall"
  41. title="New Patients Awaiting Visit">
  42. New Patients Awaiting Visit
  43. </a>
  44. </th>
  45. </tr>
  46. <tr>
  47. <th class="px-2 text-center">{{$pro->get_notes_pending_signature_count_as_mcp()}}</th>
  48. <th class="pl-2">
  49. <a href="{{ route('mcp.notes_pending_signature') }}"
  50. native target="_blank"
  51. open-in-stag-popup
  52. popup-style="tall"
  53. title="Notes Pending Signature">
  54. Notes Pending Signature
  55. </a>
  56. </th>
  57. </tr>
  58. <tr>
  59. <th class="px-2 text-center">{{$pro->get_notes_pending_billing_count_as_mcp()}}</th>
  60. <th class="pl-2">
  61. <a href="{{ route('mcp.notes_pending_billing') }}"
  62. native target="_blank"
  63. open-in-stag-popup
  64. popup-style="tall"
  65. title="Notes Pending Billing">
  66. Notes Pending Billing
  67. </a>
  68. </th>
  69. </tr>
  70. <tr>
  71. <th class="px-2 text-center">{{$pro->get_incoming_reports_pending_signature_count_as_mcp()}}</th>
  72. <th class="pl-2">
  73. <a href="{{ route('mcp.reports_pending_signature') }}"
  74. native target="_blank"
  75. open-in-stag-popup
  76. popup-style="tall"
  77. title="Reports Pending Signature">
  78. Reports Pending Signature
  79. </a>
  80. </th>
  81. </tr>
  82. <tr>
  83. <th class="px-2 text-center">{{$pro->get_patients_without_appointment_count_as_mcp()}}</th>
  84. <th class="pl-2">
  85. <a href="{{ route('mcp.patients_without_appointments') }}"
  86. native target="_blank"
  87. open-in-stag-popup
  88. popup-style="tall"
  89. title="Patients w/o Appointments">
  90. Patients w/o Appointments
  91. </a>
  92. </th>
  93. </tr>
  94. <tr>
  95. <th class="px-2 text-center">{{$pro->get_patients_overdue_count_as_mcp()}}</th>
  96. <th class="pl-2">
  97. <a href="{{ route('mcp.patients_overdue_for_visit') }}"
  98. native target="_blank"
  99. open-in-stag-popup
  100. popup-style="tall"
  101. title="Patients Overdue for Visit">
  102. Patients Overdue for Visit
  103. </a>
  104. </th>
  105. </tr>
  106. <tr>
  107. <th class="px-2 text-center">{{$pro->get_cancelled_appointments_pending_acknowledgement_count_as_mcp()}}</th>
  108. <th class="pl-2">
  109. <a href="{{ route('mcp.cancelled_appointments_pending_review') }}"
  110. native target="_blank"
  111. open-in-stag-popup
  112. popup-style="tall"
  113. title="Cancelled Appts. Pending Review">
  114. Cancelled Appts. Pending Review
  115. </a>
  116. </th>
  117. </tr>
  118. <tr>
  119. <th class="px-2 text-center">{{$pro->get_cancelled_bills_awaiting_review_count_as_mcp()}}</th>
  120. <th class="pl-2">
  121. <a href="{{ route('mcp.cancelled_bills_pending_review') }}"
  122. native target="_blank"
  123. open-in-stag-popup
  124. popup-style="tall"
  125. title="Cancelled Bills Pending Review">
  126. Cancelled Bills Pending Review
  127. </a>
  128. </th>
  129. </tr>
  130. <tr>
  131. <th class="px-2 text-center">{{$pro->get_cancelled_supply_orders_awaiting_review_count_as_mcp()}}</th>
  132. <th class="pl-2">
  133. <a href="{{ route('mcp.cancelled_supply_orders_pending_review') }}"
  134. native target="_blank"
  135. open-in-stag-popup
  136. popup-style="tall"
  137. title="Cancelled Supply Orders Pending Review">
  138. Cancelled Supply Orders Pending Review
  139. </a>
  140. </th>
  141. </tr>
  142. <tr>
  143. <th class="px-2 text-center">{{$pro->get_erx_and_orders_awaiting_signature_count_as_mcp()}}</th>
  144. <th class="pl-2">
  145. <a href="{{ route('mcp.erx_and_orders_pending_signature') }}"
  146. native target="_blank"
  147. open-in-stag-popup
  148. popup-style="tall"
  149. title="ERx & Orders Pending Signature">
  150. ERx & Orders Pending Signature
  151. </a>
  152. </th>
  153. </tr>
  154. <tr>
  155. <th class="px-2 text-center">{{$pro->get_supply_orders_awaiting_signature_count_as_mcp()}}</th>
  156. <th class="pl-2">
  157. <a href="{{ route('mcp.supply_orders_pending_signature') }}"
  158. native target="_blank"
  159. open-in-stag-popup
  160. popup-style="tall"
  161. title="Supply Orders Pending Signature">
  162. Supply Orders Pending Signature
  163. </a>
  164. </th>
  165. </tr>
  166. </tbody>
  167. </table>
  168. </div>
  169. </div>
  170. <div class="card mb-4">
  171. <div class="card-header pl-2">
  172. <strong>
  173. Remote Monitoring: {{friendly_month(date('Y-m-d'))}}
  174. </strong>
  175. </div>
  176. <div class="card-body p-0">
  177. <table class="table mb-0 dashboard-stats-table">
  178. <tbody>
  179. <tr class="thin">
  180. <th class="px-2 text-center">{{$pro->get_measurements_awaiting_review_count_as_mcp() ?? '-'}}</th>
  181. <th class="pl-2">Measurements Pending Review</th>
  182. </tr>
  183. <tr class="thin">
  184. <th class="px-2 text-center">{{$pro->get_patients_without_remote_measurement_in_48_hours_count_as_mcp() ?? '-'}}</th>
  185. <th class="pl-2">Patients w/o Measurement in 48 hrs.</th>
  186. </tr>
  187. </tbody>
  188. </table>
  189. </div>
  190. </div>
  191. <div class="card mb-4">
  192. <div class="card-header pl-2">
  193. <strong>
  194. Practice Management
  195. </strong>
  196. </div>
  197. <div class="card-body p-0">
  198. <table class="table mb-0 dashboard-stats-table">
  199. <tbody>
  200. <tr class="thin">
  201. <th colspan="2" class="font-weight-normal px-2 pl-2">Billing & Reimbursement</th>
  202. </tr>
  203. <tr class="thin">
  204. <th class="font-weight-normal px-2 pl-4">{{friendly_date_time($reimbursement['nextPaymentDate'], false)}}</th>
  205. <th class="font-weight-normal pl-2">Next Payment Date</th>
  206. </tr>
  207. <tr class="thin">
  208. <th class="font-weight-normal px-2 pl-4">
  209. ${{friendly_money($reimbursement['currentBalance'])}}</th>
  210. <th class="font-weight-normal pl-2 w-100"><a
  211. href="/practice-management/financial-transactions">Current balance</a></th>
  212. </tr>
  213. <tr class="thin">
  214. <th class="font-weight-normal px-2 pl-4">
  215. ${{friendly_money($reimbursement['nextPaymentAmount'])}}</th>
  216. <th class="font-weight-normal pl-2"><a
  217. href="/practice-management/bills-under-processing">Processing</a></th>
  218. </tr>
  219. <tr class="thin">
  220. <th class="font-weight-normal px-2 pl-5">
  221. ${{friendly_money($reimbursement['nextPaymentAmount'])}}</th>
  222. <th class="font-weight-normal pl-2"><a
  223. href="/practice-management/bills-under-processing">Treatment Services</a>
  224. </th>
  225. </tr>
  226. <tr class="thin">
  227. <th class="font-weight-normal px-2 pl-5">
  228. ${{friendly_money($reimbursement['nextPaymentAmount'])}}</th>
  229. <th class="font-weight-normal pl-2"><a
  230. href="/practice-management/bills-under-processing">Remote Monitoring</a>
  231. </th>
  232. </tr>
  233. <tr class="thin">
  234. <th class="font-weight-normal px-2 pl-5">
  235. ${{friendly_money($reimbursement['nextPaymentAmount'])}}</th>
  236. <th class="font-weight-normal pl-2"><a
  237. href="/practice-management/bills-under-processing">Other Services</a></th>
  238. </tr>
  239. {{--
  240. <tr>
  241. <th class="px-2">{{$reimbursement['lastPayment']}}</th>
  242. <th class="pl-2"><a href="/practice-management/financial-transactions">Last payment</a></th>
  243. </tr>
  244. <tr>
  245. <th class="px-2">{{friendly_date_time($reimbursement['lastPaymentDate'], false)}}</th>
  246. <th class="pl-2"><a href="/practice-management/financial-transactions">Last payment date</a></th>
  247. </tr>
  248. --}}
  249. </tbody>
  250. </table>
  251. </div>
  252. </div>
  253. </div>
  254. <div class="col-md-9">
  255. <div class="row mcp-theme-1" id="pro-dashboard-container" v-cloak>
  256. <div class="col-md-6 mcp-theme-1">
  257. <div class="card mb-4">
  258. <div class="card-header pl-2">
  259. <strong>
  260. Appointments @{{ formatSelectedDate(selectedDate) }}
  261. </strong>
  262. </div>
  263. <div class="card-body p-0">
  264. @include('app.mcp.dashboard.appointments')
  265. </div>
  266. </div>
  267. <div class="card mb-4">
  268. <div class="card-header pl-2">
  269. <strong>
  270. Measurements
  271. </strong>
  272. </div>
  273. <div class="card-body">
  274. @include('app.mcp.dashboard.measurements')
  275. </div>
  276. </div>
  277. </div>
  278. <div class="col-md-6 mcp-theme-1">
  279. <div class="card mb-4">
  280. <div class="card-header pl-2">
  281. <strong>
  282. Notifications
  283. </strong>
  284. </div>
  285. <div class="card-body">
  286. @include('app.mcp.dashboard.notifications')
  287. </div>
  288. </div>
  289. <div class="card mb-4">
  290. <div class="card-header pl-2">
  291. <strong>
  292. Messages
  293. </strong>
  294. </div>
  295. <div class="card-body">
  296. @include('app.mcp.dashboard.messages')
  297. </div>
  298. </div>
  299. <div class="card mb-4">
  300. <div class="card-header pl-2">
  301. <strong>
  302. Phone Calls & Memos
  303. </strong>
  304. </div>
  305. <div class="card-body">
  306. @include('app.mcp.dashboard.calls_memos')
  307. </div>
  308. </div>
  309. </div>
  310. </div>
  311. </div>
  312. </div>
  313. </div>
  314. </div>
  315. <div class="stag-popup stag-popup-md ticket-popup mcp-theme-1" stag-popup-key="ticket-popup"></div>
  316. <script>
  317. (function () {
  318. function init() {
  319. window.apapp = new Vue({
  320. el: '#pro-dashboard-container',
  321. delimiters: ['@{{', '}}'],
  322. data: {
  323. tab: '{{ request()->input('tab') ? request()->input('tab') : 'measurements' }}',
  324. datesWithEvents: [],
  325. selectedDate: '{{ date('Y-m-d') }}',
  326. selectedStatus: 'CREATED',
  327. events: [],
  328. numEventsForDate: 0,
  329. filterStatus: '',
  330. calendarElem: null,
  331. currentMonth: null,
  332. currentYear: null,
  333. measurementFilterStatus: 'ALL',
  334. measurements: {!! $pro->pro_type === 'ADMIN' ? '[]' : json_encode($pro->getMeasurements()) !!},
  335. appointmentsLoaded: false,
  336. },
  337. methods: {
  338. formatDate: function (date) {
  339. let d = new Date(date),
  340. month = '' + (d.getMonth() + 1),
  341. day = '' + d.getDate(),
  342. year = d.getFullYear();
  343. if (month.length < 2)
  344. month = '0' + month;
  345. if (day.length < 2)
  346. day = '0' + day;
  347. return [year, month, day].join('-');
  348. },
  349. onDateChange: function (_newDate) {
  350. let self = this;
  351. window.setTimeout(() => {
  352. // let dayValue = $('.pro-dashboard-inline-calendar td.day.active').first().text();
  353. // if(dayValue.length === 1) dayValue = '0' + dayValue;
  354. // self.selectedDate = _newDate.substr(0, 8) + dayValue;
  355. self.selectedDate = _newDate;
  356. showMask();
  357. self.loadEvents(self.selectedDate, function () {
  358. hideMask();
  359. Vue.nextTick(() => {
  360. // self.highlightDatesWithEvents(self.datesWithEvents);
  361. initFastLoad($('.appointments-tab'));
  362. });
  363. });
  364. }, 25);
  365. },
  366. selectToday: function () {
  367. $('.pro-dashboard-inline-calendar table td[data-date]').removeClass('active');
  368. $('.pro-dashboard-inline-calendar table td[data-date="{{ $milliseconds }}"]')
  369. .addClass('active');
  370. // this.onDateChange('{{ date('Y-m-d') }}');
  371. },
  372. highlightDatesWithEvents: function (_dates) {
  373. $('.pro-dashboard-inline-calendar table td[data-date]').removeAttr('has-events');
  374. for (let i = 0; i < _dates.length; i++) {
  375. $('.pro-dashboard-inline-calendar table td[data-date="' + _dates[i] + '"]')
  376. .attr('has-events', 1);
  377. }
  378. },
  379. updateStatus: function (_event) {
  380. $.post('/api/appointment/updateStatus', {
  381. uid: _event.uid,
  382. status: _event.newStatus
  383. }, function (_data) {
  384. if (!_data) {
  385. toastr.error('Unable to update appointment status!');
  386. } else {
  387. if (!_data.success) {
  388. toastr.error(_data.message);
  389. } else {
  390. _event.status = _event.newStatus;
  391. toastr.success('The appointment has been updated');
  392. }
  393. }
  394. }, 'json')
  395. },
  396. showEditForm: function (_trigger) {
  397. let form = $(_trigger).closest('[moe]').find('form').first();
  398. showMoeFormMask();
  399. form.show();
  400. setTimeout(function () {
  401. initPrimaryForm(form);
  402. }, 0);
  403. },
  404. submitEditForm: function (_trigger) {
  405. let form = $(_trigger).closest('[moe]').find('form').first();
  406. if (!form[0].checkValidity()) {
  407. form[0].reportValidity();
  408. return;
  409. }
  410. $.post(form.attr('url'), form.serialize(), function (_data) {
  411. if (_data && _data.success) {
  412. fastReload();
  413. } else {
  414. if (_data.message) {
  415. toastr.error(_data.message);
  416. } else {
  417. toastr.error('Unable to update the appointment');
  418. }
  419. }
  420. });
  421. },
  422. cancelEditForm: function (_trigger) {
  423. let form = $(_trigger).closest('[moe]').find('form').first();
  424. hideMoeFormMask();
  425. form.hide();
  426. },
  427. loadEventDates: function (_refDate = false) {
  428. let today = new Date(_refDate ? _refDate : '{{date('Y-m-d')}}'),
  429. firstOfMonth = new Date(today.getFullYear(), today.getMonth(), 1),
  430. lastOfMonth = new Date(today.getFullYear(), today.getMonth() + 1, 0);
  431. this.selectedDate = null;
  432. $('td.day.active').removeClass('active');
  433. $.get('/pro-dashboard-event-dates/' +
  434. this.formatDate(firstOfMonth) + '/' +
  435. this.formatDate(lastOfMonth), (_data) => {
  436. this.datesWithEvents = _data;
  437. console.log(this.datesWithEvents);
  438. this.calendarElem.datepicker('refresh');
  439. // this.highlightDatesWithEvents(this.datesWithEvents);
  440. this.currentMonth = firstOfMonth.getMonth();
  441. this.currentYear = firstOfMonth.getFullYear();
  442. if (!_refDate && $('td.day[data-date="{{$milliseconds}}"]:visible').length) {
  443. $('td.day[data-date="{{$milliseconds}}"]:visible').first().click();
  444. }
  445. this.appointmentsLoaded = true;
  446. }, 'json');
  447. },
  448. loadEvents: function (_date, _callback) {
  449. let self = this;
  450. $.get('/pro-dashboard-events/' + _date + '/' + _date, function (_data) {
  451. self.events = _data;
  452. self.numEventsForDate = (_data && _data.length) ? 1 : 0;
  453. _callback.call(self);
  454. }, 'json');
  455. },
  456. updateMeasurements: function () {
  457. $.get('/pro-dashboard-measurements/' + this.measurementFilterStatus, (_data) => {
  458. this.measurements = _data;
  459. Vue.nextTick(() => {
  460. // this.initCMRTE();
  461. $('#pro-dashboard-container').find('[moe][initialized]').removeAttr('initialized');
  462. initMoes();
  463. });
  464. }, 'json');
  465. },
  466. setMeasurementStatus: function (_uid, _status) {
  467. $.post('/api/measurement/updateStatus', {
  468. uid: _uid,
  469. status: _status
  470. }, (_data) => {
  471. this.updateMeasurements();
  472. }, 'json');
  473. },
  474. initCMRTE: function () {
  475. $('#pro-dashboard-container [cm-rte]').each(function () {
  476. $(this).wrap(
  477. $('<div class="border-left border-right rte-holder"/>')
  478. .attr('data-shortcuts', '')
  479. );
  480. // give a unique id to this editor instance
  481. var editorID = Math.ceil(Math.random() * 99999), fieldName = $(this).attr('data-name');
  482. var el = this;
  483. var existingContent = $(el).attr('data-content');
  484. var quill = new Quill(el, {
  485. theme: 'snow',
  486. modules: stagQuillConfig
  487. });
  488. var toolbar = $(quill.container).prev('.ql-toolbar');
  489. // add button for new shortcut
  490. var newSCButton = $('<button class="btn bg-white btn-sm btn-default text-primary w-auto px-2 border py-0 ' +
  491. 'text-sm add-shortcut" data-editor-id="' + editorID + '">+ Shortcut</button>');
  492. toolbar.append(newSCButton);
  493. quill.root.innerHTML = existingContent;
  494. $('<input type="hidden" name="' + fieldName + '">').val(existingContent).insertAfter(el);
  495. quill.on('text-change', function (delta, oldDelta, source) {
  496. $(el).next('[name="' + fieldName + '"]').val(quill.root.innerHTML);
  497. });
  498. $(quill.container)
  499. .find('.ql-editor[contenteditable]')
  500. .attr('data-field', fieldName)
  501. .attr('data-editor-id', editorID)
  502. .attr('with-shortcuts', 1);
  503. })
  504. },
  505. initLoadAppointments: function () {
  506. if (this.appointmentsLoaded) return false;
  507. this.loadEventDates();
  508. },
  509. loadMeasurements: function () {
  510. $('#measurements-tab').load('/pro-dashboard-measurements-tab', () => {
  511. initMoes();
  512. initFastLoad($('#measurements-tab'));
  513. });
  514. },
  515. getFormattedCurrentDate: function () {
  516. let date = new Date();
  517. let day = date.getDate();
  518. day = day < 10 ? '0' + day : day;
  519. return date.getFullYear() + '-' + parseInt(date.getMonth() + 1) + '-' + day;
  520. },
  521. formatSelectedDate: function (_date, _format) {
  522. _format = _format || 'MM/DD/YYYY';
  523. if (_date) {
  524. return moment(_date).format(_format);
  525. }
  526. },
  527. formatTimeZone: function (_tz) {
  528. switch (_tz) {
  529. case 'EASTERN':
  530. return 'EST'
  531. break;
  532. case 'CENTRAL':
  533. return 'CST'
  534. break;
  535. case 'MOUNTAIN':
  536. return 'MST'
  537. break;
  538. case 'PACIFIC':
  539. return 'PST'
  540. break;
  541. case 'ALASKA':
  542. return 'Alaska'
  543. break;
  544. case 'HAWAII':
  545. return 'Hawaii'
  546. break;
  547. case 'PUERTO_RICO':
  548. return 'Puerto Rico'
  549. break;
  550. default:
  551. return 'N/A';
  552. }
  553. }
  554. },
  555. mounted: function () {
  556. let self = this;
  557. this.calendarElem = $('.pro-dashboard-inline-calendar');
  558. this.calendarElem.datepicker({
  559. dateFormat: 'yy-mm-dd',
  560. onSelect: function (_date) {
  561. self.onDateChange(_date);
  562. },
  563. onChangeMonthYear: function (_year, _month) {
  564. let date = _year + '-' + (_month < 10 ? '0' : '') + _month + '-05';
  565. self.loadEventDates(date);
  566. },
  567. beforeShowDay: function (d) {
  568. if (self.datesWithEvents && self.datesWithEvents.indexOf(self.formatDate(d)) !== -1) {
  569. return [true, 'has-events'];
  570. }
  571. return [true, 'no-events'];
  572. },
  573. defaultDate: 0
  574. });
  575. // this.calendarElem
  576. // .on('changeDate', function () {
  577. // self.onDateChange(self.calendarElem.datepicker('getFormattedDate'));
  578. // })
  579. // .on('changeMonth', function () {
  580. // window.setTimeout(function() {
  581. // let ts = $('td.day[data-date]').first().closest('tr').find('td.day[data-date]').last().attr('data-date');
  582. // if(ts) {
  583. // self.loadEventDates(ts);
  584. // }
  585. // }, 10);
  586. // });
  587. $('#pro-dashboard-container').find('[moe][initialized]').removeAttr('initialized');
  588. initMoes();
  589. // init fast load
  590. initFastLoad($('#pro-dashboard-container'));
  591. $(document)
  592. .off('click', '.dashboard-measurements.pagination a.page-link')
  593. .on('click', '.dashboard-measurements.pagination a.page-link', function () {
  594. $('#measurements-tab').text('Loading...').load('/pro-dashboard-measurements-tab/' + $(this).attr('data-target-page'), () => {
  595. initMoes();
  596. initFastLoad($('#measurements-tab'));
  597. });
  598. return false;
  599. });
  600. this.loadMeasurements();
  601. this.initLoadAppointments();
  602. this.onDateChange(this.getFormattedCurrentDate());
  603. this.selectedDate = this.getFormattedCurrentDate();
  604. }
  605. });
  606. /*// refresh once ticket popup is closed
  607. $('body').off('stag-popup-closed')
  608. $('body').on('stag-popup-closed', function() {
  609. if($('#pro-dashboard-container').length) {
  610. let activeTab = $('.nav-link.active[data-tab]').attr('data-tab');
  611. if(activeTab) {
  612. fastLoad('/?tab=' + activeTab);
  613. }
  614. }
  615. });*/
  616. // ticket-popup
  617. $(document)
  618. .off('click', '.ticket-popup-trigger')
  619. .on('click', '.ticket-popup-trigger', function () {
  620. showMask();
  621. window.noMc = true;
  622. $.get(this.href, (_data) => {
  623. $('.ticket-popup').html(_data);
  624. showStagPopup('ticket-popup');
  625. $('.ticket-popup .stag-popup.stag-slide').attr('close-all-with-self', 1);
  626. runMCInitializer('patient-tickets'); // run specific mc initer
  627. hideMask();
  628. });
  629. return false;
  630. });
  631. $(document)
  632. .off('click', '.ack-client-pro-change')
  633. .on('click', '.ack-client-pro-change', function () {
  634. let trigger = $(this).text('…');
  635. $.post('/api/clientProChange/accept', {
  636. uid: $(this).attr('data-uid')
  637. }, _data => {
  638. if (!hasResponseError(_data)) {
  639. trigger.hide();
  640. let doneElem = $('<i class="text-success fa fa-check"></i>');
  641. doneElem.insertAfter(trigger);
  642. setTimeout(() => {
  643. let ackContainer = trigger.closest('.ack-container');
  644. trigger.closest('div').slideUp('fast', function () {
  645. $(this).remove();
  646. if (!ackContainer.find('>div').length) {
  647. ackContainer.remove();
  648. }
  649. });
  650. }, 500);
  651. }
  652. }, 'json');
  653. return false;
  654. });
  655. $(document)
  656. .off('click', '.ack-client-memo')
  657. .on('click', '.ack-client-memo', function () {
  658. let trigger = $(this).text('…');
  659. $.post('/api/clientMemo/stamp', {
  660. uid: $(this).attr('data-uid')
  661. }, _data => {
  662. if (!hasResponseError(_data)) {
  663. trigger.hide();
  664. let doneElem = $('<i class="text-success fa fa-check"></i>');
  665. doneElem.insertAfter(trigger);
  666. setTimeout(() => {
  667. let tbody = trigger.closest('tbody');
  668. trigger.closest('tr').remove();
  669. if (!tbody.find('>tr').length) {
  670. tbody.closest('.ack-container').remove();
  671. }
  672. }, 500);
  673. }
  674. }, 'json');
  675. return false;
  676. });
  677. $(document)
  678. .off('click', '.ack-pro-appt-update')
  679. .on('click', '.ack-pro-appt-update', function () {
  680. let trigger = $(this).text('…');
  681. $.post('/api/appointmentConfirmationDecision/acknowledgeAsAppointmentPro', {
  682. uid: $(this).attr('data-uid')
  683. }, _data => {
  684. if (!hasResponseError(_data)) {
  685. trigger.hide();
  686. let doneElem = $('<i class="text-success fa fa-check"></i>');
  687. doneElem.insertAfter(trigger);
  688. setTimeout(() => {
  689. let ackContainer = trigger.closest('tbody');
  690. trigger.closest('tr').slideUp('fast', function () {
  691. $(this).remove();
  692. if (!ackContainer.find('>tr').length) {
  693. ackContainer.remove();
  694. }
  695. });
  696. }, 500);
  697. }
  698. }, 'json');
  699. return false;
  700. });
  701. }
  702. addMCInitializer('pro-dashboard', init, '#pro-dashboard-container');
  703. })();
  704. </script>
  705. @endsection