dashboard-mcp.blade.php 81 KB

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