12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169 |
- @extends ('layouts.template')
- @section('content')
- <style>
- tr.thin th, tr.thin td {
- padding: 0.25em;
- }
- </style>
- <div class="p-3">
- <div class="">
- <div class="row mcp-theme-1" id="pro-dashboard-container" v-cloak>
- <div class="col-md-3 mcp-theme-1">
- <div class="mb-4" v-show="tab==='appointments'">
- <div class="pro-dashboard-inline-calendar"></div>
- </div>
- <div class="card mb-4">
- <div class="card-header pl-2">
- <strong>
- Key Numbers
- </strong>
- </div>
- <div class="card-body p-0">
- <table class="table mb-0 dashboard-stats-table table-sm">
- <tbody>
- <tr>
- <th class="px-2 text-center">{{$pro->get_patients_count_as_admin()}}</th>
- <th class="pl-2 font-weight-normal">Patients</th>
- </tr>
- <tr>
- <th class="px-2 text-center">{{$pro->get_new_patients_awaiting_visit_count_as_admin()}}</th>
- <th class="pl-2 font-weight-normal">New Patients Awaiting Visit</th>
- </tr>
- <tr>
- <th class="px-2 text-center">{{$pro->get_notes_pending_signature_count_as_admin()}}</th>
- <th class="pl-2 font-weight-normal">Notes Pending Signature</th>
- </tr>
- <tr>
- <th class="px-2 text-center">{{$pro->get_notes_pending_summary_suggestion_count_as_admin()}}</th>
- <th class="pl-2 font-weight-normal">
- <a href="{{ route('admin.notes_pending_summary_suggestion') }}"
- native target="_blank"
- open-in-stag-popup
- popup-style="tall stag-popup-md"
- title="Notes With Pending Summary Suggestion">
- Notes With Pending Summary Suggestion
- </a>
- </th>
- </tr>
- <tr>
- <th class="px-2 text-center">{{$pro->get_notes_rejected_summary_suggestion_count_as_admin()}}</th>
- <th class="pl-2 font-weight-normal">
- <a href="{{ route('admin.notes_rejected_summary_suggestion') }}"
- native target="_blank"
- open-in-stag-popup
- popup-style="tall"
- title="Notes With Rejected Summary Suggestion">
- Notes With Rejected Summary Suggestion
- </a>
- </th>
- </tr>
- <tr>
- <th class="px-2 text-center">{{$pro->get_notes_pending_billing_count_as_admin()}}</th>
- <th class="pl-2 font-weight-normal">Notes Pending Billing</th>
- </tr>
- <tr>
- <th class="px-2 text-center">{{$pro->get_incoming_reports_pending_signature_count_as_admin()}}</th>
- <th class="pl-2 font-weight-normal">Reports Pending Signature</th>
- </tr>
- <tr>
- <th class="px-2 text-center">{{$pro->get_patients_without_appointment_count_as_admin()}}</th>
- <th class="pl-2 font-weight-normal">Patients w/o Appointments</th>
- </tr>
- <tr>
- <th class="px-2 text-center">{{$pro->get_patients_not_seen_in_45_days_count_as_mcp()}}</th>
- <th class="pl-2 font-weight-normal">Patients Not Seen in 45 Days</th>
- </tr>
- <tr>
- <th class="px-2 text-center">{{$pro->get_cancelled_appointments_pending_acknowledgement_count_as_mcp()}}</th>
- <th class="pl-2 font-weight-normal">Cancelled Appts. Pending Review</th>
- </tr>
- <tr>
- <th class="px-2 text-center">{{$pro->get_cancelled_bills_awaiting_review_count_as_mcp()}}</th>
- <th class="pl-2 font-weight-normal">Cancelled Bills Pending Review</th>
- </tr>
- <tr>
- <th class="px-2 text-center">{{$pro->get_cancelled_supply_orders_awaiting_review_count_as_mcp()}}</th>
- <th class="pl-2 font-weight-normal">Cancelled Supply Orders</th>
- </tr>
- <tr>
- <th class="px-2 text-center">{{$pro->get_erx_and_orders_awaiting_signature_count_as_mcp()}}</th>
- <th class="pl-2 font-weight-normal">ERx & Orders Pending Signature</th>
- </tr>
- <tr>
- <th class="px-2 text-center">{{$pro->get_supply_orders_awaiting_signature_count_as_mcp()}}</th>
- <th class="pl-2 font-weight-normal">Supply Orders Pending Signature</th>
- </tr>
- <tr>
- <th class="px-2 text-center">{{$pro->get_open_tickets_count_as_mcp()}}</th>
- <th class="pl-2 font-weight-normal">
- <a href="{{ route('practice-management.myTickets') }}">
- Open Ticket{{$pro->get_open_tickets_count_as_mcp() !== 1 ? 's' : ''}}
- </a>
- </th>
- </tr>
- <tr>
- <th class="px-2 text-center">{{ $pro->myNotesPendingSupervisorPhysicianStamping() }}</th>
- <th class="pl-2 font-weight-normal">
- <a href="{{ route('practice-management.notes-pending-physician-supervisor-stamping', ['hideTitle' => true]) }}"
- native target="_blank"
- open-in-stag-popup
- popup-style="tall stag-popup-md"
- title="Notes Pending Physician Supervisor Stamping">
- Notes Pending Physician Supervisor Stamping
- </a>
- </th>
- </tr>
- <!-- new -->
- <tr>
- <th class="px-2 text-center">
- <?php
- $count = \App\Models\Client::whereNull('shadow_pro_id')
- ->where('is_active', true)
- ->where(function ($q) {
- $q->whereNull('client_engagement_status_category')
- ->orWhere('client_engagement_status_category', 'DUMMY');
- })
- ->whereRaw('(default_mcp_company_pro_payer_id IS NULL OR default_mcp_company_location_id IS NULL)')
- ->count();
- ?>
- {{$count}}
- </th>
- <th class="pl-2 font-weight-normal">
- <a href="{{ route('practice-management.clients-without-default-company-pro-payer') }}"
- native target="_blank"
- open-in-stag-popup
- popup-style=""
- title="Clients without default company pro payer">
- Clients without default company location / pro payer
- </a>
- </th>
- </tr>
- <tr>
- <th class="px-2 text-center">
- <?php
- $count = \App\Models\Note::where('is_cancelled', false)
- ->where('is_core_note', false)
- ->where('is_signed_by_hcp', true)
- ->whereNull('hcp_company_pro_payer_id')
- ->count();
- ?>
- {{$count}}
- </th>
- <th class="pl-2 font-weight-normal">
- <a href="{{ route('practice-management.notes-without-hcp-company-pro-payer') }}"
- native target="_blank"
- open-in-stag-popup
- popup-style=""
- title="Notes without HCP company pro payer">
- Notes without HCP company pro payer
- </a>
- </th>
- </tr>
- <tr>
- <th class="px-2 text-center">
- <?php
- $count = \App\Models\Bill::where('bill_service_type', 'NOTE')
- ->where('is_cancelled', false)
- ->whereNotNull('hcp_pro_id')
- ->whereNull('hcp_company_pro_id')
- ->where('has_hcp_been_paid', false)
- ->count();
- ?>
- {{$count}}
- </th>
- <th class="pl-2 font-weight-normal">
- Note HCP bills without company pro
- </th>
- </tr>
- <tr>
- <th class="px-2 text-center">
- <?php
- $count = \App\Models\Bill::where('bill_service_type', 'GENERIC')
- ->where('is_cancelled', false)
- ->whereNotNull('generic_pro_id')
- ->whereNull('generic_company_pro_id')
- ->where('has_generic_pro_been_paid', false)
- ->where('code', 'RM MCP')
- ->count();
- ?>
- {{$count}}
- </th>
- <th class="pl-2 font-weight-normal">
- RPM MCP bills without company pro
- </th>
- </tr>
- <tr>
- <th class="px-2 text-center">
- <?php
- $count = \App\Models\Bill::where('bill_service_type', 'GENERIC')
- ->where('is_cancelled', false)
- ->whereNotNull('generic_pro_id')
- ->whereNull('generic_company_pro_id')
- ->where('has_generic_pro_been_paid', false)
- ->where('code', 'RM RMM')
- ->count();
- ?>
- {{$count}}
- </th>
- <th class="pl-2 font-weight-normal">
- RPM RMM bills without company pro
- </th>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <div class="card mb-4">
- <div class="card-header pl-2">
- <strong>
- Remote Monitoring: {{friendly_month(date('Y-m-d'))}}
- </strong>
- </div>
- <div class="card-body p-0">
- <table class="table mb-0 dashboard-stats-table">
- <tbody>
- <tr>
- <th class="px-2 text-center">{{$pro->get_measurements_awaiting_review_count_as_mcp() ?? '-'}}</th>
- <th class="pl-2 font-weight-normal">Measurements Pending Review</th>
- </tr>
- <tr>
- <th class="px-2 text-center">{{$pro->get_patients_without_remote_measurement_in_48_hours_count_as_mcp() ?? '-'}}</th>
- <th class="pl-2 font-weight-normal">Patients w/o Measurement in 48 hrs.</th>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <div class="card mb-4">
- <div class="card-header pl-2">
- <strong>
- Practice Management
- </strong>
- </div>
- <div class="card-body p-0">
- <table class="table mb-0 dashboard-stats-table">
- <tbody>
- <tr>
- <th colspan="2">Revenue Cycle Management</th>
- </tr>
- <tr class="thin">
- <th class="font-weight-normal px-2 pl-4">
- ${{friendly_money($reimbursement['currentBalance'])}}</th>
- <th class="font-weight-normal pl-2 w-100"><a
- href="/practice-management/financial-transactions">Current balance</a></th>
- </tr>
- <!-- <tr>
- <th class="px-2">{{friendly_date_time($reimbursement['nextPaymentDate'], false)}}</th>
- <th class="pl-2 font-weight-normal">Next Payment Date</th>
- </tr> -->
- <tr class="thin">
- <th class="font-weight-normal px-2 pl-4">${{friendly_money($reimbursement['nextPaymentAmount'])}}</th>
- <th class="font-weight-normal pl-2"><a
- href="/practice-management/bills-under-processing">Processing</a></th>
- </tr>
- <tr class="thin">
- <th class="font-weight-normal px-2 pl-5">${{friendly_money($reimbursement['nextPaymentAmount'])}}</th>
- <th class="font-weight-normal pl-2"><a
- href="/practice-management/bills-under-processing">Treatment Services</a></th>
- </tr>
- <tr class="thin">
- <th class="font-weight-normal px-2 pl-5">${{friendly_money($reimbursement['nextPaymentAmount'])}}</th>
- <th class="font-weight-normal pl-2"><a
- href="/practice-management/bills-under-processing">Remote Monitoring</a></th>
- </tr>
- <tr class="thin">
- <th class="font-weight-normal px-2 pl-5">${{friendly_money($reimbursement['nextPaymentAmount'])}}</th>
- <th class="font-weight-normal pl-2"><a
- href="/practice-management/bills-under-processing">Other Services</a></th>
- </tr>
- {{--
- <tr>
- <th class="px-2">{{$reimbursement['lastPayment']}}</th>
- <th class="pl-2 font-weight-normal"><a href="/practice-management/financial-transactions">Last payment</a></th>
- </tr>
- <tr>
- <th class="px-2">{{friendly_date_time($reimbursement['lastPaymentDate'], false)}}</th>
- <th class="pl-2 font-weight-normal"><a href="/practice-management/financial-transactions">Last payment date</a></th>
- </tr>
- --}}
- </tbody>
- </table>
- </div>
- </div>
- @if($pro->pro_type === 'ADMIN')
- <div class="card mb-4">
- <div class="card-header pl-2">
- <strong>
- Bills & Claims
- </strong>
- </div>
- <div class="card-body p-0">
- <table class="table mb-0 dashboard-stats-table">
- <tbody>
- <tr>
- <th class="border-top-1 px-2 text-center">{{$businessNumbers['notesWithBillsToResolve']}}</th>
- <th class="border-top-1 pl-2">
- <a href="/practice-management/billing-manager">Notes with bills to
- resolve</a>
- </th>
- </tr>
- <tr>
- <th class="border-top-1 px-2 text-center">{{$businessNumbers['notesPendingBillingClosure']}}</th>
- <th class="border-top-1 pl-2">
- <a href="/practice-management/billing-manager">Notes pending billing
- closure</a>
- </th>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- @endif
- </div>
- <div class="col-md-9">
- <ul class="nav nav-tabs">
- <li class="nav-item">
- <a native data-tab="appointments" class="nav-link"
- :class="tab == 'appointments' ? 'active' : ''" href="#"
- v-on:click.prevent="tab='appointments'; initLoadAppointments();">
- Appointments
- </a>
- </li>
- <li class="nav-item">
- <a native data-tab="rpm" class="nav-link"
- :class="tab == 'rpm' ? 'active' : ''" href="#"
- v-on:click.prevent="tab='rpm';">
- RPM
- </a>
- </li>
- <li class="nav-item">
- <a native data-tab="measurements" class="nav-link"
- :class="tab == 'measurements' ? 'active' : ''" href="#"
- v-on:click.prevent="tab='measurements'; loadMeasurements();">
- Measurements
- </a>
- </li>
- <li class="nav-item">
- <a native data-tab="incoming_reports"
- class="nav-link {{count($incomingReports) ? 'text-danger font-weight-bold' : ''}}"
- :class="tab == 'incoming_reports' ? 'active' : ''" href="#"
- v-on:click.prevent="tab='incoming_reports'">
- Incoming Reports ({{count($incomingReports)}})
- </a>
- </li>
- <li class="nav-item">
- <a native data-tab="erx" class="nav-link {{$numERx ? 'text-danger font-weight-bold' : ''}}"
- :class="tab == 'erx' ? 'active' : ''" href="#"
- v-on:click.prevent="tab='erx'">
- ERx ({{$numERx}})
- </a>
- </li>
- <li class="nav-item">
- <a native data-tab="labs"
- class="nav-link {{$numLabs ? 'text-danger font-weight-bold' : ''}}"
- :class="tab == 'labs' ? 'active' : ''" href="#"
- v-on:click.prevent="tab='labs'">
- Labs ({{$numLabs}})
- </a>
- </li>
- <li class="nav-item">
- <a native data-tab="imaging"
- class="nav-link {{$numImaging ? 'text-danger font-weight-bold' : ''}}"
- :class="tab == 'imaging' ? 'active' : ''" href="#"
- v-on:click.prevent="tab='imaging'">
- Imaging ({{$numImaging}})
- </a>
- </li>
- <li class="nav-item">
- <a native data-tab="supply_orders"
- class="nav-link {{$numSupplyOrders ? 'text-danger font-weight-bold' : ''}}"
- :class="tab == 'supply_orders' ? 'active' : ''" href="#"
- v-on:click.prevent="tab='supply_orders'">
- Supply Orders ({{$numSupplyOrders}})
- </a>
- </li>
- </ul>
- <div class="border-left border-right border-bottom p-3">
- <div v-show="tab==='appointments'" class="appointments-tab">
- <div v-show="selectedDate">
- <div class="d-flex align-items-baseline mb-3">
- <b class="large"><span class="text-secondary">Today:</span> @{{ selectedDate }}</b>
- <div v-if="events && events.length" class="d-inline-flex align-items-baseline flex-grow-1">
- <label class="my-0 ml-4 mr-1">Pro:</label>
- <select v-if="events && events.length" class="form-control form-control-sm max-width-300px" v-model="filterPro">
- <option value="">All</option>
- <option v-for="(p, uid) in appointmentCountsByPro" :value="uid">@{{ p.name + ' (' + p.appointments + '/' + numEventsForDate + ')' }}</option>
- </select>
- <div class="ml-auto d-inline-flex align-items-center">
- <label class="text-secondary mr-2 my-0 text-nowrap">Filter by status:</label>
- <select v-model="filterStatus"
- class="form-control form-control-sm">
- <option value="">All</option>
- <option value="PENDING">Pending</option>
- <option value="CONFIRMED">Confirmed</option>
- <option value="CANCELLED">Cancelled</option>
- <option value="COMPLETED">Completed</option>
- </select>
- </div>
- </div>
- </div>
- <div v-for="event in events" class="align-items-end p-3 border rounded mb-3"
- v-if="!filterPro || filterPro === event.proUid"
- :class="(event.dateYMD === selectedDate && (filterStatus === '' || filterStatus === event.status) ? 'd-flex' : 'd-none') + ' ' + (event.isClientShadowOfPro ? 'training-event' : '')">
- <div class="patient-avatar mr-3 align-self-center">
- <i v-if="event.isClientShadowOfPro" class="fa fa-graduation-cap training-icon"
- :title="event.proInitials"></i>
- <span v-else class="">@{{ event.proInitials }}</span>
- </div>
- <div>
- <div class="pb-1">
- <b class="text-info">@{{ event.proName }}</b>
- /
- @{{ event.friendlyStartTime }} - @{{ event.friendlyEndTime }} <span
- class="text-secondary">@{{ event.timezone }}</span>
- /
- <span class="d-inline-block ml- 2 text-secondary font-weight-bold">@{{ event.title }}</span>
- </div>
- <div class="pb-1">
- <a :href="'/patients/view/' + event.clientUid" class="font-weight-bold">@{{
- event.clientName }}</a>
- <span class="small d-inline-block pl-2 text-secondary font-weight-normal">@{{ event.clientSummary }}</span>
- </div>
- <div class="d-flex align-items-baseline">
- <div v-if="event.status === 'PENDING'"
- class="text-warning-mellow font-weight-bold">
- <i class="fa fa-exclamation-triangle"></i>
- Confirmation pending
- </div>
- <div v-else-if="event.status === 'CONFIRMED'"
- class="text-success font-weight-bold">
- <i class="fa fa-check"></i>
- Confirmed by the patient
- </div>
- <div v-else class="text-secondary">
- Status: <b>@{{ event.status }}</b>
- </div>
- <span class="mx-2 text-secondary">|</span>
- <a :href="'/patients/view/' + event.clientUid + '/calendar/' + event.uid">
- <i class="fa fa-edit"></i>
- Edit Appointment
- </a>
- </div>
- <div class="mt-1"
- :class="event.coverage !== 'YES' ? (event.coverage === 'NO' ? 'text-danger' : 'text-warning-mellow') : 'text-success'">
- Coverage Status: <b>@{{ event.coverage }}</b>
- </div>
- </div>
- <div class="ml-auto">
- <select v-model="event.newStatus"
- class="form-control form-control-sm bg-light"
- v-on:change="updateStatus(event)">
- <option value="PENDING">PENDING</option>
- <option value="CONFIRMED">CONFIRMED</option>
- <option value="CANCELLED">CANCELLED</option>
- <option value="COMPLETED">COMPLETED</option>
- </select>
- <div v-if="selectedDate === '{{ date('Y-m-d') }}'"
- class="pt-1 text-right"
- :class="event.started ? 'text-danger': 'text-secondary'">
- @{{ event.inHowManyHours }}
- </div>
- </div>
- </div>
- <div v-if="numEventsForDate === 0" class="bg-light p-3 text-secondary border bounded">
- <span
- v-if="filterStatus === ''">You have no appointments on <b>@{{ selectedDate }}</b></span>
- <span
- v-if="filterStatus !== ''">You have no appointments on <b>@{{ selectedDate }}</b> with status <b>@{{ filterStatus }}</b></span>
- </div>
- </div>
- <div v-show="!selectedDate" class="bg-light p-3 text-secondary border bounded">
- Please select a date from the calendar on the left
- </div>
- </div>
- <div v-show="tab==='rpm'">
- <div id="rpm-tab">
- <div class="card mb-4">
- <div class="card-header pl-2">
- <strong>
- Remote Monitoring: {{friendly_month(date('Y-m-d'))}}
- </strong>
- </div>
- <div class="card-body p-1">
- @include('app.practice-management.remote-monitoring-admin-tree')
- </div>
- </div>
- </div>
- </div>
- <div v-show="tab==='measurements'">
- <div id="measurements-tab">Loading...</div>
- </div>
- <div v-show="tab==='incoming_reports'">
- @include('app.dashboard.incoming_reports')
- </div>
- <div v-show="tab==='erx'">
- @include('app.dashboard.erx')
- </div>
- <div v-show="tab==='labs'">
- @include('app.dashboard.labs')
- </div>
- <div v-show="tab==='imaging'">
- @include('app.dashboard.imaging')
- </div>
- <div v-show="tab==='supply_orders'">
- @include('app.dashboard.supply_orders')
- </div>
- </div>
- <div class="row mt-3">
- <div class="col-6">
- <div class="mb-3">
- <p class="mb-2 font-weight-bold text-secondary">Follow ups scheduled for today</p>
- <?php $fus = $pro->followupsScheduledForToday(); ?>
- @if(count($fus))
- <table class="table table-sm table-striped">
- <thead>
- <tr>
- <th>Client</th>
- <th>Assigned To</th>
- <th>Reason</th>
- <th>Status</th>
- </tr>
- </thead>
- <tbody>
- @foreach($fus as $fu)
- <tr>
- <td><a href="/patients/view/{{$fu->client_uid}}">{{$fu->client_name}}</a></td>
- <td>{{$fu->pro_first_name}} {{$fu->pro_last_name}}</td>
- <td>{{$fu->next_follow_up_reason}}</td>
- <td>{{$fu->status}}</td>
- </tr>
- @endforeach
- </tbody>
- </table>
- @else
- <span class="text-secondary">No follow ups scheduled for today!</span>
- @endif
- </div>
- </div>
- <div class="col-6">
- @if(request()->input('mcpas'))
- @if(count($newMCPAssociations))
- <div class="mb-3 border rounded px-3 py-2 ack-container">
- <div class="d-flex align-items-baseline pt-1 mb-2">
- <p class=""><b>New Patients</b></p>
- <a href="/" class="ml-auto">Close</a>
- </div>
- @foreach($newMCPAssociations as $assoc)
- <div class="d-flex align-items-start bg-light mb-2 px-2 py-1">
- <div class="flex-grow-1">
- You are now the MCP for
- <a href="/patients/view/{{$assoc->patient->uid}}"
- class="">{{$assoc->patient->displayName()}}</a>
- <?php $nextAppt = $assoc->patient->nextAppointment(); ?>
- @if($nextAppt)
- <div class="font-size-11">
- <span class="text-secondary font-size-11">Appt.</span>
- {{$nextAppt->pro->displayName()}}
- <span class="text-secondary font-size-11">on</span>
- {{friendlier_date_time($nextAppt->raw_date . ' ' . $nextAppt->raw_start_time)}}
- </div>
- @if($nextAppt->status === 'PENDING') {{-- WIP: ALIX overhaul --}}
- <div
- class="text-warning-mellow font-weight-bold font-size-11 mt-1">
- <i class="fa fa-exclamation-triangle"></i>
- Confirmation pending
- </div>
- @endif
- @if($nextAppt->status === 'CONFIRMED')
- <div class="text-success font-weight-bold font-size-11 mt-1">
- <i class="fa fa-check"></i>
- Confirmed by the patient
- </div>
- @endif
- @if($nextAppt->status === 'CANCELLED')
- <div class="text-danger font-weight-bold font-size-11 mt-1">
- <i class="fa fa-stop"></i>
- Cancelled
- </div>
- @endif
- @endif
- </div>
- <a href="#" class="ack-client-pro-change ml-3" data-uid="{{$assoc->uid}}">Ack.</a>
- </div>
- @endforeach
- </div>
- @endif
- @else
- @if(!!$newMCPAssociations)
- <a href="/?mcpas=1" class="d-block mb-2">You have <b>{{$newMCPAssociations}}</b> new MCP association{{$newMCPAssociations === 1 ? '' : 's'}}</a>
- @endif
- @endif
- @if(request()->input('naas'))
- @if(count($newNAAssociations))
- <div class="mb-3 border rounded px-3 py-2 ack-container">
- <div class="d-flex align-items-baseline pt-1 mb-2">
- <p class=""><b>New Patients</b></p>
- <a href="/" class="ml-auto">Close</a>
- </div>
- @foreach($newNAAssociations as $assoc)
- <div class="d-flex align-items-start bg-light mb-2 px-2 py-1">
- <div class="flex-grow-1">
- You are now the Care Coordinator for
- <a href="/patients/view/{{$assoc->patient->uid}}"
- class="">{{$assoc->patient->displayName()}}</a>
- <?php $nextAppt = $assoc->patient->nextAppointment(); ?>
- @if($nextAppt)
- <div class="font-size-11">
- <span class="text-secondary font-size-11">Appt.</span>
- {{$nextAppt->pro->displayName()}}
- <span class="text-secondary font-size-11">on</span>
- {{friendlier_date_time($nextAppt->raw_date . ' ' . $nextAppt->raw_start_time)}}
- </div>
- @if($nextAppt->status === 'PENDING') {{-- WIP: ALIX overhaul --}}
- <div
- class="text-warning-mellow font-weight-bold font-size-11 mt-1">
- <i class="fa fa-exclamation-triangle"></i>
- Confirmation pending
- </div>
- @endif
- @if($nextAppt->status === 'CONFIRMED')
- <div class="text-success font-weight-bold font-size-11 mt-1">
- <i class="fa fa-check"></i>
- Confirmed by the patient
- </div>
- @endif
- @if($nextAppt->status === 'CANCELLED')
- <div class="text-danger font-weight-bold font-size-11 mt-1">
- <i class="fa fa-stop"></i>
- Cancelled
- </div>
- @endif
- @endif
- </div>
- <a href="#" class="ack-client-pro-change"
- data-uid="{{$assoc->uid}}">Ack.</a>
- </div>
- @endforeach
- </div>
- @endif
- @else
- @if(!!$newNAAssociations)
- <a href="/?naas=1" class="d-block">You have <b>{{$newNAAssociations}}</b> new NA association{{$newNAAssociations === 1 ? '' : 's'}}</a>
- @endif
- @endif
- @if(request()->input('mcpcm'))
- @if(count($mcpClientMemos))
- <div class="mb-3 border rounded px-3 py-2 ack-container table-responsive">
- <div class="d-flex align-items-baseline pt-1 mb-2">
- <p class=""><b>New Patients Memos (MCP)</b></p>
- <a href="/" class="ml-auto">Close</a>
- </div>
- <table class="table table-sm table-hover table-striped table-bordered">
- <thead class="bg-light">
- <tr>
- <th class="border-bottom-0">Patient</th>
- <th class="border-bottom-0">Memo</th>
- <th class="border-bottom-0">Created</th>
- <th class="border-bottom-0"></th>
- </tr>
- </thead>
- <tbody>
- @foreach($mcpClientMemos as $memo)
- <tr>
- <td class="">
- <a href="/patients/view/{{$memo->client_uid}}">{{$memo->name_first}} {{$memo->name_last}}</a>
- </td>
- <td>{!! $memo->content !!}</td>
- <td class="text-nowrap">{{friendlier_date_time($memo->created_at)}}</td>
- <td><a href="#" class="ack-client-memo"
- data-uid="{{$memo->uid}}">Ack.</a></td>
- </tr>
- @endforeach
- </tbody>
- </table>
- </div>
- @endif
- @else
- @if($mcpClientMemos[0]->count)
- <a href="/?mcpcm=1" class="d-block mb-2">You have <b>{{$mcpClientMemos[0]->count}}</b> new MCP client memo{{$mcpClientMemos[0]->count === 1 ? '' : 's'}}</a>
- @endif
- @endif
- @if(request()->input('nacm'))
- @if(count($naClientMemos))
- <div class="mb-3 border rounded px-3 py-2 ack-container table-responsive">
- <div class="d-flex align-items-baseline pt-1 mb-2">
- <p class=""><b>New Patients Memos (NA)</b></p>
- <a href="/" class="ml-auto">Close</a>
- </div>
- <table class="table table-sm table-hover table-striped table-bordered">
- <thead class="bg-light">
- <tr>
- <th class="border-bottom-0">Patient</th>
- <th class="border-bottom-0">Memo</th>
- <th class="border-bottom-0">Created</th>
- <th class="border-bottom-0"></th>
- </tr>
- </thead>
- <tbody>
- @foreach($naClientMemos as $memo)
- <tr>
- <td class="">
- <a href="/patients/view/{{$memo->client_uid}}">{{$memo->name_first}} {{$memo->name_last}}</a>
- </td>
- <td>{!! $memo->content !!}</td>
- <td class="text-nowrap">{{friendlier_date_time($memo->created_at)}}</td>
- <td><a href="#" class="ack-client-memo"
- data-uid="{{$memo->uid}}">Ack.</a></td>
- </tr>
- @endforeach
- </tbody>
- </table>
- </div>
- @endif
- @else
- @if($naClientMemos[0]->count)
- <a href="/?nacm=1" class="d-block mb-2">You have <b>{{$naClientMemos[0]->count}}</b> new MCP client memo{{$naClientMemos[0]->count === 1 ? '' : 's'}}</a>
- @endif
- @endif
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="stag-popup stag-popup-md ticket-popup mcp-theme-1" stag-popup-key="ticket-popup"></div>
- <script>
- (function () {
- function init() {
- window.apapp = new Vue({
- el: '#pro-dashboard-container',
- delimiters: ['@{{', '}}'],
- data: {
- tab: '{{ request()->input('tab') ? request()->input('tab') : 'measurements' }}',
- datesWithEvents: [],
- selectedDate: '{{ date('Y-m-d') }}',
- selectedStatus: 'PENDING',
- events: [],
- numEventsForDate: 0,
- filterStatus: '',
- calendarElem: null,
- currentMonth: null,
- currentYear: null,
- measurementFilterStatus: 'ALL',
- measurements: {!! $pro->pro_type === 'ADMIN' ? '[]' : json_encode($pro->getMeasurements()) !!},
- appointmentsLoaded: false,
- appointmentCountsByPro: [],
- filterPro: '',
- },
- methods: {
- formatDate: function (date) {
- let d = new Date(date),
- month = '' + (d.getMonth() + 1),
- day = '' + d.getDate(),
- year = d.getFullYear();
- if (month.length < 2)
- month = '0' + month;
- if (day.length < 2)
- day = '0' + day;
- return [year, month, day].join('-');
- },
- onDateChange: function (_newDate) {
- let self = this;
- window.setTimeout(() => {
- // let dayValue = $('.pro-dashboard-inline-calendar td.day.active').first().text();
- // if(dayValue.length === 1) dayValue = '0' + dayValue;
- // self.selectedDate = _newDate.substr(0, 8) + dayValue;
- self.selectedDate = _newDate;
- showMask();
- self.loadEvents(self.selectedDate, function () {
- hideMask();
- Vue.nextTick(() => {
- // self.highlightDatesWithEvents(self.datesWithEvents);
- initFastLoad($('.appointments-tab'));
- });
- });
- }, 25);
- },
- selectToday: function () {
- $('.pro-dashboard-inline-calendar table td[data-date]').removeClass('active');
- $('.pro-dashboard-inline-calendar table td[data-date="{{ $milliseconds }}"]')
- .addClass('active');
- // this.onDateChange('{{ date('Y-m-d') }}');
- },
- highlightDatesWithEvents: function (_dates) {
- $('.pro-dashboard-inline-calendar table td[data-date]').removeAttr('has-events');
- for (let i = 0; i < _dates.length; i++) {
- $('.pro-dashboard-inline-calendar table td[data-date="' + _dates[i] + '"]')
- .attr('has-events', 1);
- }
- },
- updateStatus: function (_event) {
- $.post('/api/appointment/updateStatus', {
- uid: _event.uid,
- status: _event.newStatus
- }, function (_data) {
- if (!_data) {
- toastr.error('Unable to update appointment status!');
- } else {
- if (!_data.success) {
- toastr.error(_data.message);
- } else {
- _event.status = _event.newStatus;
- toastr.success('The appointment has been updated');
- }
- }
- }, 'json')
- },
- showEditForm: function (_trigger) {
- let form = $(_trigger).closest('[moe]').find('form').first();
- showMoeFormMask();
- form.show();
- setTimeout(function () {
- initPrimaryForm(form);
- }, 0);
- },
- submitEditForm: function (_trigger) {
- let form = $(_trigger).closest('[moe]').find('form').first();
- if (!form[0].checkValidity()) {
- form[0].reportValidity();
- return;
- }
- $.post(form.attr('url'), form.serialize(), function (_data) {
- if (_data && _data.success) {
- fastReload();
- } else {
- if (_data.message) {
- toastr.error(_data.message);
- } else {
- toastr.error('Unable to update the appointment');
- }
- }
- });
- },
- cancelEditForm: function (_trigger) {
- let form = $(_trigger).closest('[moe]').find('form').first();
- hideMoeFormMask();
- form.hide();
- },
- loadEventDates: function (_refDate = false) {
- let today = new Date(_refDate ? _refDate : '{{date('Y-m-d')}}'),
- firstOfMonth = new Date(today.getFullYear(), today.getMonth(), 1),
- lastOfMonth = new Date(today.getFullYear(), today.getMonth() + 1, 0);
- this.selectedDate = null;
- $('td.day.active').removeClass('active');
- $.get('/pro-dashboard-event-dates/' +
- this.formatDate(firstOfMonth) + '/' +
- this.formatDate(lastOfMonth), (_data) => {
- this.datesWithEvents = _data;
- console.log(this.datesWithEvents);
- this.calendarElem.datepicker('refresh');
- // this.highlightDatesWithEvents(this.datesWithEvents);
- this.currentMonth = firstOfMonth.getMonth();
- this.currentYear = firstOfMonth.getFullYear();
- if (!_refDate && $('td.day[data-date="{{$milliseconds}}"]:visible').length) {
- $('td.day[data-date="{{$milliseconds}}"]:visible').first().click();
- }
- this.appointmentsLoaded = true;
- }, 'json');
- },
- loadEvents: function (_date, _callback) {
- let self = this;
- $.get('/pro-dashboard-events/' + _date + '/' + _date, function (_data) {
- self.events = _data;
- self.numEventsForDate = (_data && _data.length) ? _data.length : 0;
- // fill appointmentCountsByPro
- self.appointmentCountsByPro = {};
- if(_data && _data.length) {
- for (let i = 0; i < _data.length; i++) {
- if(!self.appointmentCountsByPro[_data[i].proUid]) {
- self.appointmentCountsByPro[_data[i].proUid] = {
- name: _data[i].proName,
- appointments: 1
- };
- }
- else {
- self.appointmentCountsByPro[_data[i].proUid].appointments++;
- }
- }
- }
- _callback.call(self);
- }, 'json');
- },
- updateMeasurements: function () {
- $.get('/pro-dashboard-measurements/' + this.measurementFilterStatus, (_data) => {
- this.measurements = _data;
- Vue.nextTick(() => {
- // this.initCMRTE();
- $('#pro-dashboard-container').find('[moe][initialized]').removeAttr('initialized');
- initMoes();
- });
- }, 'json');
- },
- setMeasurementStatus: function (_uid, _status) {
- $.post('/api/measurement/updateStatus', {
- uid: _uid,
- status: _status
- }, (_data) => {
- this.updateMeasurements();
- }, 'json');
- },
- initCMRTE: function () {
- $('#pro-dashboard-container [cm-rte]').each(function () {
- $(this).wrap(
- $('<div class="border-left border-right rte-holder"/>')
- .attr('data-shortcuts', '')
- );
- // give a unique id to this editor instance
- var editorID = Math.ceil(Math.random() * 99999), fieldName = $(this).attr('data-name');
- var el = this;
- var existingContent = $(el).attr('data-content');
- var quill = new Quill(el, {
- theme: 'snow',
- modules: stagQuillConfig
- });
- var toolbar = $(quill.container).prev('.ql-toolbar');
- // add button for new shortcut
- var newSCButton = $('<button class="btn bg-white btn-sm btn-default text-primary w-auto px-2 border py-0 ' +
- 'text-sm add-shortcut" data-editor-id="' + editorID + '">+ Shortcut</button>');
- toolbar.append(newSCButton);
- quill.root.innerHTML = existingContent;
- $('<input type="hidden" name="' + fieldName + '">').val(existingContent).insertAfter(el);
- quill.on('text-change', function (delta, oldDelta, source) {
- $(el).next('[name="' + fieldName + '"]').val(quill.root.innerHTML);
- });
- $(quill.container)
- .find('.ql-editor[contenteditable]')
- .attr('data-field', fieldName)
- .attr('data-editor-id', editorID)
- .attr('with-shortcuts', 1);
- })
- },
- initLoadAppointments: function () {
- if (this.appointmentsLoaded) return false;
- this.loadEventDates();
- },
- loadMeasurements: function () {
- $('#measurements-tab').load('/pro-dashboard-measurements-tab', () => {
- initMoes();
- initFastLoad($('#measurements-tab'));
- });
- }
- },
- mounted: function () {
- let self = this;
- this.calendarElem = $('.pro-dashboard-inline-calendar');
- this.calendarElem.datepicker({
- dateFormat: 'yy-mm-dd',
- onSelect: function (_date) {
- self.onDateChange(_date);
- },
- onChangeMonthYear: function (_year, _month) {
- let date = _year + '-' + (_month < 10 ? '0' : '') + _month + '-05';
- self.loadEventDates(date);
- },
- beforeShowDay: function (d) {
- if (self.datesWithEvents && self.datesWithEvents.indexOf(self.formatDate(d)) !== -1) {
- return [true, 'has-events'];
- }
- return [true, 'no-events'];
- }
- });
- // this.calendarElem
- // .on('changeDate', function () {
- // self.onDateChange(self.calendarElem.datepicker('getFormattedDate'));
- // })
- // .on('changeMonth', function () {
- // window.setTimeout(function() {
- // let ts = $('td.day[data-date]').first().closest('tr').find('td.day[data-date]').last().attr('data-date');
- // if(ts) {
- // self.loadEventDates(ts);
- // }
- // }, 10);
- // });
- $('#pro-dashboard-container').find('[moe][initialized]').removeAttr('initialized');
- initMoes();
- // init fast load
- initFastLoad($('#pro-dashboard-container'));
- $(document)
- .off('click', '.dashboard-measurements.pagination a.page-link')
- .on('click', '.dashboard-measurements.pagination a.page-link', function () {
- $('#measurements-tab').text('Loading...').load('/pro-dashboard-measurements-tab/' + $(this).attr('data-target-page'), () => {
- initMoes();
- initFastLoad($('#measurements-tab'));
- });
- return false;
- });
- this.loadMeasurements();
- }
- });
- /*// refresh once ticket popup is closed
- $('body').off('stag-popup-closed')
- $('body').on('stag-popup-closed', function() {
- if($('#pro-dashboard-container').length) {
- let activeTab = $('.nav-link.active[data-tab]').attr('data-tab');
- if(activeTab) {
- fastLoad('/?tab=' + activeTab);
- }
- }
- });*/
- // ticket-popup
- $(document)
- .off('click', '.ticket-popup-trigger')
- .on('click', '.ticket-popup-trigger', function () {
- showMask();
- window.noMc = true;
- $.get(this.href, (_data) => {
- $('.ticket-popup').html(_data);
- showStagPopup('ticket-popup');
- $('.ticket-popup .stag-popup.stag-slide').attr('close-all-with-self', 1);
- runMCInitializer('patient-tickets'); // run specific mc initer
- hideMask();
- });
- return false;
- });
- $(document)
- .off('click', '.ack-client-pro-change')
- .on('click', '.ack-client-pro-change', function () {
- let trigger = $(this).text('…');
- $.post('/api/clientProChange/accept', {
- uid: $(this).attr('data-uid')
- }, _data => {
- if (!hasResponseError(_data)) {
- trigger.hide();
- let doneElem = $('<i class="text-success fa fa-check"></i>');
- doneElem.insertAfter(trigger);
- setTimeout(() => {
- let ackContainer = trigger.closest('.ack-container');
- trigger.closest('div').slideUp('fast', function () {
- $(this).remove();
- if (!ackContainer.find('>div').length) {
- ackContainer.remove();
- }
- });
- }, 500);
- }
- }, 'json');
- return false;
- });
- $(document)
- .off('click', '.ack-client-memo')
- .on('click', '.ack-client-memo', function () {
- let trigger = $(this).text('…');
- $.post('/api/clientMemo/stamp', {
- uid: $(this).attr('data-uid')
- }, _data => {
- if (!hasResponseError(_data)) {
- trigger.hide();
- let doneElem = $('<i class="text-success fa fa-check"></i>');
- doneElem.insertAfter(trigger);
- setTimeout(() => {
- let tbody = trigger.closest('tbody');
- trigger.closest('tr').remove();
- if (!tbody.find('>tr').length) {
- tbody.closest('.ack-container').remove();
- }
- }, 500);
- }
- }, 'json');
- return false;
- });
- $(document)
- .off('click', '.ack-pro-appt-update')
- .on('click', '.ack-pro-appt-update', function () {
- let trigger = $(this).text('…');
- $.post('/api/appointmentConfirmationDecision/acknowledgeAsAppointmentPro', {
- uid: $(this).attr('data-uid')
- }, _data => {
- if (!hasResponseError(_data)) {
- trigger.hide();
- let doneElem = $('<i class="text-success fa fa-check"></i>');
- doneElem.insertAfter(trigger);
- setTimeout(() => {
- let ackContainer = trigger.closest('tbody');
- trigger.closest('tr').slideUp('fast', function () {
- $(this).remove();
- if (!ackContainer.find('>tr').length) {
- ackContainer.remove();
- }
- });
- }, 500);
- }
- }, 'json');
- return false;
- });
- $(document)
- .off('click', '.ack-na-appt-update')
- .on('click', '.ack-na-appt-update', function () {
- let trigger = $(this).text('…');
- $.post('/api/appointmentConfirmationDecision/acknowledgeAsClientDefaultNa', {
- uid: $(this).attr('data-uid')
- }, _data => {
- if (!hasResponseError(_data)) {
- trigger.hide();
- let doneElem = $('<i class="text-success fa fa-check"></i>');
- doneElem.insertAfter(trigger);
- setTimeout(() => {
- let ackContainer = trigger.closest('tbody');
- trigger.closest('tr').slideUp('fast', function () {
- $(this).remove();
- if (!ackContainer.find('>tr').length) {
- ackContainer.remove();
- }
- });
- }, 500);
- }
- }, 'json');
- return false;
- });
- }
- addMCInitializer('pro-dashboard', init, '#pro-dashboard-container');
- })();
- </script>
- @endsection
|