dashboard-mcp.blade.php 79 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286
  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. }
  1136. });
  1137. /*// refresh once ticket popup is closed
  1138. $('body').off('stag-popup-closed')
  1139. $('body').on('stag-popup-closed', function() {
  1140. if($('#pro-dashboard-container').length) {
  1141. let activeTab = $('.nav-link.active[data-tab]').attr('data-tab');
  1142. if(activeTab) {
  1143. fastLoad('/?tab=' + activeTab);
  1144. }
  1145. }
  1146. });*/
  1147. // ticket-popup
  1148. $(document)
  1149. .off('click', '.ticket-popup-trigger')
  1150. .on('click', '.ticket-popup-trigger', function () {
  1151. showMask();
  1152. window.noMc = true;
  1153. $.get(this.href, (_data) => {
  1154. $('.ticket-popup').html(_data);
  1155. showStagPopup('ticket-popup');
  1156. $('.ticket-popup .stag-popup.stag-slide').attr('close-all-with-self', 1);
  1157. runMCInitializer('patient-tickets'); // run specific mc initer
  1158. hideMask();
  1159. });
  1160. return false;
  1161. });
  1162. $(document)
  1163. .off('click', '.ack-client-pro-change')
  1164. .on('click', '.ack-client-pro-change', function () {
  1165. let trigger = $(this).text('…');
  1166. $.post('/api/clientProChange/accept', {
  1167. uid: $(this).attr('data-uid')
  1168. }, _data => {
  1169. if (!hasResponseError(_data)) {
  1170. trigger.hide();
  1171. let doneElem = $('<i class="text-success fa fa-check"></i>');
  1172. doneElem.insertAfter(trigger);
  1173. setTimeout(() => {
  1174. let ackContainer = trigger.closest('.ack-container');
  1175. trigger.closest('div').slideUp('fast', function () {
  1176. $(this).remove();
  1177. if (!ackContainer.find('>div').length) {
  1178. ackContainer.remove();
  1179. }
  1180. });
  1181. }, 500);
  1182. }
  1183. }, 'json');
  1184. return false;
  1185. });
  1186. $(document)
  1187. .off('click', '.ack-client-memo')
  1188. .on('click', '.ack-client-memo', function () {
  1189. let trigger = $(this).text('…');
  1190. $.post('/api/clientMemo/stamp', {
  1191. uid: $(this).attr('data-uid')
  1192. }, _data => {
  1193. if (!hasResponseError(_data)) {
  1194. trigger.hide();
  1195. let doneElem = $('<i class="text-success fa fa-check"></i>');
  1196. doneElem.insertAfter(trigger);
  1197. setTimeout(() => {
  1198. let tbody = trigger.closest('tbody');
  1199. trigger.closest('tr').remove();
  1200. if (!tbody.find('>tr').length) {
  1201. tbody.closest('.ack-container').remove();
  1202. }
  1203. }, 500);
  1204. }
  1205. }, 'json');
  1206. return false;
  1207. });
  1208. $(document)
  1209. .off('click', '.ack-pro-appt-update')
  1210. .on('click', '.ack-pro-appt-update', function () {
  1211. let trigger = $(this).text('…');
  1212. $.post('/api/appointmentConfirmationDecision/acknowledgeAsAppointmentPro', {
  1213. uid: $(this).attr('data-uid')
  1214. }, _data => {
  1215. if (!hasResponseError(_data)) {
  1216. trigger.hide();
  1217. let doneElem = $('<i class="text-success fa fa-check"></i>');
  1218. doneElem.insertAfter(trigger);
  1219. setTimeout(() => {
  1220. let ackContainer = trigger.closest('tbody');
  1221. trigger.closest('tr').slideUp('fast', function () {
  1222. $(this).remove();
  1223. if (!ackContainer.find('>tr').length) {
  1224. ackContainer.remove();
  1225. }
  1226. });
  1227. }, 500);
  1228. }
  1229. }, 'json');
  1230. return false;
  1231. });
  1232. }
  1233. addMCInitializer('pro-dashboard', init, '#pro-dashboard-container');
  1234. })();
  1235. </script>
  1236. @endsection