dashboard-mcp.blade.php 79 KB

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