Explorar o código

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

= %!s(int64=3) %!d(string=hai) anos
pai
achega
e09b3bf59d

+ 21 - 0
app/Http/Controllers/PracticeManagementController.php

@@ -89,6 +89,27 @@ class PracticeManagementController extends Controller
         return view ('app.practice-management.remote-monitoring-report', compact('rows', 'isAdmin'));
 	}
 
+    public function dailyTreatmentServices(Request $request) {
+        $type = $request->input('t');
+        $fPro = null;
+        if($type === 'pro') {
+            $fPro = Pro::where('uid', $request->input('p'))->first();
+            $rows = DB::select(DB::raw("
+SELECT effective_date, hcp_pro_id, p.name_first, p.name_last, count(*), sum(number_of_units) as units 
+FROM bill JOIN pro p on p.id = bill.hcp_pro_id 
+WHERE code = 'Treatment Services' 
+GROUP BY effective_date, hcp_pro_id, p.name_first, p.name_last 
+ORDER BY effective_date DESC, p.name_first ASC, p.name_last ASC
+"));
+        }
+        else {
+            $rows = DB::select(DB::raw("
+SELECT effective_date, count(*), sum(number_of_units) as units FROM bill WHERE code = 'Treatment Services' GROUP BY effective_date ORDER BY effective_date DESC
+"));
+        }
+        return view ('app.practice-management.daily-treatment-services', compact('rows'));
+    }
+
     public function billingReport(Request $request)
     {
 

+ 28 - 40
resources/views/app/patient/tickets.blade.php

@@ -52,24 +52,15 @@
     <link href="/select2/select2.min.css" rel="stylesheet" />
     <script src="/select2/select2.min.js"></script>
 
-    <div class="alert alert-warning border-warning">
-        <b>Deprecated:</b> 
-        This ERx / Orders feature has been deprecated, and is now read-only. For new prescriptions, please use
-        <a href="{{ route('patients.view.patient-prescriptions', ['patient' => $patient]) }}" class="font-weight-bold">ERx &amp; Orders</a>.
-    </div>
-
     <div id="ticketsApp" v-cloak>
         <div class="d-flex align-items-end pb-0">
-            <h4 class="font-weight-bold m-0 font-size-16">ERx / Orders</h4>
+            <h4 class="font-weight-bold m-0 font-size-16">Tickets
+                <span v-if="statusFilter === 'open'" class="text-secondary font-weight-normal">(@{{ otherNumOpen }} open)</span>
+                <span v-if="statusFilter === 'closed'" class="text-secondary font-weight-normal">(@{{ otherNumClosed }} closed)</span>
+                <span v-if="statusFilter === 'all'" class="text-secondary font-weight-normal">(@{{ otherNumOpen }} open, @{{ otherNumClosed }} closed)</span>
+            </h4>
+            <a class="mx-4 c-pointer font-weight-bold" v-on:click.prevent="otherShowPopup()">+ New</a>
             <select class="hide-inside-ticket-popup ml-auto max-width-200px form-control form-control-sm pr-2"
-                    onchange="return fastLoad('/patients/view/{{$patient->uid}}/tickets/' + this.value, true, false, false)">
-                <option value="" {{$type === '' ? 'selected' : ''}}>All</option>
-                <option value="erx" {{$type === 'erx' ? 'selected' : ''}}>ERx</option>
-                <option value="lab" {{$type === 'lab' ? 'selected' : ''}}>Lab Orders</option>
-                <option value="imaging" {{$type === 'imaging' ? 'selected' : ''}}>Imaging Orders</option>
-                <option value="other" {{$type === 'other' ? 'selected' : ''}}>Other Orders</option>
-            </select>
-            <select class="hide-inside-ticket-popup ml-2 max-width-200px form-control form-control-sm pr-2"
                     v-model="statusFilter">
                 <option value="open">Open tickets (@{{ numOpen }})</option>
                 <option value="closed">Closed tickets (@{{ numClosed }})</option>
@@ -77,18 +68,7 @@
             </select>
         </div>
 
-        @if($type === '' || $type === 'erx')
-            @include('app.patient.tickets.erx')
-        @endif
-        @if($type === '' || $type === 'lab')
-            @include('app.patient.tickets.lab')
-        @endif
-        @if($type === '' || $type === 'imaging')
-            @include('app.patient.tickets.imaging')
-        @endif
-        @if($type === '' || $type === 'other')
-            @include('app.patient.tickets.other')
-        @endif
+        @include('app.patient.tickets.other')
 
         @include('app.patient.tickets.ticket_send_fax_form')
     </div>
@@ -241,15 +221,15 @@
                         <?php } ?>
                     },
                     watch: {
-{{--                        <?php for ($i=0; $i<count($categories); $i++) { ?>--}}
-{{--                            {{ $categories[$i] }}CurrentItemData: { // ex: erxCurrentItemData, labCurrentItemData, etc.--}}
-{{--                                handler: function(val, oldVal) {--}}
-{{--                                    if (this.{{ $categories[$i] }}PopupMode !== 'edit' || !this.currentItemUid || this.reloading) return;--}}
-{{--                                    this.{{ $categories[$i] }}AutoSave();--}}
-{{--                                },--}}
-{{--                                deep: true--}}
-{{--                            },--}}
-{{--                        <?php } ?>--}}
+                        <?php for ($i=0; $i<count($categories); $i++) { ?>
+                            {{ $categories[$i] }}CurrentItemData: { // ex: erxCurrentItemData, labCurrentItemData, etc.
+                                handler: function(val, oldVal) {
+                                    if (this.{{ $categories[$i] }}PopupMode !== 'edit' || !this.currentItemUid || this.reloading) return;
+                                    this.{{ $categories[$i] }}AutoSave();
+                                },
+                                deep: true
+                            },
+                        <?php } ?>
                     },
                     methods: {
 
@@ -600,7 +580,11 @@
                                 this.otherPopupItem.data.comments = [];
                             }
                             this.otherPopupItem.data.comments.push(comment);
+                            this.comment = '';
                             this.otherSavePopupItem(true);
+                            Vue.nextTick(() => {
+                                $('[stag-popup-key="other-popup"]>form').scrollTop(10000);
+                            });
                         },
 
                         // common
@@ -630,14 +614,16 @@
                             $.post('/api/ticket/close', {
                                 uid: _item.uid
                             }, (_data) => {
-                                this.reloadPopupItem(this.currentCategory, true);
+                                // this.reloadPopupItem(this.currentCategory, true);
+                                fastLoad('/patients/view/{{$patient->uid}}/tickets/' + this.currentCategory + '/' + this.currentItemUid);
                             }, 'json');
                         },
                         openItem: function(_item) {
                             $.post('/api/ticket/open', {
                                 uid: _item.uid
                             }, (_data) => {
-                                this.reloadPopupItem(this.currentCategory);
+                                // this.reloadPopupItem(this.currentCategory);
+                                fastLoad('/patients/view/{{$patient->uid}}/tickets/' + this.currentCategory + '/' + this.currentItemUid);
                             }, 'json');
                         },
                         showSendFaxPopup: function() {
@@ -718,14 +704,16 @@
                             $.post('/api/ticket/signAsOrderingPro', {
                                 uid: _item.uid
                             }, (_data) => {
-                                this.reloadPopupItem(this.currentCategory);
+                                // this.reloadPopupItem(this.currentCategory);
+                                fastLoad('/patients/view/{{$patient->uid}}/tickets/' + this.currentCategory + '/' + this.currentItemUid);
                             }, 'json');
                         },
                         undoSignAsOrderingPro: function(_item) {
                             $.post('/api/ticket/undoSignAsOrderingPro', {
                                 uid: _item.uid
                             }, (_data) => {
-                                this.reloadPopupItem(this.currentCategory);
+                                // this.reloadPopupItem(this.currentCategory);
+                                fastLoad('/patients/view/{{$patient->uid}}/tickets/' + this.currentCategory + '/' + this.currentItemUid);
                             }, 'json');
                         },
                         toggleAddingReport: function() {

+ 7 - 3
resources/views/app/patient/tickets/common-fields.blade.php

@@ -48,8 +48,12 @@
                                class="form-control form-control-sm mr-2"
                                :value="[<?=$category?>PopupItem.ordering_pro.name_last, <?=$category?>PopupItem.ordering_pro.name_first].filter(Boolean).join(', ')">
                     </div>
-                    <div v-if="<?=$category?>PopupItem.has_ordering_pro_signed" class="text-success text-nowrap">
-                        <i class="fa fa-check mr-1"></i>Signed
+                    <div v-if="<?=$category?>PopupItem.has_ordering_pro_signed" class="d-flex align-items-baseline">
+                        <span class="text-success text-nowrap"><i class="fa fa-check mr-1"></i>Signed</span>
+                        <span class="text-primary c-pointer text-nowrap ml-2"
+                              v-on:click.prevent="undoSignAsOrderingPro(<?=$category?>PopupItem)">
+                            <i class="fa fa-undo mr-1"></i>
+                        </span>
                     </div>
                     <div v-if="<?=$category?>PopupItem.ordering_pro_id === <?=$pro->id?>" class="ml-2 text-nowrap">
                         <span v-if="!<?=$category?>PopupItem.has_ordering_pro_signed"
@@ -86,7 +90,7 @@
         </div>
     </div>
 
-    <div v-if="<?=$category?>PopupMode === 'edit'" class="row">
+    <div v-if="'<?=$category?>' !== 'other' && <?=$category?>PopupMode === 'edit'" class="row">
         <div class="col-3 d-inline-flex align-items-center">
             <label class="text-secondary m-0">Ticket PDF</label>
         </div>

+ 2 - 2
resources/views/app/patient/tickets/header-end.blade.php

@@ -1,5 +1,5 @@
 <div v-if="<?=$category?>PopupMode === 'edit'" class="ml-auto mr-3">
-    <!--<a v-if="<?=$category?>PopupItem.is_open" href="#"
+    <a v-if="<?=$category?>PopupItem.is_open" href="#"
        class="btn btn-sm btn-default border bg-white text-dark text-nowrap shadow-none"
        v-on:click.prevent="closeItem(<?=$category?>PopupItem)">
         <i class="fa fa-check text-success mr-2"></i>Mark Complete
@@ -8,6 +8,6 @@
        class="btn btn-sm btn-success text-nowrap text-white shadow-none"
        v-on:click.prevent="openItem(<?=$category?>PopupItem)">
         <i class="fa fa-check mr-2"></i>Complete
-    </a>-->
+    </a>
 </div>
 <a href="#" class="text-secondary" onclick="return closeStagPopup()"><i class="fa fa-chevron-right"></i></a>

+ 4 - 23
resources/views/app/patient/tickets/other.blade.php

@@ -1,23 +1,4 @@
 <div class="my-4">
-    <div class="d-flex align-items-end mb-3">
-        <h4 class="font-weight-bold m-0 text-secondary font-size-16">Other
-            <span v-if="statusFilter === 'open'" class="text-secondary font-weight-normal">(@{{ otherNumOpen }} open)</span>
-            <span v-if="statusFilter === 'closed'" class="text-secondary font-weight-normal">(@{{ otherNumClosed }} closed)</span>
-            <span v-if="statusFilter === 'all'" class="text-secondary font-weight-normal">(@{{ otherNumOpen }} open, @{{ otherNumClosed }} closed)</span>
-        </h4>
-        <!--<a class="px-3 c-pointer font-weight-bold"
-           v-on:click.prevent="otherShowPopup()">+ New</a>-->
-        <a class="py-0 font-weight-normal c-pointer flex-grow-1 text-right pr-2"
-           v-if="!otherCollapsed"
-           v-on:click.prevent="otherCollapsed = true">
-            <i class="text-secondary fa fa-chevron-up"></i>
-        </a>
-        <a class="py-0 font-weight-normal c-pointer flex-grow-1 text-right pr-2"
-           v-if="otherCollapsed"
-           v-on:click.prevent="otherCollapsed = false">
-            <i class="text-secondary fa fa-chevron-down"></i>
-        </a>
-    </div>
     <div class="ticket-section" :class="otherCollapsed ? 'ticket-section-collapsed' : ''">
         <table class="table table-sm tickets-table mb-0 border-bottom">
             <tbody>
@@ -96,19 +77,19 @@
             </div>
 
             <!-- attachments -->
-            @include('app.patient.tickets.attachments', ['category' => 'other'])
+            {{--@include('app.patient.tickets.attachments', ['category' => 'other'])--}}
 
             <!-- bills -->
-            <div class="px-3 py-3 border-top" v-if="otherPopupMode !== 'add'">
+            <!--<div class="px-3 py-3 border-top" v-if="otherPopupMode !== 'add'">
                 <a class="mb-0 font-weight-normal font-size-16 d-flex align-items-center"
                    native target="_blank"
                    open-in-stag-popup
                    popup-style="tall"
                    title="Admin. Bills"
-                   :href="'/generic-bill-view/Ticket/' + otherPopupMode.uid">
+                   :href="'/generic-bill-view/Ticket/' + otherPopupItem.uid">
                     Admin. Bills
                 </a>
-            </div>
+            </div>-->
 
             <!-- comments -->
             @include('app.patient.tickets.comments', ['category' => 'other'])

+ 2 - 2
resources/views/app/practice-management/billing-report.blade.php

@@ -47,13 +47,13 @@
                             </a>
                             @if($row->client->latestClientPrimaryCoverage )
                                 <div>Plan Type: {{$row->client->latestClientPrimaryCoverage->plan_type}}</div>
-                                @if($row->client->latestClientPrimaryCoverage->auto_medicare_is_partbprimary)
+                                @if($row->client->latestClientPrimaryCoverage->auto_medicare_is_partbprimary == 'YES')
                                     <div>
                                         Deductible: {{$row->client->latestClientPrimaryCoverage->auto_medicare_mpb_deductible}}
                                     </div>
                                 @else 
                                     <div>
-                                        Not part b primary
+                                       Not part B Primary
                                     </div>
                                 @endif
                             @endif

+ 71 - 0
resources/views/app/practice-management/daily-treatment-services.blade.php

@@ -0,0 +1,71 @@
+@extends ('layouts/template')
+
+@section('content')
+    <div class="p-3 mcp-theme-1" id="daily-treatment-services">
+        <div class="card">
+            <div class="card-header px-2 py-2 d-flex align-items-center">
+                <strong class="">
+                    <i class="fas fa-user"></i>
+                    Daily Treatment Services
+                </strong>
+                <form class="ml-3" id="dts-form">
+                    <select name="t" class="form-control form-control-sm width-200px">
+                        <option {{!request()->input('t') ? 'selected' : ''}} value="">Overall</option>
+                        <option {{request()->input('t') === 'pro' ? 'selected' : ''}} value="pro">By Pro</option>
+                    </select>
+                </form>
+            </div>
+            <?php
+            // dump($rows);
+            ?>
+            <div class="card-body p-0">
+                <table class="table table-sm table-striped p-0 m-0">
+                    <thead class="bg-light">
+                        <tr>
+                            <th class="px-3 border-0 width-150px">Date</th>
+                            @if(request()->input('t') === 'pro')
+                                <th class="border-0 width-300px">HCP</th>
+                            @endif
+                            <th class="border-0 width-100px">#Bills</th>
+                            <th class="border-0">$Hours Total</th>
+                        </tr>
+                    </thead>
+                    <tbody>
+                        @foreach($rows as $row)
+                            <tr>
+                                <td class="px-3">
+                                    {{ friendly_date($row->effective_date) }}
+                                </td>
+                                @if(request()->input('t') === 'pro')
+                                <td>
+                                    {{ $row->name_first }}
+                                    {{ $row->name_last }}
+                                </td>
+                                @endif
+                                <td>
+                                    {{ $row->count }}
+                                </td>
+                                <td>
+                                    {{ $row->units }}
+                                </td>
+                            </tr>
+                        @endforeach
+                    </tbody>
+                </table>
+            </div>
+        </div>
+    </div>
+    <script>
+        (function() {
+            function init() {
+                $('#dts-form [name="t"]')
+                    .off('change')
+                    .on('change', function() {
+                        fastLoad('{{route('practice-management.daily-treatment-services')}}?' + $('#dts-form').serialize());
+                        return false;
+                    });
+            }
+            addMCInitializer('daily-treatment-services', init, '#daily-treatment-services');
+        }).call(window);
+    </script>
+@endsection

+ 1 - 1
resources/views/app/ticket/other.blade.php

@@ -28,7 +28,7 @@
 </section>
 
 <?php $otherData = json_decode($ticket->data); ?>
-<div style="margin: 1.5rem 0 1rem; font-weight: bold; opacity: 0.5"><span style="font-size: 24px">R</span><span style="font-size: 16px">x</span></div>
+<div style="margin: 1.5rem 0 1rem; font-weight: bold; opacity: 0.5">&nbsp;</div>
 <section style="font-size: 15px;">
     <table cellpadding="0" cellspacing="0" border="0" style="width: 100%">
         <tr>

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

@@ -148,6 +148,10 @@ $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_creat
 							</ul>
 							*/ ?>
 						</li>
+						<li class="nav-item">
+							<a class="nav-link {{ strpos($routeName, 'patients.view.patient-tickets') === 0 && @$type === '' ? 'active' : '' }}"
+							   href="{{ route('patients.view.patient-tickets', ['patient' => $patient, 'type' => '']) }}">Tickets</a>
+						</li>
 						@if($isOldClient)
 						<li class="nav-item">
 							<a class="nav-link {{ strpos($routeName, 'patients.view.patient-tickets') === 0 ? 'active' : '' }}"

+ 10 - 3
resources/views/layouts/template.blade.php

@@ -128,6 +128,7 @@
                             <a class="dropdown-item" href="{{ route('practice-management.client-ccm-rm-status') }}">Client RM Status</a>
                         @else
                             <a class="dropdown-item" href="{{ route('practice-management.remote-monitoring-admin') }}">Remote Monitoring (admin)</a>
+                            <a class="dropdown-item" href="{{ route('practice-management.daily-treatment-services') }}">Daily Treatment Services</a>
                         @endif
                         @if($pro->pro_type == 'ADMIN')
                             <a class="dropdown-item" href="{{ route('practice-management.rpmMatrix') }}">RPM Matrix</a>
@@ -234,9 +235,15 @@
             <div class="d-flex align-items-center">
 
                 <div class="dropdown">
-                    <a class="nav-link dropdown-toggle text-white pl-1 pr-0" href="#" id="account-menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
-                        <span class="text-white my-0 small">Hi, <b title="Cell# {{$pro->cell_number}}">{{ $pro->name_first }}!</b></span>
-                    </a>
+                    @if($performer->logged_in_as_pro_from_admin_pro_app_session_id)
+                        <a class="nav-link dropdown-toggle text-primary px-2 py-1 rounded bg-aliceblue" href="#" id="account-menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+                            <span class="text-danger my-0 small">Masquerading as <b title="Cell# {{$pro->cell_number}}">{{ $pro->name_first }}!</b></span>
+                        </a>
+                    @else
+                        <a class="nav-link dropdown-toggle text-white pl-1 pr-0" href="#" id="account-menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+                            <span class="text-white my-0 small">Hi, <b title="Cell# {{$pro->cell_number}}">{{ $pro->name_first }}!</b></span>
+                        </a>
+                    @endif
                     <div class="dropdown-menu dropdown-menu-right mcp-theme-1 pt-0 pb-1" aria-labelledby="account-menu">
                         @if($performer->logged_in_as_pro_from_admin_pro_app_session_id)
                             <form action="{{route('back-to-admin-pro')}}" method="post" target="_top" class="d-block pt-1">

+ 1 - 0
routes/web.php

@@ -268,6 +268,7 @@ Route::middleware('pro.auth')->group(function () {
             Route::get('rm-action-report', 'PracticeManagementController@rmActionReport')->name('rmActionReport');
         	
 		    Route::get('remote-monitoring-report', 'PracticeManagementController@remoteMonitoringReport')->name('remoteMonitoringReport');
+            Route::get('daily-treatment-services', 'PracticeManagementController@dailyTreatmentServices')->name('daily-treatment-services');
 
             // BILLING REPORT
             Route::get('billing-report', 'PracticeManagementController@billingReport')->name('billing-report');