Vijayakrishnan před 3 roky
rodič
revize
4a1536579e

+ 32 - 11
app/Http/Controllers/PracticeManagementController.php

@@ -3664,26 +3664,47 @@ ORDER BY c.name_last, c.name_first
 		n.is_claim_closed IS NOT TRUE AND
             
 	    n.is_cancelled IS NOT TRUE AND 
-            n.created_at::DATE >= '2022-01-01'::DATE 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	
+		    -- 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
-            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);
         }

+ 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>