Przeglądaj źródła

na portal updates

Josh 3 lat temu
rodzic
commit
8258e119ba

+ 7 - 10
app/Http/Controllers/HomeController.php

@@ -573,6 +573,7 @@ WHERE cl.shadow_pro_id IS NULL
         $keyNumbers  = [];
 
         $queryClients = $this->performer()->pro->getAccessibleClientsQuery();
+        $keyNumbers['patients'] = $queryClients->count();
 
         $pendingNotesToSign = Note::where('ally_pro_id', $performerProID)->where('is_signed_by_ally', false)->where('is_cancelled', false)->where('is_core_note', false)->count();
         $keyNumbers['pendingNotesToSign'] = $pendingNotesToSign;
@@ -604,7 +605,7 @@ WHERE cl.shadow_pro_id IS NULL
             ->count();
 
         // unacknowledged cancelled bills for authed pro
-        $keyNumbers['unacknowledgedCancelledBills'] = Bill::where('hcp_pro_id', $performerProID)
+        $keyNumbers['unacknowledgedCancelledBills'] = Bill::where('na_pro_id', $performerProID)
             ->where('is_cancelled', true)
             ->where('is_cancellation_acknowledged', false)
             ->count();
@@ -659,13 +660,12 @@ WHERE cl.shadow_pro_id IS NULL
         }
 
         //expectedPay
-        $expectedForHcp = DB::select(DB::raw("SELECT coalesce(SUM(hcp_expected_payment_amount),0) as expected_pay FROM bill WHERE hcp_pro_id = :performerProID  AND has_hcp_been_paid = false AND is_signed_by_hcp IS TRUE AND is_cancelled = false"), ['performerProID' => $performerProID])[0]->expected_pay;
         $expectedForCm = DB::select(DB::raw("SELECT coalesce(SUM(cm_expected_payment_amount),0) as expected_pay  FROM bill WHERE cm_pro_id = :performerProID  AND has_cm_been_paid = false AND is_signed_by_cm IS TRUE AND is_cancelled = false"), ['performerProID' => $performerProID])[0]->expected_pay;
         $expectedForRme = DB::select(DB::raw("SELECT coalesce(SUM(rme_expected_payment_amount),0) as expected_pay  FROM bill WHERE rme_pro_id = :performerProID  AND has_rme_been_paid = false AND is_signed_by_rme IS TRUE AND is_cancelled = false"), ['performerProID' => $performerProID])[0]->expected_pay;
         $expectedForRmm = DB::select(DB::raw("SELECT coalesce(SUM(rmm_expected_payment_amount),0) as expected_pay  FROM bill WHERE rmm_pro_id = :performerProID  AND has_rmm_been_paid = false AND is_signed_by_rmm IS TRUE AND is_cancelled = false"), ['performerProID' => $performerProID])[0]->expected_pay;
         $expectedForNa = DB::select(DB::raw("SELECT coalesce(SUM(generic_pro_expected_payment_amount),0) as expected_pay  FROM bill WHERE generic_pro_id = :performerProID  AND has_generic_pro_been_paid = false AND is_signed_by_generic_pro IS TRUE AND is_cancelled = false"), ['performerProID' => $performerProID])[0]->expected_pay;
 
-        $totalExpectedAmount =  $expectedForHcp + $expectedForCm + $expectedForRme + $expectedForRmm + $expectedForNa;
+        $totalExpectedAmount =  $expectedForCm + $expectedForRme + $expectedForRmm + $expectedForNa;
         $reimbursement['nextPaymentAmount'] =  $totalExpectedAmount;
 
         $milliseconds = strtotime(date('Y-m-d')) . '000';
@@ -767,9 +767,6 @@ ORDER BY cm.created_at DESC
             ->where(function ($q) use ($performerProID) {
                 $q
                     ->where(function ($q2) use ($performerProID) {
-                        $q2->where('hcp_pro_id', $performerProID)->where('is_signed_by_hcp', false);
-                    })
-                    ->orWhere(function ($q2) use ($performerProID) {
                         $q2->where('rme_pro_id', $performerProID)->where('is_signed_by_rme', false);
                     })
                     ->orWhere(function ($q2) use ($performerProID) {
@@ -785,7 +782,7 @@ ORDER BY cm.created_at DESC
             DB::raw(
                 "
 SELECT count(client.id) as cnt FROM client join care_month on care_month.client_id = client.id
-WHERE ((client.mcp_pro_id = {$performer->pro->id}) OR (client.rmm_pro_id = {$performer->pro->id})
+WHERE ( (client.rmm_pro_id = {$performer->pro->id})
           OR (client.rme_pro_id = {$performer->pro->id}) OR (client.default_na_pro_id = {$performer->pro->id}))
   AND EXTRACT(MONTH from care_month.start_date) = EXTRACT(MONTH from now())
   AND EXTRACT(YEAR from care_month.start_date) = EXTRACT(YEAR from now())
@@ -799,7 +796,7 @@ WHERE ((client.mcp_pro_id = {$performer->pro->id}) OR (client.rmm_pro_id = {$per
             DB::raw(
                 "
 SELECT count(client.id) as cnt FROM client join care_month on care_month.client_id = client.id
-WHERE ((client.mcp_pro_id = {$performer->pro->id}) OR (client.rmm_pro_id = {$performer->pro->id})
+WHERE ((client.rmm_pro_id = {$performer->pro->id})
           OR (client.rme_pro_id = {$performer->pro->id}) OR (client.default_na_pro_id = {$performer->pro->id}))
   AND EXTRACT(MONTH from care_month.start_date) = EXTRACT(MONTH from now())
   AND EXTRACT(YEAR from care_month.start_date) = EXTRACT(YEAR from now())
@@ -813,7 +810,7 @@ WHERE ((client.mcp_pro_id = {$performer->pro->id}) OR (client.rmm_pro_id = {$per
             DB::raw(
                 "
 SELECT count(client.id) as cnt FROM client join care_month on care_month.client_id = client.id
-WHERE ((client.mcp_pro_id = {$performer->pro->id}) OR (client.rmm_pro_id = {$performer->pro->id})
+WHERE ((client.rmm_pro_id = {$performer->pro->id})
           OR (client.rme_pro_id = {$performer->pro->id}) OR (client.default_na_pro_id = {$performer->pro->id}))
   AND EXTRACT(MONTH from care_month.start_date) = EXTRACT(MONTH from now())
   AND EXTRACT(YEAR from care_month.start_date) = EXTRACT(YEAR from now())
@@ -827,7 +824,7 @@ WHERE ((client.mcp_pro_id = {$performer->pro->id}) OR (client.rmm_pro_id = {$per
             DB::raw(
                 "
 SELECT count(client.id) as cnt FROM client join care_month on care_month.client_id = client.id
-WHERE ((client.mcp_pro_id = {$performer->pro->id}) OR (client.rmm_pro_id = {$performer->pro->id})
+WHERE ( (client.rmm_pro_id = {$performer->pro->id})
           OR (client.rme_pro_id = {$performer->pro->id}) OR (client.default_na_pro_id = {$performer->pro->id}))
   AND EXTRACT(MONTH from care_month.start_date) = EXTRACT(MONTH from now())
   AND EXTRACT(YEAR from care_month.start_date) = EXTRACT(YEAR from now())

+ 18 - 24
app/Models/Pro.php

@@ -333,6 +333,11 @@ class Pro extends Model
         return $query->where('mcp_pro_id', $this->id)->count();
     }
 
+    function get_patients_count_as_dna() {
+        $query = Client::whereNull('shadow_pro_id');
+        return $query->where('default_na_pro_id', $this->id)->count();
+    }
+
     function get_new_patients_awaiting_visit_count_as_mcp() {
         $query = Client::whereNull('shadow_pro_id');
         return $query->where('mcp_pro_id', $this->id)
@@ -340,6 +345,13 @@ class Pro extends Model
             ->count();
     }
 
+    function get_new_patients_awaiting_visit_count_as_dna() {
+        $query = Client::whereNull('shadow_pro_id');
+        return $query->where('default_na_pro_id', $this->id)
+            ->where('has_mcp_done_onboarding_visit', '!=', 'YES')
+            ->count();
+    }
+
     function get_notes_pending_signature_count_as_mcp() {
         return Note::where('hcp_pro_id', $this->id)
             ->where('is_cancelled', '<>', true)
@@ -348,31 +360,13 @@ class Pro extends Model
             ->count();
     }
 
+
     function get_notes_pending_signature_count_as_dna() {
-        return;
-        $naBillableSignedNotes = DB::select(DB::raw("
-SELECT count(note.id) as na_billable_notes
-FROM note
-WHERE
-        note.is_signed_by_hcp = TRUE AND
-        note.ally_pro_id = :pro_id AND
-        note.is_cancelled = FALSE AND
-        (
-            SELECT count(bill.id)
-            FROM bill
-            WHERE
-                  bill.is_cancelled = FALSE AND
-                  bill.generic_pro_id = :pro_id AND
-                  bill.note_id = note.id
-        ) = 0
-        "), ["pro_id" => $performerProID]);
-
-        if(!$naBillableSignedNotes || !count($naBillableSignedNotes)) {
-            $naBillableSignedNotes = 0;
-        }
-        else {
-            $naBillableSignedNotes = $naBillableSignedNotes[0]->na_billable_notes;
-        }
+        return Note::where('ally_pro_id', $this->id)
+            ->where('is_cancelled', '<>', true)
+            ->where('is_core_note', '<>', true)
+            ->where('is_signed_by_ally', '<>', true)
+            ->count();
     }
 
     function get_notes_pending_billing_count_as_mcp() {

+ 5 - 8
resources/views/app/dashboard-dna.blade.php

@@ -25,7 +25,7 @@
                             <table class="table mb-0 dashboard-stats-table">
                                 <tbody>
                                 <tr>
-                                    <th class="px-2 text-center">{{$pro->get_patients_count_as_mcp()}}</th>
+                                    <th class="px-2 text-center">{{$pro->get_patients_count_as_dna()}}</th>
                                     <th class="pl-2">Patients</th>
                                 </tr>
                                 <tr>
@@ -33,7 +33,7 @@
                                     <th class="pl-2">New Patients Awaiting Visit</th>
                                 </tr>
                                 <tr>
-                                    <th class="px-2 text-center">{{$pro->get_notes_pending_signature_count_as_mcp()}}</th>
+                                    <th class="px-2 text-center">{{$pro->get_notes_pending_signature_count_as_dna()}}</th>
                                     <th class="pl-2">Notes Pending Signature</th>
                                 </tr>
                                 <tr>
@@ -87,10 +87,7 @@
                         <div class="card-body p-0">
                             <table class="table mb-0 dashboard-stats-table">
                                 <tbody>
-                                <tr>
-                                    <th class="px-2 text-center">{{$pro->get_measurements_awaiting_review_count_as_mcp() ?? '-'}}</th>
-                                    <th class="pl-2">Measurements Pending Review</th>
-                                </tr>
+                                
                                 <tr>
                                     <th class="px-2 text-center">{{$pro->get_patients_without_remote_measurement_in_48_hours_count_as_mcp() ?? '-'}}</th>
                                     <th class="pl-2">Patients w/o Measurement in 48 hrs.</th>
@@ -126,7 +123,7 @@
                                     <th class="font-weight-normal pl-2"><a
                                             href="/practice-management/bills-under-processing">Processing</a></th>
                                 </tr>
-                                <tr class="thin">
+                                <!-- <tr class="thin">
                                     <th class="font-weight-normal px-2 pl-5">${{friendly_money($reimbursement['nextPaymentAmount'])}}</th>
                                     <th class="font-weight-normal pl-2"><a
                                             href="/practice-management/bills-under-processing">Treatment Services</a></th>
@@ -140,7 +137,7 @@
                                     <th class="font-weight-normal px-2 pl-5">${{friendly_money($reimbursement['nextPaymentAmount'])}}</th>
                                     <th class="font-weight-normal pl-2"><a
                                             href="/practice-management/bills-under-processing">Other Services</a></th>
-                                </tr>
+                                </tr> -->
                                 {{--
                                 <tr>
                                     <th class="px-2">{{$reimbursement['lastPayment']}}</th>

+ 76 - 0
resources/views/app/dna/patients-table.blade.php

@@ -0,0 +1,76 @@
+<table class="table table-condensed p-0 m-0">
+	<thead class="bg-light">
+		<tr>
+			<th class="px-3 border-0">Chart #</th>
+			<th class="px-3 border-0">Name (F.I. LAST)</th>
+			<th class="px-3 border-0">DOB</th>
+			<th class="px-3 border-0">Gender</th>
+			<th class="px-3 border-0">MCP</th>
+			<th class="px-3 border-0">BMI</th>
+			<th class="px-3 border-0">Insurance</th>
+			<th class="px-3 border-0">Last Visit</th>
+			<th class="px-3 border-0">Next Appt.</th>
+			<th class="px-3 border-0">Status</th>
+			<th class="px-3 border-0">CCM</th>
+			<th class="px-3 border-0">RPM</th>
+			<th class="px-3 border-0">Last Weight-In</th>
+			<th class="px-3 border-0">Last BP</th>
+			<th class="px-3 border-0">Assigned On</th>
+		</tr>
+	</thead>
+	<tbody>
+		@foreach($patients as $patient)
+		<tr>
+			<td class="px-3">
+				<a href="{{route('patients.view.dashboard', $patient)}}">
+					{{$patient->chart_number}}
+				</a>
+			</td>
+			<td>{{$patient->displayName()}}</td>
+			<td>{{ friendly_date_time($patient->dob, false) }} {{ $patient->age_in_years ? '(' . $patient->age_in_years . ' y.o)' : '(-)' }}</td>
+			<td>{{ $patient->sex }}</td>
+			<td>{{ $patient->mcp->name_display }}</td>
+			<td>{{ $patient->usual_bmi }}</td>
+			<td>
+				<?php $coverageStatus = $patient->getPrimaryCoverageStatus(); ?>
+				@if($coverageStatus === 'YES')
+				<div class="text-nowrap">Covered <i class="fa fa-check-circle text-success"></i>
+				</div>
+				@elseif($coverageStatus === 'NO')
+				<div class="text-nowrap">Not Covered <i class="fa fa-times text-danger"></i></div>
+				@else
+				<div class="text-nowrap">Unknown <i class="fa fa-exclamation-triangle text-warning-mellow"></i></div>
+				@endif
+				<?php $coverage = $patient->getPrimaryCoverage(); ?>
+				@if($coverage)
+				{{$coverage->toString()}}
+				@endif
+			</td>
+			<td>{{$patient->lastMcpAppointment() ? $patient->lastMcpAppointment()->start_date : '-'}}</td>
+			<td>{{$patient->nextMcpAppointment() ? $patient->nextMcpAppointment()->start_date : '-'}}</td>
+			<td>{{$patient->nextMcpAppointment() ? $patient->nextMcpAppointment()->status : '-'}}</td>
+			<td>{{$patient->is_enrolled_in_cm ? 'Yes' : 'No'}}</td>
+			<td>{{$patient->is_enrolled_in_rm ? 'Yes' : 'No'}}</td>
+			<td>
+				<?php $m = $patient->lastMeasurementOfType('Wt. (lbs.)'); ?>
+				{{$m && $m->value ? round($m->value, 2) : '-'}}
+			</td>
+			<td>
+				<?php $m = $patient->lastMeasurementOfType('BP'); ?>
+				{{$m && $m->value ? $m->value : '-'}}
+			</td>
+			<td>{{$patient->getMcpAssignedOn()}}</td>
+		</tr>
+		@endforeach
+
+		@if(count($patients) === 0)
+		<tr>
+			<td colspan="14">No records found!</td>
+		</tr>
+		@endif
+	</tbody>
+
+</table>
+<div class="p-3">
+	{{$patients->links()}}
+</div>

+ 2 - 2
resources/views/app/dna/patients.blade.php

@@ -13,9 +13,9 @@
 
         <div class="card-body p-0">
             <div class="p-3">
-                @include('app.mcp.patients_filters')
+                @include('app.dna.patients_filters')
             </div>
-            @include('app.mcp.patients-table')
+            @include('app.dna.patients-table')
         </div>
     </div>
 </div>

+ 261 - 0
resources/views/app/dna/patients_filters.blade.php

@@ -0,0 +1,261 @@
+<style>
+	#dna-patients-filters label {
+		font-weight: bold;
+	}
+
+	#dna-patients-filters .mw-100px {
+		min-width: 100px;
+	}
+</style>
+<form id="dna-patients-filters" method="GET" action="{{ route('dna.patients') }}" class="row align-items-end" v-cloak>
+	<!-- AGE	 -->
+	<div class="col-md-2">
+		<div class="form-group">
+			<label>Age:</label>
+			<select name="age_category" class="form-control input-sm" v-model="filters.age_category">
+				<option value="">All</option>
+				<option value="EXACTLY">Exactly</option>
+				<option value="LESS_THAN">Less Than</option>
+				<option value="GREATER_THAN">Greater Than</option>
+				<option value="BETWEEN">Between</option>
+				<option value="NOT_BETWEEN">Not Between</option>
+			</select>
+		</div>
+	</div>
+	<div v-show="filters.age_category" class="col-md-2">
+		<div class="form-group">
+			<label>&nbsp;</label>
+			<input name="age_value_1" v-model="filters.age_value_1" type="number" class="form-control input-sm" :placeholder="(filters.age_category === 'BETWEEN' || filters.age_category === 'NOT_BETWEEN') ? 'From' : 'Age'" />
+		</div>
+	</div>
+	<div v-show="filters.age_category && (filters.age_category === 'BETWEEN' || filters.age_category === 'NOT_BETWEEN')" class="col-md-2">
+		<div class="form-group">
+			<label>&nbsp;</label>
+			<input name="age_value_2" v-model="filters.age_value_2" type="number" class="form-control input-sm" placeholder="To" />
+		</div>
+	</div>
+	<!-- SEX -->
+	<div class="col-md-2">
+		<div class="form-group">
+			<label>Sex:</label>
+			<select name="sex" class="form-control input-sm" v-model="filters.sex">
+				<option value="">All</option>
+				<option value="M">Male</option>
+				<option value="F">Female</option>
+			</select>
+		</div>
+	</div>
+	<!-- BMI -->
+	<div class="col-md-2">
+		<div class="form-group">
+			<label>BMI:</label>
+			<select name="bmi_category" class="form-control input-sm" v-model="filters.bmi_category">
+				<option value="">All</option>
+				<option value="EXACTLY">Exactly</option>
+				<option value="LESS_THAN">Less Than</option>
+				<option value="GREATER_THAN">Greater Than</option>
+				<option value="BETWEEN">Between</option>
+				<option value="NOT_BETWEEN">Not Between</option>
+			</select>
+		</div>
+	</div>
+	<div v-show="filters.bmi_category" class="col-md-2">
+		<div class="form-group">
+			<label>&nbsp;</label>
+			<input name="bmi_value_1" v-model="filters.bmi_value_1" type="number" class="form-control input-sm" :placeholder="(filters.bmi_category === 'BETWEEN' || filters.bmi_category === 'NOT_BETWEEN') ? 'From' : 'BMI'" />
+		</div>
+	</div>
+	<div v-show="filters.bmi_category && (filters.bmi_category === 'BETWEEN' || filters.bmi_category === 'NOT_BETWEEN')" class="col-md-2">
+		<div class="form-group">
+			<label>&nbsp;</label>
+			<input name="bmi_value_2" v-model="filters.bmi_value_2" type="number" class="form-control input-sm" placeholder="To" />
+		</div>
+	</div>
+
+	<!-- LAST VISIT -->
+	<div class="col-md-2">
+		<div class="form-group">
+			<label>Last Visit **:</label>
+			<select name="last_visit_category" class="form-control input-sm" v-model="filters.last_visit_category">
+				<option value="">All</option>
+				<option value="EXACTLY">Exactly</option>
+				<option value="LESS_THAN">Less Than</option>
+				<option value="GREATER_THAN">Greater Than</option>
+				<option value="BETWEEN">Between</option>
+				<option value="NOT_BETWEEN">Not Between</option>
+			</select>
+		</div>
+	</div>
+	<div v-show="filters.last_visit_category" class="col-md-2">
+		<div class="form-group">
+			<label>&nbsp;</label>
+			<input name="last_visit_value_1" v-model="filters.last_visit_value_1" type="date" class="form-control input-sm" :placeholder="(filters.last_visit_category === 'BETWEEN' || filters.last_visit_category === 'NOT_BETWEEN') ? 'From' : 'Last Visit'" />
+		</div>
+	</div>
+	<div v-show="filters.last_visit_category && (filters.last_visit_category === 'BETWEEN' || filters.last_visit_category === 'NOT_BETWEEN')" class="col-md-2">
+		<div class="form-group">
+			<label>&nbsp;</label>
+			<input name="last_visit_value_2" v-model="filters.last_visit_value_2" type="date" class="form-control input-sm" placeholder="To" />
+		</div>
+	</div>
+
+	<!-- NEXT APPOINTMENT -->
+	<div class="col-md-2">
+		<div class="form-group">
+			<label>Next Appointment **:</label>
+			<select name="next_appointment_category" class="form-control input-sm" v-model="filters.next_appointment_category">
+				<option value="">All</option>
+				<option value="EXACTLY">Exactly</option>
+				<option value="LESS_THAN">Less Than</option>
+				<option value="GREATER_THAN">Greater Than</option>
+				<option value="BETWEEN">Between</option>
+				<option value="NOT_BETWEEN">Not Between</option>
+			</select>
+		</div>
+	</div>
+	<div v-if="filters.next_appointment_category" class="col-md-2">
+		<div class="form-group">
+			<label>&nbsp;</label>
+			<input name="next_appointment_value_1" v-model="filters.next_appointment_value_1" type="date" class="form-control input-sm" :placeholder="(filters.next_appointment_category === 'BETWEEN' || filters.next_appointment_category === 'NOT_BETWEEN') ? 'From' : 'Next Appointment'" />
+		</div>
+	</div>
+	<div v-if="filters.next_appointment_category && (filters.next_appointment_category === 'BETWEEN' || filters.next_appointment_category === 'NOT_BETWEEN')" class="col-md-2">
+		<div class="form-group">
+			<label>&nbsp;</label>
+			<input name="next_appointment_value_2" v-model="filters.next_appointment_value_2" type="date" class="form-control input-sm" placeholder="To" />
+		</div>
+	</div>
+
+	<!-- STATUS -->
+	<div class="col-md-2">
+		<div class="form-group">
+			<label>Status:</label>
+			<select name="status" class="form-control input-sm" v-model="filters.status">
+				<option value="">All</option>
+				<option value="ACTIVE">Active</option>
+				<option value="AWAITING_VISIT">Awaiting Visit</option>
+				<option value="INACTIVE">Inactive</option>
+			</select>
+		</div>
+	</div>
+
+	<!-- LAST WEIGHED-IN -->
+	<div class="col-md-2">
+		<div class="form-group">
+			<label>Last Weighed-In:</label>
+			<select name="last_weighed_in_category" class="form-control input-sm" v-model="filters.last_weighed_in_category">
+				<option value="">All</option>
+				<option value="EXACTLY">Exactly</option>
+				<option value="LESS_THAN">Less Than</option>
+				<option value="GREATER_THAN">Greater Than</option>
+				<option value="BETWEEN">Between</option>
+				<option value="NOT_BETWEEN">Not Between</option>
+			</select>
+		</div>
+	</div>
+	<div v-if="filters.last_weighed_in_category" class="col-md-2">
+		<div class="form-group">
+			<label>&nbsp;</label>
+			<input name="last_weighed_in_value_1" v-model="filters.last_weighed_in_value_1" type="date" class="form-control input-sm" :placeholder="(filters.last_weighed_in_category === 'BETWEEN' || filters.last_weighed_in_category === 'NOT_BETWEEN') ? 'From' : 'Enter Date'" />
+		</div>
+	</div>
+	<div v-if="filters.last_weighed_in_category && (filters.last_weighed_in_category === 'BETWEEN' || filters.last_weighed_in_category === 'NOT_BETWEEN')" class="col-md-2">
+		<div class="form-group">
+			<label>&nbsp;</label>
+			<input name="last_weighed_in_value_2" v-model="filters.last_weighed_in_value_2" type="date" class="form-control input-sm" placeholder="To" />
+		</div>
+	</div>
+
+	<!-- LAST BP -->
+	<div class="col-md-2">
+		<div class="form-group">
+			<label>Last BP:</label>
+			<select name="last_bp_category" class="form-control input-sm" v-model="filters.last_bp_category">
+				<option value="">All</option>
+				<option value="EXACTLY">Exactly</option>
+				<option value="LESS_THAN">Less Than</option>
+				<option value="GREATER_THAN">Greater Than</option>
+				<option value="BETWEEN">Between</option>
+				<option value="NOT_BETWEEN">Not Between</option>
+			</select>
+		</div>
+	</div>
+	<div v-if="filters.last_bp_category" class="col-md-2">
+		<div class="form-group">
+			<label>&nbsp;</label>
+			<input name="last_bp_value_1" v-model="filters.last_bp_value_1" type="date" class="form-control input-sm" :placeholder="(filters.last_bp_category === 'BETWEEN' || filters.last_bp_category === 'NOT_BETWEEN') ? 'From' : 'Enter Date'" />
+		</div>
+	</div>
+	<div v-if="filters.last_bp_category && (filters.last_bp_category === 'BETWEEN' || filters.last_bp_category === 'NOT_BETWEEN')" class="col-md-2">
+		<div class="form-group">
+			<label>&nbsp;</label>
+			<input name="last_bp_value_2" v-model="filters.last_bp_value_2" type="date" class="form-control input-sm" placeholder="To" />
+		</div>
+	</div>
+
+	<div class="col-md-2">
+		<div class="form-group d-flex">
+			<label>&nbsp;</label>
+			<button type="button" v-on:click.prevent="doSubmit()" class="btn btn-primary btn-sm mr-2 mw-100px">Apply Filters</button>
+			<a href="{{ route('dna.patients') }}" class="btn btn-danger btn-sm text-white mw-100px">Clear Filters</a>
+		</div>
+	</div>
+</form>
+
+<?php
+$loadedFilters = $filters;
+$allFilterKeys = [
+	'age_category',
+	'age_value_1',
+	'age_value_2',
+	'bmi_category',
+	'bmi_value_1',
+	'bmi_value_2',
+	'last_bp_category',
+	'last_bp_value_1',
+	'last_bp_value_2',
+	'last_visit_category',
+	'last_visit_value_1',
+	'last_visit_value_2',
+	'last_weighed_in_category',
+	'last_weighed_in_value_1',
+	'next_appointment_category',
+	'next_appointment_value_1',
+	'sex',
+	'status',
+];
+for ($i=0; $i < count($allFilterKeys); $i++) {
+	if (!isset($loadedFilters[$allFilterKeys[$i]]) || !$loadedFilters[$allFilterKeys[$i]]) {
+		$loadedFilters[$allFilterKeys[$i]] = '';
+	}
+}
+?>
+<script>
+	(function() {
+		function init() {
+			new Vue({
+				el: '#dna-patients-filters',
+				delimiters: ['@{{', '}}'],
+				data: {
+					filters: <?= json_encode($loadedFilters) ?>
+				},
+				methods: {
+					init: function() {
+						
+					},
+					doSubmit: function() {
+						fastLoad('{{ route('dna.patients') }}?' + $('#dna-patients-filters').serialize());
+						return false;
+					}
+				},
+				mounted: function() {
+					console.log(this.filters);
+					this.init();
+				},
+			});
+
+
+		}
+		addMCInitializer('dna-patients-filters', init, '#dna-patients-filters');
+	})();
+</script>

+ 5 - 3
resources/views/layouts/patient.blade.php

@@ -726,6 +726,7 @@ $isVisitNote = ($routeName === 'patients.view.notes.view.dashboard' && @$note &&
                                         </span>
                                         </div>
                                     </section>
+									
                                     <section class="hide-inside-popup screen-only vbox mt-2 align-self-start ml-1">
                                         @if($performer->pro->pro_type == 'ADMIN' || true)
                                         <div>
@@ -736,9 +737,10 @@ $isVisitNote = ($routeName === 'patients.view.notes.view.dashboard' && @$note &&
 											<button class="col-2-button" onclick="return openInRHS('/pro/meet/{{ $patient->uid }}')">Join Video</button>
 										</div>
                                     </section>
-																		<section class="hide-inside-popup screen-only vbox align-self-start mt-2 mx-2">
-																			@include('app.patient.coverage-status')
-																		</section>
+
+									<section class="hide-inside-popup screen-only vbox align-self-start mt-2 mx-2">
+										@include('app.patient.coverage-status')
+									</section>
 
 									<ul class="vbox ml-auto mt-2 align-self-start patient-header-address">
 										<li class="d-flex align-items-start">