Explorar o código

RPM admin - insurance and state cols and filters

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

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

@@ -1801,6 +1801,44 @@ WHERE
             $v = trim($request->input('f_name'));
             $conditions[] = "(client.name_first ILIKE '%{$v}%' OR client.name_last ILIKE '%{$v}%')";
         }
+
+        if(trim($request->input('f_payer_type'))) {
+            switch($request->input('f_payer_type')) {
+                case 'Medicare':
+                    $conditions[] = "(cpc.plan_type = 'MEDICARE')";
+                    break;
+                case 'Non Medicare':
+                    $conditions[] = "(cpc.plan_type != 'MEDICARE')";
+                    break;
+                case 'Medicaid':
+                    $conditions[] = "(cpc.plan_type = 'MEDICAID')";
+                    break;
+                case 'Commercial':
+                    $conditions[] = "(cpc.plan_type = 'COMMERCIAL')";
+                    break;
+            }
+        }
+
+        if((trim($request->input('f_payer_type')) === 'Non Medicare' || trim($request->input('f_payer_type')) === 'Commercial') && trim($request->input('f_payer'))) {
+            $v = trim($request->input('f_payer'));
+            $conditions[] = "(payer.name ILIKE '%{$v}%')";
+        }
+
+        if(trim($request->input('f_state'))) {
+            $v = trim($request->input('f_state'));
+            switch($v) {
+                case 'NONE':
+                    $conditions[] = "(client.mailing_address_state IS NULL)";
+                    break;
+                case 'NOT_MD':
+                    $conditions[] = "(client.mailing_address_state IS NOT NULL AND client.mailing_address_state != 'MD')";
+                    break;
+                default:
+                    $conditions[] = "(client.mailing_address_state ILIKE '%{$v}%')";
+                    break;
+            }
+        }
+
         if(trim($request->input('f_mcp'))) {
             $v = trim($request->input('f_mcp'));
             $conditions[] = "(mcpPro.uid = '{$v}')";
@@ -1937,6 +1975,8 @@ FROM care_month join client on care_month.client_id = client.id
     join note mrnote on client.most_recent_completed_mcp_note_id = mrnote.id
     left join pro mcpPro on care_month.mcp_pro_id = mcpPro.id
     left join pro rmmPro on care_month.rmm_pro_id = rmmPro.id
+    left join client_primary_coverage cpc on client.effective_client_primary_coverage_id = cpc.id
+    left join payer on cpc.commercial_payer_id = payer.id
     {$genericBillJoinClause}
 WHERE
       EXTRACT(MONTH from care_month.start_date) = " . ($request->input('m') ?: 'EXTRACT(MONTH from now())') . "
@@ -1988,6 +2028,11 @@ SELECT client.name_first, client.name_last,
        (mcpPro.name_first || ' ' || mcpPro.name_last) as mcp_name,
        rmmPro.rmm_payment_strategy,
        rmmPro.rmm_payment_amount,
+       client.mailing_address_state,
+       care_month.most_recent_cellular_weight_measurement_at,
+       cpc.plan_type,
+       cpc.auto_medicare_is_partbprimary,
+       payer.name as payer_name,
        (SELECT COUNT(*) FROM claim_line where claim_line.cpt = '99454' AND claim_line.claim_id IN (SELECT claim.id FROM claim WHERE claim.care_month_id = care_month.id AND claim.status != 'CANCELLED')) as claim_454,
        (SELECT COUNT(*) FROM claim_line where claim_line.cpt = '99457' AND claim_line.claim_id IN (SELECT claim.id FROM claim WHERE claim.care_month_id = care_month.id AND claim.status != 'CANCELLED')) as claim_457,
        {$genericBillIdColumns}
@@ -1995,6 +2040,8 @@ FROM care_month join client on care_month.client_id = client.id
     join note mrnote on client.most_recent_completed_mcp_note_id = mrnote.id
     left join pro mcpPro on care_month.mcp_pro_id = mcpPro.id
     left join pro rmmPro on care_month.rmm_pro_id = rmmPro.id
+    left join client_primary_coverage cpc on client.effective_client_primary_coverage_id = cpc.id
+    left join payer on cpc.commercial_payer_id = payer.id
     {$genericBillJoinClause}
 WHERE
       EXTRACT(MONTH from care_month.start_date) = " . ($request->input('m') ?: 'EXTRACT(MONTH from now())') . "

+ 9 - 0
resources/views/app/practice-management/remote-monitoring-row-markup-for-admin.blade.php

@@ -11,6 +11,15 @@
            class="text-nowrap d-block max-width-170px overflow-hidden text-ellipsis"
         ><span class="sort-data">{{ $iPatient->client_name }}</span></a>
     </td>
+    <td>
+        @if($iPatient->plan_type === 'MEDICARE')
+            Medicare
+        @elseif($iPatient->plan_type === 'MEDICAID')
+            Medicaid
+        @elseif($iPatient->plan_type === 'COMMERCIAL')
+            {{$iPatient->payer_name}}
+        @endif
+    <td>{{$iPatient->mailing_address_state}}</td>
     <td>{{$iPatient->mcp_name}}</td>
     <td>{{$iPatient->age_in_years}}</td>
     {{--<td>{!! $iPatient->is_enrolled_in_rm === 'YES' ? '<i class="fa fa-check text-success"></i>' : 'No' !!}</td>--}}

+ 2 - 0
resources/views/app/practice-management/rpm-matrix-for-admin-table.blade.php

@@ -26,6 +26,8 @@
             <tr>
 		        <th class="border-0"></th>
                 <th class="border-0 pl-2">@include('app.practice-management._sort_header_multi', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'Name', 'key' => 'client_name'])</th>
+                <th class="border-0">@include('app.practice-management._sort_header_multi', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'Insurance', 'key' => 'insurance'])</th>
+                <th class="border-0">@include('app.practice-management._sort_header_multi', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'State', 'key' => 'state'])</th>
                 <th class="border-0">@include('app.practice-management._sort_header_multi', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'CM MCP', 'key' => 'mcp_name'])</th>
                 <th class="border-0">@include('app.practice-management._sort_header_multi', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'Age', 'key' => 'age_in_years'])</th>
                 {{--<th class="border-0">@include('app.practice-management._sort_header_multi', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'RPM?', 'key' => 'is_enrolled_in_rm'])</th>--}}

+ 83 - 2
resources/views/app/practice-management/rpm-matrix-for-admin.blade.php

@@ -87,14 +87,95 @@
                             </select>
                         </div>
 
-                        <div>
+                        <div class="max-width-110px mr-2">
                             <label class="mb-0 text-sm {{request()->input('f_name') ? 'font-weight-bold text-info' : 'text-secondary'}}">Name</label>
                             <input type="text"
-                                   class="mr-2 form-control form-control-sm min-width-unset max-width-110px"
+                                   class="form-control form-control-sm min-width-unset max-width-110px"
                                    name="f_name" value="{{request()->input('f_name')}}">
                         </div>
 
                         <div class="max-width-110px mr-2">
+                            <label class="mb-0 text-sm {{request()->input('f_payer_type') ? 'font-weight-bold text-info' : 'text-secondary'}}">Payer Type</label>
+                            <div class="d-flex align-items-start">
+                                <select name="f_payer_type"
+                                        class=" form-control form-control-sm min-width-unset width-140px pl-0">
+                                    <option value="">Any</option>
+                                    <option {{request()->input('f_payer_type') === 'Medicare' ? 'selected' : ''}} value="Medicare">Medicare</option>
+                                    <option {{request()->input('f_payer_type') === 'Non Medicare' ? 'selected' : ''}} value="Non Medicare">Non Medicare</option>
+                                    <option {{request()->input('f_payer_type') === 'Medicaid' ? 'selected' : ''}} value="Medicaid">Medicaid</option>
+                                    <option {{request()->input('f_payer_type') === 'Commercial' ? 'selected' : ''}} value="Commercial">Commercial</option>
+                                </select>
+                            </div>
+                        </div>
+
+                        <div class="max-width-110px mr-2">
+                            <label class="mb-0 text-sm {{request()->input('f_payer') ? 'font-weight-bold text-info' : 'text-secondary'}}">Comm. Payer</label>
+                            <input name="f_payer" class="form-control form-control-sm min-width-unset" value="{{request()->input('f_payer')}}" autocomplete="off" stag-suggest stag-suggest-ep="/search-payer/json" />
+                        </div>
+
+                        <div class="max-width-110px mr-2">
+                            <label class="mb-0 text-sm {{request()->input('f_state') ? 'font-weight-bold text-info' : 'text-secondary'}}">State</label>
+                            <div class="d-flex align-items-start">
+                                <select name="f_state"
+                                        class=" form-control form-control-sm min-width-unset pl-0">
+                                    <option value="">Any</option>
+                                    <option {{request()->input('f_state') === 'NONE' ? 'selected' : ''}} value="NONE">Not Available</option>
+                                    <option {{request()->input('f_state') === 'NOT_MD' ? 'selected' : ''}} value="NOT_MD">Not MD</option>
+                                    <option {{request()->input('f_state') === 'AL' ? 'selected' : ''}} value="AL">Alabama</option>
+                                    <option {{request()->input('f_state') === 'AK' ? 'selected' : ''}} value="AK">Alaska</option>
+                                    <option {{request()->input('f_state') === 'AZ' ? 'selected' : ''}} value="AZ">Arizona</option>
+                                    <option {{request()->input('f_state') === 'AR' ? 'selected' : ''}} value="AR">Arkansas</option>
+                                    <option {{request()->input('f_state') === 'CA' ? 'selected' : ''}} value="CA">California</option>
+                                    <option {{request()->input('f_state') === 'CO' ? 'selected' : ''}} value="CO">Colorado</option>
+                                    <option {{request()->input('f_state') === 'CT' ? 'selected' : ''}} value="CT">Connecticut</option>
+                                    <option {{request()->input('f_state') === 'DE' ? 'selected' : ''}} value="DE">Delaware</option>
+                                    <option {{request()->input('f_state') === 'FL' ? 'selected' : ''}} value="FL">Florida</option>
+                                    <option {{request()->input('f_state') === 'GA' ? 'selected' : ''}} value="GA">Georgia</option>
+                                    <option {{request()->input('f_state') === 'HI' ? 'selected' : ''}} value="HI">Hawaii</option>
+                                    <option {{request()->input('f_state') === 'ID' ? 'selected' : ''}} value="ID">Idaho</option>
+                                    <option {{request()->input('f_state') === 'IL' ? 'selected' : ''}} value="IL">Illinois</option>
+                                    <option {{request()->input('f_state') === 'IN' ? 'selected' : ''}} value="IN">Indiana</option>
+                                    <option {{request()->input('f_state') === 'IA' ? 'selected' : ''}} value="IA">Iowa</option>
+                                    <option {{request()->input('f_state') === 'KS' ? 'selected' : ''}} value="KS">Kansas</option>
+                                    <option {{request()->input('f_state') === 'KY' ? 'selected' : ''}} value="KY">Kentucky</option>
+                                    <option {{request()->input('f_state') === 'LA' ? 'selected' : ''}} value="LA">Louisiana</option>
+                                    <option {{request()->input('f_state') === 'ME' ? 'selected' : ''}} value="ME">Maine</option>
+                                    <option {{request()->input('f_state') === 'MD' ? 'selected' : ''}} value="MD">Maryland</option>
+                                    <option {{request()->input('f_state') === 'MA' ? 'selected' : ''}} value="MA">Massachusetts</option>
+                                    <option {{request()->input('f_state') === 'MI' ? 'selected' : ''}} value="MI">Michigan</option>
+                                    <option {{request()->input('f_state') === 'MN' ? 'selected' : ''}} value="MN">Minnesota</option>
+                                    <option {{request()->input('f_state') === 'MS' ? 'selected' : ''}} value="MS">Mississippi</option>
+                                    <option {{request()->input('f_state') === 'MO' ? 'selected' : ''}} value="MO">Missouri</option>
+                                    <option {{request()->input('f_state') === 'MT' ? 'selected' : ''}} value="MT">Montana</option>
+                                    <option {{request()->input('f_state') === 'NE' ? 'selected' : ''}} value="NE">Nebraska</option>
+                                    <option {{request()->input('f_state') === 'NV' ? 'selected' : ''}} value="NV">Nevada</option>
+                                    <option {{request()->input('f_state') === 'NH' ? 'selected' : ''}} value="NH">New Hampshire</option>
+                                    <option {{request()->input('f_state') === 'NJ' ? 'selected' : ''}} value="NJ">New Jersey</option>
+                                    <option {{request()->input('f_state') === 'NM' ? 'selected' : ''}} value="NM">NewMexico</option>
+                                    <option {{request()->input('f_state') === 'NY' ? 'selected' : ''}} value="NY">New York</option>
+                                    <option {{request()->input('f_state') === 'NC' ? 'selected' : ''}} value="NC">North Carolina</option>
+                                    <option {{request()->input('f_state') === 'ND' ? 'selected' : ''}} value="ND">North Dakota</option>
+                                    <option {{request()->input('f_state') === 'OH' ? 'selected' : ''}} value="OH">Ohio</option>
+                                    <option {{request()->input('f_state') === 'OK' ? 'selected' : ''}} value="OK">Oklahoma</option>
+                                    <option {{request()->input('f_state') === 'OR' ? 'selected' : ''}} value="OR">Oregon</option>
+                                    <option {{request()->input('f_state') === 'PA' ? 'selected' : ''}} value="PA">Pennsylvania</option>
+                                    <option {{request()->input('f_state') === 'RI' ? 'selected' : ''}} value="RI">RhodeIsland</option>
+                                    <option {{request()->input('f_state') === 'SC' ? 'selected' : ''}} value="SC">South Carolina</option>
+                                    <option {{request()->input('f_state') === 'SD' ? 'selected' : ''}} value="SD">South Dakota</option>
+                                    <option {{request()->input('f_state') === 'TN' ? 'selected' : ''}} value="TN">Tennessee</option>
+                                    <option {{request()->input('f_state') === 'TX' ? 'selected' : ''}} value="TX">Texas</option>
+                                    <option {{request()->input('f_state') === 'UT' ? 'selected' : ''}} value="UT">Utah</option>
+                                    <option {{request()->input('f_state') === 'VT' ? 'selected' : ''}} value="VT">Vermont</option>
+                                    <option {{request()->input('f_state') === 'VA' ? 'selected' : ''}} value="VA">Virginia</option>
+                                    <option {{request()->input('f_state') === 'WA' ? 'selected' : ''}} value="WA">Washington</option>
+                                    <option {{request()->input('f_state') === 'WV' ? 'selected' : ''}} value="WV">West Virginia</option>
+                                    <option {{request()->input('f_state') === 'WI' ? 'selected' : ''}} value="WI">Wisconsin</option>
+                                    <option {{request()->input('f_state') === 'WY' ? 'selected' : ''}} value="WY">Wyoming</option>
+                                </select>
+                            </div>
+                        </div>
+
+                        <div class="max-width-110px mr-2 position-relative">
                             <label class="mb-0 text-sm {{request()->input('f_mcp') ? 'font-weight-bold text-info' : 'text-secondary'}}">MCP</label>
                             <select name="f_mcp" class="form-control form-control-sm min-width-unset" provider-search provider-type="hcp" data-pro-uid="{{request()->input('f_mcp')}}">
                                 <option value="">--select--</option>