Forráskód Böngészése

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

= 4 éve
szülő
commit
cc5d067fb1

+ 22 - 1
app/Http/Controllers/PracticeManagementController.php

@@ -859,6 +859,15 @@ class PracticeManagementController extends Controller
 
     public function patientClaimSummary(Request $request, $proUid=null)
     {
+
+        $notesTotal = DB::select(DB::raw("SELECT COUNT(*) FROM note WHERE is_cancelled IS NOT TRUE"))[0]->count;
+        $notesTotalWithBillingClosed = DB::select(DB::raw("SELECT COUNT(*) FROM note WHERE is_cancelled IS NOT TRUE AND is_bill_closed IS TRUE"))[0]->count;
+        $notesTotalWithClaimingClosed = DB::select(DB::raw("SELECT COUNT(*) FROM note WHERE is_cancelled IS NOT TRUE AND is_claim_closed IS TRUE"))[0]->count;
+
+        $patientsTotal = DB::select(DB::raw("SELECT COUNT(*) FROM client WHERE is_active IS TRUE AND 0 NOT IN (SELECT c FROM (SELECT COUNT(*) c FROM note WHERE is_cancelled IS NOT TRUE AND note.client_id = client.id) x)"))[0]->count;
+        $patientsTotalWithBillingClosed = DB::select(DB::raw("SELECT COUNT(*) FROM client WHERE is_active IS TRUE AND 0 NOT IN (SELECT c FROM (SELECT COUNT(*) c FROM note WHERE is_cancelled IS NOT TRUE AND note.client_id = client.id) y) AND 0 IN (SELECT c FROM (SELECT COUNT(*) c FROM note WHERE is_cancelled IS NOT TRUE AND is_bill_closed IS NOT TRUE AND note.client_id = client.id) x)"))[0]->count;
+        $patientsTotalWithClaimingClosed = DB::select(DB::raw("SELECT COUNT(*) FROM client WHERE is_active IS TRUE AND 0 NOT IN (SELECT c FROM (SELECT COUNT(*) c FROM note WHERE is_cancelled IS NOT TRUE AND note.client_id = client.id) y) AND 0 IN (SELECT c FROM (SELECT COUNT(*) c FROM note WHERE is_cancelled IS NOT TRUE AND is_claim_closed IS NOT TRUE AND note.client_id = client.id) x)"))[0]->count;
+
         $performerPro = $this->performer->pro;
         $allPros = [];
         if ($performerPro->pro_type == 'ADMIN') {
@@ -886,7 +895,19 @@ class PracticeManagementController extends Controller
 
            $patients =  $patientsQuery->paginate(50);
 
-        return view('app.practice-management.patient-claim-summary', compact('patients', 'proUid', 'allPros'));
+            $data = [
+                'patients' => $patients,
+                'proUid' => $proUid,
+                'allPros' => $allPros,
+                'notesTotal' => $notesTotal,
+                'notesTotalWithBillingClosed' => $notesTotalWithBillingClosed,
+                'notesTotalWithClaimingClosed' => $notesTotalWithClaimingClosed,
+                'patientsTotal' => $patientsTotal,
+                'patientsTotalWithBillingClosed' => $patientsTotalWithBillingClosed,
+                'patientsTotalWithClaimingClosed' => $patientsTotalWithClaimingClosed
+            ];
+
+        return view('app.practice-management.patient-claim-summary', $data);
     }
 
 }

+ 17 - 7
public/css/style.css

@@ -216,7 +216,7 @@ body>nav.navbar {
 .stag-content {
     height: calc(100% - 55px);
 }
-[moe][large] form {
+[moe][large] form, [moe][large] [url] {
     width: 450px;
 }
 [moe][bottom] form {
@@ -962,7 +962,7 @@ body .node input[type="number"] {
 .stag-popup.show {
     display: block;
 }
-.stag-popup>form {
+.stag-popup>form, .stag-popup>.stag-popup-content {
     width: 80%;
     background: #fff;
     border: 1px solid #aaa;
@@ -972,19 +972,19 @@ body .node input[type="number"] {
     margin: 0 auto;
     padding: 0.75rem;
 }
-.stag-popup.wide>form {
+.stag-popup.wide>form, .stag-popup.wide>.stag-popup-content {
     width: calc(100% - 4rem);
 }
-.stag-popup.narrow>form {
+.stag-popup.narrow>form, .stag-popup.narrow>.stag-popup-content {
     max-width: 500px;
 }
-.stag-popup.stag-popup-sm>form {
+.stag-popup.stag-popup-sm>form, .stag-popup.stag-popup-sm>.stag-popup-content {
     max-width: 500px;
 }
-.stag-popup.stag-popup-md>form {
+.stag-popup.stag-popup-md>form, .stag-popup.stag-popup-md>.stag-popup-content {
     max-width: 632pt;
 }
-.stag-popup.stag-popup-right>form {
+.stag-popup.stag-popup-right>form, .stag-popup.stag-popup-right>.stag-popup-content {
     margin-right: 1.5rem;
     margin-left: auto;
 }
@@ -1593,4 +1593,14 @@ th.only-screen, td.only-screen {
 .ticket-popup .disable-inside-ticket-poppup {
     pointer-events: none !important;
     opacity: 0.5;
+}
+.fill-percent-value {
+    width: 60px;
+}
+.fill-percent-content {
+    width: 100px;
+}
+.fill-bar {
+    height: 20px !important;
+    border: 1px solid #ddd;
 }

+ 2 - 1
public/js/pro-suggest.js

@@ -91,7 +91,7 @@
     window.initProSuggest = function() {
 
         // make select[provider-search] hidden & insert a textbox with pro-suggest
-        $('select[provider-search]').each(function() {
+        $('select[provider-search]:not([pro-suggest-initialized])').each(function() {
             let elem = $(this);
             elem.next('.pro-suggest-input').remove();
             elem.next('.pro-suggestions-container').remove();
@@ -134,6 +134,7 @@
                 //     }, 50);
                 // });
 
+            $(this).attr('pro-suggest-initialized', 1);
         });
 
         $(document).off('click', '.suggest-item.pro-suggest[data-target-uid]');

+ 79 - 3
public/js/stag-popup.js

@@ -37,6 +37,16 @@ function closeStagPopup(_noEvent = false) {
             closeStagPopup(true);
         }
     }
+    else {
+        if(popup.is('[update-parent]')) {
+            if(stagPopupsQueue.length) {
+                refreshDynamicStagPopup();
+            }
+            else {
+                fastReload()
+            }
+        }
+    }
     // if all closed
     if(!stagPopupsQueue.length) {
         $('html, body').removeClass('no-scroll');
@@ -47,6 +57,62 @@ function closeStagPopup(_noEvent = false) {
     }
     return false;
 }
+function openDynamicStagPopup(url, initer, title, updateParent) {
+    url += (url.indexOf('?') !== -1 ? '&' : '?') + 'popupmode=1';
+    showMask();
+    window.noMc = true;
+    $.get(url, (_data) => {
+        let popup = $('.dynamic-popup[stag-popup-key="' + url + '"]');
+        if(!popup.length) {
+            $('main.stag-content').append(
+                '<div class="stag-popup stag-popup-lg dynamic-popup mcp-theme-1" stag-popup-key="' + url + '">' +
+                '<div class="stag-popup-content p-0">' +
+                '<h3 class="stag-popup-title mb-0 mt-3 mx-3 pb-0 border-bottom-0"><span></span>' +
+                '<a href="#" class="ml-auto text-secondary" onclick="return closeStagPopup()"><i class="fa fa-times-circle"></i></a>\n' +
+                '</h3>' +
+                '<div class="stag-popup-content-inner"></div>' +
+                '</div>' +
+                '</div>'
+            );
+            popup = $('.dynamic-popup[stag-popup-key="' + url + '"]');
+        }
+        popup.attr('mc-initer', initer);
+        popup.find('.stag-popup-title>span').text(title);
+        popup.find('.stag-popup-content-inner').html(_data);
+        if(updateParent) {
+            popup.attr('update-parent', 1);
+        }
+        else {
+            popup.removeAttr('update-parent');
+        }
+        showStagPopup(url);
+        if(initer) runMCInitializer(initer);
+        runMCInitializer('pro-suggest');
+        hideMask();
+    });
+}
+function isDynamicStagPopupPresent() {
+    if(!stagPopupsQueue.length) return false;
+    let popup = stagPopupsQueue[stagPopupsQueue.length - 1];
+    if(popup.is('.dynamic-popup')) return true;
+    return false;
+}
+function refreshDynamicStagPopup() {
+    if(!stagPopupsQueue.length) return;
+    let popup = stagPopupsQueue[stagPopupsQueue.length - 1];
+    if(popup.is('.dynamic-popup')) {
+        showMask();
+        window.noMc = true;
+        let url = popup.attr('stag-popup-key'),
+            initer = popup.attr('mc-initer');
+        $.get(url, (_data) => {
+            popup.find('.stag-popup-content-inner').html(_data);
+            if(initer) runMCInitializer(initer);
+            runMCInitializer('pro-suggest');
+            hideMask();
+        });
+    }
+}
 (function() {
     window.initStagPopupEvents = function () {
         $(document)
@@ -62,12 +128,22 @@ function closeStagPopup(_noEvent = false) {
             .off('keydown.stag-popup-escape')
             .on('keydown.stag-popup-escape', function (e) {
                 if(e.which === 27) {
-                    if(stagPopupsQueue.length) {
-                        closeStagPopup();
-                        return false;
+                    if(!window.moeClosedAt || (new Date()).getTime() - window.moeClosedAt > 1000) {
+                        if(stagPopupsQueue.length) {
+                            closeStagPopup();
+                            return false;
+                        }
                     }
                 }
             });
+
+        $(document)
+            .off('click.open-in-stag-popup', 'a[open-in-stag-popup]')
+            .on('click.open-in-stag-popup', 'a[open-in-stag-popup]', function() {
+                openDynamicStagPopup(this.href, $(this).attr('mc-initer'), $(this).attr('title'), $(this).is('[update-parent]'));
+                return false;
+            });
+
     }
     addMCInitializer('stag-popups', window.initStagPopupEvents);
 })();

+ 5 - 0
public/js/yemi.js

@@ -527,6 +527,8 @@ var initMoes = function() {
                                 initFastLoad(moeParent);
                                 initAutoRxAndICDComplete();
                             });
+                        } else if(isDynamicStagPopupPresent()) {
+                            refreshDynamicStagPopup();
                         } else {
                             pageReload();
                         }
@@ -559,6 +561,8 @@ var initMoes = function() {
                                 initFastLoad(moeParent);
                                 initAutoRxAndICDComplete();
                             });
+                        } else if(isDynamicStagPopupPresent()) {
+                            refreshDynamicStagPopup();
                         } else {
                             pageReload();
                         }
@@ -1097,6 +1101,7 @@ $(document).ready(function () {
                 if (visibleMoes.length) {
                     hideMoeFormMask();
                     visibleMoes.hide();
+                    window.moeClosedAt = (new Date()).getTime();
                     return false;
                 }
             }

+ 9 - 6
resources/views/app/dashboard.blade.php

@@ -179,7 +179,7 @@
                 </ul>
 
                 <div class="border-left border-right border-bottom p-3">
-                    <div v-show="tab==='appointments'">
+                    <div v-show="tab==='appointments'" class="appointments-tab">
                         <div class="d-flex align-items-end mb-3">
                             <b class="large"><span class="text-secondary">Today:</span> @{{ selectedDate }}</b>
                             <div class="ml-auto d-inline-flex align-items-center">
@@ -207,7 +207,7 @@
                                     <span class="d-inline-block ml- 2 text-secondary font-weight-bold">@{{ event.title }}</span>
                                 </div>
                                 <div class="pb-1">
-                                    <a target="_blank" :href="'/patients/view/' + event.clientUid" class="font-weight-bold">@{{ event.clientName }}</a>
+                                    <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>
@@ -236,9 +236,9 @@
                             </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>
+                            <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="tab==='measurements'">
                         @include('app.dashboard.measurements')
@@ -311,6 +311,9 @@
                             // self.updateNumEventsForDate();
                             self.appointmentsLoaded = true;
                             hideMask();
+                            Vue.nextTick(() => {
+                                initFastLoad($('.appointments-tab'));
+                            });
                         });
                     },
                     selectToday: function () {
@@ -500,7 +503,7 @@
                     initMoes();
 
                     // init fast load
-                    initFastLoad($('#pro-dashboard-container'));
+                    // initFastLoad($('#pro-dashboard-container'));
 
                 }
             });

+ 107 - 26
resources/views/app/patient/claims-resolver.blade.php

@@ -5,9 +5,8 @@
 
 @section('inner-content')
     <?php
-        $patient = $patient;
-    ?>
-    <?php
+    /** @var \App\Models\Client $patient */
+
     $firstDateEverSeenByAnyone = null;
     $firstDateEverSeenByMcpTypePro = null;
     $firstDateEverSeenByCurrentMcp = null;
@@ -19,6 +18,9 @@
     $loopLastContentByHcp = [];
     $daysInMcpProgramTotal = null;
     $hcpIdToProMap = [];
+    $totalNotes = 0;
+    $totalNotesWithBillingClosed = 0;
+    $totalNotesWithClaimingClosed = 0;
     foreach($patient->notesAscending as $note){
         $hcpIdToProMap[$note->hcp_pro_id] = $note->hcpPro;
         $d = $note->effective_dateest;
@@ -29,7 +31,7 @@
         $firstDateEverSeenByAnyone = $firstDateEverSeenByAnyone ? $firstDateEverSeenByAnyone : $d;
         if($note->hcpPro->is_enrolled_as_mcp){
             $firstDateEverSeenByMcpTypePro = $firstDateEverSeenByMcpTypePro ? $firstDateEverSeenByMcpTypePro : $d;
-            if($note->hcpPro->id == $note->client->mcp->id){
+            if($note->client->mcp && $note->hcpPro->id == $note->client->mcp->id){
                 $firstDateEverSeenByCurrentMcp = $firstDateEverSeenByMcpTypePro;
             }
         }
@@ -43,13 +45,17 @@
         if($note->hcpPro->is_enrolled_as_mcp){
             $loopLastDateSeenByMcpTypePro = $d;
         }
-        $daysInMcpProgramTotal = $daysInMcpProgram;
-        }
+        $daysInMcpProgramTotal = (strtotime(date('Y-m-d')) - strtotime($firstDateSeenByThisHcp)) / (60 * 60 * 24);
+
+        $totalNotes++;
+        if($note->is_bill_closed) $totalNotesWithBillingClosed++;
+        if($note->is_claim_closed) $totalNotesWithClaimingClosed++;
+    }
     ?>
     <h2><strong>Numbers:</strong></h2>
     <table class="table table-sm table-striped">
         <tr>
-            <td>First date ever seen by anyone:</td>
+            <td class="w-25">First date ever seen by anyone:</td>
             <td>{{ friendly_date_time($firstDateEverSeenByAnyone, false) }}</td>
         </tr>
         <tr>
@@ -68,6 +74,38 @@
             <td>Days in MCP program:</td>
             <td>{{ $daysInMcpProgramTotal }}</td>
         </tr>
+        <tr>
+            <td>Total Notes:</td>
+            <td>{{ $totalNotes }}</td>
+        </tr>
+        <tr>
+            <td>Total Notes With Billing Closed:</td>
+            <td>
+                <div class="d-flex">
+                    <span class="fill-percent-content">{{ $totalNotesWithBillingClosed }} / {{$totalNotes}}</span>
+                    <div class="d-inline-flex flex-grow-1 ml-3">
+                        <span class="fill-percent-value">{{round($totalNotesWithBillingClosed * 100 / $totalNotes, 1)}}%</span>
+                        <div class="flex-grow-1 position-relative fill-bar">
+                            <div class="bg-info position-absolute" style="left: 0; top: 0; height: 100%; width: {{$totalNotesWithBillingClosed * 100 / $totalNotes}}%"></div>
+                        </div>
+                    </div>
+                </div>
+            </td>
+        </tr>
+        <tr>
+            <td>Total Notes With Claiming Closed:</td>
+            <td>
+                <div class="d-flex align-items-center">
+                    <span class="fill-percent-content">{{ $totalNotesWithClaimingClosed }} / {{$totalNotes}}</span>
+                    <div class="d-inline-flex flex-grow-1 ml-3">
+                        <span class="fill-percent-value">{{round($totalNotesWithClaimingClosed * 100 / $totalNotes, 1)}}%</span>
+                        <div class="flex-grow-1 position-relative fill-bar">
+                            <div class="bg-info position-absolute" style="left: 0; top: 0; height: 100%; width: {{$totalNotesWithClaimingClosed * 100 / $totalNotes}}%"></div>
+                        </div>
+                    </div>
+                </div>
+            </td>
+        </tr>
     </table>
     <h2><strong>All HCPs:</strong></h2>
     <table class="table table-sm table-condensed table-striped">
@@ -91,7 +129,7 @@
                     {{ $daysBetweenFirstAndLastVisit }}
                 </td>
                 <td>{{ $hcpNoteCountMap[$k] }}</td>
-                <td> {{ round($daysBetweenFirstAndLastVisit / ($hcpNoteCountMap[$k] - 1), 2) }} </td>
+                <td> {{ ($hcpNoteCountMap[$k] - 1) ? round($daysBetweenFirstAndLastVisit / ($hcpNoteCountMap[$k] - 1), 2) : null }} </td>
             </tr>
         @endforeach
     </table>
@@ -148,9 +186,10 @@
 
     </style>
     <div style="overflow: auto">
-        <table class="table table-bordered table-condensed">
+        <table class="table table-bordered table-condensed" id="notes-table">
         <thead>
         <tr>
+            <th>#</th>
             <th>HCP</th>
             <th>Date</th>
 {{--            <th>Days in Program</th>--}}
@@ -161,6 +200,8 @@
 {{--            <th>Days Since Last MCP Type Visit</th>--}}
 {{--            <th>Loop check</th>--}}
             <th>Signed By HCP?</th>
+            <th>Billing Closed?</th>
+            <th>Claiming Closed?</th>
 {{--            <th>Content</th>--}}
             <th>Bills</th>
             <th>Claims</th>
@@ -178,8 +219,11 @@
             $hcpNoteCountMap = [];
             $loopLastDateSeenByMcpTypePro = null;
             $loopLastContentByHcp = [];
+            $rowIndex = 0;
             foreach($patient->notesAscending as $note){
 
+                $rowIndex++;
+
                 $d = $note->effective_dateest;
                 $firstDateSeenByHcpMap[$note->hcp_pro_id] = isset($firstDateSeenByHcpMap[$note->hcp_pro_id]) ? $firstDateSeenByHcpMap[$note->hcp_pro_id] : $d;
                 $noteCount = $hcpNoteCountMap[$note->hcp_pro_id] = isset($hcpNoteCountMap[$note->hcp_pro_id]) ? $hcpNoteCountMap[$note->hcp_pro_id]  + 1 : 1;
@@ -217,11 +261,17 @@
 
         ?>
         <tr>
+            <td>{{$rowIndex}}</td>
             <td>
                 <strong>{{ $note->hcpPro->displayName() }}</strong>
             </td>
             <td>
-                <a href="/patients/view/{{ $note->client->uid }}/notes/view/{{ $note->uid }}" class="font-weight-bold">
+                <a native target="_blank"
+                   open-in-stag-popup
+                   update-parent
+                   mc-initer="note-single"
+                   title="Note Details"
+                   href="/patients/view/{{ $note->client->uid }}/notes/view/{{ $note->uid }}">
                     {{ friendly_date_time($d, false) }}
                 </a>
             </td>
@@ -247,27 +297,29 @@
 {{--                {{ $loopLastDateSeenByMcpTypePro }}--}}
 {{--            </td>--}}
             <td>
-                {{ $note->is_signed_by_hcp }}
+                {{ $note->is_signed_by_hcp ? 'Yes' : 'No' }}
             </td>
+            <td>{{ $note->is_bill_closed ? 'Yes' : 'No' }}</td>
+            <td>{{ $note->is_claim_closed ? 'Yes' : 'No' }}</td>
 {{--            <td><div style="max-height: 200px; overflow-y: auto;">{!! $content !!}</div></td>--}}
 
-            <td>
+            <td class="p-0">
                 <div>
-                    <table>
-                @foreach($note->bills as $bill)
+                    <table class="table table-sm m-0 border-0">
+                    @foreach($note->bills as $bill)
                         <tr>
                             <td>{{$bill->code}}</td>
-                            <td>
+                            <td style="width: 60px">
                                 {{str_contains($bill->code, 'Treatment Services') ? floor((float) $bill->number_of_units * 60) . ' mins.' : $bill->number_of_units}}
                             </td>
                         </tr>
-                @endforeach
+                    @endforeach
                     </table>
                 </div>
             </td>
-            <td>
+            <td class="p-0">
                 <div>
-                    <table class="table table-sm">
+                    <table class="table table-sm m-0 border-0">
                         @foreach($note->claims as $claim)
                             <?php if($claim->is_cancelled) continue; ?>
                             <tr>
@@ -276,20 +328,30 @@
                                 </td>
                             </tr>
                             <tr>
-                                <td>
-                                    <table class="table table-sm table-striped">
+                                <td class="p-0">
+                                    <table class="table table-sm table-striped m-0">
                                     @foreach($claim->lines as $line)
                                             <tr>
-                                                <td>{{ $line->cpt }}</td>
-                                                <td>{{ $line->units }}</td>
-                                                <td>
-                                                    <table class="table table-sm">
+                                                <td style="width: 80px">{{ $line->cpt }}</td>
+                                                <td style="width: 30px">{{ $line->units }}</td>
+                                                <td class="p-0">
+                                                    <table class="table table-sm m-0 border-0">
                                                     @foreach($line->claimLineIcds as $icd)
                                                             <tr>
                                                                 <td>{{ $icd->code }}</td>
                                                                 <td>{{ $icd->description }}</td>
                                                             </tr>
                                                     @endforeach
+                                                    @if(!$line->claimLineIcds || !count($line->claimLineIcds))
+                                                            <tr>
+                                                                <td colspan="2">
+                                                                    <b>
+                                                                        <i class="fa fa-exclamation-triangle"></i>
+                                                                        No ICDs
+                                                                    </b>
+                                                                </td>
+                                                            </tr>
+                                                    @endif
                                                     </table>
                                                 </td>
                                             </tr>
@@ -302,8 +364,13 @@
                 </div>
             </td>
             <td>
-                <div style="max-height: 250px; overflow-y: auto;">
-                    <?php echo Diff::toTable(Diff::compare($lastContentText, $contentText)) ?>
+                <div moe large relative no-mask>
+                    <a href="#" start show>Show Diff</a>
+                    <div url="/dummy" right>
+                        <div style="max-height: 250px; overflow-y: auto;">
+                            <?php echo Diff::toTable(Diff::compare($lastContentText, $contentText)) ?>
+                        </div>
+                    </div>
                 </div>
             </td>
         </tr>
@@ -319,6 +386,20 @@
         </tbody>
     </table>
     </div>
+
+    <script>
+        (function() {
+            function init() {
+                $('#notes-table').DataTable({
+                    paging: false,
+                    scrollY: 500,
+                    scrollX: true
+                });
+            }
+            addMCInitializer('claims-resolver', init);
+        }).call(window);
+    </script>
+
 @endsection
 
 <?php

+ 56 - 0
resources/views/app/patient/note/_create-bill.blade.php

@@ -81,6 +81,62 @@
         <input type="hidden" name="numberOfUnits" value="1">
     </div>
 </div>
+@if(!$note->is_bill_closed)
+    <span class="mx-2 text-secondary">|</span>
+    @if($pro->pro_type === 'ADMIN')
+        <span class="d-block" moe>
+            <a class="text-danger" href="" show start>Close Billing</a>
+            <form url="/api/note/closeBilling">
+                <input type="hidden" name="uid" value="{{$note->uid}}">
+                <p>Close billing?</p>
+                <div class="mb-0">
+                    <button class="btn btn-success btn-sm" submit>Submit</button>
+                    <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                </div>
+            </form>
+        </span>
+    @endif
+@elseif($note->is_bill_closed)
+    <span class="mx-2 text-secondary">|</span>
+    <span class="d-block" moe>
+        <a class="text-danger" href="" show start>Reopen Billing</a>
+        <form url="/api/note/reopenBilling">
+            <input type="hidden" name="uid" value="{{$note->uid}}">
+            <p>Reopen billing?</p>
+            <div class="mb-0">
+                <button class="btn btn-success btn-sm" submit>Submit</button>
+                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+            </div>
+        </form>
+    </span>
+@endif
+<span class="mx-2 text-secondary">|</span>
+@if(!$note->is_billing_marked_done)
+    <span class="d-block" moe>
+        <a class="text-danger" href="" show start>Mark Billing Done</a>
+        <form url="/api/note/setIsBillingMarkedDoneToTrue">
+            <input type="hidden" name="uid" value="{{$note->uid}}">
+            <p>Mark billing on this note as done?</p>
+            <div class="mb-0">
+                <button class="btn btn-success btn-sm" submit>Submit</button>
+                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+            </div>
+        </form>
+    </span>
+@else
+    <span class="d-block" moe>
+        <i class="fa fa-check"></i>
+        <a class="text-danger" href="" show start>Undo Mark Billing Done</a>
+        <form url="/api/note/setIsBillingMarkedDoneToFalse">
+            <input type="hidden" name="uid" value="{{$note->uid}}">
+            <p>Mark billing on this note as not done?</p>
+            <div class="mb-0">
+                <button class="btn btn-success btn-sm" submit>Submit</button>
+                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+            </div>
+        </form>
+    </span>
+@endif
 <script>
     (function() {
         let selectedCodeHourlyRate = 0;

+ 43 - 0
resources/views/app/patient/note/_create-claim.blade.php

@@ -1,5 +1,48 @@
 <span class="mx-2 text-secondary">|</span>
 <a href="#" onclick="return showStagPopup('create-claim')">Create Claim</a>
+@if($pro->pro_type === 'ADMIN')
+    @if(!$note->is_claim_closed)
+        <span class="mx-2 text-secondary">|</span>
+        <span class="d-block" moe>
+            <a class="text-danger" href="" show start>Close Claiming</a>
+            <form url="/api/note/closeClaiming">
+                <input type="hidden" name="uid" value="{{$note->uid}}">
+                <p>Close claiming?</p>
+                <div class="mb-0">
+                    <button class="btn btn-success btn-sm" submit>Submit</button>
+                    <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                </div>
+            </form>
+        </span>
+    @elseif($note->is_claim_closed)
+        <span class="mx-2 text-secondary">|</span>
+        <span class="d-block" moe>
+            <a class="text-danger" href="" show start>Reopen Claiming</a>
+            <form url="/api/note/reopenClaiming">
+                <input type="hidden" name="uid" value="{{$note->uid}}">
+                <p>Reopen claiming?</p>
+                <div class="mb-0">
+                    <button class="btn btn-success btn-sm" submit>Submit</button>
+                    <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                </div>
+            </form>
+        </span>
+        <span class="mx-2 text-secondary">|</span>
+        <span class="d-block" moe>
+            <a class="text-danger" href="" show start>Update Claim Total Paid</a>
+            <form url="/api/note/updateClaimTotalPaid">
+                <input type="hidden" name="uid" value="{{$note->uid}}">
+                <div class="form-group">
+                    <input type="number" class="form-control" name="claimTotalPaid">
+                </div>
+                <div class="mb-0">
+                    <button class="btn btn-success btn-sm" submit>Submit</button>
+                    <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                </div>
+            </form>
+        </span>
+    @endif
+@endif
 <div class="stag-popup stag-popup-md mcp-theme-1" stag-popup-key="create-claim">
     <form action="/api/claim/createForNote" id="createClaimApp">
         <h3 class="stag-popup-title border-bottom-0 mb-0">

+ 0 - 102
resources/views/app/patient/note/dashboard.blade.php

@@ -765,65 +765,6 @@
                         <div class="d-flex align-items-center mb-2">
                             <p class="font-weight-bold text-secondary m-0">Bills</p>
                             @include('app/patient/note/_create-bill')
-
-                                @if(!$note->is_bill_closed)
-                                    <span class="mx-2 text-secondary">|</span>
-                                    Billing Not Closed&nbsp;
-				    @if($pro->pro_type === 'ADMIN')    
-				    <span class="d-block" moe>
-                                        <a class="text-danger" href="" show start>Close Billing</a>
-                                        <form url="/api/note/closeBilling">
-                                            <input type="hidden" name="uid" value="{{$note->uid}}">
-                                            <p>Close billing?</p>
-                                            <div class="mb-0">
-                                                <button class="btn btn-success btn-sm" submit>Submit</button>
-                                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
-                                            </div>
-                                        </form>
-                                    </span>
-				    @endif
-                                @elseif($note->is_bill_closed)
-                                    <span class="mx-2 text-secondary">|</span>
-                                    <span class="d-block" moe>
-                                        <a class="text-danger" href="" show start>Reopen Billing</a>
-                                        <form url="/api/note/reopenBilling">
-                                            <input type="hidden" name="uid" value="{{$note->uid}}">
-                                            <p>Reopen billing?</p>
-                                            <div class="mb-0">
-                                                <button class="btn btn-success btn-sm" submit>Submit</button>
-                                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
-                                            </div>
-                                        </form>
-                                    </span>
-                                @endif
-                                <span class="mx-2 text-secondary">|</span>
-                                @if(!$note->is_billing_marked_done)
-                                    <span class="d-block" moe>
-                                        <a class="text-danger" href="" show start>Mark Billing Done</a>
-                                        <form url="/api/note/setIsBillingMarkedDoneToTrue">
-                                            <input type="hidden" name="uid" value="{{$note->uid}}">
-                                            <p>Mark billing on this note as done?</p>
-                                            <div class="mb-0">
-                                                <button class="btn btn-success btn-sm" submit>Submit</button>
-                                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
-                                            </div>
-                                        </form>
-                                    </span>
-                                @else
-                                    <span class="d-block" moe>
-					<i class="fa fa-check"></i>
-                                        <a class="text-danger" href="" show start>Undo Mark Billing Done</a>
-                                        <form url="/api/note/setIsBillingMarkedDoneToFalse">
-                                            <input type="hidden" name="uid" value="{{$note->uid}}">
-                                            <p>Mark billing on this note as not done?</p>
-                                            <div class="mb-0">
-                                                <button class="btn btn-success btn-sm" submit>Submit</button>
-                                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
-                                            </div>
-                                        </form>
-                                    </span>
-
-                            @endif
                         </div>
 
                         @if($pro->pro_type === 'ADMIN')
@@ -1281,49 +1222,6 @@
                         <div class="d-flex align-items-center mb-2">
                             <p class="font-weight-bold text-secondary m-0">Claims</p>
                             @include('app/patient/note/_create-claim')
-                            @if($pro->pro_type === 'ADMIN')
-                                @if(!$note->is_claim_closed)
-                                    <span class="mx-2 text-secondary">|</span>
-                                    <span class="d-block" moe>
-                                        <a class="text-danger" href="" show start>Close Claiming</a>
-                                        <form url="/api/note/closeClaiming">
-                                            <input type="hidden" name="uid" value="{{$note->uid}}">
-                                            <p>Close claiming?</p>
-                                            <div class="mb-0">
-                                                <button class="btn btn-success btn-sm" submit>Submit</button>
-                                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
-                                            </div>
-                                        </form>
-                                    </span>
-                                @elseif($note->is_claim_closed)
-                                    <span class="mx-2 text-secondary">|</span>
-                                    <span class="d-block" moe>
-                                        <a class="text-danger" href="" show start>Reopen Claiming</a>
-                                        <form url="/api/note/reopenClaiming">
-                                            <input type="hidden" name="uid" value="{{$note->uid}}">
-                                            <p>Reopen claiming?</p>
-                                            <div class="mb-0">
-                                                <button class="btn btn-success btn-sm" submit>Submit</button>
-                                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
-                                            </div>
-                                        </form>
-                                    </span>
-                                    <span class="mx-2 text-secondary">|</span>
-                                    <span class="d-block" moe>
-                                        <a class="text-danger" href="" show start>Update Claim Total Paid</a>
-                                        <form url="/api/note/updateClaimTotalPaid">
-                                            <input type="hidden" name="uid" value="{{$note->uid}}">
-                                            <div class="form-group">
-                                                <input type="number" class="form-control" name="claimTotalPaid">
-                                            </div>
-                                            <div class="mb-0">
-                                                <button class="btn btn-success btn-sm" submit>Submit</button>
-                                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
-                                            </div>
-                                        </form>
-                                    </span>
-                                @endif
-                            @endif
                         </div>
 
                         <table class="table table-sm tabe-striped mb-3 border-left border-right border-bottom">

+ 7 - 0
resources/views/app/practice-management/claim-matrix.blade.php

@@ -0,0 +1,7 @@
+@extends ('layouts/template')
+
+@section('content')
+    <div >
+        <iframe class="mt-5" src="/api/dev/view/claimsReport?sessionKey={{$performer->session_key}}" style="position:fixed; top:0; left:0; bottom:0; right:0; width:100%; height:100%; border:none; margin:0; padding:0; overflow:hidden;"/>
+    </div>
+@endsection

+ 96 - 5
resources/views/app/practice-management/patient-claim-summary.blade.php

@@ -2,7 +2,84 @@
 
 @section('content')
 
-    <div id="practice-bills" class="p-3 mcp-theme-1">
+    <div class="p-3 mcp-theme-1">
+        <div class="card">
+            <div class="card-header px-3 py-2 d-flex align-items-center">
+                <strong class="mr-4 d-inline-block">
+                    <i class="fas fa-chart-bar"></i>
+                    Key numbers
+                </strong>
+            </div>
+            <div class="card-body p-0 border-0">
+                <table class="table mb-0 table-sm table-bordered table-striped">
+                    <tbody>
+                    <tr>
+                        <th class="border-top-0 pl-2" style="width: 300px;">Total notes</th>
+                        <td class="border-top-0 px-2"  style="width: 100px;">{{$notesTotal}}</td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <th class="pl-2">Notes with billing closed</th>
+                        <td class="px-2">{{$notesTotalWithBillingClosed}} / {{ $notesTotal }}</td>
+                        <td>
+                            <div class="d-flex align-items-center">
+                                <span class="fill-percent-value">{{round(($notesTotalWithBillingClosed) *100/ $notesTotal, 1)}}%</span>
+                                <div class="flex-grow-1 position-relative fill-bar">
+                                    <div class="bg-info position-absolute" style="left: 0; top: 0; height: 100%; width: {{ ($notesTotalWithBillingClosed) * 100/ $notesTotal }}%"></div>
+                                </div>
+                            </div>
+                        </td>
+                    </tr>
+                    <tr>
+                        <th class="pl-2">Notes with claiming closed</th>
+                        <td class="px-2">{{$notesTotalWithClaimingClosed}} / {{ $notesTotal }}</td>
+                        <td>
+                            <div class="d-flex align-items-center">
+                                <span class="fill-percent-value">{{round(($notesTotalWithClaimingClosed) *100/ $notesTotal, 1)}}%</span>
+                                <div class="flex-grow-1 position-relative fill-bar">
+                                    <div class="bg-info position-absolute" style="left: 0; top: 0; height: 100%; width: {{ ($notesTotalWithClaimingClosed) * 100/ $notesTotal }}%"></div>
+                                </div>
+                            </div>
+                        </td>
+                    </tr>
+
+
+                    <tr>
+                        <th class="border-top-0 pl-2" style="width: 250px;">Total patients w/ notes</th>
+                        <td class="border-top-0 px-2"  style="width: 100px;">{{$patientsTotal}}</td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <th class="pl-2">Patients with notes & billing closed</th>
+                        <td class="px-2">{{$patientsTotalWithBillingClosed}} / {{ $patientsTotal }}</td>
+                        <td>
+                            <div class="d-flex align-items-center">
+                                <span class="fill-percent-value">{{round(($patientsTotalWithBillingClosed) *100/ $patientsTotal, 1)}}%</span>
+                                <div class="flex-grow-1 position-relative fill-bar">
+                                    <div class="bg-info position-absolute" style="left: 0; top: 0; height: 100%; width: {{ ($patientsTotalWithBillingClosed) * 100/ $patientsTotal }}%"></div>
+                                </div>
+                            </div>
+                        </td>
+                    </tr>
+                    <tr>
+                        <th class="pl-2">Patients with notes & claiming closed</th>
+                        <td class="px-2">{{$patientsTotalWithClaimingClosed}} / {{ $patientsTotal }}</td>
+                        <td>
+                            <div class="d-flex align-items-center">
+                                <span class="fill-percent-value">{{round(($patientsTotalWithClaimingClosed) *100/ $patientsTotal, 1)}}%</span>
+                                <div class="flex-grow-1 position-relative fill-bar">
+                                    <div class="bg-info position-absolute" style="left: 0; top: 0; height: 100%; width: {{ ($patientsTotalWithClaimingClosed) * 100/ $patientsTotal }}%"></div>
+                                </div>
+                            </div>
+                        </td>
+                    </tr>
+                    </tbody>
+                </table>
+            </div>
+        </div>
+    </div>
+
+    <div id="practice-bills" class="px-3 mcp-theme-1">
         <div class="card">
 
             <div class="card-header px-3 py-2 d-flex align-items-center">
@@ -20,27 +97,41 @@
                 </select>
             </div>
             <div class="card-body p-0 border-0">
-                {{--                Patient | MCP | # Notes Total | # Notes without Billing Closed | # Notes without Claiming Closed--}}
                 <table class="table table-striped table-condensed table-sm">
                     <thead>
                     <tr>
                         <th>Patient</th>
                         <th>MCP</th>
-                        <th>#Notes Total</th>
                         <th>#Notes without Billing Closed</th>
                         <th>#Notes without Claiming Closed</th>
+                        <th>#Notes Total</th>
+                        <th>% Notes with Claiming Closed</th>
                     </tr>
                     </thead>
                     <tbody>
                     @foreach($patients as  $patient)
                         <tr>
                             <td>
-                                <a href="{{route('patients.view.claims-resolver', $patient->uid)}}">{{$patient->name_first}} {{$patient->name_last}}</a>
+                                <a native target="_blank"
+                                   open-in-stag-popup
+                                   update-parent
+                                   title="{{$patient->name_first}} {{$patient->name_last}} - Claims Resolver"
+                                   href="{{route('patients.view.claims-resolver', $patient->uid)}}">
+                                    {{$patient->name_first}} {{$patient->name_last}}
+                                </a>
                             </td>
                             <td>{{$patient->mcp}}</td>
-                            <td>{{$patient->notes_total}}</td>
                             <td>{{$patient->notes_without_billing_closed}}</td>
                             <td>{{$patient->notes_without_claiming_closed}}</td>
+                            <td>{{$patient->notes_total}}</td>
+                            <td>
+                                <div class="d-flex align-items-center">
+                                    <span class="fill-percent-value">{{round(($patient->notes_total - $patient->notes_without_claiming_closed) *100/$patient->notes_total, 1)}}%</span>
+                                    <div class="flex-grow-1 position-relative fill-bar">
+                                        <div class="bg-info position-absolute" style="left: 0; top: 0; height: 100%; width: {{($patient->notes_total - $patient->notes_without_claiming_closed) *100/$patient->notes_total}}%"></div>
+                                    </div>
+                                </div>
+                            </td>
                         </tr>
                     @endforeach
                     </tbody>

+ 2 - 0
resources/views/layouts/template.blade.php

@@ -339,6 +339,8 @@
 
         });
     </script>
+    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.10.24/fc-3.3.2/fh-3.1.8/datatables.min.css"/>
+    <script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.10.24/fc-3.3.2/fh-3.1.8/datatables.min.js"></script>
 </body>
 
 </html>