Sfoglia il codice sorgente

Merge branch 'dev' into dev-vj

Vijayakrishnan 3 anni fa
parent
commit
114f0b6d29

+ 29 - 68
app/Http/Controllers/DnaController.php

@@ -38,35 +38,21 @@ class DnaController extends Controller
         $filters = $request->all();
         $patients = Client::whereNull('shadow_pro_id')->where('default_na_pro_id', $this->performer->pro->id);
 
-        // filters
-        /*
-        array:18 [▼
-          "age_category" => "LESS_THAN"
-          "age_value_1" => "34"
-          "age_value_2" => null
-          "sex" => "M"
-          "bmi_category" => "BETWEEN"
-          "bmi_value_1" => "20"
-          "bmi_value_2" => "25"
-          "last_visit_category" => "LESS_THAN"
-          "last_visit_value_1" => "2021-10-14"
-          "last_visit_value_2" => null
-          "next_appointment_category" => "LESS_THAN"
-          "next_appointment_value_1" => "2021-10-15"
-          "status" => "ACTIVE"
-          "last_weighed_in_category" => "EXACTLY"
-          "last_weighed_in_value_1" => "2021-10-07"
-          "last_bp_category" => "BETWEEN"
-          "last_bp_value_1" => "2021-10-01"
-          "last_bp_value_2" => "2021-10-31"
-        ]
-        */
+        if ($request->input('name')) {
+            $name = trim($request->input('name'));
+            if ($name) {
+                $patients = $patients->where(function ($q) use ($name) {
+                    $q->where('name_first', 'ILIKE', '%' . $name . '%')
+                        ->orWhere('name_last', 'ILIKE', '%' . $name . '%');
+                });
+            }
+        }
 
         $this->filterMultiQuery($request, $patients, 'age_in_years', 'age_category', 'age_value_1', 'age_value_2');
         $this->filterSimpleQuery($request, $patients, 'sex', 'sex');
-        $this->filterMultiQuery($request, $patients, 'usual_bmi', 'bmi_category', 'bmi_value_1', 'bmi_value_2');
-        $this->filterMultiQuery($request, $patients, 'most_recent_weight_at', 'last_weighed_in_category', 'last_weighed_in_value_1', 'last_weighed_in_value_2');
-        $this->filterMultiQuery($request, $patients, 'most_recent_bp_at', 'last_bp_category', 'last_bp_value_1', 'last_bp_value_2');
+        $this->filterMultiQuery($request, $patients, 'usual_bmi_max', 'bmi_category', 'bmi_value_1', 'bmi_value_2');
+        $this->filterMultiQuery($request, $patients, 'most_recent_completed_mcp_note_date', 'last_visit_category', 'last_visit_value_1', 'last_visit_value_2'); 
+        $this->filterMultiQuery($request, $patients, 'next_mcp_appointment_date', 'next_appointment_category', 'next_appointment_value_1', 'next_appointment_value_2');
 
         switch($request->input('status')) {
             case 'ACTIVE':
@@ -79,50 +65,19 @@ class DnaController extends Controller
                 $patients->where('is_active', '<>', true);
                 break;
         }
-
         $patients = $patients->orderBy('created_at', 'DESC')->paginate(20);
         return view('app.dna.patients', compact('patients', 'filters'));
     }
 
-    public function filterSimpleQuery(Request $request, $query, $columnName, $valueName) {
-        if($request->input($valueName)) {
-            $query->where($columnName, $request->input($valueName));
-        }
-    }
-    public function filterMultiQuery(Request $request, $query, $columnName, $keyName, $valueName1, $valueName2) {
-        switch($request->input($keyName)) {
-            case 'EXACTLY':
-                if($request->input($valueName1)) {
-                    $query->where($columnName, $request->input($valueName1));
-                }
-                break;
-            case 'LESS_THAN':
-                if($request->input($valueName1)) {
-                    $query->where($columnName, '<', $request->input($valueName1));
-                }
-                break;
-            case 'GREATER_THAN':
-                if($request->input($valueName1)) {
-                    $query->where($columnName, '>', $request->input($valueName1));
-                }
-                break;
-            case 'BETWEEN':
-                if($request->input($valueName1) && $request->input($valueName2)) {
-                    $query
-                        ->where($columnName, '>=', $request->input($valueName1))
-                        ->where($columnName, '<=', $request->input($valueName2));
-                }
-                break;
-            case 'NOT_BETWEEN':
-                if($request->input($valueName1) && $request->input($valueName2)) {
-                    $query
-                        ->where(function ($q) use ($request, $columnName, $valueName1, $valueName2) {
-                            $q->where($columnName, '<', $request->input($valueName1))
-                                ->orWhere($columnName, '>', $request->input($valueName2));
-                        });
-                }
-                break;
-        }
+    public function encounters(Request $request)
+    {
+        $filters = $request->all();
+        $notes = Note::query();
+        $notes = $notes->where('ally_pro_id', $this->performer->pro->id);
+        $this->filterMultiQuery($request, $notes, 'effective_time', 'date_category', 'date_value_1', 'date_value_2');
+        $this->filterSimpleQuery($request, $notes, 'new_or_fu_or_na', 'new_or_fu_or_na');
+        $notes = $notes->orderBy('created_at', 'DESC')->paginate(20);
+        return view('app.dna.encounters', compact('notes', 'filters'));
     }
 
     public function notes(Request $request)
@@ -133,8 +88,14 @@ class DnaController extends Controller
 
     public function appointments(Request $request)
     {
-        $data = [];
-        return view('app.dna.appointments', $data);
+        $filters = $request->all();
+        $appointments = Appointment::select('appointment.*')
+                        ->join('client', 'client.id', '=', 'appointment.client_id')
+                        ->where('client.default_na_pro_id', $this->performer->pro->id);
+        $this->filterMultiQuery($request, $appointments, 'raw_date', 'date_category', 'date_value_1', 'date_value_2');
+        $this->filterSimpleQuery($request, $appointments, 'status', 'status');
+        $appointments = $appointments->orderBy('end_time', 'DESC')->paginate(20);
+        return view('app.dna.appointments', compact('appointments', 'filters'));
     }
 
     public function bills(Request $request)

+ 5 - 0
app/Models/Client.php

@@ -842,6 +842,11 @@ ORDER BY m.ts DESC
         return $this->hasOne(Note::class, 'id', 'core_note_id');
     }
 
+    public function mostRecentCompletedMcpNote(){
+        return $this->hasOne(Note::class, 'id', 'most_recent_completed_mcp_note_id');
+    }
+
+    
     public function nonCoreVisitNotes() {
         return $this->hasMany(Note::class, 'client_id', 'id')
             ->where('id', '<>', $this->core_note_id)

+ 168 - 0
resources/views/app/dna/DnaController.php

@@ -0,0 +1,168 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use App\Models\Appointment;
+use App\Models\BDTDevice;
+use App\Models\CareMonth;
+use App\Models\Client;
+use App\Models\ClientBDTDevice;
+use App\Models\ClientInfoLine;
+use App\Models\Erx;
+use App\Models\Facility;
+use App\Models\Handout;
+use App\Models\IncomingReport;
+use App\Models\MBClaim;
+use App\Models\MBPayer;
+use App\Models\Note;
+use App\Models\NoteTemplate;
+use App\Models\Pro;
+use App\Models\Product;
+use App\Models\ProProAccess;
+use App\Models\SectionTemplate;
+use App\Models\Shipment;
+use App\Models\SupplyOrder;
+use App\Models\Ticket;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\File;
+
+use Illuminate\Support\Facades\Http;
+use PDF;
+
+class DnaController extends Controller
+{
+
+    public function patients(Request $request)
+    {
+        $filters = $request->all();
+        $patients = Client::whereNull('shadow_pro_id')->where('default_na_pro_id', $this->performer->pro->id);
+
+        if ($request->input('name')) {
+            $name = trim($request->input('name'));
+            if ($name) {
+                $patients = $patients->where(function ($q) use ($name) {
+                    $q->where('name_first', 'ILIKE', '%' . $name . '%')
+                        ->orWhere('name_last', 'ILIKE', '%' . $name . '%');
+                });
+            }
+        }
+
+        $this->filterMultiQuery($request, $patients, 'age_in_years', 'age_category', 'age_value_1', 'age_value_2');
+        $this->filterSimpleQuery($request, $patients, 'sex', 'sex');
+        $this->filterMultiQuery($request, $patients, 'usual_bmi_max', 'bmi_category', 'bmi_value_1', 'bmi_value_2');
+        $this->filterMultiQuery($request, $patients, 'most_recent_completed_mcp_note_date', 'last_visit_category', 'last_visit_value_1', 'last_visit_value_2'); 
+        $this->filterMultiQuery($request, $patients, 'next_mcp_appointment_date', 'next_appointment_category', 'next_appointment_value_1', 'next_appointment_value_2');
+
+        switch($request->input('status')) {
+            case 'ACTIVE':
+                $patients->where('is_active', true)->where('has_mcp_done_onboarding_visit', true);
+                break;
+            case 'AWAITING_VISIT':
+                $patients->where('is_active', true)->where('has_mcp_done_onboarding_visit', false);
+                break;
+            case 'INACTIVE':
+                $patients->where('is_active', '<>', true);
+                break;
+        }
+        $patients = $patients->orderBy('created_at', 'DESC')->paginate(20);
+        return view('app.dna.patients', compact('patients', 'filters'));
+    }
+
+    public function encounters(Request $request)
+    {
+        $filters = $request->all();
+        $notes = Note::query();
+        $notes = $notes->where('ally_pro_id', $this->performer->pro->id);
+        $this->filterMultiQuery($request, $notes, 'effective_time', 'date_category', 'date_value_1', 'date_value_2');
+        $this->filterSimpleQuery($request, $notes, 'new_or_fu_or_na', 'new_or_fu_or_na');
+        $notes = $notes->orderBy('created_at', 'DESC')->paginate(20);
+        return view('app.dna.encounters', compact('notes', 'filters'));
+    }
+
+    public function notes(Request $request)
+    {
+        $data = [];
+        return view('app.dna.notes', $data);
+    }
+
+    public function appointments(Request $request)
+    {
+        $filters = $request->all();
+        $appointments = Appointment::where('pro_id', $this->performer->pro->id);
+        $this->filterMultiQuery($request, $appointments, 'raw_date', 'date_category', 'date_value_1', 'date_value_2');
+        $this->filterSimpleQuery($request, $appointments, 'status', 'status');
+        $appointments = $appointments->orderBy('end_time', 'DESC')->paginate(20);
+        return view('app.dna.appointments', compact('appointments', 'filters'));
+    }
+
+    public function bills(Request $request)
+    {
+        $data = [];
+        return view('app.dna.bills', $data);
+    }
+
+    public function erx_and_orders(Request $request)
+    {
+        $data = [];
+        return view('app.dna.erx_and_orders', $data);
+    }
+
+    public function reports(Request $request)
+    {
+        $data = [];
+        return view('app.dna.reports', $data);
+    }
+
+    public function supply_orders(Request $request)
+    {
+        $data = [];
+        return view('app.dna.supply_orders', $data);
+    }
+
+    public function new_patients_awaiting_visit(Request $request){
+        $data = [];
+        return view('app.dna.new_patients_awaiting_visit', $data);
+    }
+    public function notes_pending_signature(Request $request){
+        $data = [];
+        return view('app.dna.notes_pending_signature', $data);
+    }
+    public function notes_pending_billing(Request $request){
+        $data = [];
+        return view('app.dna.notes_pending_billing', $data);
+    }
+    public function reports_pending_signature(Request $request){
+        $data = [];
+        return view('app.dna.reports_pending_signature', $data);
+    }
+    public function patients_without_appointments(Request $request){
+        $data = [];
+        return view('app.dna.patients_without_appointments', $data);
+    }
+    public function patients_overdue_for_visit(Request $request){
+        $data = [];
+        return view('app.dna.patients_overdue_for_visit', $data);
+    }
+    public function cancelled_appointments_pending_review(Request $request){
+        $data = [];
+        return view('app.dna.cancelled_appointments_pending_review', $data);
+    }
+    public function cancelled_bills_pending_review(Request $request){
+        $data = [];
+        return view('app.dna.cancelled_bills_pending_review', $data);
+    }
+    public function cancelled_supply_orders_pending_review(Request $request){
+        $data = [];
+        return view('app.dna.cancelled_supply_orders_pending_review', $data);
+    }
+    public function erx_and_orders_pending_signature(Request $request){
+        $data = [];
+        return view('app.dna.erx_and_orders_pending_signature', $data);
+    }
+    public function supply_orders_pending_signature(Request $request){
+        $data = [];
+        return view('app.dna.supply_orders_pending_signature', $data);
+    }
+
+}

+ 92 - 2
resources/views/app/dna/appointments.blade.php

@@ -1,5 +1,95 @@
 @extends ('layouts/template')
 
 @section('content')
-    <h1>Hi</h1>
-@endsection
+<div class="p-3 mcp-theme-1" id="patients-list">
+    <div class="card">
+
+        <div class="card-header px-3 py-2 d-flex align-items-center">
+            <strong class="mr-4">
+                <i class="fas fa-calendar-alt"></i>
+                Appointments
+            </strong>
+        </div>
+
+        <div class="card-body p-0">
+            <div class="p-3">
+                @include('app.dna.appointments_filters')
+            </div>
+            <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</th>
+                        <th class="px-3 border-0">DOB</th>
+                        <th class="px-3 border-0">Age</th>
+                        <th class="px-3 border-0">Sex</th>
+                        <th class="px-3 border-0">Insurance</th>
+                        <th class="px-3 border-0">MCP</th>
+                        <th class="px-3 border-0">Time</th>
+                        <th class="px-3 border-0">Status</th>
+                    </tr>
+                </thead>
+                <tbody>
+                    @foreach($appointments as $appointment)
+                    <tr>
+
+                        <td class="px-3 text-nowrap">
+                            <a native target="_blank" href="{{route('patients.view.dashboard', $appointment->client)}}">
+                                {{$appointment->client->chart_number}}
+                            </a>
+                        </td>
+                        <td class="px-3 text-nowrap">
+                            <a native target="_blank" href="{{route('patients.view.dashboard', $appointment->client)}}">
+                                {{$appointment->client->displayName()}}
+                            </a>
+                        </td>
+                        <td class="text-nowrap">{{ friendly_date_time($appointment->client->dob, false) }}</td>
+                        <td>{{ $appointment->client->age_in_years ?  $appointment->client->age_in_years : '-' }}</td>
+                        <td>{{ $appointment->client->sex }}</td>
+                        <td>
+                            <?php $coverageStatus = $appointment->client->getPrimaryCoverageStatus(); ?>
+                            <div class="text-nowrap">
+                                @if($coverageStatus === 'YES')
+                                <i class="fa fa-check-circle text-success" data-toggle="tooltip" data-placement="bottom" title="Covered"></i>
+                                @elseif($coverageStatus === 'NO')
+                                <i class="fa fa-times text-danger" data-toggle="tooltip" data-placement="bottom" title="Not Covered"></i>
+                                @else
+                                <i class="fa fa-exclamation-triangle text-warning-mellow" data-toggle="tooltip" data-placement="bottom" title="Unknown"></i>
+                                @endif
+                                <?php $coverage = $appointment->client->getPrimaryCoverage(); ?>
+                                @if($coverage)
+                                {{$coverage->insuranceDisplayName()}}
+                                @endif
+                            </div>
+                        </td>
+                        <td>{{ $appointment->client->mcp->displayName() }}</td>
+                        <td>
+                            <a href="/patients/view/{{$appointment->client->uid}}/calendar/{{$appointment->uid}}" class="font-weight-bold text-nowrap">
+                                {{friendlier_date_time($appointment->raw_date . ' ' . $appointment->raw_start_time)}}
+                            </a>
+                        </td>
+                        <td class="px-2">
+                            {{ $appointment->status }}
+                            @if($appointment->status_memo)
+                            <hr>
+                            {{$appointment->status_memo}}
+                            @endif
+                        </td>
+                    </tr>
+                    @endforeach
+
+                    @if(count($appointments) === 0)
+                    <tr>
+                        <td colspan="6">No records found!</td>
+                    </tr>
+                    @endif
+                </tbody>
+
+            </table>
+            <div class="ml-2 mt-2">
+                {{ $appointments->appends(request()->input())->links() }}
+            </div>
+        </div>
+    </div>
+</div>
+@endsection

+ 111 - 0
resources/views/app/dna/appointments_filters.blade.php

@@ -0,0 +1,111 @@
+<style>
+	#dna-appointments-filters label {
+		font-weight: bold;
+	}
+
+	#dna-appointments-filters .mw-100px {
+		min-width: 100px;
+	}
+	.filter-container{
+		display: flex;
+		align-items: flex-start;
+		flex-wrap: wrap;
+	}
+	.filter-container >div {
+		width: 165px;
+	}
+	.filter-container >div:not(:last-child) {
+		margin-right: 15px;
+	}
+</style>
+<form id="dna-appointments-filters" method="GET" action="{{ route('dna.appointments') }}" class="filter-container" v-cloak>
+	   <!-- DATE -->
+	<div class="">
+		<div class="form-group">
+			<label>Date:</label>
+			<select name="date_category" class="form-control input-sm" v-model="filters.date_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 v-show="filters.date_category" class="mt-2">
+				<div>
+					<input  name="date_value_1" v-model="filters.date_value_1" type="date" class="form-control input-sm"/>
+				</div>
+				<div v-show="filters.date_category === 'BETWEEN' || filters.date_category === 'NOT_BETWEEN'" class="mt-2">
+					<input name="date_value_2" v-model="filters.date_value_2" type="date" class="form-control input-sm"/>
+				</div>
+			</div>
+		</div>
+	</div>
+	<!-- STATUS -->
+	<div class="">
+		<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="PENDING">PENDING</option>
+				<option value="CONFIRMED">CONFIRMED</option>
+				<option value="CANCELLED">CANCELLED</option>
+				<option value="COMPLETED">COMPLETED</option>
+			</select>
+		</div>
+	</div>
+
+	<div class="">
+		<div class="form-group">
+			<label>&nbsp;</label>
+			<div class="d-flex">
+				<button type="submit" v-on:click.prevent="doSubmit()" class="btn btn-primary btn-sm mr-2"><i class="fas fa-filter"></i> Filter</button>
+				<a href="#" v-on:click.prevent="fastLoad('{{route('dna.appointments')}}')" class="btn btn-link btn-sm text-danger">Clear Filters</a>
+			</div>
+		</div>
+	</div>
+</form>
+
+<?php
+$loadedFilters = $filters;
+$allFilterKeys = [
+	'date_category',
+	'date_value_1',
+	'date_value_2',
+	'status'
+];
+for ($i=0; $i < count($allFilterKeys); $i++) {
+	if (!isset($loadedFilters[$allFilterKeys[$i]]) || !$loadedFilters[$allFilterKeys[$i]]) {
+		$loadedFilters[$allFilterKeys[$i]] = '';
+	}
+}
+?>
+
+<script>
+	(function() {
+		function init() {
+			window.apapp = new Vue({
+				el: '#dna-appointments-filters',
+				delimiters: ['@{{', '}}'],
+				data: {
+					filters: <?= json_encode($loadedFilters) ?>
+				},
+				methods: {
+					doSubmit: function() {
+						fastLoad('{{ route("dna.appointments") }}?' + $('#dna-appointments-filters').serialize());
+						return false;
+					},
+					init: function() {
+
+					}
+				},
+				mounted: function() {
+					this.init();
+				},
+			});
+
+
+		}
+		addMCInitializer('dna-appointments-filters', init, '#dna-appointments-filters');
+	})();
+</script>

+ 90 - 0
resources/views/app/dna/encounters.blade.php

@@ -0,0 +1,90 @@
+@extends ('layouts/template')
+
+@section('content')
+<div class="p-3 mcp-theme-1" id="patients-list">
+    <div class="card">
+
+        <div class="card-header px-3 py-2 d-flex align-items-center">
+            <strong class="mr-4">
+                <i class="fas fa-notes-medical"></i>
+                Encounters
+            </strong>
+        </div>
+
+        <div class="card-body p-0">
+            <div class="p-3">
+                @include('app.dna.encounters_filters')
+            </div>
+            <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</th>
+                        <th class="px-3 border-0">DOB</th>
+                        <th class="px-3 border-0">Age</th>
+                        <th class="px-3 border-0">Sex</th>
+                        <th class="px-3 border-0">Insurance</th>
+                        <th class="px-3 border-0">MCP</th>
+                        <th class="px-3 border-0">Visit Date</th>
+                    </tr>
+                </thead>
+                <tbody>
+                    @foreach ($notes as $note)
+                    <tr class="{{ $note->is_cancelled ? 'cancelled-item always-clickable' : '' }}">
+                        <td class="px-3 text-nowrap">
+                            <a native target="_blank" href="{{route('patients.view.dashboard', $note->client)}}">
+                                {{$note->client->chart_number}}
+                            </a>
+                        </td>
+                        <td class="px-3 text-nowrap">
+                            <a native target="_blank" href="{{route('patients.view.dashboard', $note->client)}}">
+                                {{$note->client->displayName()}}
+                            </a>
+                        </td>
+                        <td class="text-nowrap">{{ friendly_date_time($note->client->dob, false) }}</td>
+                        <td>{{ $note->client->age_in_years ?  $note->client->age_in_years : '-' }}</td>
+                        <td>{{ $note->client->sex }}</td>
+                        <td>
+                            <?php $coverageStatus = $note->client->getPrimaryCoverageStatus(); ?>
+                            <div class="text-nowrap">
+                                @if($coverageStatus === 'YES')
+                                <i class="fa fa-check-circle text-success" data-toggle="tooltip" data-placement="bottom" title="Covered"></i>
+                                @elseif($coverageStatus === 'NO')
+                                <i class="fa fa-times text-danger" data-toggle="tooltip" data-placement="bottom" title="Not Covered"></i>
+                                @else
+                                <i class="fa fa-exclamation-triangle text-warning-mellow" data-toggle="tooltip" data-placement="bottom" title="Unknown"></i>
+                                @endif
+                                <?php $coverage = $note->client->getPrimaryCoverage(); ?>
+                                @if($coverage)
+                                {{$coverage->insuranceDisplayName()}}
+                                @endif
+                            </div>
+                        </td>
+                        <td>{{ $note->client->mcp->displayName() }}</td>
+                        <td class="px-2">
+                            <a href="/patients/view/{{ $note->client->uid }}/notes/view/{{ $note->uid }}" class="font-weight-bold">
+                                {{ friendly_date_time($note->effective_dateest, false) }}
+                            </a>
+                            @if(!!$note->visitTemplate)
+                            <span class="text-info font-weight-bold">*</span>
+                            @endif
+                            <span class="ml-1">{{ $note->is_cancelled ? '[cancelled]' : '' }}</span>
+                        </td>
+                    </tr>
+                    @endforeach
+
+                    @if(count($notes) === 0)
+                    <tr>
+                        <td colspan="8">No records found!</td>
+                    </tr>
+                    @endif
+                </tbody>
+
+            </table>
+            <div class="ml-2 mt-2">
+                {{ $notes->appends(request()->input())->links() }}
+            </div>
+        </div>
+    </div>
+</div>
+@endsection

+ 107 - 0
resources/views/app/dna/encounters_filters.blade.php

@@ -0,0 +1,107 @@
+<style>
+	#dna-notes-filters label {
+		font-weight: bold;
+	}
+
+	#dna-notes-filters .mw-100px {
+		min-width: 100px;
+	}
+	.filter-container{
+		display: flex;
+		align-items: flex-start;
+		flex-wrap: wrap;
+	}
+	.filter-container >div {
+		width: 165px;
+	}
+	.filter-container >div:not(:last-child) {
+		margin-right: 15px;
+	}
+</style>
+<form id="dna-notes-filters" method="GET" action="{{ route('dna.encounters') }}" class="filter-container" v-cloak>
+	<!-- DATE	 -->
+	<div>
+		<div class="form-group">
+			<label>Date:</label>
+			<select name="date_category" class="form-control input-sm" v-model="filters.date_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 v-show="filters.date_category" class="filter-child-container mt-2">
+				<div>
+					<input  name="date_value_1" v-model="filters.date_value_1" type="date" class="form-control input-sm"/>
+				</div>
+				<div v-show="filters.date_category === 'BETWEEN' || filters.date_category === 'NOT_BETWEEN'" class="mt-2">
+					<input name="date_value_2" v-model="filters.date_value_2" type="date" class="form-control input-sm"/>
+				</div>
+			</div>
+		</div>
+	</div>
+	<!-- STATUS -->
+	<div>
+		<div class="form-group">
+			<label>New/FU:</label>
+			<select name="new_or_fu_or_na" class="form-control input-sm" v-model="filters.new_or_fu_or_na">
+				<option value="">All</option>
+				<option value="NEW">New</option>
+				<option value="FU">FU</option>
+			</select>
+		</div>
+	</div>
+
+	<div>
+		<div class="form-group">
+			<label>&nbsp;</label>
+			<div class="d-flex">
+				<button type="submit"  v-on:click.prevent="doSubmit()" class="btn btn-primary btn-sm mr-2"><i class="fas fa-filter"></i> Filter</button>
+				<a href="#" v-on:click.prevent="fastLoad('{{route('dna.encounters')}}')" class="btn btn-link btn-sm text-danger">Clear Filters</a>
+			</div>
+		</div>
+	</div>
+</form>
+<?php
+$loadedFilters = $filters;
+$allFilterKeys = [
+	'date_category',
+	'date_value_1',
+	'date_value_2',
+	'new_or_fu_or_na'
+];
+for ($i=0; $i < count($allFilterKeys); $i++) {
+	if (!isset($loadedFilters[$allFilterKeys[$i]]) || !$loadedFilters[$allFilterKeys[$i]]) {
+		$loadedFilters[$allFilterKeys[$i]] = '';
+	}
+}
+?>
+
+<script>
+	(function() {
+		function init() {
+			window.apapp = new Vue({
+				el: '#dna-notes-filters',
+				delimiters: ['@{{', '}}'],
+				data: {
+					filters: <?= json_encode($loadedFilters) ?>
+				},
+				methods: {
+					doSubmit: function() {
+						fastLoad('{{ route("dna.encounters") }}?' + $('#dna-notes-filters').serialize());
+						return false;
+					},
+					init: function() {
+
+					}
+				},
+				mounted: function() {
+					this.init();
+				},
+			});
+
+		}
+		addMCInitializer('dna-notes-filters', init, '#dna-notes-filters');
+	})();
+</script>

+ 52 - 25
resources/views/app/dna/patients-table.blade.php

@@ -1,20 +1,21 @@
 <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">#</th>
+			<th class="px-3 border-0">Name</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">Age</th>
+			<th class="px-3 border-0">Sex</th>
 			<th class="px-3 border-0">BMI</th>
 			<th class="px-3 border-0">Insurance</th>
+			<th class="px-3 border-0">MCP</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 d-none">Last Weight-In</th>
+			<th class="px-3 border-0 d-none">Last BP</th>
 			<th class="px-3 border-0">Assigned On</th>
 		</tr>
 	</thead>
@@ -22,40 +23,66 @@
 		@foreach($patients as $patient)
 		<tr>
 			<td class="px-3">
-				<a href="{{route('patients.view.dashboard', $patient)}}">
+				<a native target="_blank" 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 class="text-nowrap">{{ friendly_date_time($patient->dob, false) }}</td>
+			<td>{{ $patient->age_in_years ?  $patient->age_in_years : '-' }}</td>
 			<td>{{ $patient->sex }}</td>
-			<td>{{ $patient->mcp->name_display }}</td>
-			<td>{{ $patient->usual_bmi }}</td>
+			<td>
+				<div class="d-flex flex-column">
+					@if($patient->usual_bmi_min && $patient->usual_bmi_max)
+					<small class="text-muted">BMI (Usual): <b>{{ $patient->usual_bmi_min }}</b> {{ $patient->usual_bmi_min_category }} to <b>{{ $patient->usual_bmi_max }}</b> {{ $patient->usual_bmi_max_category }}</small>
+					@endif
+					@if($patient->ideal_bmi)
+					<small class="text-muted">BMI (Ideal) <b>{{ $patient->ideal_bmi }}</b> {{ $patient->ideal_bmi_category }}</small>
+					@endif
+				</div>
+			</td>
 			<td>
 				<?php $coverageStatus = $patient->getPrimaryCoverageStatus(); ?>
-				@if($coverageStatus === 'YES')
-				<div class="text-nowrap">Covered <i class="fa fa-check-circle text-success"></i>
+				<div class="text-nowrap">
+					@if($coverageStatus === 'YES')
+					<i class="fa fa-check-circle text-success" data-toggle="tooltip" data-placement="bottom" title="Covered"></i>
+					@elseif($coverageStatus === 'NO')
+					<i class="fa fa-times text-danger" data-toggle="tooltip" data-placement="bottom" title="Not Covered"></i>
+					@else
+					<i class="fa fa-exclamation-triangle text-warning-mellow" data-toggle="tooltip" data-placement="bottom" title="Unknown"></i>
+					@endif
+					<?php $coverage = $patient->getPrimaryCoverage(); ?>
+					@if($coverage)
+					{{$coverage->insuranceDisplayName()}}
+					@endif
+				</div>
+			</td>
+			<td>
+				<div class="d-flex flex-column">
+					<span>{{ $patient->mcp->displayName() }}</span>
+					@if($patient->next_mcp_appointment_date)
+						<span>Next Appt. {{ friendly_date_time($patient->next_mcp_appointment_date) }}</span>
+					@endif
+					<?= $recentNote = $patient->mostRecentCompletedMcpNote; ?>
+					@if($recentNote)
+					<div>
+						Note: <a href="/patients/view/{{ $patient->uid }}/notes/view/{{ $recentNote->uid }}" class="font-weight-bold">
+                        {{ friendly_date_time($recentNote->effective_dateest, false) }}
+                    </a>
+					</div>
+					@endif
 				</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->insuranceDisplayName()}}
-				@endif
 			</td>
 			<td>{{$patient->lastMcpAppointment ? friendly_date_time($patient->lastMcpAppointment->raw_date.' '.$patient->lastMcpAppointment->raw_start_time) : '-'}}</td>
 			<td>{{$patient->nextMcpAppointment ? friendly_date_time($patient->nextMcpAppointment->raw_date.' '.$patient->nextMcpAppointment->raw_start_time) : '-'}}</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>
+			<td class="d-none">
 				<?php $m = $patient->lastMeasurementOfType('Wt. (lbs.)'); ?>
 				{{$m && $m->value ? round($m->value, 2) : '-'}}
 			</td>
-			<td>
+			<td class="d-none">
 				<?php $m = $patient->lastMeasurementOfType('BP'); ?>
 				{{$m && $m->value ? $m->value : '-'}}
 			</td>
@@ -65,12 +92,12 @@
 
 		@if(count($patients) === 0)
 		<tr>
-			<td colspan="14">No records found!</td>
+			<td colspan="16">No records found!</td>
 		</tr>
 		@endif
 	</tbody>
 
 </table>
 <div class="p-3">
-	{{$patients->links()}}
+	{{$patients->withQueryString()->links()}}
 </div>

+ 76 - 123
resources/views/app/dna/patients_filters.blade.php

@@ -6,10 +6,34 @@
 	#dna-patients-filters .mw-100px {
 		min-width: 100px;
 	}
+
+	.filter-container {
+		display: flex;
+		align-items: flex-start;
+		flex-wrap: wrap;
+	}
+
+	.filter-container>div {
+		width: 165px;
+	}
+
+	.filter-container>div:not(:last-child) {
+		margin-right: 15px;
+	}
+
+	.sm-section {
+		width: 125px !important;
+	}
 </style>
-<form id="dna-patients-filters" method="GET" action="{{ route('dna.patients') }}" class="row align-items-start" v-cloak>
+<form id="dna-patients-filters" method="GET" action="{{ route('dna.patients') }}" class="filter-container" v-cloak>
+	<div class="sm-section">
+		<div class="form-group">
+			<label>Name:</label>
+			<input name="name" class="form-control input-sm" v-model="filters.name">
+		</div>
+	</div>
 	<!-- AGE	 -->
-	<div class="col-md-2">
+	<div class="sm-section">
 		<div class="form-group">
 			<label>Age:</label>
 			<select name="age_category" class="form-control input-sm" v-model="filters.age_category">
@@ -20,22 +44,18 @@
 				<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 v-show="filters.age_category" class="mt-2">
+				<div>
+					<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 v-show="filters.age_category === 'BETWEEN' || filters.age_category === 'NOT_BETWEEN'" class="mt-2">
+					<input name="age_value_2" v-model="filters.age_value_2" type="number" class="form-control input-sm" placeholder="To" />
+				</div>
+			</div>
 		</div>
 	</div>
 	<!-- SEX -->
-	<div class="col-md-2">
+	<div class="sm-section">
 		<div class="form-group">
 			<label>Sex:</label>
 			<select name="sex" class="form-control input-sm" v-model="filters.sex">
@@ -46,7 +66,7 @@
 		</div>
 	</div>
 	<!-- BMI -->
-	<div class="col-md-2">
+	<div class="sm-section">
 		<div class="form-group">
 			<label>BMI:</label>
 			<select name="bmi_category" class="form-control input-sm" v-model="filters.bmi_category">
@@ -57,25 +77,21 @@
 				<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 v-show="filters.bmi_category" class="mt-2">
+				<div>
+					<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 v-show="filters.bmi_category === 'BETWEEN' || filters.bmi_category === 'NOT_BETWEEN'" class="mt-2">
+					<input name="bmi_value_2" v-model="filters.bmi_value_2" type="number" class="form-control input-sm" placeholder="To" />
+				</div>
+			</div>
 		</div>
 	</div>
 
 	<!-- LAST VISIT -->
-	<div class="col-md-2">
+	<div class="sm-section">
 		<div class="form-group">
-			<label>Last Visit **:</label>
+			<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>
@@ -84,25 +100,21 @@
 				<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 v-show="filters.last_visit_category" class="mt-2">
+				<div>
+					<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 v-show="filters.last_visit_category === 'BETWEEN' || filters.last_visit_category === 'NOT_BETWEEN'" class="mt-2">
+					<input name="last_visit_value_2" v-model="filters.last_visit_value_2" type="date" class="form-control input-sm" placeholder="To" />
+				</div>
+			</div>
 		</div>
 	</div>
 
 	<!-- NEXT APPOINTMENT -->
-	<div class="col-md-2">
+	<div>
 		<div class="form-group">
-			<label>Next Appointment **:</label>
+			<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>
@@ -111,23 +123,19 @@
 				<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 v-show="filters.next_appointment_category" class="mt-2">
+				<div>
+					<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 Appt.'" />
+				</div>
+				<div v-show="filters.next_appointment_category === 'BETWEEN' || filters.next_appointment_category === 'NOT_BETWEEN'" class="mt-2">
+					<input name="next_appointment_value_2" v-model="filters.next_appointment_value_2" type="date" class="form-control input-sm" placeholder="To" />
+				</div>
+			</div>
 		</div>
 	</div>
 
 	<!-- STATUS -->
-	<div class="col-md-2">
+	<div class="sm-section">
 		<div class="form-group">
 			<label>Status:</label>
 			<select name="status" class="form-control input-sm" v-model="filters.status">
@@ -139,65 +147,13 @@
 		</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>
 		<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 class=" d-flex">
+				<button type="button" v-on:click.prevent="doSubmit()" class="btn btn-primary btn-sm mr-2"><i class="fas fa-filter"></i> Filter</button>
+				<a href="#" v-on:click.prevent="fastLoad('{{route('dna.patients')}}')" class="btn btn-link btn-sm text-danger">Clear Filters</a>
+			</div>
 		</div>
 	</div>
 </form>
@@ -205,26 +161,23 @@
 <?php
 $loadedFilters = $filters;
 $allFilterKeys = [
+	'name',
 	'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',
+	'bmi_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',
+	'next_appointment_value_2',
 	'sex',
 	'status',
 ];
-for ($i=0; $i < count($allFilterKeys); $i++) {
+for ($i = 0; $i < count($allFilterKeys); $i++) {
 	if (!isset($loadedFilters[$allFilterKeys[$i]]) || !$loadedFilters[$allFilterKeys[$i]]) {
 		$loadedFilters[$allFilterKeys[$i]] = '';
 	}
@@ -241,10 +194,10 @@ for ($i=0; $i < count($allFilterKeys); $i++) {
 				},
 				methods: {
 					init: function() {
-						
+
 					},
 					doSubmit: function() {
-						fastLoad('{{ route('dna.patients') }}?' + $('#dna-patients-filters').serialize());
+						fastLoad('{{ route("dna.patients") }}?' + $('#dna-patients-filters').serialize());
 						return false;
 					}
 				},

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

@@ -212,6 +212,8 @@
                         @elseif($pro && $pro->isDefaultNA())
 
                             <a class="dropdown-item" href="/practice-management/my-teams">My Teams</a>
+                            <a class="dropdown-item" href="{{ route('dna.encounters') }}">Encounters</a>
+                            <a class="dropdown-item" href="{{ route('dna.appointments') }}">Appointments</a>
 
                         @endif
 

+ 1 - 0
routes/web.php

@@ -107,6 +107,7 @@ Route::middleware('pro.auth')->group(function () {
     Route::name('dna.')->prefix('n')->group(function () {
 
         Route::get('patients', 'DnaController@patients')->name('patients');
+        Route::get('encounters', 'DnaController@encounters')->name('encounters');
         Route::get('notes', 'DnaController@notes')->name('notes');
         Route::get('appointments', 'DnaController@appointments')->name('appointments');
         Route::get('bills', 'DnaController@bills')->name('bills');