Przeglądaj źródła

Merge branch 'master' of https://rav.triplestart.com/jmudaka/stagfe2

logicpowerhouse 4 lat temu
rodzic
commit
fc2f9a3e79

+ 4 - 0
app/Http/Controllers/AppointmentController.php

@@ -283,4 +283,8 @@ class AppointmentController extends Controller
         return json_encode($events);
     }
 
+    public function appointmentConfirmationHistory(Request $request, Appointment $appointment) {
+        return view('app.patient.partials.appointment-confirmation-history', compact('appointment'));
+    }
+
 }

+ 4 - 0
app/Http/Controllers/PatientController.php

@@ -368,4 +368,8 @@ class PatientController extends Controller
     public function mcpRequests(Request $request, Client $patient) {
         return view('app.patient.mcp-requests', compact('patient'));
     }
+
+    public function eligibleRefreshes(Request $request, Client $patient) {
+        return view('app.patient.eligible-refreshes', compact('patient'));
+    }
 }

+ 7 - 1
app/Models/Appointment.php

@@ -19,6 +19,12 @@ class Appointment extends Model
     }
 
     public function confirmationRequests() {
-        return $this->hasMany(AppointmentConfirmationRequest::class, 'appointment_id', 'id');
+        return $this->hasMany(AppointmentConfirmationRequest::class, 'appointment_id', 'id')
+            ->orderBy('created_at', 'desc');
+    }
+
+    public function confirmationDecisions() {
+        return $this->hasMany(AppointmentConfirmationDecision::class, 'appointment_id', 'id')
+            ->orderBy('created_at', 'desc');
     }
 }

+ 13 - 0
app/Models/AppointmentConfirmationDecision.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Relations\HasOne;
+
+# use Illuminate\Database\Eloquent\Model;
+
+class AppointmentConfirmationDecision extends Model
+{
+    protected $table = 'appointment_confirmation_decision';
+
+}

+ 6 - 0
app/Models/Client.php

@@ -390,4 +390,10 @@ class Client extends Model
             ->orderBy('created_at', 'desc');
     }
 
+    public function eligibleRefreshes()
+    {
+        return $this->hasMany(ClientEligibleRefresh::class, 'client_id', 'id')
+            ->orderBy('created_at', 'desc');
+    }
+
 }

+ 19 - 0
app/Models/ClientEligibleRefresh.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Models;
+
+use Carbon\Carbon;
+use DateTime;
+
+# use Illuminate\Database\Eloquent\Model;
+
+class ClientEligibleRefresh extends Model
+{
+    protected $table = 'client_eligible_refresh';
+
+    public function medicareResult()
+    {
+        return $this->hasOne(MedicareResult::class, 'id', 'medicare_result_id');
+    }
+
+}

+ 14 - 0
app/Models/MedicareResult.php

@@ -0,0 +1,14 @@
+<?php
+
+namespace App\Models;
+
+use Carbon\Carbon;
+use DateTime;
+
+# use Illuminate\Database\Eloquent\Model;
+
+class MedicareResult extends Model
+{
+    protected $table = 'medicare_result';
+
+}

+ 29 - 0
public/css/style.css

@@ -1406,3 +1406,32 @@ button.note-templates-trigger-assessment {
     fill: #888;
     transform: translateY(-18px);
 }
+
+/* appt. confirmation history */
+.appointment-confirmation-history-trigger .appointment-confirmation-history {
+    position: absolute;
+    width: 300px;
+    right: 0;
+    background: #fff;
+    opacity: 0;
+    padding: 0 0.75rem;
+    padding-bottom: 0.5rem;
+    box-shadow: 0 0 2px #999;
+    pointer-events: none;
+    transition: opacity 0.3s ease;
+    z-index: 2;
+}
+.appointment-confirmation-history-trigger:hover .appointment-confirmation-history {
+    opacity: 1;
+    pointer-events: all;
+}
+.on-hover-text-reveal {
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+}
+/*.on-hover-text-reveal:hover {
+    white-space: normal;
+    overflow: unset;
+    text-overflow: unset;
+}*/

+ 4 - 0
resources/views/app/patient/appointments.blade.php

@@ -32,6 +32,7 @@
                     <th class="px-2 text-secondary border-bottom-0">Title</th>
                     <th class="px-2 text-secondary border-bottom-0">Description</th>
                     <th class="px-2 text-secondary border-bottom-0">Status</th>
+                    <th class="px-2 text-secondary border-bottom-0">Confirmation</th>
                 </tr>
                 </thead>
                 <tbody>
@@ -46,6 +47,9 @@
                         <td class="px-2">{{ $appointment->title }}</td>
                         <td class="px-2">{{ $appointment->description }}</td>
                         <td class="px-2">{{ $appointment->status }}</td>
+                        <td class="px-2">
+                            @include('app.patient.partials.appointment-confirmation')
+                        </td>
                     </tr>
                 @endforeach
                 </tbody>

+ 124 - 0
resources/views/app/patient/eligible-refreshes.blade.php

@@ -0,0 +1,124 @@
+@extends ('layouts.patient')
+
+@section('inner-content')
+<div id="client-settings-container">
+    <div class="row">
+        <div class="col-md-12">
+            <h1>Eligible Refreshes</h1>
+            <div>
+                <div moe relative class="ml-2">
+                    <a href="" start show class="btn btn-sm btn-success text-white font-weight-bold small">Refresh Eligible Data</a>
+                    <form url="/api/client/refreshEligible" class="mcp-theme-1" right>
+                        <input type="hidden" name="uid" value="{{$patient->uid}}">
+                        <p>Refresh eligible data?</p>
+                        <div>
+                            <button submit class="btn btn-sm btn-primary mr-2">Yes</button>
+                            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                        </div>
+                    </form>
+                </div>
+            </div>
+            <hr>
+            <table class="table table-condensed table-striped">
+                <thead>
+                    <tr>
+                        <th>Timestamp</th>
+                        <th>Result</th>
+                    </tr>
+                </thead>
+                <tbody>
+                    @foreach($patient->eligibleRefreshes as $el)
+                    <tr>
+                        <td>{{friendly_date_time($el->ts)}}</td>
+                        <td>
+                        <table class="table table-sm table-striped table-condensed">
+                            <tr>
+                                <td>Was Successful</td>
+                                <td>{{$el->medicareResult->was_successful}}</td>
+                            </tr>
+                            <tr>
+                                <td>Reject Reason Code</td>
+                                <td>{{$el->medicareResult->reject_reason_code}}</td>
+                            </tr>
+                            <tr>
+                                <td>Reject Reason Description</td>
+                                <td>{{$el->medicareResult->reject_reason_description}}</td>
+                            </tr>
+                            <tr>
+                                <td>Follow Up Action Code</td>
+                                <td>{{$el->medicareResult->follow_up_action_code}}</td>
+                            </tr>
+                            <tr>
+                                <td>Follow Up Action Description</td>
+                                <td>{{$el->medicareResult->follow_up_action_description}}</td>
+                            </tr>
+                            <tr>
+                                <td>Details</td>
+                                <td>{{$el->medicareResult->details}}</td>
+                            </tr>
+                            <tr>
+                                <td>Is Mcn Valid Number</td>
+                                <td>{{$el->medicareResult->is_mcn_valid_number}}</td>
+                            </tr>
+                            <tr>
+                                <td>Address Street Line1</td>
+                                <td>{{$el->medicareResult->address_street_line1}}</td>
+                            </tr>
+                            <tr>
+                                <td>Address Street Line2</td>
+                                <td>{{$el->medicareResult->address_street_line2}}</td>
+                            </tr>
+                            <tr>
+                                <td>Address City</td>
+                                <td>{{$el->medicareResult->address_city}}</td>
+                            </tr>
+                            <tr>
+                                <td>Address State</td>
+                                <td>{{$el->medicareResult->address_state}}</td>
+                            </tr>
+                            <tr>
+                                <td>Address Zip</td>
+                                <td>{{$el->medicareResult->address_zip}}</td>
+                            </tr>
+                            <tr>
+                                <td>Is Partbprimary</td>
+                                <td>{{$el->medicareResult->is_partbprimary}}</td>
+                            </tr>
+                            <tr>
+                                <td>Is Hospice</td>
+                                <td>{{$el->medicareResult->is_hospice}}</td>
+                            </tr>
+                            <tr>
+                                <td>Mcn Response Detail</td>
+                                <td>{{$el->medicareResult->mcn_response_detail}}</td>
+                            </tr>
+                            <tr>
+                                <td>Billing Address</td>
+                                <td>{{$el->medicareResult->billing_address}}</td>
+                            </tr>
+                            <tr>
+                                <td>Reason Not Partb</td>
+                                <td>{{$el->medicareResult->reason_not_partb}}</td>
+                            </tr>
+                            <tr>
+                                <td>Reason Not Partbmemo</td>
+                                <td>{{$el->medicareResult->reason_not_partbmemo}}</td>
+                            </tr>
+                            <tr>
+                                <td>Is Medicare Advantage</td>
+                                <td>{{$el->medicareResult->is_medicare_advantage}}</td>
+                            </tr>
+                            <tr>
+                                <td>Medicare Advantage Plan</td>
+                                <td>{{$el->medicareResult->medicare_advantage_plan}}</td>
+                            </tr>
+                        </table>
+                        </td>
+                    </tr>
+                    @endforeach
+                </tbody>
+            </table>
+        </div>
+    </div>
+</div>
+@endsection

+ 17 - 0
resources/views/app/patient/measurements.blade.php

@@ -25,6 +25,23 @@
                         </div>
                     </form>
                 </div>
+                @if($performer->pro->pro_type == 'ADMIN')
+                <span class="mx-2 text-secondary">|</span>
+                <div moe>
+                    <a start show class="py-0 font-weight-normal">Process Client BDT Measurements Report</a>
+                    <form url="/api/clientBdtReport/processClientBdtReport">
+                        <input type="hidden" name="uid" value="{{ $patient->uid }}">
+                        <div class="mb-2">
+                            <label for="" class="control-label">Process client bd measurements report?</label>
+                        </div>
+                       
+                        <div class="d-flex align-items-center">
+                            <button class="btn btn-sm btn-primary mr-2" submit>Yes</button>
+                            <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
+                        </div>
+                    </form>
+                </div>
+                @endif
             </div>
             <table class="table table-striped table-sm table-bordered mt-2 mb-0">
                 <thead>

+ 23 - 0
resources/views/app/patient/partials/appointment-confirmation-history.blade.php

@@ -0,0 +1,23 @@
+@php
+$cRequests = $appointment->confirmationRequests;
+$cDecisions = $appointment->confirmationDecisions;
+@endphp
+
+@if($cRequests && count($cRequests))
+    <p class="my-2"><b>Requests</b></p>
+    @foreach($cRequests as $cRequest)
+        <div class="bg-light p-1 my-1 border border">
+            <div class="text-nowrap">{{ friendly_date_time($cRequest->created_at) }} to <b>{{ $cRequest->to_sms_number }}</b> (SMS)</div>
+            <div class="text-secondary text-sm on-hover-text-reveal">{{ $cRequest->message }}</div>
+        </div>
+    @endforeach
+@endif
+
+@if($cDecisions && count($cDecisions))
+    <p class="my-2"><b>Decisions</b></p>
+    @foreach($cDecisions as $cDecision)
+        <div class="bg-light p-1 my-1 border border">
+            <b class="{{$cDecision->accepted_or_rejected === 'ACCEPTED' ? 'text-success' : 'text-warning-mellow'}}">{{$cDecision->accepted_or_rejected}}</b> on {{ friendly_date_time($cDecision->created_at) }}
+        </div>
+    @endforeach
+@endif

+ 64 - 0
resources/views/app/patient/partials/appointment-confirmation.blade.php

@@ -0,0 +1,64 @@
+<div class="d-flex">
+    <div class="flex-grow-1">
+        @if($appointment->status === 'CREATED' && !$appointment->latest_confirmation_request_at && !$appointment->latest_confirmation_decision_at)
+            <b class="text-warning-mellow">Not requested yet</b>
+            <div>
+                @include('app.patient.partials.appointment-request-confirmation', ['label' => 'Request Confirmation'])
+            </div>
+        @endif
+        @if($appointment->latest_confirmation_decision_at)
+            @if($appointment->status === 'CONFIRMED')
+                <div class="text-nowrap">
+                    <b class="text-success">{{ucwords($appointment->status)}}</b>
+                    <span class="text-secondary ml-1">on {{friendly_date_time($appointment->latest_confirmation_decision_at)}}</span>
+                </div>
+                <div>
+                    @include('app.patient.partials.appointment-request-confirmation', ['label' => 'Re-request Confirmation'])
+                </div>
+            @elseif($appointment->status === 'REJECTED')
+                <div class="text-nowrap">
+                    <b class="text-warning-mellow">{{ucwords($appointment->status)}}</b>
+                    <span class="text-secondary ml-1">on {{friendly_date_time($appointment->latest_confirmation_decision_at)}}</span>
+                </div>
+                <div>
+                    <a href="/patients/view/{{$patient->uid}}/calendar/{{$appointment->uid}}" class="font-weight-bold">
+                        Re-schedule
+                    </a>
+                </div>
+            @endif
+        @elseif($appointment->latest_confirmation_request_at) {{-- requested but not confirmed yet --}}
+            <div class="text-nowrap">
+                <b class="text-primary">Requested</b>
+                <span class="text-secondary ml-1">on {{friendly_date_time($appointment->latest_confirmation_request_at)}}</span>
+            </div>
+            <div>
+                @include('app.patient.partials.appointment-request-confirmation', ['label' => 'Re-request Confirmation'])
+            </div>
+        @endif
+    </div>
+    @if($appointment->latest_confirmation_request_at || $appointment->latest_confirmation_decision_at)
+        <div class="ml-4 px-2 c-pointer position-relative appointment-confirmation-history-trigger"
+             data-uid="{{$appointment->uid}}">
+            <i class="fa fa-history text-secondary"></i>
+            <div class="appointment-confirmation-history">
+
+            </div>
+        </div>
+    @endif
+</div>
+
+<script>
+    (function() {
+        function init() {
+            $('.appointment-confirmation-history-trigger')
+                .off('mouseenter.appointment-confirmation-history')
+                .on('mouseenter.appointment-confirmation-history', function() {
+                    let container = $(this).find('.appointment-confirmation-history')
+                        .empty()
+                        .append('<span class="text-secondary">Please wait ...</span>');
+                    container.load('/appointment-confirmation-history/' + $(this).attr('data-uid'));
+                });
+        }
+        addMCInitializer('appointment-confirmation', init);
+    }).call(window);
+</script>

+ 14 - 0
resources/views/app/patient/partials/appointment-request-confirmation.blade.php

@@ -0,0 +1,14 @@
+<div moe relative class="">
+    <a href="#" start show class="text-sm font-weight-normal">{{ $label }}</a>
+    <form url="/api/appointment/sendConfirmationRequestViaSms" right>
+        <input type="hidden" name="uid" value="{{ $appointment->uid }}">
+        <div class="mb-2">
+            <label for="" class="text-sm text-secondary mb-1">Cell Number</label>
+            <input type="text" class="form-control form-control-sm" name="toSmsNumber" value="{{$patient->cell_number}}" required>
+        </div>
+        <div>
+            <button submit class="btn btn-sm btn-primary mr-1">Send</button>
+            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+        </div>
+    </form>
+</div>

+ 1 - 1
resources/views/app/patient/partials/mcp-queue.blade.php

@@ -59,7 +59,7 @@
                 <div class="font-weight-bold small text-nowrap text-ellipsis text-secondary">@{{ item.name }}</div>
             </div>
             <button class="btn btn-sm btn-primary mt-1 text-white font-weight-bold py-0 mx-auto d-block"
-                    v-on:click.prevent="claim(item.clientUid)">Claim</button>
+                    v-on:click.prevent="claim(item.clientUid)">Open</button>
         </div>
     </div>
 </div>

+ 1 - 1
resources/views/app/patient/tickets.blade.php

@@ -556,7 +556,7 @@
                                     dynStrengthsID = 'rx-' + randPart + '-strengths';
                                 $(strengthElem).attr('id', dynStrengthsID);
                                 $(strengthElem).attr('rx-id', dynID);
-                                new window.Def.Autocompleter.Prefetch(dynStrengthsID, []);
+                                new window.Def.Autocompleter.Prefetch(dynStrengthsID, [], {matchListValue: false});
                                 new window.Def.Autocompleter.Search(dynID,
                                     'https://clinicaltables.nlm.nih.gov/api/rxterms/v3/search?ef=STRENGTHS_AND_FORMS');
                                 window.Def.Autocompleter.Event.observeListSelections(dynID, function() {

+ 8 - 2
resources/views/app/patient/tickets/attachments.blade.php

@@ -11,11 +11,14 @@
     </div>
     <div class="mb-3" v-if="addingReport">
         <div v-for="(report) in reports" class="d-flex align-items-start py-1 border-bottom">
-            <div class="pro-initials pro-initials-sm text-uppercase mr-2"
+            <div v-if="report.hcp_pro_id" class="pro-initials pro-initials-sm text-uppercase mr-2"
                  :title="allProsFlat['pro_' + report.hcp_pro_id].displayedName"
                  :style="'background-color: ' + allProsFlat['pro_' + report.hcp_pro_id].colors.bc + '; color: ' + allProsFlat['pro_' + report.hcp_pro_id].colors.fc + ';'"
                  v-html="allProsFlat['pro_' + report.hcp_pro_id].displayedInitials">
             </div>
+            <div v-if="!report.hcp_pro_id" class="pro-initials pro-initials-sm text-uppercase mr-2"
+                 title="HCP not set"
+                 style="background-color: #eee; color: #666">&hellip;</div>
             <div class="flex-grow-1">
                 <div class="d-flex align-items-center">
                     <a class="pdf-viewer-trigger" native target="_blank"
@@ -41,11 +44,14 @@
         v-if="!addingReport && <?=$category?>PopupMode === 'edit' && <?=$category?>PopupItem.data.attachments && <?=$category?>PopupItem.data.attachments.length"
         class="py-2 bg-light">
         <div v-for="(attachment) in <?=$category?>PopupItem.data.attachments" class="d-flex align-items-start pb-2">
-            <div class="pro-initials text-uppercase mr-2"
+            <div v-if="attachment.hcp_pro_id" class="pro-initials pro-initials-sm text-uppercase mr-2"
                  :title="allProsFlat['pro_' + attachment.hcp_pro_id].displayedName"
                  :style="'background-color: ' + allProsFlat['pro_' + attachment.hcp_pro_id].colors.bc + '; color: ' + allProsFlat['pro_' + attachment.hcp_pro_id].colors.fc + ';'"
                  v-html="allProsFlat['pro_' + attachment.hcp_pro_id].displayedInitials">
             </div>
+            <div v-if="!attachment.hcp_pro_id" class="pro-initials pro-initials-sm text-uppercase mr-2"
+                 title="HCP not set"
+                 style="background-color: #eee; color: #666">&hellip;</div>
             <div class="flex-grow-1">
                 <div class="d-flex align-items-center">
                     <a class="pdf-viewer-trigger" native target="_blank"

+ 1 - 1
resources/views/app/patient/tickets/erx.blade.php

@@ -104,7 +104,7 @@
                         <label class="text-sm text-secondary mb-1">Medication</label>
                         <input type="hidden" v-model="erxPopupItem.data.medication">
                         <input required type="text" data-field="medication" placeholder="Medication"
-                               :value="erxPopupItem.data.medication"
+                               v-model="erxPopupItem.data.medication"
                                class="form-control form-control-sm">
                     </div>
                     <div class="col-3 pl-0">

+ 4 - 0
resources/views/app/practice-management/treatment-services-util.blade.php

@@ -19,6 +19,8 @@
                     <tr>
                         <th>Date</th>
                         <th>Total hrs.</th>
+                        <th>Total Bills</th>
+                        <th>Total Pros</th>
                     </tr>
                     </thead>
                     <tbody>
@@ -32,6 +34,8 @@
                                 {{ $dowMap[date('w', strtotime($x->effective_date))] }}
                             </td>
                             <td>{{$x->total_hrs}}</td>
+                            <td>{{$x->total_bills}}</td>
+                            <td>{{$x->total_pros}}</td>
                         </tr>
                     @endforeach
                     </tbody>

+ 4 - 0
resources/views/layouts/patient.blade.php

@@ -142,6 +142,10 @@
                             <a class="nav-link {{ strpos($routeName, 'patients.view.mcp-requests') === 0 ? 'active' : '' }}"
                                href="{{ route('patients.view.mcp-requests', $patient) }}">MCP Requests</a>
                         </li>
+                        <li class="nav-item">
+                            <a class="nav-link {{ strpos($routeName, 'patients.view.eligible-refreshes') === 0 ? 'active' : '' }}"
+                               href="{{ route('patients.view.eligible-refreshes', $patient) }}">Eligible Refreshes</a>
+                        </li>
                         @endif
                     </ul>
                     <div class="mt-3 mcp-theme-1">

+ 7 - 0
routes/web.php

@@ -44,6 +44,8 @@ Route::get("/guest/handout/{handoutClientUid}", 'GuestController@handout')->name
 Route::get("/appointment-confirmation/{appointmentUid}", 'GuestController@appointmentConfirmation')->name('appointment_confirmation');
 Route::post("/process-appointment-confirmation", 'GuestController@processAppointmentConfirmation')->name('process-appointment_confirmation');
 
+Route::get('/ticket-download-as-pdf/{ticket}', 'TicketController@downloadAsPdf')->name('ticket-download-as-pdf');
+
 Route::middleware('pro.auth')->group(function () {
 
     //complete authentication
@@ -64,6 +66,7 @@ Route::middleware('pro.auth')->group(function () {
 
     Route::get('/unmapped-sms/{filter?}', 'HomeController@unmappedSMS')->name('unmapped-sms');
 
+
     Route::name('practice-management.')->prefix('practice-management')->group(function () {
         Route::get('rates/{selectedProUid?}', 'PracticeManagementController@rates')->name('rates');
         Route::get('dashboard', 'PracticeManagementController@dashboard')->name('dashboard');
@@ -105,6 +108,7 @@ Route::middleware('pro.auth')->group(function () {
 
     Route::middleware('pro.auth.admin')->group(function(){
         Route::get('patients/view/mcp-requests/{patient?}', 'PatientController@mcpRequests')->name('patients.view.mcp-requests');
+        Route::get('patients/view/eligible-refreshes/{patient}', 'PatientController@eligibleRefreshes')->name('patients.view.eligible-refreshes');
     });
 
     Route::name('patients.view.')->prefix('patients/view/{patient}')->group(function () {
@@ -209,6 +213,9 @@ Route::middleware('pro.auth')->group(function () {
     // refresh single ticket
     Route::get('/get-ticket/{ticket}', 'PatientController@getTicket');
 
+
+    Route::get('/appointment-confirmation-history/{appointment}', 'AppointmentController@appointmentConfirmationHistory')->name('appointment-confirmation-history');
+
     // 2-pane outer page housing lhs (practice management) and rhs (video call)
     Route::get('/mc/{fragment?}', 'HomeController@mc')
         ->where('fragment', '.*')