Przeglądaj źródła

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

= 3 lat temu
rodzic
commit
b596e4382e

+ 3 - 2
app/Helpers/helpers.php

@@ -580,8 +580,9 @@ if(!function_exists('year_part_from_date')) {
 }
 
 if(!function_exists('friendly_money')){
-    function friendly_money($value){
-        return number_format((float)$value, 2, '.', '');
+    function friendly_money($value, $decimals = 2) {
+        // if($decimals === 0) return intval($value);
+        return number_format((float)$value, $decimals, '.', '');
     }
 }
 

+ 78 - 14
app/Http/Controllers/PracticeManagementController.php

@@ -1407,6 +1407,39 @@ WHERE care_month.uid = '{$careMonthUid}' AND client.uid = '{$clientUid}'
             }
         }
 
+        // default sort
+        if(!$request->input('sort_by')) {
+            if($mode === 'mcp') {
+                $orderBy = "ORDER BY care_month.number_of_days_with_remote_measurements DESC NULLS LAST, care_month.rm_total_time_in_seconds_by_mcp DESC NULLS LAST";
+            }
+            elseif ($mode === 'rmm') {
+                $orderBy = "ORDER BY care_month.number_of_days_with_remote_measurements DESC NULLS LAST, care_month.rm_total_time_in_seconds_by_rmm_pro DESC NULLS LAST";
+            }
+            else {
+                $orderBy = "ORDER BY care_month.number_of_days_with_remote_measurements DESC NULLS LAST";
+            }
+        }
+        else {
+            $sortBy = $request->input('sort_by');
+            $sortDir = $request->input('sort_dir');
+            if($sortBy && $sortDir) {
+                if(!in_array($sortBy, ['number_of_days_with_remote_measurements', 'rm_total_time_in_seconds_by_mcp', 'rm_total_time_in_seconds_by_rmm_pro'])) {
+                    if($mode === 'mcp') {
+                        $orderBy = "ORDER BY $sortBy $sortDir NULLS LAST, care_month.number_of_days_with_remote_measurements DESC NULLS LAST, care_month.rm_total_time_in_seconds_by_mcp DESC NULLS LAST";
+                    }
+                    elseif ($mode === 'rmm') {
+                        $orderBy = "ORDER BY $sortBy $sortDir NULLS LAST, care_month.number_of_days_with_remote_measurements DESC NULLS LAST, care_month.rm_total_time_in_seconds_by_rmm_pro DESC NULLS LAST";
+                    }
+                    else {
+                        $orderBy = "ORDER BY $sortBy $sortDir NULLS LAST, care_month.number_of_days_with_remote_measurements DESC NULLS LAST";
+                    }
+                }
+                else {
+                    $orderBy = "ORDER BY $sortBy $sortDir NULLS LAST";
+                }
+            }
+        }
+
         // filters from the UI
         if(trim($request->input('f_name'))) {
             $v = trim($request->input('f_name'));
@@ -1492,6 +1525,13 @@ WHERE care_month.uid = '{$careMonthUid}' AND client.uid = '{$clientUid}'
             $conditions[] = "(care_month.{$field} {$o} {$v})";
         }
 
+        if($request->input('not-enrolled')) {
+            $conditions[] = "(client.is_enrolled_in_rm != 'YES')";
+        }
+        else {
+            $conditions[] = "(client.is_enrolled_in_rm = 'YES')";
+        }
+
         $proTypeCondition = '';
         $genericBillIdColumns = '';
         $genericBillJoinClause = '';
@@ -3660,27 +3700,51 @@ ORDER BY c.name_last, c.name_first
 		-- n.visit_number = 2 AND
 		n.is_signed_by_hcp IS TRUE AND
             -- n.effective_dateest < '2022-03-01' AND
-	    -- n.id IN (SELECT note_id FROM segment WHERE summary_html ILIKE '%n95%') AND
-	    n.is_claim_closed IS NOT TRUE AND
-            n.is_cancelled IS NOT TRUE AND 
-            n.created_at::DATE >= '2022-01-01'::DATE AND
+	    
+		n.is_claim_closed IS NOT TRUE AND
+            
+	    n.is_cancelled IS NOT TRUE AND 
             c.client_engagement_status_category <> 'DUMMY' AND
             c.name_first NOT ILIKE '%test%' AND 
             c.name_last NOT ILIKE '%test%' AND
-            n.id IN (SELECT note_id FROM bill WHERE code ILIKE '%treatment%' AND bill.is_cancelled IS NOT TRUE AND note_id IS NOT NULL) AND
+            n.id IN (SELECT note_id FROM bill WHERE code ILIKE '%treatment%' AND bill.is_cancelled IS NOT TRUE AND note_id IS NOT NULL)
+		    -- AND	
             -- n.id NOT IN (SELECT note_id FROM claim WHERE note_id IS NOT NULL) AND
-            c.is_part_b_primary <> 'YES' -- AND
-            -- c.latest_eligible_refresh_at::DATE >= '2022-01-01' AND
-            -- c.mpb_remaining = 0 -- AND
-            -- c.created_at::DATE >= '2022-01-01'::DATE
             ";
         $filters = [];
-        if($request->input('f')) {
-            $filters[] =  "(n.detail_json IS NOT NULL AND ((n.detail_json)::json->'farah_decision')::text = '\"" . $request->input('f') . "\"')";
+
+        if(trim($request->input('f_pb_primary'))) {
+            $v = trim($request->input('f_pb_primary'));
+            if($v === 'yes') {
+                $filters[] = "(c.is_part_b_primary = 'YES')";
+            }
+            else if($v === 'no') {
+                $filters[] = "(c.is_part_b_primary != 'YES')";
+            }
         }
-        if($request->input('s')) {
-            $filters[] =  "(n.detail_json IS NOT NULL AND ((n.detail_json)::json->'shawn_decision')::text = '\"" . $request->input('s') . "\"')";
+        if(trim($request->input('f_deductible_zero'))) {
+            $v = trim($request->input('f_deductible_zero'));
+            if($v === 'yes') {
+                $filters[] = "(c.mpb_remaining = 0)";
+            }
+            else if($v === 'no') {
+                $filters[] = "(c.mpb_remaining > 0)";
+            }
         }
+        if(trim($request->input('f_note_hcp'))) {
+            $v = trim($request->input('f_note_hcp'));
+            $filters[] = "(n.hcp_pro_id IN (SELECT id FROM pro WHERE uid = '{$v}'))";
+        }
+        if(trim($request->input('f_2022_patient'))) {
+            $v = trim($request->input('f_2022_patient'));
+            if($v === 'yes') {
+                $filters[] = "(c.created_at::DATE >= '2022-01-01'::DATE)";
+            }
+            else if($v === 'no') {
+                $filters[] = "(c.created_at::DATE < '2022-01-01'::DATE)";
+            }
+        }
+
         if(count($filters)) {
             $filters = 'AND ' . implode(' AND ',  $filters);
         }
@@ -3689,7 +3753,7 @@ ORDER BY c.name_last, c.name_first
         }
         // $filters = '';
         $orderBy = "ORDER BY 
-		c.id ASC, 
+			-- c.id ASC, 
 		n.id ASC, n.effective_dateest ASC";
 
         $countQuery = "SELECT count(*) {$from} {$where} {$filters}";

+ 4 - 0
app/Models/Bill.php

@@ -37,6 +37,10 @@ class Bill extends Model
         return $this->hasOne(Pro::class, 'id', 'generic_pro_id');
     }
 
+    public function hcpCompany() {
+        return $this->hasOne(Company::class, 'id', 'hcp_company_id');
+    }
+
     public function hcpCompanyPro() {
         return $this->hasOne(CompanyPro::class, 'id', 'hcp_company_pro_id');
     }

+ 2 - 0
config/app.php

@@ -76,6 +76,8 @@ return [
     'weightSmsNumber' => env('WEIGHT_SMS_NUMBER', ''),
     'bpSmsNumber' => env('BP_SMS_NUMBER', ''),
 
+    'nonMedicalVisitTemplateUid' => env('NON_MEDICAL_VISIT_TEMPLATE_UID'),
+
     /*
     |--------------------------------------------------------------------------
     | Application Timezone

+ 11 - 51
resources/views/app/patient/care-month/dashboard.blade.php

@@ -980,11 +980,10 @@
                             <table class="table table-sm tabe-striped mb-0 table-bordered">
                                 <thead class="bg-light">
                                 <tr class="text-secondary">
-                                    <?php /* <th class="border-bottom-0"></th> */ ?>
                                     <th class="border-bottom-0">Date</th>
                                     <th class="border-bottom-0">Service</th>
                                     <th class="border-bottom-0">Billable</th>
-                                    <th class="border-bottom-0">HCP</th>
+                                    <th class="border-bottom-0">Pro</th>
                                     <th class="border-bottom-0">Total</th>
                                     <th class="border-bottom-0">Sign</th>
                                     <th class="border-bottom-0">Bal Post Date</th>
@@ -996,26 +995,7 @@
                                 <tbody>
                                 @foreach ($careMonth->bills as $bill)
                                     <tr class="{{$bill->is_cancelled ? 'bg-light text-secondary' : ''}}">
-                                        <?php /* <td class="p-0">
-                                            <table class="table-striped table-sm table-condensed border border-left-0 border-top-0 border-bottom-0">
-                                                <tbody>
-                                                    <tr><td>collected_amount</td><td>{{$bill->collected_amount}}</td></tr>
-                                                    <tr><td>effective_date</td><td>{{$bill->effective_date}}</td></tr>
-                                                    <tr><td>has_hcp_been_paid</td><td>{{$bill->has_hcp_been_paid}}</td></tr>
-                                                    <tr><td>hcp_expected_payment_amount</td><td>{{$bill->hcp_expected_payment_amount}}</td></tr>
-                                                    <tr><td>hcp_payment_amount</td><td>{{$bill->hcp_payment_amount}}</td></tr>
-                                                    <tr><td>is_cancelled</td><td>{{$bill->is_cancelled}}</td></tr>
-                                                    <tr><td>hcp_payment_pro_transaction_id</td><td>{{$bill->hcp_payment_pro_transaction_id}}</td></tr>
-                                                    <tr><td>balance_post_date</td><td>{{$bill->balance_post_date}}</td></tr>
-                                                    <tr><td>is_verified</td><td>{{$bill->is_verified}}</td></tr>
-                                                    <tr><td>is_cancellation_acknowledged</td><td>{{$bill->is_cancellation_acknowledged}}</td></tr>
-                                                    <tr><td>is_cancelled_by_administrator</td><td>{{$bill->is_cancelled_by_administrator}}</td></tr>
-                                                    <tr><td>total_expected</td><td>{{$bill->total_expected}}</td></tr>
-                                                    <tr><td>total_paid</td><td>{{$bill->total_paid}}</td></tr>
-                                                </tbody>
-                                            </table>
-                                        </td> */ ?>
-                                        <td class="text-nowrap">{{friendlier_date_time($bill->effective_date, false)}}</td>
+                                        <td class="text-nowrap">{{friendlier_date_time($bill->careMonth->end_date, false)}}</td>
                                         <td>{{$bill->code}} {{$bill->cm_or_rm}} {{$bill->is_cancelled}}</td>
                                         <td class="">
                                             @if(strpos(strtolower($bill->code), 'treatment services') !== FALSE)
@@ -1041,42 +1021,22 @@
                                             @endif
                                         </td>
                                         <td class="">
-                                            <div class="text-nowrap font-weight-bold text-secondary">{{ $bill->hcp->displayName() }} (HCP)</div>
+                                            <div class="text-nowrap font-weight-bold text-secondary">{{ $bill->genericPro ? $bill->genericPro->displayName() : '' }} (HCP)</div>
                                             <div class="text-nowrap mt-1">
                                                 <span class="text-secondary">Paid: </span>
-                                                <span>{{ $bill->has_hcp_been_paid ? 'Yes' : 'No' }}</span>
+                                                <span>{{ $bill->has_generic_pro_been_paid ? 'Yes' : 'No' }}</span>
                                             </div>
                                             @if(!$bill->has_hcp_been_paid)
                                                 <div class="text-nowrap mt-1">
                                                     <span class="text-secondary">Expected: </span>
-                                                    <span class="font-weight-bold">${{ $bill->hcp_expected_payment_amount }}</span>
+                                                    <span class="font-weight-bold">${{ $bill->generic_pro_expected_payment_amount }}</span>
                                                 </div>
                                             @else
                                                 <div class="text-nowrap mt-1">
                                                     <span class="text-secondary">Amount: </span>
-                                                    <span class="font-weight-bold">${{ $bill->hcp_payment_amount }}</span>
+                                                    <span class="font-weight-bold">${{ $bill->generic_pro_payment_amount }}</span>
                                                 </div>
                                             @endif
-                                            @if($bill->ally)
-                                                <hr>
-                                                <div class="text-nowrap font-weight-bold text-secondary">{{ $bill->ally->displayName() }} (NA)</div>
-                                                <div class="text-nowrap mt-1">
-                                                    <span class="text-secondary">Paid: </span>
-                                                    <span>{{ $bill->has_na_been_paid ? 'Yes' : 'No' }}</span>
-                                                </div>
-                                                @if(!$bill->has_na_been_paid)
-                                                    <div class="text-nowrap mt-1">
-                                                        <span class="text-secondary">Expected: </span>
-                                                        <span class="font-weight-bold">${{ $bill->na_expected_payment_amount }}</span>
-                                                    </div>
-                                                @else
-                                                    <div class="text-nowrap mt-1">
-                                                        <span class="text-secondary">Amount: </span>
-                                                        <span class="font-weight-bold">${{ $bill->na_payment_amount }}</span>
-                                                    </div>
-                                                @endif
-                                            @endif
-
                                         </td>
                                         <td class="pr-3">
                                             @if($bill->has_hcp_been_paid)
@@ -1089,19 +1049,19 @@
                                         </td>
                                         <td>
                                             @if(!$bill->is_cancelled)
-                                                @if($bill->is_signed_by_hcp)
+                                                @if($bill->is_signed_by_generic_pro)
                                                     <span class="d-block text-secondary text-nowrap">
                                                             <i class="fa fa-check"></i>
-                                                            HCP Signed
+                                                            Pro Signed
                                                         </span>
                                                 @else
                                                     <span moe
                                                           class="d-block {{ $bill->hcp_pro_id !== $pro->id && $pro->pro_type !== 'ADMIN' ? 'moe-disabled' : '' }}"
-                                                          title="{{ $bill->hcp_pro_id !== $pro->id  && $pro->pro_type !== 'ADMIN' ? 'Only the bill\'s HCP can sign' : '' }}">
+                                                          title="{{ $bill->hcp_pro_id !== $pro->id  && $pro->pro_type !== 'ADMIN' ? 'Only the bill\'s Pro can sign' : '' }}">
                                                         <a class="" href="" show start>Sign As HCP</a>
-                                                        <form url="/api/bill/signAsHcp">
+                                                        <form url="/api/bill/signAsGenericPro">
                                                             <input type="hidden" name="uid" value="{{$bill->uid}}">
-                                                            <p>Sign this bill as HCP?</p>
+                                                            <p>Sign this bill?</p>
                                                             <div class="mb-0">
                                                                 <button class="btn btn-success btn-sm" submit>Sign</button>
                                                                 <button class="btn btn-default border btn-sm" cancel>Cancel</button>

+ 130 - 128
resources/views/app/patient/note/dashboard.blade.php

@@ -157,7 +157,7 @@ use App\Models\Handout;
 
             <div class="px-2 border-right">
                 <div class="d-flex">
-                    <span><span class="text-secondary">HCP:</span> {{$note->hcpPro->name_first}} {{$note->hcpPro->name_last}}</span>
+                    <span><span class="text-secondary">{{$note->hcpPro->is_hcp ? 'HCP' : 'Pro'}}:</span> {{$note->hcpPro->name_first}} {{$note->hcpPro->name_last}}</span>
                 </div>
             </div>
 
@@ -338,7 +338,7 @@ use App\Models\Handout;
                                 @if($pro->pro_type === 'ADMIN' || ($note->hcpPro && $pro->id === $note->hcpPro->id && !$note->hasClaims()))
                                     <div class="ml-3">
                                         <div moe>
-                                            <a class="" href="" show start>Undo Sign{{$pro->pro_type === 'ADMIN' ? ' As HCP' : ''}}</a>
+                                            <a class="" href="" show start>Undo Sign{{$pro->pro_type === 'ADMIN' ? ' As ' . ($note->hcpPro->is_hcp ? 'HCP' : 'Pro') : ''}}</a>
                                             <form url="/api/note/adminUndoSignAsHcp" right>
                                                 <input type="hidden" name="uid" value="{{$note->uid}}">
                                                 <p>Undo HCP signature?</p>
@@ -384,7 +384,7 @@ use App\Models\Handout;
                                        title="Confirm and Sign"
                                        class="screen-only"
                                        href="{{route('patients.view.notes.view.sign-confirmation', compact('patient', 'note'))}}">
-                                        Sign Note As HCP
+                                        Sign Note As {{$note->hcpPro->is_hcp ? 'HCP' : 'Pro'}}
                                     </a>
                                 @endif
                             @endif
@@ -738,7 +738,7 @@ use App\Models\Handout;
                                                     {{ $iSupplyOrder->product->title }}
                                                 </td>
                                                 <td class="px-2">{{ $iSupplyOrder->reason }}</td>
-                                                <td class="px-2">{{ friendlier_date($iSupplyOrder->created_at) }} <i class="fas fa-info-circle text-primary" data-toggle="tooltip" data-placement="top" data-html="true" title="Created at: {{ friendlier_date_time($iSupplyOrder->created_at) }} By: {{ $iSupplyOrder->createdByPro->displayName() }}"></i> </td>
+                                                <td class="px-2">{{ friendlier_date($iSupplyOrder->created_at) }} <i class="fas fa-info-circle text-primary" data-toggle="tooltip" data-placement="top" data-html="true" title="Created at: {{ friendlier_date_time($iSupplyOrder->created_at) }} By: {{ $iSupplyOrder->createdByPro ? $iSupplyOrder->createdByPro->displayName() : ''}}"></i> </td>
                                                 <td class="px-2">
                                                     {{ $iSupplyOrder->is_signed_by_pro ? $iSupplyOrder->signedPro->displayName() : '-' }}
                                                     <i class="fas fa-info-circle text-primary" data-toggle="tooltip" data-placement="top" data-html="true" title="Signed at: {{ friendlier_date_time($iSupplyOrder->pro_signed_at) }}"></i>
@@ -1009,133 +1009,135 @@ use App\Models\Handout;
                     @endif
                 </div>
 
-                @if($pro->pro_type === 'ADMIN')
-                <div class="p-3 border-bottom screen-only" data-non-segment-section="Bills & Claims Summary">
-                    <div>
-                        <h2 class="font-weight-bold text-secondary">Bills & Claims Summary</h2>
-                        <div class="d-flex justify-content-center align-items-start">
-                            <table class="w-25 flex-grow-1 table-bordered table-condensed table-sm table-striped">
-                                <tbody>
-                                <tr>
-                                    <td class="text-secondary">Bill Total Exp.</td>
-                                    <td>${{friendly_money($note->bill_total_expected)}}</td>
-                                </tr>
-                                <tr>
-                                    <td class="text-secondary">Is Billing Closed</td>
-                                    <td>{{$note->is_bill_closed ? 'Yes' : 'No'}}</td>
-                                </tr>
-                                <tr>
-                                    <td class="text-secondary">Bill Summary</td>
-                                    <td>{{$note->bill_summary ? $note->bill_summary : '-'}}</td>
-                                </tr>
-                                <tr>
-                                    <td class="text-secondary">Bill Total Paid</td>
-                                    <td>${{friendly_money($note->bill_total_paid)}}</td>
-                                </tr>
-                                <tr>
-                                    <td class="text-secondary">Billing Closed At</td>
-                                    <td>{{friendlier_date_time($note->bill_closed_at)}}</td>
-                                </tr>
-                                </tbody>
-                            </table>
-                            <table class="w-25 flex-grow-1 table-bordered table-condensed table-sm table-striped ml-2">
-                                <tbody>
-                                <tr>
-                                    <td class="text-secondary">Claim Total Exp.</td>
-                                    <td>${{friendly_money($note->claim_total_expected)}}</td>
-                                </tr>
-                                <tr>
-                                    <td class="text-secondary">Is Claiming Closed</td>
-                                    <td>{{$note->is_claim_closed ? 'Yes' : 'No'}}</td>
-                                </tr>
-                                <tr>
-                                    <td class="text-secondary">Claim Summary</td>
-                                    <td>{{$note->claim_summary ? $note->claim_summary : '-'}}</td>
-                                </tr>
-                                <tr>
-                                    <td class="text-secondary">Claim Total Paid</td>
-                                    <td>${{friendly_money($note->claim_total_paid)}}</td>
-                                </tr>
-                                <tr>
-                                    <td class="text-secondary">Claiming Closed At</td>
-                                    <td>{{$note->claim_closed_at ? friendlier_date_time($note->claim_closed_at) : '-'}}</td>
-                                </tr>
-                                </tbody>
-                            </table>
-                            <table class="w-25 flex-grow-1 table-bordered table-condensed table-sm table-striped ml-2">
-                                <tbody>
-                                <tr>
-                                    <td class="text-secondary">HCP Bill Total Exp.</td>
-                                    <td>${{friendly_money($note->hcp_bill_total_expected)}}</td>
-                                </tr>
-                                <tr>
-                                    <td class="text-secondary">NA Bill Total Exp.</td>
-                                    <td>${{friendly_money($note->na_bill_total_expected)}}</td>
-                                </tr>
-                                <tr>
-                                    <td class="text-secondary">RMM Bill Total Exp.</td>
-                                    <td>${{friendly_money($note->rmm_bill_total_expected)}}</td>
-                                </tr>
-                                <tr>
-                                    <td class="text-secondary">RME Bill Total Exp.</td>
-                                    <td>${{friendly_money($note->rme_bill_total_expected)}}</td>
-                                </tr>
-                                <tr>
-                                    <td class="text-secondary">RMS Bill Total Exp.</td>
-                                    <td>${{friendly_money($note->rms_bill_total_expected)}}</td>
-                                </tr>
-                                <tr>
-                                    <td class="text-secondary">RMG Bill Total Exp.</td>
-                                    <td>${{friendly_money($note->rmg_bill_total_expected)}}</td>
-                                </tr>
-                                <tr>
-                                    <td class="text-secondary">CM Bill Total Exp.</td>
-                                    <td>${{friendly_money($note->cm_bill_total_expected)}}</td>
-                                </tr>
-                                </tbody>
-                            </table>
-                            <table class="w-25 flex-grow-1 table-bordered table-condensed table-sm table-striped ml-2">
-                                <tbody>
-                                <tr>
-                                    <td class="text-secondary">HCP Bill Total Paid</td>
-                                    <td>${{friendly_money($note->hcp_bill_total_paid)}}</td>
-                                </tr>
-                                <tr>
-                                    <td class="text-secondary">NA Bill Total Paid</td>
-                                    <td>${{friendly_money($note->na_bill_total_paid)}}</td>
-                                </tr>
-                                <tr>
-                                    <td class="text-secondary">RMM Bill Total Paid</td>
-                                    <td>${{friendly_money($note->rmm_bill_total_paid)}}</td>
-                                </tr>
-                                <tr>
-                                    <td class="text-secondary">RME Bill Total Paid</td>
-                                    <td>${{friendly_money($note->rme_bill_total_paid)}}</td>
-                                </tr>
-                                <tr>
-                                    <td class="text-secondary">RMS Bill Total Paid</td>
-                                    <td>${{friendly_money($note->rms_bill_total_paid)}}</td>
-                                </tr>
-                                <tr>
-                                    <td class="text-secondary">RMG Bill Total Paid</td>
-                                    <td>${{friendly_money($note->rmg_bill_total_paid)}}</td>
-                                </tr>
-                                <tr>
-                                    <td class="text-secondary">CM Bill Total Paid</td>
-                                    <td>${{friendly_money($note->cm_bill_total_paid)}}</td>
-                                </tr>
-<!--                                <tr>
-                                    <td class="text-secondary">HCP Company Pro</td>
-                                    <td>{{$note->hcp_company_pro_id}}</td>
-                                </tr>-->
-                                </tbody>
-                            </table>
+                @if(!$note->is_non_medical)
+                    @if($pro->pro_type === 'ADMIN')
+                    <div class="p-3 border-bottom screen-only" data-non-segment-section="Bills & Claims Summary">
+                        <div>
+                            <h2 class="font-weight-bold text-secondary">Bills & Claims Summary</h2>
+                            <div class="d-flex justify-content-center align-items-start">
+                                <table class="w-25 flex-grow-1 table-bordered table-condensed table-sm table-striped">
+                                    <tbody>
+                                    <tr>
+                                        <td class="text-secondary">Bill Total Exp.</td>
+                                        <td>${{friendly_money($note->bill_total_expected)}}</td>
+                                    </tr>
+                                    <tr>
+                                        <td class="text-secondary">Is Billing Closed</td>
+                                        <td>{{$note->is_bill_closed ? 'Yes' : 'No'}}</td>
+                                    </tr>
+                                    <tr>
+                                        <td class="text-secondary">Bill Summary</td>
+                                        <td>{{$note->bill_summary ? $note->bill_summary : '-'}}</td>
+                                    </tr>
+                                    <tr>
+                                        <td class="text-secondary">Bill Total Paid</td>
+                                        <td>${{friendly_money($note->bill_total_paid)}}</td>
+                                    </tr>
+                                    <tr>
+                                        <td class="text-secondary">Billing Closed At</td>
+                                        <td>{{friendlier_date_time($note->bill_closed_at)}}</td>
+                                    </tr>
+                                    </tbody>
+                                </table>
+                                <table class="w-25 flex-grow-1 table-bordered table-condensed table-sm table-striped ml-2">
+                                    <tbody>
+                                    <tr>
+                                        <td class="text-secondary">Claim Total Exp.</td>
+                                        <td>${{friendly_money($note->claim_total_expected)}}</td>
+                                    </tr>
+                                    <tr>
+                                        <td class="text-secondary">Is Claiming Closed</td>
+                                        <td>{{$note->is_claim_closed ? 'Yes' : 'No'}}</td>
+                                    </tr>
+                                    <tr>
+                                        <td class="text-secondary">Claim Summary</td>
+                                        <td>{{$note->claim_summary ? $note->claim_summary : '-'}}</td>
+                                    </tr>
+                                    <tr>
+                                        <td class="text-secondary">Claim Total Paid</td>
+                                        <td>${{friendly_money($note->claim_total_paid)}}</td>
+                                    </tr>
+                                    <tr>
+                                        <td class="text-secondary">Claiming Closed At</td>
+                                        <td>{{$note->claim_closed_at ? friendlier_date_time($note->claim_closed_at) : '-'}}</td>
+                                    </tr>
+                                    </tbody>
+                                </table>
+                                <table class="w-25 flex-grow-1 table-bordered table-condensed table-sm table-striped ml-2">
+                                    <tbody>
+                                    <tr>
+                                        <td class="text-secondary">HCP Bill Total Exp.</td>
+                                        <td>${{friendly_money($note->hcp_bill_total_expected)}}</td>
+                                    </tr>
+                                    <tr>
+                                        <td class="text-secondary">NA Bill Total Exp.</td>
+                                        <td>${{friendly_money($note->na_bill_total_expected)}}</td>
+                                    </tr>
+                                    <tr>
+                                        <td class="text-secondary">RMM Bill Total Exp.</td>
+                                        <td>${{friendly_money($note->rmm_bill_total_expected)}}</td>
+                                    </tr>
+                                    <tr>
+                                        <td class="text-secondary">RME Bill Total Exp.</td>
+                                        <td>${{friendly_money($note->rme_bill_total_expected)}}</td>
+                                    </tr>
+                                    <tr>
+                                        <td class="text-secondary">RMS Bill Total Exp.</td>
+                                        <td>${{friendly_money($note->rms_bill_total_expected)}}</td>
+                                    </tr>
+                                    <tr>
+                                        <td class="text-secondary">RMG Bill Total Exp.</td>
+                                        <td>${{friendly_money($note->rmg_bill_total_expected)}}</td>
+                                    </tr>
+                                    <tr>
+                                        <td class="text-secondary">CM Bill Total Exp.</td>
+                                        <td>${{friendly_money($note->cm_bill_total_expected)}}</td>
+                                    </tr>
+                                    </tbody>
+                                </table>
+                                <table class="w-25 flex-grow-1 table-bordered table-condensed table-sm table-striped ml-2">
+                                    <tbody>
+                                    <tr>
+                                        <td class="text-secondary">HCP Bill Total Paid</td>
+                                        <td>${{friendly_money($note->hcp_bill_total_paid)}}</td>
+                                    </tr>
+                                    <tr>
+                                        <td class="text-secondary">NA Bill Total Paid</td>
+                                        <td>${{friendly_money($note->na_bill_total_paid)}}</td>
+                                    </tr>
+                                    <tr>
+                                        <td class="text-secondary">RMM Bill Total Paid</td>
+                                        <td>${{friendly_money($note->rmm_bill_total_paid)}}</td>
+                                    </tr>
+                                    <tr>
+                                        <td class="text-secondary">RME Bill Total Paid</td>
+                                        <td>${{friendly_money($note->rme_bill_total_paid)}}</td>
+                                    </tr>
+                                    <tr>
+                                        <td class="text-secondary">RMS Bill Total Paid</td>
+                                        <td>${{friendly_money($note->rms_bill_total_paid)}}</td>
+                                    </tr>
+                                    <tr>
+                                        <td class="text-secondary">RMG Bill Total Paid</td>
+                                        <td>${{friendly_money($note->rmg_bill_total_paid)}}</td>
+                                    </tr>
+                                    <tr>
+                                        <td class="text-secondary">CM Bill Total Paid</td>
+                                        <td>${{friendly_money($note->cm_bill_total_paid)}}</td>
+                                    </tr>
+    <!--                                <tr>
+                                        <td class="text-secondary">HCP Company Pro</td>
+                                        <td>{{$note->hcp_company_pro_id}}</td>
+                                    </tr>-->
+                                    </tbody>
+                                </table>
+                            </div>
                         </div>
                     </div>
-                </div>
-                @endif
+                    @endif
 
-                @include('app.patient.note.partials.cpp-bills-claims-container')
+                    @include('app.patient.note.partials.cpp-bills-claims-container')
+                @endif
 
                 {{-- addendums --}}
                 @if($note->is_signed_by_hcp)

+ 16 - 12
resources/views/app/patient/note/lhs-tree.blade.php

@@ -47,25 +47,29 @@
 
     <hr>
     <div class="note-tree-node"><a native="" target="_top" data-non-segment-target="Handouts" href="#">Handouts</a></div>
+    @if(!$note->is_non_medical)
     <div class="note-tree-node"><a native="" target="_top" data-non-segment-target="Prescriptions" href="#">ERx &amp; Orders</a></div>
+    @endif
     <div class="note-tree-node"><a native="" target="_top" data-non-segment-target="Incoming Reports" href="#">Incoming Reports</a></div>
     <div class="note-tree-node"><a native="" target="_top" data-non-segment-target="RM Setup" href="#">RM Setup</a></div>
     <div class="note-tree-node"><a native="" target="_top" data-non-segment-target="Supply Orders Summary" href="#">Supply Orders Summary</a></div>
     <div class="note-tree-node"><a native="" target="_top" data-non-segment-target="Vitals Settings" href="#">Vitals Settings</a></div>
     <div class="note-tree-node"><a native="" target="_top" data-non-segment-target="ICDs" href="#">ICDs</a></div>
-    @if($pro->pro_type === 'ADMIN')
-        <div class="note-tree-node"><a native="" target="_top" data-non-segment-target="Bills & Claims Summary" href="#">Bills & Claims Summary</a></div>
-    @endif
-    @if($note->method === 'IN_CLINIC' || $pro->pro_type === 'ADMIN')
-        <div class="note-tree-node"><a native="" target="_top" data-non-segment-target="Pro/Payer Settings" href="#">Pro/Payer Settings</a></div>
-    @endif
-    @if($pro->pro_type === 'ADMIN' || ($note->hcpPro && $pro->id === $note->hcpPro->id))
-        <div class="note-tree-node"><a native="" target="_top" data-non-segment-target="HCP Bills" href="#">HCP Bills</a></div>
-    @endif
-    @if($pro->pro_type === 'ADMIN' || ($note->allyPro && $pro->id === $note->allyPro->id))
-        <div class="note-tree-node"><a native="" target="_top" data-non-segment-target="NA Bills" href="#">NA Bills</a></div>
+    @if(!$note->is_non_medical)
+        @if($pro->pro_type === 'ADMIN')
+            <div class="note-tree-node"><a native="" target="_top" data-non-segment-target="Bills & Claims Summary" href="#">Bills & Claims Summary</a></div>
+        @endif
+        @if($note->method === 'IN_CLINIC' || $pro->pro_type === 'ADMIN')
+            <div class="note-tree-node"><a native="" target="_top" data-non-segment-target="Pro/Payer Settings" href="#">Pro/Payer Settings</a></div>
+        @endif
+        @if($pro->pro_type === 'ADMIN' || ($note->hcpPro && $pro->id === $note->hcpPro->id))
+            <div class="note-tree-node"><a native="" target="_top" data-non-segment-target="HCP Bills" href="#">HCP Bills</a></div>
+        @endif
+        @if($pro->pro_type === 'ADMIN' || ($note->allyPro && $pro->id === $note->allyPro->id))
+            <div class="note-tree-node"><a native="" target="_top" data-non-segment-target="NA Bills" href="#">NA Bills</a></div>
+        @endif
+        <div class="note-tree-node"><a native="" target="_top" data-non-segment-target="Claims" href="#">Claims</a></div>
     @endif
-    <div class="note-tree-node"><a native="" target="_top" data-non-segment-target="Claims" href="#">Claims</a></div>
     @if($note->is_signed_by_hcp)
         <div class="note-tree-node mb-3"><a native="" target="_top" data-non-segment-target="Addendums" href="#">Addendums</a></div>
     @endif

+ 1 - 1
resources/views/app/patient/note/partials/cpp-bills-claims-container.blade.php

@@ -371,7 +371,7 @@
                                 </span>
                             @else
                                 <div class="text-success font-weight-bold"><i class="fa fa-check"></i> Verified</div>
-                                <div class="text-muted">By: {{@$bill->markedVerifiedBySession->pro->displayName()}} on {{friendly_date_time(@$bill->marked_verified_at)}}</div>
+                                <div class="text-muted">By: {{@$bill->markedVerifiedBySession && @$bill->markedVerifiedBySession->pro ? @$bill->markedVerifiedBySession->pro->displayName() : '-'}} on {{friendly_date_time(@$bill->marked_verified_at)}}</div>
                                 <span class="d-block mt-1" moe>
                                     <a class="" href="" show start>Undo</a>
                                     <form url="/api/bill/undoMarkAsVerified">

+ 45 - 1
resources/views/app/patient/note/partials/resolve-content.blade.php

@@ -337,7 +337,7 @@
                             </form>
                         </div>
                     </div>
-                    @include('app.patient.note.rhs-sidebar')
+                    @include('app.patient.note.rhs-sidebar-nrc')
                 </div>
             </div>
         </div>
@@ -444,6 +444,50 @@
                     $(this).closest('.on-hover-content').find('[menu]').hide();
                     return false;
                 });
+            parentSegment.find('.dx-data')
+                .off('click.quick-add-icd')
+                .on('click.quick-add-icd', function () {
+                    let code = $.trim($(this).find('.dx-data-code').text()),
+                        description = $.trim($(this).find('.dx-data-description').text()),
+                        table = $(this).closest('.card-body').find('.nrc-icds').find('table').first(),
+                        tr = null;
+                    table.find('tbody>tr').each(function() {
+                        if($.trim($(this).find('[icd-autocomplete-code]').first().val()) === '') {
+                            tr = $(this);
+                            return false;
+                        }
+                    });
+                    if(tr) {
+                        tr.find('[icd-autocomplete-code]').val(code);
+                        tr.find('[icd-autocomplete-description]').val(description);
+                    }
+                    return false;
+                });
+            parentSegment.find('.dx-add-all')
+                .off('click.quick-add-icd')
+                .on('click.quick-add-icd', function () {
+                    let table = $(this).closest('.card-body').find('.nrc-icds').find('table').first();
+                    table.find('[icd-autocomplete-code], [icd-autocomplete-description]').val('');
+                    $(this).closest('.dx-items').find('.dx-data').each(function() {
+                        let code = $.trim($(this).find('.dx-data-code').text()),
+                            description = $.trim($(this).find('.dx-data-description').text()),
+                            tr = null;
+                        table.find('tbody>tr').each(function() {
+                            if($.trim($(this).find('[icd-autocomplete-code]').first().val()) === '') {
+                                tr = $(this);
+                                return false;
+                            }
+                        });
+                        if(tr) {
+                            tr.find('[icd-autocomplete-code]').val(code);
+                            tr.find('[icd-autocomplete-description]').val(description);
+                        }
+                    });
+                    if($(this).is('[save]')) {
+                        $(this).closest('.card-body').find('.nrc-icds').find('button[submit]').trigger('click');
+                    }
+                    return false;
+                });
         }
         addMCInitializer('note-resolve-{{$note->uid}}', init, '#note-resolve-{{$note->uid}}');
         addMCHook('onICDUpdate-{{$note->uid}}', function() {

+ 204 - 0
resources/views/app/patient/note/rhs-sidebar-nrc.blade.php

@@ -0,0 +1,204 @@
+<div class="note-rhs-sidebar screen-only" id="note-rhs-sidebar">
+
+    <?php
+    $cmStartDate = date('Y-m-01', strtotime($note->effective_dateest));
+    $careMonth = \App\Models\CareMonth::where('client_id', $patient->id)->where('start_date', $cmStartDate)->first();
+    ?>
+    <div id="recent-measurements"
+         class="p-2 border-bottom  ">
+        <div class="font-weight-bold">
+            Recent Measurements
+        </div>
+        <?php
+        $date = date('Y-m-d');
+        $end = strtotime($date);
+        $start = date_sub(date_create($date), date_interval_create_from_date_string("12 days"))->getTimestamp();
+        $start *= 1000;
+        $end *= 1000;
+        $recentMeasurements = \App\Models\Measurement
+            ::where('client_id', $patient->id)
+            ->whereRaw("(is_removed IS NULL OR is_removed = FALSE)")
+            ->whereNotNull('ts')
+            ->whereRaw("(is_cellular_zero IS NULL OR is_cellular_zero = FALSE)")
+            ->whereRaw("(label = 'BP' OR label = 'Wt. (lbs.)')")
+            ->where('ts', '>=', $start)
+            ->where('ts', '<=', $end)
+            ->orderBy('ts', 'desc')
+            ->skip(0)
+            ->take(10)
+            ->get();
+        ?>
+        @if($recentMeasurements && count($recentMeasurements))
+            <div class="pt-2">
+                @foreach($recentMeasurements as $m)
+                    @if($m->label === 'BP')
+                        <div class="text-sm text-nowrap">BP: {{round($m->sbp_mm_hg)}}/{{round($m->dbp_mm_hg)}} ({{date('m/d/Y', $m->ts/1000)}})</div>
+                    @elseif($m->label === 'Wt. (lbs.)')
+                        <div class="text-sm text-nowrap">Wt: {{round($m->value, 1)}} ({{date('m/d/Y', $m->ts/1000)}})</div>
+                    @endif
+                @endforeach
+            </div>
+        @endif
+    </div>
+
+    <?php
+    $allergies = \App\Models\Point::getPointsOfCategory($patient, "ALLERGY");
+    $medications = \App\Models\Point::getPointsOfCategory($patient, "MEDICATION");
+    $supplements = \App\Models\Point::getPointsOfCategory($patient, "SUPPLEMENT");
+    $problems = \App\Models\Point::getPointsOfCategory($patient, "PROBLEM");
+    $goals = \App\Models\Point::getPointsOfCategory($patient, "GOAL");
+    $prescriptions = $patient->prescriptionsCreatedInNote($note);
+    $tracker = \App\Models\Point::getGlobalSingletonOfCategory($patient, 'NO_KNOWN_TRACKER');
+    ?>
+    <div id="active-allergies"
+         class="p-2 border-bottom  ">
+        <div class="font-weight-bold mb-2">
+            Allergies
+            <i class="fa fa-bolt text-primary ml-1"></i>
+        </div>
+        @if($tracker && @($tracker->data->no_known_drug_allergies))
+            <div class="text-secondary mb-2"><span>No Known Drug Allergies</span></div>
+        @endif
+        @if($tracker && @($tracker->data->no_known_allergies_of_any_type))
+            <div class="text-secondary mb-2"><span>No Known Allergies of Any Type</span></div>
+        @endif
+        @if(!$tracker || !@($tracker->data->no_known_allergies_of_any_type))
+            @if($allergies && count($allergies))
+                @foreach($allergies as $allergy)
+                    <?php $rel = $allergy->relevanceToNote($note); ?>
+                    <div class="d-inline-flex align-items-baseline px-1 {{$rel ? 'bg-warning-mellow' : ''}}">
+                        <span class="mr-1">•</span>
+                        <span>{{$allergy->data->name}}</span>
+                    </div>
+                @endforeach
+            @else
+                <span class="px-1 text-secondary">-</span>
+            @endif
+        @endif
+    </div>
+    <div id="active-medications"
+         class="p-2 border-bottom  ">
+        <div class="font-weight-bold mb-2">
+            Medications
+            <i class="fa fa-bolt text-primary ml-1"></i>
+        </div>
+        @if($tracker && @($tracker->data->no_known_medications))
+            <div class="text-secondary mb-2"><span>-</span></div>
+        @endif
+        @if(!$tracker || !@($tracker->data->no_known_medications))
+            @if($medications && count($medications))
+                @foreach($medications as $medication)
+                    <?php $rel = $medication->relevanceToNote($note); ?>
+                    <div class="d-inline-flex align-items-baseline px-1 {{$rel ? 'bg-warning-mellow' : ''}}">
+                        <span class="mr-1">•</span>
+                        <span>{{$medication->data->name}}
+                        <?php
+                        if($medication->lastChildReview) {
+                            $review = json_decode($medication->lastChildReview->data);
+                            if(isset($review->value) && isset($review->experience)) {
+                                ?>
+                                <span class="text-dark text-sm ml-1">({{$review->value}})</span>
+                                <?php
+                            }
+                        }
+                        ?>
+                        </span>
+                    </div>
+                @endforeach
+            @else
+                <span class="px-1 text-secondary">-</span>
+            @endif
+        @endif
+    </div>
+    <div id="active-problems"
+         class="p-2 border-bottom  ">
+        <div class="font-weight-bold mb-2">
+            Problems
+            <i class="fa fa-bolt text-primary ml-1"></i>
+        </div>
+        @if($problems && count($problems))
+            <div class="dx-items">
+                @foreach($problems as $problem)
+                    <?php $rel = $problem->relevanceToNote($note); ?>
+                    <div class="d-inline-flex align-items-baseline px-1 {{$rel ? 'bg-warning-mellow' : ''}}">
+                        <span class="mr-1">•</span>
+                        <span class="dx-data font-underline c-pointer on-hover-aliceblue">
+                            <span class="dx-data-description">{{$problem->data->name}}</span>
+                            <span class="dx-data-code">{{$problem->data->icd}}</span>
+                        </span>
+                    </div>
+                @endforeach
+                <div class="d-flex align-items-center">
+                    <button class="btn btn-sm btn-primary mt-2 dx-add-all text-sm">Apply</button>
+                    <button class="btn btn-sm btn-primary mt-2 dx-add-all text-sm ml-2" save>Apply &amp; Save</button>
+                </div>
+            </div>
+        @else
+            <span class="px-1 text-secondary">-</span>
+        @endif
+    </div>
+    <div id="active-goals"
+         class="p-2 border-bottom  ">
+        <div class="font-weight-bold mb-2">
+            Goals
+            <i class="fa fa-bolt text-primary ml-1"></i>
+        </div>
+        @if($goals && count($goals))
+            @foreach($goals as $goal)
+                <?php $rel = $goal->relevanceToNote($note); ?>
+                <div class="d-inline-flex align-items-baseline px-1 {{$rel ? 'bg-warning-mellow' : ''}}">
+                    <span class="mr-1">•</span>
+                    <span>{{$goal->data->goal}}</span>
+                </div>
+            @endforeach
+        @else
+            <span class="px-1 text-secondary">-</span>
+        @endif
+    </div>
+    <div id="active-careteam"
+         class="p-2 border-bottom  ">
+        <div class="font-weight-bold">
+            Care Team
+            <i class="fa fa-external-link-alt text-primary ml-1"></i>
+        </div>
+    </div>
+    <div id="note-prescriptions" class="p-2 border-bottom  ">
+        <div class="font-weight-bold">
+            ERx &amp; Orders
+        </div>
+        @if($prescriptions && count($prescriptions))
+            @foreach($prescriptions as $prescription)
+                <div class="d-flex align-items-baseline px-1 pt-2">
+                    <span class="mr-2 text-secondary text-sm font-weight-bold">{{$prescription->erx_category}}</span>
+                    <?php $parsed = json_decode($prescription->clinical_detail_json) ?>
+                    <span class="flex-grow-1">
+                        <?php
+                        switch($prescription->erx_category) {
+                            case 'DRUG':
+                                if(@$parsed && @$parsed->items) {
+                                    foreach ($parsed->items as $item) {
+                                        echo '<div>' . $item->medication . '</div>';
+                                    }
+                                }
+                                break;
+                            case 'LAB':
+                            case 'IMAGING':
+                                if(@$parsed && @$parsed->items) {
+                                    foreach ($parsed->items as $item) {
+                                        if(@$item->tests) {
+                                            foreach ($item->tests as $test) {
+                                                echo '<div>' . $test->desc . '</div>';
+                                            }
+                                        }
+                                    }
+                                }
+                                break;
+                        }
+                        ?>
+                    </span>
+                </div>
+            @endforeach
+        @endif
+    </div>
+
+</div>

+ 3 - 1
resources/views/app/patient/note/rhs-sidebar.blade.php

@@ -146,7 +146,9 @@
                 <?php $rel = $problem->relevanceToNote($note); ?>
                 <div class="d-inline-flex align-items-baseline px-1 {{$rel ? 'bg-warning-mellow' : ''}}">
                     <span class="mr-1">•</span>
-                    <span>{{$problem->data->name}}</span>
+                    <span>{{$problem->data->name}}
+                    	{{$problem->data->icd}}
+			</span>
                 </div>
             @endforeach
         @else

+ 17 - 17
resources/views/app/patient/segment-templates/omega_problems/summary.blade.php

@@ -17,24 +17,24 @@ $plural = 'Problems';
         <?php $rel = $point->relevanceToNote($note); ?>
        <div>
             <span class="">
-                <span class="font-weight-bold" <?= $point->is_removed ? 'strike-through' : '' ?> grow-till-300px" >
-                    <?= !!@($point->data->name) ? @($point->data->name) : '-' ?>:
+                <span class="font-weight-bold <?= $point->is_removed ? 'strike-through' : '' ?> grow-till-300px" >
+                    <?= !!@($point->data->name) ? @($point->data->name) : '-' ?><?= !!@($point->data->icd) ? ' / ' . @($point->data->icd) : '' ?>:
+                </span>
+		        <span class="text-nowrap">
+                   <?php if ($point->is_removed): ?>
+                   @if($point->removal_reason_category === 'DURING_VISIT')
+                       <span class="text-sm text-secondary">Removed during visit</span>
+                   @elseif($point->removal_reason_category === 'ON_INTAKE')
+                       <span class="text-sm text-secondary">Removed on intake</span>
+                   @endif
+                   <?php elseif ($point->added_in_note_id === $note->id): ?>
+                   <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>
+                            <span class="text-sm text-success">* Added during visit</span>
+                        <?php else: ?>
+                            <span class="text-sm text-info">* Added on intake</span>
+                        <?php endif;?>
+                   <?php endif; ?>
                 </span>
-		<span class="text-nowrap">
-                       <?php if ($point->is_removed): ?>
-                       @if($point->removal_reason_category === 'DURING_VISIT')
-                           <span class="text-sm text-secondary">Removed during visit</span>
-                       @elseif($point->removal_reason_category === 'ON_INTAKE')
-                           <span class="text-sm text-secondary">Removed on intake</span>
-                       @endif
-                       <?php elseif ($point->added_in_note_id === $note->id): ?>
-                       <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>
-                                <span class="text-sm text-success">* Added during visit</span>
-                            <?php else: ?>
-                                <span class="text-sm text-info">* Added on intake</span>
-                            <?php endif;?>
-                       <?php endif; ?>
-                    </span>
             </span>
            <div class="ml-3 mb-1">
                    <?php $review = $point->childReviewAddedInNote($note); ?>

+ 14 - 7
resources/views/app/practice-management/_sort_header.blade.php

@@ -1,7 +1,14 @@
-<a href="{{ $route }}?{{queryLineExcept(['sort_by', 'sort_dir'])}}&sort_by={{$key}}&sort_dir={{request()->input('sort_by') === $key && request()->input('sort_dir') === 'ASC' ? 'DESC' : 'ASC'}}" class="ml-1 text-decoration-none">
-    <b class="{{request()->input('sort_by') === $key ? 'text-primary' : 'text-secondary'}}">{{$label}}</b>
-    <span class="ml-2 d-inline-flex align-items-baseline">
-        <i class="text-sm fa fa-chevron-up {{request()->input('sort_by') === $key && request()->input('sort_dir') === 'DESC' ? '' : 'on-hover-opaque text-secondary'}}"></i>
-        <i class="ml-1 text-sm fa fa-chevron-down {{request()->input('sort_by') === $key && request()->input('sort_dir') === 'ASC' ? '' : 'on-hover-opaque text-secondary'}}"></i>
-    </span>
-</a>
+<div class="d-flex align-items-baseline flex-wrap">
+    <a href="{{ $route }}?{{queryLineExcept(['sort_by', 'sort_dir'])}}&sort_by={{$key}}&sort_dir={{request()->input('sort_by') === $key && request()->input('sort_dir') === 'ASC' ? 'DESC' : 'ASC'}}" class="text-decoration-none">
+        <b class="{{request()->input('sort_by') === $key ? 'text-primary' : 'text-secondary'}}">{{$label}}</b>
+        <span class="ml-1 d-inline-flex align-items-baseline">
+            <i class="text-sm fa fa-chevron-up {{request()->input('sort_by') === $key && request()->input('sort_dir') === 'DESC' ? '' : 'on-hover-opaque text-secondary'}}"></i>
+            <i class="ml-1 text-sm fa fa-chevron-down {{request()->input('sort_by') === $key && request()->input('sort_dir') === 'ASC' ? '' : 'on-hover-opaque text-secondary'}}"></i>
+        </span>
+    </a>
+    @if(request()->input('sort_by') === $key)
+        <a href="{{ $route }}?{{queryLineExcept(['sort_by', 'sort_dir'])}}" class="text-sm on-hover-opaque text-secondary ml-1">
+            <i class="fa fa-times"></i>
+        </a>
+    @endif
+</div>

+ 56 - 3
resources/views/app/practice-management/notes-resolution-center-v2.blade.php

@@ -9,9 +9,9 @@
 
     <div id="notes-resolution-center" class="px-3 pt-3 mcp-theme-1" v-cloak>
 
-        <div class="d-flex align-items-baseline">
-            <h6 class="font-size-16 font-weight-bold text-secondary mb-3">Notes Resolution Center</h6>
-            <form class="ml-5 d-inline-flex align-items-center" action="{{route('practice-management.notes-resolution-center-v2')}}" method="GET">
+        <div class="d-flex align-items-baseline mb-3">
+            <h6 class="font-size-16 font-weight-bold text-secondary my-0 mr-4">Notes Resolution Center</h6>
+            <!--<form class="ml-5 d-inline-flex align-items-center" action="{{route('practice-management.notes-resolution-center-v2')}}" method="GET">
                 <span class="">Farah:</span>
                 <select name="f" class="form-control form-control-sm min-width-unset max-width-110px ml-2"
                         onchange="fastLoad('{{route('practice-management.notes-resolution-center-v2')}}?' + $(this).closest('form').serialize()); return false;">
@@ -26,6 +26,59 @@
                     <option {{ request()->input('s') === 'green' ? 'selected' : '' }} value="green">Green</option>
                     <option {{ request()->input('s') === 'red' ? 'selected' : '' }} value="red">Red</option>
                 </select>
+            </form>-->
+            <form class="d-inline-flex flex-grow-1 align-items-stretch" onsubmit="return fastLoad('{{route('practice-management.notes-resolution-center-v2')}}?' + $(this).serialize());">
+
+                <div class="d-inline-flex align-items-baseline mr-2">
+                    <label class="text-nowrap mb-0 text-sm mr-1 {{request()->input('f_pb_primary') && request()->input('f_pb_primary') !== 'any' ? 'text-info' : 'text-secondary'}}">PB Primary?</label>
+                    <div class="d-flex align-items-start">
+                        <select name="f_pb_primary" class="mr-2 form-control form-control-sm min-width-unset width-70px pl-0">
+                            <option {{!request()->input('f_pb_primary') || request()->input('f_pb_primary') === 'any' ? 'selected' : ''}} value="any">All</option>
+                            <option {{request()->input('f_pb_primary') === 'yes' ? 'selected' : ''}} value="yes">Yes</option>
+                            <option {{request()->input('f_pb_primary') === 'no' ? 'selected' : ''}} value="no">No</option>
+                        </select>
+                    </div>
+                </div>
+
+                <div class="d-inline-flex align-items-baseline mr-2">
+                    <label class="text-nowrap mb-0 text-sm mr-1 {{request()->input('f_deductible_zero') && request()->input('f_deductible_zero') !== 'any' ? 'text-info' : 'text-secondary'}}">Deductible 0?</label>
+                    <div class="d-flex align-items-start">
+                        <select name="f_deductible_zero" class="mr-2 form-control form-control-sm min-width-unset width-70px pl-0">
+                            <option {{!request()->input('f_deductible_zero') || request()->input('f_deductible_zero') === 'any' ? 'selected' : ''}} value="any">All</option>
+                            <option {{request()->input('f_deductible_zero') === 'yes' ? 'selected' : ''}} value="yes">Yes</option>
+                            <option {{request()->input('f_deductible_zero') === 'no' ? 'selected' : ''}} value="no">No</option>
+                        </select>
+                    </div>
+                </div>
+
+                <div class="d-inline-flex align-items-baseline mr-2">
+                    <label class="text-nowrap mb-0 text-sm mr-1 {{request()->input('f_note_hcp') ? 'text-info' : 'text-secondary'}}">Note HCP:</label>
+                    <select name="f_note_hcp" class="form-control form-control-sm min-width-unset max-width-110px" provider-search provider-type="hcp" data-pro-uid="{{request()->input('f_note_hcp')}}">
+                        <option value="">--select--</option>
+                    </select>
+                </div>
+
+                <div class="d-inline-flex align-items-baseline mr-2">
+                    <label class="text-nowrap mb-0 text-sm mr-1 {{request()->input('f_2022_patient') && request()->input('f_2022_patient') !== 'any' ? 'text-info' : 'text-secondary'}}">2022 Pt.?</label>
+                    <div class="d-flex align-items-start">
+                        <select name="f_2022_patient" class="mr-2 form-control form-control-sm min-width-unset width-70px pl-0">
+                            <option {{!request()->input('f_2022_patient') || request()->input('f_2022_patient') === 'any' ? 'selected' : ''}} value="any">All</option>
+                            <option {{request()->input('f_2022_patient') === 'yes' ? 'selected' : ''}} value="yes">Yes</option>
+                            <option {{request()->input('f_2022_patient') === 'no' ? 'selected' : ''}} value="no">No</option>
+                        </select>
+                    </div>
+                </div>
+
+                <div class="d-flex align-items-start">
+                    <button type="button" class="btn-apply btn btn-sm btn-primary mr-2"
+                            onclick="return fastLoad('{{route('practice-management.notes-resolution-center-v2')}}?' + $(this).closest('form').serialize());">
+                        <i class="fa fa-check"></i>
+                    </button>
+                    <button type="button" class="btn-reset btn btn-sm btn-default bg-white text-secondary border"
+                            onclick="return fastLoad('{{route('practice-management.notes-resolution-center-v2')}}');">
+                        <i class="fa fa-times"></i>
+                    </button>
+                </div>
             </form>
         </div>
 

+ 5 - 3
resources/views/app/practice-management/processing-bill-matrix.blade.php

@@ -140,13 +140,15 @@
                                 {{$row->hcp->name_last}}, {{$row->hcp->name_first}}
                                 <div class="mt-1 text-sm text-secondary">
                                     <i class="fa fa-hospital mr-1"></i>
-                                    {{$row->hcpCompany? $row->hcpCompanyPro->company->name:''}}
+                                    {{$row->hcpCompanyPro ? $row->hcpCompanyPro->company->name:''}}
                                 </div>
                                 @elseif(request()->input('t') === 'na')
                                 {{$row->genericPro->name_last}}, {{$row->genericPro->name_first}}
                                 <div class="mt-1 text-sm text-secondary">
                                     <i class="fa fa-hospital mr-1"></i>
-                                    {{$row->genericCompanyPro->company->name}}
+                                    @if($row->genericCompanyPro && $row->genericCompanyPro->company)
+                                        {{$row->genericCompanyPro->company->name}}
+                                    @endif
                                 </div>
                                 @endif
 
@@ -293,4 +295,4 @@
         addMCInitializer('processing-bill-matrix', init, '#processing-bill-matrix');
     }).call(window);
 </script>
-@endsection
+@endsection

+ 195 - 144
resources/views/app/practice-management/remote-monitoring-row-markup-by-pro-type.blade.php

@@ -1,3 +1,10 @@
+@if($mode === 'mcp')
+    <?php $strategy = 'X16_DAYS_20_MINS_ON_OWN_MCP_COM_DURING_CM'; // $pro->mcp_rpm_payment_strategy; ?>
+@elseif($mode === 'rmm')
+    <?php $strategy = 'X16_DAYS_20_MINS_ON_OWN_MCP_COM_DURING_CM'; // $pro->rmm_payment_strategy; ?>
+@elseif($mode === 'rmm')
+    <?php $strategy = 'X16_DAYS'; // $pro->rme_payment_strategy; ?>
+@endif
 <tr data-client-uid="{{$iPatient->client_uid}}" data-care-month-uid="{{$iPatient->care_month_uid}}">
     <td class="pl-2">
         <a href="/patients/view/{{ $iPatient->client_uid }}/care-months/view/{{$iPatient->care_month_uid}}" class="text-nowrap"
@@ -11,7 +18,7 @@
     </td>
 
     <td>{{friendly_date($iPatient->dob)}}</td>
-    <td>{!! $iPatient->is_enrolled_in_rm === 'YES' ? '<i class="fa fa-check text-success"></i>' : 'No' !!}</td>
+    {{--<td>{!! $iPatient->is_enrolled_in_rm === 'YES' ? '<i class="fa fa-check text-success"></i>' : 'No' !!}</td>--}}
     <td>{!! $iPatient->is_assigned_cellular_bp_device ? '<i class="fa fa-check text-success"></i>' : 'No' !!}</td>
     <td>{!! $iPatient->is_assigned_cellular_weight_scale_device ? '<i class="fa fa-check text-success"></i>' : 'No' !!}</td>
     <td>
@@ -46,59 +53,61 @@
                 <div class="d-flex align-items-baseline">
                     <i class="mr-1 text-sm fa {{$iPatient->has_mcp_interacted_with_client_about_rm ? 'fa-check text-success' : 'fa-exclamation-triangle text-danger on-hover-opaque'}}"></i>
                     <span class="sort-data">{{$iPatient->has_mcp_interacted_with_client_about_rm ? 'Yes' : 'No'}}</span>
-                    @if($mode === 'mcp')
-                        <div moe large relative class="ml-2">
-                            <a start show class="py-0 mb-3 text-sm">Entry</a>
-                            <form url="/api/careMonthEntry/createForRm" right hook="refresh-rpm-row-{{$trIndex}}">
-                                <input type="hidden" name="careMonthUid" value="{{ $iPatient->care_month_uid }}">
-                                <input type="hidden" name="proUid" value="{{ $pro->uid }}">
-                                <div class="mb-2">
-                                    <div class="row">
-                                        <div class="col-6 pr-0">
-                                            <?php
-                                            $sD = strtotime($rcmStartDate);
-                                            $y = date('Y', $sD);
-                                            $m0 = date('m', $sD);
-                                            $d = date('t', $sD);
-                                            $defaultED = $sD >= strtotime(date('Y-m-d')) ? date('Y-m-d') : $rcmStartDate;
-                                            ?>
-                                            <label class="text-sm text-secondary mb-1">Effective Date</label>
-                                            <input autofocus type="date" min="{{ date($y . '-' . $m0 . '-01') }}" max="{{ date($y . '-' . $m0 . '-' . $d) }}"
-                                                   value="{{$defaultED}}"
-                                                   class="form-control form-control-sm w-100" name="effectiveDate"
-                                                   placeholder="Effective Date" required>
+                    @if(!request()->input('not-enrolled'))
+                        @if($mode === 'mcp')
+                            <div moe large relative class="ml-2">
+                                <a start show class="py-0 mb-3 text-sm">Entry</a>
+                                <form url="/api/careMonthEntry/createForRm" right hook="refresh-rpm-row-{{$trIndex}}">
+                                    <input type="hidden" name="careMonthUid" value="{{ $iPatient->care_month_uid }}">
+                                    <input type="hidden" name="proUid" value="{{ $pro->uid }}">
+                                    <div class="mb-2">
+                                        <div class="row">
+                                            <div class="col-6 pr-0">
+                                                <?php
+                                                $sD = strtotime($rcmStartDate);
+                                                $y = date('Y', $sD);
+                                                $m0 = date('m', $sD);
+                                                $d = date('t', $sD);
+                                                $defaultED = $sD >= strtotime(date('Y-m-d')) ? date('Y-m-d') : $rcmStartDate;
+                                                ?>
+                                                <label class="text-sm text-secondary mb-1">Effective Date</label>
+                                                <input autofocus type="date" min="{{ date($y . '-' . $m0 . '-01') }}" max="{{ date($y . '-' . $m0 . '-' . $d) }}"
+                                                       value="{{$defaultED}}"
+                                                       class="form-control form-control-sm w-100" name="effectiveDate"
+                                                       placeholder="Effective Date" required>
+                                            </div>
+                                            <div class="col-6">
+                                                <label class="text-sm text-secondary mb-1">Seconds</label>
+                                                <input type="number" min="75" max="300" class="form-control form-control-sm w-100 cm-time-value" name="timeInSeconds"
+                                                       value="75" placeholder="Time (secs.)" required>
+                                            </div>
                                         </div>
-                                        <div class="col-6">
-                                            <label class="text-sm text-secondary mb-1">Seconds</label>
-                                            <input type="number" min="75" max="300" class="form-control form-control-sm w-100 cm-time-value" name="timeInSeconds"
-                                                   value="75" placeholder="Time (secs.)" required>
+                                    </div>
+                                    <div class="mb-2 border border-info p-2 mt-2 bg-light">
+                                        <span>I have had interactive communication with <b>{{$iPatient->client_name}}</b>.</span>
+                                        <div class="d-flex border-top mt-2">
+                                            <label class="mt-2 mb-0 d-inline-flex align-items-center mr-3">
+                                                <input type="radio" class="mr-2" name="didProInteractWithClientAboutRm" value="true" required>
+                                                <span>Yes</span>
+                                            </label>
+                                            <label class="mt-2 mb-0 d-inline-flex align-items-center">
+                                                <input type="radio" class="mr-2" name="didProInteractWithClientAboutRm" value="false" required>
+                                                <span>No</span>
+                                            </label>
                                         </div>
                                     </div>
-                                </div>
-                                <div class="mb-2 border border-info p-2 mt-2 bg-light">
-                                    <span>I have had interactive communication with <b>{{$iPatient->client_name}}</b>.</span>
-                                    <div class="d-flex border-top mt-2">
-                                        <label class="mt-2 mb-0 d-inline-flex align-items-center mr-3">
-                                            <input type="radio" class="mr-2" name="didProInteractWithClientAboutRm" value="true" required>
-                                            <span>Yes</span>
-                                        </label>
-                                        <label class="mt-2 mb-0 d-inline-flex align-items-center">
-                                            <input type="radio" class="mr-2" name="didProInteractWithClientAboutRm" value="false" required>
-                                            <span>No</span>
-                                        </label>
+                                    <div class="mb-2">
+                                        <label class="text-sm text-secondary mb-1">Memo</label>
+                                        <textarea class="form-control form-control-sm w-100" name="contentText"
+                                                  required>Interacted with the patient</textarea>
                                     </div>
-                                </div>
-                                <div class="mb-2">
-                                    <label class="text-sm text-secondary mb-1">Memo</label>
-                                    <textarea class="form-control form-control-sm w-100" name="contentText"
-                                              required>Interacted with the patient</textarea>
-                                </div>
-                                <div class="d-flex align-items-center">
-                                    <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                                    <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                </div>
-                            </form>
-                        </div>
+                                    <div class="d-flex align-items-center">
+                                        <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
+                                        <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
+                                    </div>
+                                </form>
+                            </div>
+                        @endif
                     @endif
                 </div>
             </td>
@@ -107,26 +116,28 @@
             <div class="d-flex align-items-baseline">
                 <i class="mr-1 text-sm fa {{$iPatient->number_of_days_with_remote_measurements >= 16 ? 'fa-check text-success' : 'fa-exclamation-triangle text-danger on-hover-opaque'}}"></i>
                 <span class="sort-data">{{$iPatient->number_of_days_with_remote_measurements ?: 0}}</span>
-                @if($iPatient->number_of_days_with_remote_measurements < 16)
-                    <div moe relative class="ml-2">
-                        <a href="#" start show class="text-sm">SMS</a>
-                        <form url="/api/clientSms/createOutgoing" right="" class="mcp-theme-1" noreload="" style="display: none;">
-                            <input type="hidden" name="uid" value="{{ $iPatient->client_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="cellNumber" value="{{$iPatient->cell_number}}">
-                            </div>
-                            <div class="mb-2">
-                                <label for="" class="text-sm text-secondary mb-1">Message</label>
-                                <textarea rows="5" class="form-control form-control-sm" name="message">Hi! This is {{$pro->displayName(true)}}, from Cardio 1st. Please check your blood pressure.</textarea>
-                            </div>
-                            <div class="d-flex align-items-center">
-                                <button class="btn btn-sm btn-primary mr-2" submit="">Send</button>
-                                <button class="btn btn-sm btn-default mr-2 border" cancel="">Cancel</button>
-                            </div>
-                        </form>
-                    </div>
-                @endif
+                {{--@if(!request()->input('not-enrolled'))
+                    @if($iPatient->number_of_days_with_remote_measurements < 16)
+                        <div moe relative class="ml-2">
+                            <a href="#" start show class="text-sm">SMS</a>
+                            <form url="/api/clientSms/createOutgoing" right="" class="mcp-theme-1" noreload="" style="display: none;">
+                                <input type="hidden" name="uid" value="{{ $iPatient->client_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="cellNumber" value="{{$iPatient->cell_number}}">
+                                </div>
+                                <div class="mb-2">
+                                    <label for="" class="text-sm text-secondary mb-1">Message</label>
+                                    <textarea rows="5" class="form-control form-control-sm" name="message">Hi! This is {{$pro->displayName(true)}}, from Cardio 1st. Please check your blood pressure.</textarea>
+                                </div>
+                                <div class="d-flex align-items-center">
+                                    <button class="btn btn-sm btn-primary mr-2" submit="">Send</button>
+                                    <button class="btn btn-sm btn-default mr-2 border" cancel="">Cancel</button>
+                                </div>
+                            </form>
+                        </div>
+                    @endif
+                @endif--}}
             </div>
         </td>
         @if($strategy === 'X16_DAYS_20_MINS_ON_OWN_MCP_COM_DURING_CM')
@@ -134,31 +145,35 @@
                 <div class="d-flex align-items-baseline">
                     @if($mode === 'mcp')
                         <span class="sort-data">{{$iPatient->rm_num_measurements_not_stamped_by_mcp}}</span>
-                        @if($iPatient->rm_num_measurements_not_stamped_by_mcp)
-                            <a href="{{ route('practice-management.rpm_work_matrix') }}?patientUid={{$iPatient->client_uid}}&careMonthUid={{$iPatient->care_month_uid}}"
-                               native target="_blank"
-                               open-in-stag-popup
-                               update-parent="refresh-rpm-row-{{$trIndex}}"
-                               popup-style="tall overflow-visible"
-                               class="ml-2 text-sm"
-                               mc-initer="rpm-work-matrix"
-                               title="RPM Work Matrix">
-                                View
-                            </a>
+                        @if(!request()->input('not-enrolled'))
+                            @if($iPatient->rm_num_measurements_not_stamped_by_mcp)
+                                <a href="{{ route('practice-management.rpm_work_matrix') }}?patientUid={{$iPatient->client_uid}}&careMonthUid={{$iPatient->care_month_uid}}"
+                                   native target="_blank"
+                                   open-in-stag-popup
+                                   update-parent="refresh-rpm-row-{{$trIndex}}"
+                                   popup-style="tall overflow-visible"
+                                   class="ml-2 text-sm"
+                                   mc-initer="rpm-work-matrix"
+                                   title="RPM Work Matrix">
+                                    View
+                                </a>
+                            @endif
                         @endif
                     @elseif($mode === 'rmm')
                         <span class="sort-data">{{$iPatient->rm_num_measurements_not_stamped_by_rmm}}</span>
-                        @if($iPatient->rm_num_measurements_not_stamped_by_rmm)
-                            <a href="{{ route('practice-management.rpm_work_matrix') }}?patientUid={{$iPatient->client_uid}}&careMonthUid={{$iPatient->care_month_uid}}"
-                               native target="_blank"
-                               open-in-stag-popup
-                               update-parent="refresh-rpm-row-{{$trIndex}}"
-                               popup-style="tall overflow-visible"
-                               class="ml-2 text-sm"
-                               mc-initer="rpm-work-matrix"
-                               title="RPM Work Matrix">
-                                View
-                            </a>
+                        @if(!request()->input('not-enrolled'))
+                            @if($iPatient->rm_num_measurements_not_stamped_by_rmm)
+                                <a href="{{ route('practice-management.rpm_work_matrix') }}?patientUid={{$iPatient->client_uid}}&careMonthUid={{$iPatient->care_month_uid}}"
+                                   native target="_blank"
+                                   open-in-stag-popup
+                                   update-parent="refresh-rpm-row-{{$trIndex}}"
+                                   popup-style="tall overflow-visible"
+                                   class="ml-2 text-sm"
+                                   mc-initer="rpm-work-matrix"
+                                   title="RPM Work Matrix">
+                                    View
+                                </a>
+                            @endif
                         @endif
                     @endif
                 </div>
@@ -169,26 +184,28 @@
             <div class="d-flex align-items-baseline">
                 <i class="mr-1 text-sm fa {{$iPatient->number_of_days_with_remote_measurements >= 16 ? 'fa-check text-success' : 'fa-exclamation-triangle text-danger on-hover-opaque'}}"></i>
                 <span class="sort-data">{{$iPatient->number_of_days_with_remote_measurements ?: 0}}</span>
-                @if($iPatient->number_of_days_with_remote_measurements < 16)
-                    <div moe relative class="ml-2">
-                        <a href="#" start show class="text-sm">SMS</a>
-                        <form url="/api/clientSms/createOutgoing" right="" class="mcp-theme-1" noreload="" style="display: none;">
-                            <input type="hidden" name="uid" value="{{ $iPatient->client_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="cellNumber" value="{{$iPatient->cell_number}}">
-                            </div>
-                            <div class="mb-2">
-                                <label for="" class="text-sm text-secondary mb-1">Message</label>
-                                <textarea rows="5" class="form-control form-control-sm" name="message">Hi! This is {{$pro->displayName(true)}}, from Cardio 1st. Please check your blood pressure.</textarea>
-                            </div>
-                            <div class="d-flex align-items-center">
-                                <button class="btn btn-sm btn-primary mr-2" submit="">Send</button>
-                                <button class="btn btn-sm btn-default mr-2 border" cancel="">Cancel</button>
-                            </div>
-                        </form>
-                    </div>
-                @endif
+                {{--@if(!request()->input('not-enrolled'))
+                    @if($iPatient->number_of_days_with_remote_measurements < 16)
+                        <div moe relative class="ml-2">
+                            <a href="#" start show class="text-sm">SMS</a>
+                            <form url="/api/clientSms/createOutgoing" right="" class="mcp-theme-1" noreload="" style="display: none;">
+                                <input type="hidden" name="uid" value="{{ $iPatient->client_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="cellNumber" value="{{$iPatient->cell_number}}">
+                                </div>
+                                <div class="mb-2">
+                                    <label for="" class="text-sm text-secondary mb-1">Message</label>
+                                    <textarea rows="5" class="form-control form-control-sm" name="message">Hi! This is {{$pro->displayName(true)}}, from Cardio 1st. Please check your blood pressure.</textarea>
+                                </div>
+                                <div class="d-flex align-items-center">
+                                    <button class="btn btn-sm btn-primary mr-2" submit="">Send</button>
+                                    <button class="btn btn-sm btn-default mr-2 border" cancel="">Cancel</button>
+                                </div>
+                            </form>
+                        </div>
+                    @endif
+                @endif--}}
             </div>
         </td>
     @endif
@@ -213,76 +230,110 @@
             </div>
         @endif
     </td>
+    @if(!request()->input('not-enrolled'))
     <td>
         @if($mode === 'mcp')
-            @if($iPatient->mcp_rm_generic_bill_id)
+            @if($lastVisitWithin90Days && $iPatient->has_mcp_interacted_with_client_about_rm && $iPatient->number_of_days_with_remote_measurements >= 16 && $iPatient->rm_total_time_in_seconds_by_mcp >= 1200)
                 <span class="text-success font-weight-bold">
                     <i class="fa fa-check"></i>
-                    Yes
+                    ${{friendly_money($pro->mcp_rpm_payment_amount, 0)}}
                 </span>
-                (${{friendly_money($iPatient->mcp_rm_generic_bill_expected_payment_amount)}})
-                @if($iPatient->mcp_rm_generic_bill_signed)
-                    <div moe relative
-                         class="d-inline-block {{ $iPatient->mcp_rm_generic_bill_generic_pro_id !== $pro->id ? 'moe-disabled' : '' }}"
-                         title="{{ $iPatient->mcp_rm_generic_bill_generic_pro_id !== $pro->id ? 'Only the bill\'s pro can sign' : '' }}">
-                        <a class="font-weight-bold" href="" show start>Sign</a>
-                        <form url="/api/bill/signAsGenericPro" right>
-                            <input type="hidden" name="uid" value="{{$iPatient->mcp_rm_generic_bill_uid}}">
-                            <p>Sign this bill?</p>
+                {{--
+                @if($iPatient->mcp_rm_generic_bill_uid)
+                    ${{friendly_money($iPatient->mcp_rm_generic_bill_expected_payment_amount)}}
+                    @if($iPatient->mcp_rm_generic_bill_signed)
+                        <div moe relative
+                             class="d-inline-block {{ $iPatient->mcp_rm_generic_bill_generic_pro_id !== $pro->id ? 'moe-disabled' : '' }}"
+                             title="{{ $iPatient->mcp_rm_generic_bill_generic_pro_id !== $pro->id ? 'Only the bill\'s pro can sign' : '' }}">
+                            <a class="font-weight-bold" href="" show start>Sign</a>
+                            <form url="/api/bill/signAsGenericPro" right>
+                                <input type="hidden" name="uid" value="{{$iPatient->mcp_rm_generic_bill_uid}}">
+                                <p>Sign this bill?</p>
+                                <div class="mb-0">
+                                    <button class="btn btn-success btn-sm" submit>Sign</button>
+                                    <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                                </div>
+                            </form>
+                        </div>
+                    @else
+                        <span class="text-success">Signed</span>
+                    @endif
+                @else
+                    <div moe relative class="d-inline-block">
+                        <a class="font-weight-bold" href="" show start>Bill</a>
+                        <form url="/api/careMonth/generateRmGenericBillForMcpAndAutoSign" right>
+                            <input type="hidden" name="uid" value="{{$iPatient->care_month_uid}}">
+                            <p>Bill for this care month and sign it?</p>
                             <div class="mb-0">
-                                <button class="btn btn-success btn-sm" submit>Sign</button>
+                                <button class="btn btn-success btn-sm" submit>Bill &amp; Sign</button>
                                 <button class="btn btn-default border btn-sm" cancel>Cancel</button>
                             </div>
                         </form>
                     </div>
-                @else
-                    <span class="text-success">Signed</span>
                 @endif
+                --}}
             @else
                 <span class="text-danger font-weight-normal">
-                    Not yet
+                    No
                 </span>
             @endif
         @elseif($mode === 'rmm')
-            @if($iPatient->rmm_rm_generic_bill_id)
+            @if($lastVisitWithin90Days && $iPatient->has_mcp_interacted_with_client_about_rm && $iPatient->number_of_days_with_remote_measurements >= 16 && $iPatient->rm_total_time_in_seconds_by_rmm_pro >= 1200)
                 <span class="text-success font-weight-bold">
                     <i class="fa fa-check"></i>
-                    Yes
                 </span>
-                (${{friendly_money($iPatient->rmm_rm_generic_bill_expected_payment_amount)}})
-                @if($iPatient->rmm_rm_generic_bill_signed)
-                    <div moe relative
-                         class="d-inline-block {{ $iPatient->rmm_rm_generic_bill_generic_pro_id !== $pro->id ? 'moe-disabled' : '' }}"
-                         title="{{ $iPatient->rmm_rm_generic_bill_generic_pro_id !== $pro->id ? 'Only the bill\'s pro can sign' : '' }}">
-                        <a class="font-weight-bold" href="" show start>Sign</a>
-                        <form url="/api/bill/signAsGenericPro" right>
-                            <input type="hidden" name="uid" value="{{$iPatient->rmm_rm_generic_bill_uid}}">
-                            <p>Sign this bill?</p>
+                ${{friendly_money($pro->rmm_payment_amount, 0)}}
+                {{--
+                @if($iPatient->rmm_rm_generic_bill_uid)
+                    ${{friendly_money($iPatient->rmm_rm_generic_bill_expected_payment_amount)}}
+                    @if($iPatient->rmm_rm_generic_bill_signed)
+                        <div moe relative
+                             class="d-inline-block {{ $iPatient->rmm_rm_generic_bill_generic_pro_id !== $pro->id ? 'moe-disabled' : '' }}"
+                             title="{{ $iPatient->rmm_rm_generic_bill_generic_pro_id !== $pro->id ? 'Only the bill\'s pro can sign' : '' }}">
+                            <a class="font-weight-bold" href="" show start>Sign</a>
+                            <form url="/api/bill/signAsGenericPro" right>
+                                <input type="hidden" name="uid" value="{{$iPatient->rmm_rm_generic_bill_uid}}">
+                                <p>Sign this bill?</p>
+                                <div class="mb-0">
+                                    <button class="btn btn-success btn-sm" submit>Sign</button>
+                                    <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                                </div>
+                            </form>
+                        </div>
+                    @else
+                        <span class="text-success">Signed</span>
+                    @endif
+                @else
+                    <div moe relative class="d-inline-block">
+                        <a class="font-weight-bold" href="" show start>Bill</a>
+                        <form url="/api/careMonth/generateRmGenericBillForRmmAndAutoSign" right>
+                            <input type="hidden" name="uid" value="{{$iPatient->care_month_uid}}">
+                            <p>Bill for this care month and sign it?</p>
                             <div class="mb-0">
-                                <button class="btn btn-success btn-sm" submit>Sign</button>
+                                <button class="btn btn-success btn-sm" submit>Bill &amp; Sign</button>
                                 <button class="btn btn-default border btn-sm" cancel>Cancel</button>
                             </div>
                         </form>
                     </div>
-                @else
-                    <span class="text-success">Signed</span>
                 @endif
+                --}}
             @else
                 <span class="text-danger font-weight-normal">
-                    Not yet
+                    No
                 </span>
             @endif
         @elseif($mode === 'rme')
             @if($lastVisitWithin90Days && $iPatient->number_of_days_with_remote_measurements >= 16)
                 <span class="text-success font-weight-bold">
                     <i class="fa fa-check"></i>
-                    Yes
                 </span>
+                ${{friendly_money($pro->rme_payment_amount, 0)}}
             @else
                 <span class="text-danger font-weight-normal">
-                    Not yet
+                    No
                 </span>
             @endif
         @endif
     </td>
+    @endif
 </tr>

+ 98 - 0
resources/views/app/practice-management/rpm-matrix-by-pro-type-table.blade.php

@@ -0,0 +1,98 @@
+<div class="d-flex align-items-stretch m-0 h-100">
+    {{--<div class="overflow-auto border-right h-100 rpm-matrix-left-column">
+        @include('app.stat-tree.summary', ['slug' => 'rm-tree-' . $mode, 'showForPro' => $pro, 'noDropVisualize' => true, 'stParams' => ['start_date' => $rcmStartDate]])
+    </div>--}}
+    <div class="flex-grow-1 px-0 overflow-auto h-100 rpm-matrix-right-column">
+        <?php $trIndex = 0; ?>
+        @if(!request()->input('not-enrolled'))
+            @foreach ($patients as $iPatient)
+                <script>
+                    addMCHook(
+                        'refresh-rpm-row-{{$trIndex}}',
+                        function () {
+                            refreshRpmRow({{$trIndex}});
+                        }
+                    );
+                </script>
+                <?php $trIndex++; ?>
+            @endforeach
+        @endif
+        <table class="table table-sm table-striped table-hover p-0 m-0 min-width-1100px" id="table-rm-matrix">
+            <thead class="bg-light">
+            <tr>
+                <!--<th class="border-0 pl-2">Name</th>
+                                <th class="border-0">DOB</th>
+                                <th class="border-0">RPM?</th>
+                                <th class="border-0">Cell. BP?</th>
+                                <th class="border-0">Cell. Scale?</th>
+                                <th class="border-0">Last BP</th>
+                                <th class="border-0">Last Wt</th>
+                                <th class="border-0">Days Since Last Visit</th>
+                                <th class="border-0">Interacted?</th>
+                                <th class="border-0">#Meas. Days</th>
+                                <th class="border-0">#Unstamped</th>
+                                <th class="border-0 {{$strategy === 'X16_DAYS_20_MINS_ON_OWN_MCP_COM_DURING_CM' ? '' : 'd-nonex'}}">#RPM Mins.</th>
+                                <th class="border-0">Billable</th>-->
+
+                <th class="border-0 pl-2">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => 'Name', 'key' => 'client_name'])</th>
+                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => 'DOB', 'key' => 'dob'])</th>
+                {{--<th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => 'RPM?', 'key' => 'is_enrolled_in_rm'])</th>--}}
+                <th class="border-0 text-secondary">Cell. BP?</th>
+                <th class="border-0 text-secondary">Cell. Scale?</th>
+                <th class="border-0 text-secondary">Latest BP</th>
+                <th class="border-0 text-secondary">Latest Wt</th>
+                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => 'Days Since Last Visit', 'key' => 'most_recent_completed_mcp_note_date'])</th>
+                @if($mode === 'mcp' || $mode === 'rmm')
+                    @if($strategy === 'X16_DAYS_20_MINS_ON_OWN_MCP_COM_DURING_CM')
+                        <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => 'Interacted?', 'key' => 'has_mcp_interacted_with_client_about_rm'])</th>
+                    @endif
+                    <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => '#Meas. Days', 'key' => 'number_of_days_with_remote_measurements'])</th>
+                    @if($strategy === 'X16_DAYS_20_MINS_ON_OWN_MCP_COM_DURING_CM')
+                        <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => '#Unstamped', 'key' => 'rm_num_measurements_not_stamped_by_mcp'])</th>
+                    @endif
+                    @if($mode === 'mcp')
+                        <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => '#MCP Mins.', 'key' => 'rm_total_time_in_seconds_by_mcp'])</th>
+                    @else
+                        <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => '#RMM Mins.', 'key' => 'rm_total_time_in_seconds_by_rmm_pro'])</th>
+                    @endif
+                @elseif($mode === 'rme')
+                    <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => '#Meas. Days', 'key' => 'number_of_days_with_remote_measurements'])</th>
+                    <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => '#RME Mins.', 'key' => 'rm_total_time_in_seconds_by_rme_pro'])</th>
+                @endif
+                @if(!request()->input('not-enrolled'))
+                    {{--
+                    @if(!request()->input('f_billable') || request()->input('f_billable') === 'all')
+                        @if($mode === 'mcp')
+                            <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => 'Billable', 'key' => 'mcp_rm_generic_bill_id'])</th>
+                        @elseif($mode === 'rmm')
+                            <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => 'Billable', 'key' => 'rmm_rm_generic_bill_id'])</th>
+                        @endif
+                    @else
+                        <th class="border-0 text-secondary">Billable</th>
+                    @endif
+                    --}}
+                    <th class="border-0 text-secondary">Billable</th>
+                @endif
+            </tr>
+            </thead>
+            <tbody>
+            <?php $trIndex = 0; ?>
+            @foreach ($patients as $iPatient)
+                <?php
+
+                $daysDiff = -1;
+                if ($iPatient->most_recent_completed_mcp_note_date) {
+                    $careMonthLastDay = date_add(date_create($rcmStartDate), date_interval_create_from_date_string("1 month"));
+                    $careMonthLastDay = date_sub($careMonthLastDay, date_interval_create_from_date_string("1 day"));
+                    $daysDiff = date_diff($careMonthLastDay, date_create($iPatient->most_recent_completed_mcp_note_date))->days;
+                }
+                $lastVisitWithin90Days = ($daysDiff !== -1 && $daysDiff <= 90);
+
+                ?>
+                @include('app.practice-management.remote-monitoring-row-markup-by-pro-type')
+                <?php $trIndex++; ?>
+            @endforeach
+            </tbody>
+        </table>
+    </div>
+</div>

+ 24 - 97
resources/views/app/practice-management/rpm-matrix-by-pro-type.blade.php

@@ -36,12 +36,12 @@
             padding: 0.5rem;
         }
     </style>
-    <div class="p-3 mcp-theme-1 body-height" id="practice-remote-monitoring" v-cloak>
+    <div class="p-3 mcp-theme-1" id="practice-remote-monitoring" v-cloak>
 
         <div class="card h-100">
 
             <div class="card-header px-2 py-2 d-flex align-items-baseline">
-                <form class="d-block w-100" action="" method="GET">
+                <form class="d-block w-100" action="" method="GET" id="rpm-matrix-filter">
 
                     <div class="d-flex align-items-end">
                         <span class="mr-4">
@@ -70,17 +70,15 @@
                         <span class="mr-2">Strategy:</span>
                         @if($mode === 'mcp')
                             {{strategy_display($pro->mcp_rpm_payment_strategy, $mode)}}
-                            <?php $strategy = $pro->mcp_rpm_payment_strategy; ?>
+                            <?php $strategy = 'X16_DAYS_20_MINS_ON_OWN_MCP_COM_DURING_CM'; // $pro->mcp_rpm_payment_strategy; ?>
                         @elseif($mode === 'rmm')
                             {{strategy_display($pro->rme_payment_strategy, $mode)}}
-                            <?php $strategy = $pro->rmm_payment_strategy; ?>
+                            <?php $strategy = 'X16_DAYS_20_MINS_ON_OWN_MCP_COM_DURING_CM'; // $pro->rmm_payment_strategy; ?>
                         @elseif($mode === 'rmm')
                             {{strategy_display($pro->rmm_payment_strategy, $mode)}}
-                            <?php $strategy = $pro->rme_payment_strategy; ?>
+                            <?php $strategy = 'X16_DAYS'; // $pro->rme_payment_strategy; ?>
                         @endif
 
-                        <?php $strategy = 'X16_DAYS_20_MINS_ON_OWN_MCP_COM_DURING_CM'; ?>
-
                         <div class="ml-auto d-inline-flex flex-nowrap align-items-baseline">
                             <span class="mr-2">Month</span>
                             <select class="form-control form-control-sm min-width-unset width-100px mr-3" name="m"
@@ -108,8 +106,9 @@
                         </div>
                     </div>
 
-                    <div class="d-flex align-items-start mt-2 pt-1 border-top">
+                    <div class="d-none align-items-start mt-2 pt-1 border-top">
 
+                        {{--
                         <div>
                             <label class="mb-0 text-sm {{request()->input('f_name') ? 'text-info' : 'text-secondary'}}">Name</label>
                             <input type="text"
@@ -248,105 +247,33 @@
                                 <button class="btn-reset btn btn-sm btn-default bg-white text-secondary border"><i class="fa fa-times"></i></button>
                             </div>
                         </div>
+                        --}}
                     </div>
 
+                    <input type="hidden" name="not-enrolled" value="{{request()->input('not-enrolled')}}">
+
                 </form>
             </div>
 
             <?php $rc = request()->input('rc') ? request()->input('rc') : 1; ?>
 
             <div class="card-body p-0">
-                <div class="d-flex align-items-stretch m-0 h-100">
-                    <div class="overflow-auto border-right h-100 rpm-matrix-left-column">
-                        @include('app.stat-tree.summary', ['slug' => 'rm-tree-' . $mode, 'showForPro' => $pro, 'noDropVisualize' => true, 'stParams' => ['start_date' => $rcmStartDate]])
-                    </div>
-                    <div class="flex-grow-1 px-0 overflow-auto h-100 rpm-matrix-right-column">
-                        <?php $trIndex = 0; ?>
-                        @foreach ($patients as $iPatient)
-                            <script>
-                                addMCHook(
-                                    'refresh-rpm-row-{{$trIndex}}',
-                                    function () {
-                                        refreshRpmRow({{$trIndex}});
-                                    }
-                                );
-                            </script>
-                            <?php $trIndex++; ?>
-                        @endforeach
-                        <table class="table table-sm table-striped table-hover p-0 m-0 min-width-1100px" id="table-rm-matrix">
-                            <thead class="bg-light">
-                            <tr>
-                            <!--<th class="border-0 pl-2">Name</th>
-                                <th class="border-0">DOB</th>
-                                <th class="border-0">RPM?</th>
-                                <th class="border-0">Cell. BP?</th>
-                                <th class="border-0">Cell. Scale?</th>
-                                <th class="border-0">Last BP</th>
-                                <th class="border-0">Last Wt</th>
-                                <th class="border-0">Days Since Last Visit</th>
-                                <th class="border-0">Interacted?</th>
-                                <th class="border-0">#Meas. Days</th>
-                                <th class="border-0">#Unstamped</th>
-                                <th class="border-0 {{$strategy === 'X16_DAYS_20_MINS_ON_OWN_MCP_COM_DURING_CM' ? '' : 'd-nonex'}}">#RPM Mins.</th>
-                                <th class="border-0">Billable</th>-->
-
-                                <th class="border-0 pl-2">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => 'Name', 'key' => 'client_name'])</th>
-                                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => 'DOB', 'key' => 'dob'])</th>
-                                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => 'RPM?', 'key' => 'is_enrolled_in_rm'])</th>
-                                <th class="border-0 text-secondary">Cell. BP?</th>
-                                <th class="border-0 text-secondary">Cell. Scale?</th>
-                                <th class="border-0 text-secondary">Latest BP</th>
-                                <th class="border-0 text-secondary">Latest Wt</th>
-                                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => 'Days Since Last Visit', 'key' => 'most_recent_completed_mcp_note_date'])</th>
-                                @if($mode === 'mcp' || $mode === 'rmm')
-                                    @if($strategy === 'X16_DAYS_20_MINS_ON_OWN_MCP_COM_DURING_CM')
-                                        <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => 'Interacted?', 'key' => 'has_mcp_interacted_with_client_about_rm'])</th>
-                                    @endif
-                                    <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => '#Meas. Days', 'key' => 'number_of_days_with_remote_measurements'])</th>
-                                    @if($strategy === 'X16_DAYS_20_MINS_ON_OWN_MCP_COM_DURING_CM')
-                                        <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => '#Unstamped', 'key' => 'rm_num_measurements_not_stamped_by_mcp'])</th>
-                                    @endif
-                                    @if($mode === 'mcp')
-                                        <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => '#MCP Mins.', 'key' => 'rm_total_time_in_seconds_by_mcp'])</th>
-                                    @else
-                                        <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => '#RMM Mins.', 'key' => 'rm_total_time_in_seconds_by_rmm_pro'])</th>
-                                    @endif
-                                @elseif($mode === 'rme')
-                                    <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => '#Meas. Days', 'key' => 'number_of_days_with_remote_measurements'])</th>
-                                    <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => '#RME Mins.', 'key' => 'rm_total_time_in_seconds_by_rme_pro'])</th>
-                                @endif
-                                @if(!request()->input('f_billable') || request()->input('f_billable') === 'all')
-                                    @if($mode === 'mcp')
-                                        <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => 'Billable', 'key' => 'mcp_rm_generic_bill_id'])</th>
-                                    @elseif($mode === 'rmm')
-                                        <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-" . $mode), 'label' => 'Billable', 'key' => 'rmm_rm_generic_bill_id'])</th>
-                                    @endif
-                                @else
-                                    <th class="border-0 text-secondary">Billable</th>
-                                @endif
-                            </tr>
-                            </thead>
-                            <tbody>
-                            <?php $trIndex = 0; ?>
-                            @foreach ($patients as $iPatient)
-                                <?php
-
-                                $daysDiff = -1;
-                                if ($iPatient->most_recent_completed_mcp_note_date) {
-                                    $careMonthLastDay = date_add(date_create($rcmStartDate), date_interval_create_from_date_string("1 month"));
-                                    $careMonthLastDay = date_sub($careMonthLastDay, date_interval_create_from_date_string("1 day"));
-                                    $daysDiff = date_diff($careMonthLastDay, date_create($iPatient->most_recent_completed_mcp_note_date))->days;
-                                }
-                                $lastVisitWithin90Days = ($daysDiff !== -1 && $daysDiff <= 90);
-
-                                ?>
-                                @include('app.practice-management.remote-monitoring-row-markup-by-pro-type')
-                                <?php $trIndex++; ?>
-                            @endforeach
-                            </tbody>
-                        </table>
+                <div>
+                    <div class="d-flex align-items-baseline p-2 border-bottom" tab-links="">
+                        <a class="{{ !request()->input('not-enrolled') ? 'tab-link-active' : '' }} text-dark c-pointer"
+                           onclick="$('[name=not-enrolled]').val(''); return fastLoad('{{route('practice-management.rpm-matrix-' . $mode)}}?' + $('#rpm-matrix-filter').serialize());"
+                           tab-link="rpm">Enrolled in RPM</a>
+                        <a class="{{ request()->input('not-enrolled') ? 'tab-link-active' : '' }} text-dark c-pointer"
+                           onclick="$('[name=not-enrolled]').val('1'); return fastLoad('{{route('practice-management.rpm-matrix-' . $mode)}}?' + $('#rpm-matrix-filter').serialize());"
+                           tab-link="no-rpm">Not Enrolled in RPM</a>
                     </div>
                 </div>
+                <div class="cm-tab {{!request()->input('not-enrolled') ? '' : 'd-none'}}" tab-key="rpm">
+                    @include('app.practice-management.rpm-matrix-by-pro-type-table')
+                </div>
+                <div class="cm-tab {{request()->input('not-enrolled') ? '' : 'd-none'}}" tab-key="no-rpm">
+                    @include('app.practice-management.rpm-matrix-by-pro-type-table')
+                </div>
             </div>
         </div>
     </div>

+ 18 - 0
resources/views/layouts/patient-header.blade.php

@@ -101,6 +101,24 @@ $addressParts .= implode(", ", $addressPart2);
           </b>
         </div>
         @endif
+        <div moe class="ml-3">
+          <a href="#" start show>Edit Chart</a>
+          <form url="/api/visit/create" redir="/patients/view/{{$patient->uid}}/notes/view/[data]">
+            <p>Create a note for making changes to the chart?</p>
+            <input type="hidden" name="clientUid" value="{{$patient->uid}}">
+            <input type="hidden" name="title" value="Note">
+            <input type="hidden" name="effectiveDate" value="{{date('Y-m-d')}}">
+            <input type="hidden" name="hcpProUid" value="{{$pro->uid}}">
+            <input type="hidden" name="visitTemplateUid" value="{{config('app.nonMedicalVisitTemplateUid')}}">
+            <input type="hidden" name="newOrFuOrNa" value="FU">
+            <input type="hidden" name="noteContactMethod" value="AUDIO">
+            <input type="hidden" name="isNonMedical" value="1">
+            <div class="d-flex">
+              <button submit class="btn btn-sm btn-primary">Yes</button>
+              <button cancel class="ml-2 btn btn-default border">No</button>
+            </div>
+          </form>
+        </div>
       </div>
     </div>
       <div class="d-flex align-items-start">