Peter Muturi 1 year ago
parent
commit
e6d107d490

+ 4 - 4
app/Helpers/helpers.php

@@ -1176,7 +1176,7 @@ if(!function_exists('getDefaultCompanyClientUidSession')) {
 if(!function_exists('formatAsTitle')) {
     function formatAsTitle($inputString) {
         $cleanString = preg_replace('/[^a-zA-Z0-9\s]/', '', $inputString);
-        $titleCaseString = ucwords(strtolower($cleanString));        
+        $titleCaseString = ucwords(strtolower($cleanString));
         return $titleCaseString;
     }
 }
@@ -1185,15 +1185,15 @@ if(!function_exists('getSurveyData')) {
     function getSurveyData($survey) {
         $surveyFormPath = resource_path(Survey::FORM_PATH . '/' . $survey->internal_name . '.blade.php');
         if(!file_exists($surveyFormPath)) return null;
-        
+
         $entity = null;
         if($survey->entity_type === 'Client'){
             $entity = Client::where('uid', $survey->entity_uid)->first();
         }
 
         $preview = true;
-        $layout = 'app.admin.surveys.partials.preview-layout';
-        $html = (string) view('app.admin.surveys.forms.'.$survey->internal_name, compact('entity', 'survey', 'preview', 'layout'));
+        $layout = 'app.patient.surveys.partials.preview-layout';
+        $html = (string) view('app.patient.surveys.forms.'.$survey->internal_name, compact('entity', 'survey', 'preview', 'layout'));
         return $html;
     }
 }

+ 6 - 77
app/Http/Controllers/AdminController.php

@@ -34,7 +34,6 @@ use Illuminate\Support\Facades\Http;
 use PDF;
 use Illuminate\Support\Facades\Schema;
 use App\Models\AdminPatient;
-use App\Models\Survey;
 use App\Models\SupplyOrderView;
 use Illuminate\Pagination\LengthAwarePaginator;
 
@@ -779,9 +778,9 @@ class AdminController extends Controller
                 $s = "'" . '%'.strtolower(trim($string)).'%'. "'";
                 array_push($searchArray, $s);
             }
-            $searchArrayStrings = implode(',', $searchArray);  
+            $searchArrayStrings = implode(',', $searchArray);
         }
-        
+
 
         $qry = "
         SELECT
@@ -801,7 +800,7 @@ class AdminController extends Controller
         c.most_recent_completed_mcp_note_date as last_visit_date,
         (cover.plan_type) as cover
 
-        FROM 
+        FROM
         point p
         LEFT JOIN client c on c.id = p.client_id
         LEFT JOIN pro mcp on mcp.id = c.mcp_pro_id
@@ -811,7 +810,7 @@ class AdminController extends Controller
         if($searchArrayStrings){
             $qry = $qry . "WHERE lower(p.data) ILIKE any (array[".$searchArrayStrings."])";
         }
-        
+
 
         $records = DB::select($qry);
 
@@ -821,8 +820,8 @@ class AdminController extends Controller
 
         $records = new LengthAwarePaginator(
             $collect->forPage($page, $size),
-            $collect->count(), 
-            $size, 
+            $collect->count(),
+            $size,
             $page
           );
 
@@ -830,74 +829,4 @@ class AdminController extends Controller
 
         return view('app.admin.patients-notes-points-filter', compact('records', 'filters'));
     }
-
-    public function surveys(Request $request)
-    {
-        $filters = $request->all();
-        $entityTypes = Survey::ALLOWED_ENTITIES;
-        $surveyFormsPath = resource_path(Survey::FORM_PATH);
-        $filesInFolder = File::allFiles($surveyFormsPath);
-        $forms = [];
-
-
-        foreach ($filesInFolder as $path) {
-            $file = pathinfo($path);
-            $fileName = $file['filename'];
-            $internalName = explode('.', $fileName)[0];
-            $forms[] = $internalName;
-        }
-        
-        $records = Survey::query();
-        $searchString = $request->get('string');
-        if($searchString){
-            $searchString = strtolower($searchString);
-            $records = $records->where(function ($q) use ($searchString) {
-                return $q->orWhereRaw('LOWER(title::text) ILIKE ?', ['%' . $searchString . '%'])
-                    ->orWhereRaw('LOWER(internal_name::text) ILIKE ?', ['%' . $searchString . '%'])
-                    ->orWhereRaw('survey_data ILIKE ?', ['%' . $searchString . '%']);
-            });
-        }
-
-        $entityType = $request->get('entity_type');
-        if($entityType){
-            $records = $records->where('entity_type', $entityType);
-        }
-
-        $records = $records->orderBy('created_at', 'DESC')->paginate(5);
-        return view('app.admin.surveys.list', compact('forms', 'records', 'entityTypes', 'filters'));
-    }
-
-    public function getEntityRecords(Request $request)
-    {
-        $term = $request->get('term');
-        $type = $request->get('type');
-        if(!in_array($type, Survey::ALLOWED_ENTITIES)){
-            return $this->fail('Invalid entity type');
-        }
-        $records = [];
-        if($type === 'Client'){
-            $clients = Client::query();
-            $clients = $clients->where('is_active', true);
-
-            $clients = $clients->where(function ($q) use ($term) {
-                return $q->orWhereRaw('LOWER(name_first::text) ILIKE ?', ['%' . $term . '%'])
-                    ->orWhereRaw('LOWER(name_last::text) ILIKE ?', ['%' . $term . '%'])
-                    ->orWhereRaw('LOWER(email_address::text) ILIKE ?', ['%' . $term . '%'])
-                    ->orWhereRaw('cell_number ILIKE ?', ['%' . $term . '%']);
-            });
-            $clients = $clients->orderBy('name_first', 'ASC')->limit(10)->get();
-            $clientsData = $clients->map(function($client) {
-                return [
-                    "uid" => $client->uid,
-                    "id" => $client->id,
-                    "text" => $client->displayName(),
-                ];
-            });
-            return json_encode([
-                "results" => $clientsData
-            ]);
-        }
-
-        return $this->pass($records);
-    }
 }

+ 73 - 3
app/Http/Controllers/PatientController.php

@@ -39,6 +39,7 @@ use Illuminate\Support\Facades\File;
 use App\Models\Measurement;
 use App\Models\ClientReviewRequest;
 use App\Models\Point;
+use App\Models\Survey;
 use Illuminate\Support\Facades\Http;
 use PDF;
 
@@ -130,7 +131,7 @@ class PatientController extends Controller
                 "value" => $shortcut->text
             ];
         }
-        
+
         $recentMeasurements = $patient->recentMeasurements;
 
         $latestVitals = Point::where('client_id', $patient->id)->where('category', 'VITALS')->orderBy('id', 'DESC')->first();
@@ -749,7 +750,7 @@ class PatientController extends Controller
 
         $companyClients = CompanyClient::where('client_id', $patient->id)->get();
         $companyClientsIds = CompanyClient::where('client_id', $patient->id)->pluck('id')->toArray();
-        
+
         $documents = CompanyProDocument::whereIn('company_client_id', $companyClientsIds)->orderBy('created_at', 'DESC')->paginate(50);
 
         return view('app.patient.client-documents-requests', compact('templates', 'patient', 'companyClients', 'documents'));
@@ -785,9 +786,78 @@ class PatientController extends Controller
                     }
                 }
             }
-            
+
         }
         if($isCptSubmitted) return $this->pass('SUBMITTED');
         return $this->pass('NOT_SUBMITTED');
     }
+    public function surveys(Request $request, Client $patient)
+    {
+        $filters = $request->all();
+        $entityTypes = Survey::ALLOWED_ENTITIES;
+        $surveyFormsPath = resource_path(Survey::FORM_PATH);
+        $filesInFolder = File::allFiles($surveyFormsPath);
+        $forms = [];
+
+
+        foreach ($filesInFolder as $path) {
+            $file = pathinfo($path);
+            $fileName = $file['filename'];
+            $internalName = explode('.', $fileName)[0];
+            $forms[] = $internalName;
+        }
+
+        $records = Survey::where('entity_uid', $patient->id);
+        $searchString = $request->get('string');
+        if($searchString){
+            $searchString = strtolower($searchString);
+            $records = $records->where(function ($q) use ($searchString) {
+                return $q->orWhereRaw('LOWER(title::text) ILIKE ?', ['%' . $searchString . '%'])
+                    ->orWhereRaw('LOWER(internal_name::text) ILIKE ?', ['%' . $searchString . '%'])
+                    ->orWhereRaw('survey_data ILIKE ?', ['%' . $searchString . '%']);
+            });
+        }
+
+        $entityType = $request->get('entity_type');
+        if($entityType){
+            $records = $records->where('entity_type', $entityType);
+        }
+
+        $records = $records->orderBy('created_at', 'DESC')->paginate(5);
+        return view('app.patient.surveys.list', compact('forms', 'records', 'entityTypes', 'filters', 'patient'));
+    }
+
+    public function getEntityRecords(Request $request, Client $patient)
+    {
+        $term = $request->get('term');
+        $type = $request->get('type');
+        if(!in_array($type, Survey::ALLOWED_ENTITIES)){
+            return $this->fail('Invalid entity type');
+        }
+        $records = [];
+        if($type === 'Client'){
+            $clients = Client::query();
+            $clients = $clients->where('is_active', true);
+
+            $clients = $clients->where(function ($q) use ($term) {
+                return $q->orWhereRaw('LOWER(name_first::text) ILIKE ?', ['%' . $term . '%'])
+                    ->orWhereRaw('LOWER(name_last::text) ILIKE ?', ['%' . $term . '%'])
+                    ->orWhereRaw('LOWER(email_address::text) ILIKE ?', ['%' . $term . '%'])
+                    ->orWhereRaw('cell_number ILIKE ?', ['%' . $term . '%']);
+            });
+            $clients = $clients->orderBy('name_first', 'ASC')->limit(10)->get();
+            $clientsData = $clients->map(function($client) {
+                return [
+                    "uid" => $client->uid,
+                    "id" => $client->id,
+                    "text" => $client->displayName(),
+                ];
+            });
+            return json_encode([
+                "results" => $clientsData
+            ]);
+        }
+
+        return $this->pass($records);
+    }
 }

+ 2 - 1
app/Http/Middleware/EnsureProCanAccessPatient.php

@@ -19,13 +19,14 @@ class EnsureProCanAccessPatient
         $sessionKey = $request->cookie('sessionKey');
         $appSession = AppSession::where('session_key', $sessionKey)->where('is_active', true)->first();
         $authenticated = $sessionKey && $appSession && $appSession->pro;
-       
+
         if (!$authenticated) {
             abort(403);
         }
 
         $patient = \request()->route('patient');
 
+
         if(!!$patient) {
             if(!$appSession->pro->canAccess($patient->uid)) {
                 abort(403);

+ 1 - 1
app/Models/Survey.php

@@ -6,7 +6,7 @@ class Survey extends Model
 {
     protected $table = 'survey';
 
-    const FORM_PATH = "views/app/admin/surveys/forms";
+    const FORM_PATH = "views/app/patient/surveys/forms";
     const ALLOWED_ENTITIES = [
         'Client',
     ];

+ 0 - 106
resources/views/app/admin/surveys/list.blade.php

@@ -1,106 +0,0 @@
-@extends ('layouts/template')
-
-@section('content')
-    <link href="/select2/select2.min.css" rel="stylesheet" />
-    <script src="/select2/select2.min.js"></script>
-
-    <div class="p-3 mcp-theme-1" id="patients-list">
-        <div class="card">
-            <div class="card-header px-3 py-2">
-                <div class="d-flex align-items-start justify-content-between">
-                    <div>
-                        <strong class="mr-4">
-                            <i class="fas fa-clipboard-list"></i>
-                            Surveys
-                        </strong>
-                    </div>
-                    <div>
-                        @include('app.admin.surveys.partials.create')
-                    </div>
-                </div>
-
-            </div>
-            <div class="p-3">
-			@include('app.admin.surveys.partials.filters')
-		</div>
-            <table class="table table-hover bg-white p-0 m-0 table-bordered table-sm border-top border-bottom ">
-                <thead class="bg-light">
-                    <tr>
-                        <th class="border-0" style="width:150px">Created At</th>
-                        <th class="border-0" style="width:150px">Title</th>
-                        <th class="border-0" style="width:200px">Internal Name</th>
-                        <th class="border-0" style="width:200px">Entity Type</th>
-                        <th class="border-0">Entity</th>
-                        <th class="border-0" style="width:180px">Survey Completed</th>
-                        <th class="border-0" style="width:150px">Access Granted</th>
-                        <th class="border-0" style="width:200px">Access Link</th>
-                    </tr>
-                </thead>
-                <tbody>
-                    @foreach ($records as $record)
-                        <tr>
-                            <td>{{ friendly_date($record->created_at) }}</td>
-                            <td>{{ $record->title }}</td>
-                            <td>{{ $record->internal_name }}</td>
-                            <td>{{ $record->entity_type }}</td>
-                            <td>
-                                @if ($record->entity_type === 'Client')
-                                    {{ $record->getEntity()->displayName() }}
-                                @else
-                                    ---
-                                @endif
-                            </td>
-                            <td>
-                                @if ($record->survey_data)
-                                    <span class="text-success">Yes</span>
-                                    @include('app.admin.surveys.partials.survey-results')
-                                @else
-                                    <span class="text-danger">No</span>
-                                @endif
-                            </td>
-                            {{-- <td><?= parseRender(json_decode($record->survey_data ?? '{}')) ?></td> --}}
-                            <td>
-                                @if ($record->is_accessible_to_target)
-                                    <span class="text-success">Yes</span>
-                                @else
-                                    <span class="text-danger">No</span>
-                                @endif
-                            </td>
-                            <td>
-                                @if ($record->is_accessible_to_target)
-                                    <a href="{{ route('view-survey-form', $record->access_key) }}" target="_blank"
-                                        class="mr-2" native>Open Link</a>
-                                    @include('app.admin.surveys.partials.revoke-access-to-target')
-                                @else
-                                    @include('app.admin.surveys.partials.grant-access-to-target')
-                                @endif
-                            </td>
-
-                        </tr>
-                    @endforeach
-
-                    @if (count($records) === 0)
-                        <tr>
-                            <td colspan="8">No records found!</td>
-                        </tr>
-                    @endif
-                </tbody>
-
-            </table>
-        </div>
-        <div class="p-3">
-            {{ $records->withQueryString()->links() }}
-        </div>
-    </div>
-
-    <script>
-        (function($){
-            $('[show-survey-results]').click(function(){
-                var uid = $(this).attr('show-survey-results');
-                $.get("/survey/"+uid+"/preview", {}, function(response){
-                    $('#'+uid).html(response);
-                });
-            });
-        })(jQuery);
-    </script>
-@endsection

+ 0 - 0
resources/views/app/admin/surveys/forms/sleep.blade.php → resources/views/app/patient/surveys/forms/sleep.blade.php


+ 83 - 0
resources/views/app/patient/surveys/list.blade.php

@@ -0,0 +1,83 @@
+@extends ('layouts.patient')
+@section('inner-content')
+    <link href="/select2/select2.min.css" rel="stylesheet" />
+    <script src="/select2/select2.min.js"></script>
+
+    <div class="d-block" id="patients-list">
+      <div class="d-flex align-items-center pb-2">
+        <p class="font-weight-bold text-secondary m-0 font-size-14">Surveys</p>
+        <span class="mx-2 text-secondary">|</span>
+        @include('app.patient.surveys.partials.create')
+      </div>
+      <div class="bg-light border border-bottom-0 p-2">
+          @include('app.patient.surveys.partials.filters')
+      </div>
+      <table class="table table-striped table-sm table-bordered m-0">
+          <thead class="bg-light">
+              <tr>
+                  <th class="border-0" style="width:150px">Created At</th>
+                  <th class="border-0" style="width:150px">Title</th>
+                  <th class="border-0" style="width:200px">Internal Name</th>
+                  <th class="border-0" style="width:180px">Survey Completed</th>
+                  <th class="border-0" style="width:150px">Access Granted</th>
+                  <th class="border-0" style="width:200px">Access Link</th>
+              </tr>
+          </thead>
+          <tbody>
+              @foreach ($records as $record)
+                  <tr>
+                      <td>{{ friendly_date($record->created_at) }}</td>
+                      <td>{{ $record->title }}</td>
+                      <td>{{ $record->internal_name }}</td>
+                      <td>
+                          @if ($record->survey_data)
+                              <span class="text-success">Yes</span>
+                              @include('app.patient.surveys.partials.survey-results')
+                          @else
+                              <span class="text-danger">No</span>
+                          @endif
+                      </td>
+                      {{-- <td><?= parseRender(json_decode($record->survey_data ?? '{}')) ?></td> --}}
+                      <td>
+                          @if ($record->is_accessible_to_target)
+                              <span class="text-success">Yes</span>
+                          @else
+                              <span class="text-danger">No</span>
+                          @endif
+                      </td>
+                      <td>
+                          @if ($record->is_accessible_to_target)
+                              <a href="{{ route('view-survey-form', $record->access_key) }}" target="_blank"
+                                  class="mr-2" native>Open Link</a>
+                              @include('app.patient.surveys.partials.revoke-access-to-target')
+                          @else
+                              @include('app.patient.surveys.partials.grant-access-to-target')
+                          @endif
+                      </td>
+
+                  </tr>
+              @endforeach
+
+              @if (count($records) === 0)
+                  <tr>
+                      <td colspan="8">No records found!</td>
+                  </tr>
+              @endif
+          </tbody>
+      </table>
+      <div class="p-3">
+        {{ $records->withQueryString()->links() }}
+      </div>
+    </div>
+
+    <script>
+        (function($){
+            $('[show-survey-results]').click(function(){
+                var uid = $(this).attr('show-survey-results');
+                $.get("/survey/"+uid+"/preview", {}, function(response){
+                    $('#'+uid).html(response);
+                });
+            });
+        })(jQuery);
+    </script>
+@endsection

+ 6 - 19
resources/views/app/admin/surveys/partials/create.blade.php → resources/views/app/patient/surveys/partials/create.blade.php

@@ -1,7 +1,9 @@
-<div moe>
-    <a href="" start show class="btn btn-primary text-white btn-sm mb-2">+ Create Survey</a>
+<div moe wide relative center>
+    <a href="" start show>+ Create Survey</a>
 
     <form url="/api/survey/create" class="mcp-theme-1" right>
+      <input type="hidden" name="entityType" value="Client">
+      <input type="hidden" name="entityUid" value="{{$patient->uid}}">
         <div id="createSurveyForm" v-cloak>
           <div class="form-group">
             <label>Survey Template</label>
@@ -16,28 +18,13 @@
                 <label>Title</label>
                 <input type="text" name="title" class="form-control" />
             </div>
-            <div class="form-group">
-                <label>Entity Type</label>
-                <select name="entityType" class="form-control" v-model="form.entityType" @change="onEntityTypeChange">
-                    <option value=""></option>
-                    @foreach ($entityTypes as $entityType)
-                        <option value="{{ $entityType }}">{{ formatAsTitle($entityType) }}</option>
-                    @endforeach
-                </select>
-            </div>
-            <div v-if="form.entityType" class="form-group">
-                <label>Entity</label>
-                <select name="entityUid" class="form-control" v-model="form.entityUid">
-                    <option value=""></option>
-                </select>
-            </div>
         </div>
         <div class="form-group text-nowrap mb-0">
             <button class="btn btn-sm btn-primary" submit>Submit</button>
             <button class="btn btn-sm btn-default border" close>Close</button>
         </div>
     </form>
-
+  </div>
     <script>
         (function() {
             function init() {
@@ -64,7 +51,7 @@
                                 placeholder: "Search " + self.form.entityType,
                                 minimumInputLength: 2,
                                 ajax: {
-                                    url: '{{ route("admin.get-entity-records") }}',
+                                    url: '{{ route("patients.view.get-entity-records", $patient) }}',
                                     dataType: 'json',
                                     type: "GET",
                                     quietMillis: 50,

+ 7 - 7
resources/views/app/admin/surveys/partials/filters.blade.php → resources/views/app/patient/surveys/partials/filters.blade.php

@@ -1,5 +1,5 @@
 <?php
-    $url = route('admin.surveys');
+    $url = route('patients.view.surveys', $patient);
 ?>
 <style>
 	#admin-surveys-filters label {
@@ -35,14 +35,14 @@
 			<input name="string" class="form-control input-sm" v-model="filters.string">
 		</div>
 	</div>
-    <div class="sm-section">
+    <div class="sm-section d-none">
 		<div class="">
 			<label>Entity Type:</label>
 			<select name="entity_type" class="form-control input-sm" v-model="filters.entity_type">
-                @foreach ($entityTypes as $entityType)
-                    <option value="{{ $entityType }}">{{ formatAsTitle($entityType) }}</option>
-                @endforeach
-            </select>
+          @foreach ($entityTypes as $entityType)
+              <option value="{{ $entityType }}">{{ formatAsTitle($entityType) }}</option>
+          @endforeach
+      </select>
 		</div>
 	</div>
 
@@ -96,4 +96,4 @@ for ($i = 0; $i < count($allFilterKeys); $i++) {
 		}
 		addMCInitializer('admin-surveys-filters', init, '#admin-surveys-filters');
 	})();
-</script>
+</script>

+ 0 - 0
resources/views/app/admin/surveys/partials/form-layout.blade.php → resources/views/app/patient/surveys/partials/form-layout.blade.php


+ 0 - 0
resources/views/app/admin/surveys/partials/grant-access-to-target.blade.php → resources/views/app/patient/surveys/partials/grant-access-to-target.blade.php


+ 0 - 0
resources/views/app/admin/surveys/partials/preview-layout.blade.php → resources/views/app/patient/surveys/partials/preview-layout.blade.php


+ 0 - 0
resources/views/app/admin/surveys/partials/revoke-access-to-target.blade.php → resources/views/app/patient/surveys/partials/revoke-access-to-target.blade.php


+ 0 - 0
resources/views/app/admin/surveys/partials/survey-results.blade.php → resources/views/app/patient/surveys/partials/survey-results.blade.php


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

@@ -81,6 +81,9 @@ $patientCompanyClients = $patient->companyClients;
 							<li class="nav-item">
 								<a class="nav-link" href="/patients/view/{{ $patient->uid }}/intake">Intake</a>
 							</li>
+							<li class="nav-item">
+								<a class="nav-link" href="/patients/view/{{ $patient->uid }}/surveys">Surveys</a>
+							</li>
 						</ul>
 					</li>
 					<li class="nav-item">

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

@@ -276,7 +276,6 @@
                             <a class="dropdown-item" href="{{ route('management-stats') }}">Management Stats</a>
                             <a class="dropdown-item" href="{{ route('messages') }}">Messages</a>
                             <a class="dropdown-item" href="{{ route('admin.patients-notes-points-filter') }}">Patients Notes Points Filter</a>
-                            <a class="dropdown-item" href="{{ route('admin.surveys') }}">Surveys</a>
                         </div>
                     </li>
                     <li class="nav-item dropdown">

+ 4 - 4
routes/web.php

@@ -244,8 +244,8 @@ Route::middleware('pro.auth')->group(function () {
         Route::get('client_messages', [RdController::class, 'clientMessages'])->name('client_messages');
         Route::get('patients_accounts_invites', [RdController::class, 'patientsAccountsInvites'])->name('patients_accounts_invites');
         Route::get('clients_bdt_devices', [RdController::class, 'clientsBdtDevices'])->name('clients_bdt_devices');
-        
-        
+
+
 
     });
 
@@ -281,8 +281,6 @@ Route::middleware('pro.auth')->group(function () {
         Route::get('patients-missing-defult-settings', 'AdminController@patientsMissingDefasultSettings')->name('patientsMissingDefasultSettings');
         Route::get('points', 'AdminController@points')->name('points');
         Route::get('patients-notes-points-filter', 'AdminController@patientsNotesPointsFilter')->name('patients-notes-points-filter');
-        Route::get('surveys', 'AdminController@surveys')->name('surveys');
-        Route::get('surveys/get-entity-records', 'AdminController@getEntityRecords')->name('get-entity-records');
     });
     Route::middleware('pro.auth.admin')->group(function () {
         Route::get('mgmt-stats', [ManagementStatsController::class, 'index'])->name('management-stats');
@@ -578,6 +576,8 @@ Route::middleware('pro.auth')->group(function () {
             Route::get('intake', 'PatientController@intake')->name('intake');
             Route::get('canvas', 'PatientController@canvas')->name('canvas');
             Route::get('intake', 'PatientController@intake')->name('intake');
+            Route::get('surveys', 'PatientController@surveys')->name('surveys');
+            Route::get('surveys/get-entity-records', 'PatientController@getEntityRecords')->name('get-entity-records');
             Route::get('care-plan', 'PatientController@carePlan')->name('care-plan');
             Route::get('medications', 'PatientController@medications')->name('medications');
             Route::get('dx-and-focus-areas', 'PatientController@dxAndFocusAreas')->name('dx-and-focus-areas');