Jelajahi Sumber

Merge branch 'cleanup-forms-fix' of https://rav.triplestart.com/tigerphp/stagfe2 into cleanup-forms-fix

Peter Muturi 1 tahun lalu
induk
melakukan
1418b32cea

+ 8 - 1
.env.example

@@ -65,4 +65,11 @@ GOOGLE_SPREADSHEET_PRODUCTS_SHEET_NAME=records
 
 OPENTOK_API_KEY=46871644
 OPENTOK_API_SECRET=48c39d640cbcfb1032606d7c40ab5971290a5163
-OPENTOK_SESSION_ID=1_MX40Njg3MTY0NH5-MTU5NjQyMzcxMjQ4OX5PRnNIVmFDU2t2d3BnWG1YbkMvSWFRNk1-fg
+OPENTOK_SESSION_ID=1_MX40Njg3MTY0NH5-MTU5NjQyMzcxMjQ4OX5PRnNIVmFDU2t2d3BnWG1YbkMvSWFRNk1-fg
+
+DEFAULT_ERX_COMPANY_NAME='Scholar Medical Group MD LLC'
+DEFAULT_ERX_COMPANY_LINE_1='133 Rollins Ave'
+DEFAULT_ERX_COMPANY_LINE_2='Ste 3'
+DEFAULT_ERX_COMPANY_CITY='Rockville'
+DEFAULT_ERX_COMPANY_STATE='MD'
+DEFAULT_ERX_COMPANY_ZIP='20852'

+ 30 - 12
app/Http/Controllers/AdminController.php

@@ -730,20 +730,18 @@ class AdminController extends Controller
         return view('app.admin.patients_missing_default_settings', compact('patients', 'filters'));
     }
 
-    public function points(Request $request){
+    public function points(Request $request)
+    {
         $filters = $request->all();
         $points = Point::query();
-        $points = $points->where('is_removed','!=', true);
+        $points = $points->where('is_removed', '!=', true)
+            ->where('category', '!=', 'REVIEW')
+            ->where('category', '!=', 'PLAN');
+
+        $categories = [];
+        $names = [];
+
 
-        if ($request->input('name')) {
-            $name = trim($request->input('name'));
-            if ($name) {
-                $points = $points->whereHas('client', function ($q) use ($name) {
-                    $q->where('name_first', 'ILIKE', '%' . $name . '%')
-                        ->orWhere('name_last', 'ILIKE', '%' . $name . '%');
-                });
-            }
-        }
 
         if ($request->input('mcp')) {
             $mcp = Pro::where('uid', trim($request->input('mcp')))->first();
@@ -752,12 +750,32 @@ class AdminController extends Controller
             }
         }
 
+        if ($request->input('intentions')) {
+            $points = $points->whereIn('intention', $request->input('intentions'));
+            $implodedIntentions = join("','", $request->input('intentions'));
+            $categories = DB::select("SELECT category, COUNT(category) as count FROM point WHERE intention in ('" . $implodedIntentions . "')  GROUP BY category ORDER BY category ASC");
+        }
+
+        if ($request->input('categories')) {
+            $points = $points->whereIn('category', $request->input('categories'));
+            $implodedCategories = join("','", $request->input('categories'));
+            $names = DB::select("select (data::json)->>'name' as name, count(id) as count from point where category in ('".$implodedCategories."') group by 1 order by 1 asc");
+        }
+
+        if ($request->input('names')){
+            $implodedNames = join("','", $request->input('names'));
+            $points = $points->whereRaw("(data::json)->>'name' in ('".$implodedNames."')");
+        }
+
         $points = $points->paginate(30);
 
         $_point = new Point;
         $tableName = $_point->getTable();
         $columns = Schema::getColumnListing($tableName);
-        return view('app.admin.points.index', compact('points', 'filters', 'columns'));
+
+        $intentions = DB::select("SELECT intention, COUNT(intention) as count FROM point WHERE intention is not null  GROUP BY intention ORDER BY intention ASC");
+
+        return view('app.admin.points.index', compact('points', 'filters', 'columns', 'intentions', 'categories', 'names'));
     }
 
     public function messages(Request $request)

+ 6 - 0
config/app.php

@@ -85,6 +85,12 @@ return [
     'opentokApiSecret' => env('OPENTOK_API_SECRET'),
     'opentokSessionId' => env('OPENTOK_SESSION_ID'),
     'socketIoUrl' => env('SOCKET_IO_URL'),
+    'defaultErxCompanyName' => env('DEFAULT_ERX_COMPANY_NAME'),
+    'defaultErxCompanyLine_1' => env('DEFAULT_ERX_COMPANY_LINE_1'),
+    'defaultErxCompanyLine_2' => env('DEFAULT_ERX_COMPANY_LINE_2'),
+    'defaultErxCompanyCity' => env('DEFAULT_ERX_COMPANY_CITY'),
+    'defaultErxCompanyState' => env('DEFAULT_ERX_COMPANY_STATE'),
+    'defaultErxCompanyZip' => env('DEFAULT_ERX_COMPANY_ZIP'),
 
     /*
     |--------------------------------------------------------------------------

+ 5 - 0
config/stag.php

@@ -73,6 +73,11 @@ return [
             'history_surgical/edit' => ['omega_history_surgical'],
             'weight_loss_intake/edit' => ['omega_subjective_system', 'omega_plan_system'],
             'lifestyle_general/edit' => ['omega_subjective_system', 'omega_plan_system'],
+            'lifestyle_physical_activity/edit' => ['omega_subjective_system', 'omega_plan_system'],
+            'lifestyle_sleep/edit' => ['omega_subjective_system', 'omega_plan_system'],
+            'lifestyle_social_relationships/edit' => ['omega_subjective_system', 'omega_plan_system'],
+            'lifestyle_stress/edit' => ['omega_subjective_system', 'omega_plan_system'],
+            'lifestyle_substances/edit' => ['omega_subjective_system', 'omega_plan_system'],
             'nutrition-center' => ['omega_subjective_system', 'omega_plan_system'],
             'exercise-center' => ['omega_subjective_system', 'omega_plan_system'],
             'behavior-center' => ['omega_subjective_system', 'omega_plan_system'],

+ 64 - 54
resources/views/app/admin/points/filters.blade.php

@@ -13,11 +13,11 @@
         flex-wrap: wrap;
     }
 
-    .filter-container>div {
+    .filter-container > div {
         width: 165px;
     }
 
-    .filter-container>div:not(:last-child) {
+    .filter-container > div:not(:last-child) {
         margin-right: 10px;
     }
 
@@ -26,70 +26,80 @@
         margin-bottom: 10px;
     }
 </style>
-<form id="admin-points-filters" method="GET" action="{{ route('admin.points') }}" class="filter-container" v-cloak>
-    <div class="sm-section">
+<form id="admin-points-filters" method="GET" action="{{ route('admin.points') }}"  >
+    <div class="">
+        <fieldset name="Intentions">
+            <legend>
+                Intentions
+            </legend>
+            @foreach($intentions as $intention)
+                <div class="d-inline-block">
+                    <label for="">
+                        <input type="checkbox" name="intentions[]"  value="{{$intention->intention}}" @if(isset($filters['intentions']) && in_array($intention->intention, $filters['intentions'])) checked @endif>
+                        {{$intention->intention}}({{$intention->count}})
+                    </label>
+                </div>
+            @endforeach
+        </fieldset>
+    </div>
+
+    @if(isset($categories) && count($categories))
+    <div class="">
+        <fieldset name="Categories">
+            <legend>
+                Categories
+            </legend>
+            @foreach($categories as $category)
+                <div class="d-inline-block">
+                    <label for="">
+                        <input type="checkbox" name="categories[]"  value="{{$category->category}}" @if(isset($filters['categories']) && in_array($category->category, $filters['categories'])) checked @endif>
+                        {{$category->category}}({{$category->count}})
+                    </label>
+                </div>
+            @endforeach
+        </fieldset>
+    </div>
+    @endif
+
+    @if(isset($names) && count($names))
         <div class="">
-            <label>Name:</label>
-            <input name="name" class="form-control input-sm" v-model="filters.name">
+            <fieldset name="Names">
+                <legend>
+                    Data
+                </legend>
+                @foreach($names as $name)
+                    <div class="d-inline-block">
+                        <label for="">
+                            <input type="checkbox" name="names[]"
+                                   value="{{$name->name}}"
+                                   @if(isset($filters['names']) && in_array($name->name, $filters['names'])) checked @endif>
+                            {{$name->name}}({{$name->count}})
+                        </label>
+                    </div>
+                @endforeach
+            </fieldset>
         </div>
-    </div>
+    @endif
 
-    <div class="sm-section">
-        <div class="mcp-filter-container">
-            <label>MCP:</label>
+    <div class="">
+        <div class="">
+            <label>Name:</label>
+            <input name="name" class="form-control input-sm" value=""  >
         </div>
     </div>
 
+
     <div>
         <div class="">
             <label>&nbsp;</label>
             <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('admin.points')}}')" class="btn btn-link btn-sm text-danger">Clear</a>
+                <button  class="btn btn-primary btn-sm mr-2"><i
+                        class="fas fa-filter"></i> Filter
+                </button>
+                <a href="#"
+                   class="btn btn-link btn-sm text-danger">Clear</a>
             </div>
         </div>
     </div>
 </form>
 
-<?php
-$loadedFilters = @$filters;
-$allFilterKeys = [
-    'name',
-];
-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: '#admin-points-filters',
-                delimiters: ['@{{', '}}'],
-                data: {
-                    filters: <?= json_encode($loadedFilters) ?>
-                },
-                methods: {
-                    init: function() {
-
-                    },
-                    doSubmit: function() {
-                        fastLoad("{{ route('admin.points') }}?" + $('#admin-points-filters').serialize());
-                        return false;
-                    }
-                },
-                mounted: function() {
-                    console.log(this.filters);
-                    this.init();
-                    let mcpSelect = $('<select name="mcp" class="form-control min-width-unset input-sm" provider-search data-pro-uid="{{request()->input('mcp')}}" provider-type="hcp"><option value="">--select--</option></select>').appendTo('.mcp-filter-container');
-                    initProSuggest();
-                },
-            });
-
-
-        }
-        addMCInitializer('admin-points-filters', init, '#admin-points-filters');
-    })();
-</script>

+ 2 - 2
resources/views/app/admin/points/index.blade.php

@@ -1,4 +1,4 @@
-@extends ('layouts/template')
+@extends ('layouts/template-simple')
 
 @section('content')
     <div class="p-3 mcp-theme-1" id="patients-list">
@@ -17,4 +17,4 @@
             </div>
         </div>
     </div>
-@endsection
+@endsection

+ 4 - 3
resources/views/app/admin/points/record-details.blade.php

@@ -9,9 +9,10 @@
                         <th>{{ $column }}</th>
                         <td class="text-wrap">
                             @if($column === 'data')
-                            <?php 
+                            <?php
                                 $__data = json_decode($point->{$column}, true);
-                                parseRender($__data);
+                                var_dump($__data);
+//                                parseRender($__data);
                             ?>
                             @else
                             <?= $point->{$column} ?>
@@ -26,4 +27,4 @@
             <button class="btn btn-default border btn-sm" cancel>Close</button>
         </div>
     </form>
-</div>
+</div>

+ 24 - 6
resources/views/app/admin/points/table.blade.php

@@ -6,11 +6,12 @@
                 <th class="border-0">Patient</th>
                 <th class="border-0">Note</th>
                 <th class="border-0">Creator Pro</th>
-                <th class="border-0">Parent Category</th>
-                <th class="border-0">Category</th>
                 <th class="border-0">Intetion</th>
+                <th class="border-0">Category</th>
                 <th class="border-0">ICD</th>
-                <th class="border-0"></th>                
+                <th class="border-0">Last Review</th>
+                <th class="border-0">Last Plan</th>
+                <th class="border-0"></th>
             </tr>
         </thead>
         <tbody>
@@ -33,10 +34,27 @@
                 <td>
                     {{ $point->creatorPro->displayName() }}
                 </td>
-                <td>{{ $point->parent_category }}</td>
-                <td>{{ $point->category }}</td>
                 <td>{{ $point->intention }}</td>
+                <td>{{ $point->category }}</td>
                 <td>{{ $point->icd }}</td>
+                <td>
+                    <b>{{ friendly_date_time($point->last_child_review_effective_date, false) }}</b>
+                    @if($point->last_child_review_scoped_note_uid)
+                        <a native target="_blank"
+                           href="/patients/view/{{ $point->note->client->uid }}/notes/view/{{ $point->last_child_review_point_scoped_note_uid }}">
+                            <b>View review note</b>
+                        </a>
+                    @endif
+                </td>
+                <td>
+                    <b>{{ friendly_date_time($point->last_child_plan_effective_date, false) }}</b>
+                    @if($point->last_child_plan_scoped_note_uid)
+                        <a native target="_blank"
+                           href="/patients/view/{{ $point->note->client->uid }}/notes/view/{{ $point->last_child_plan_point_scoped_note_uid }}">
+                            <b>View plan note</b>
+                        </a>
+                    @endif
+                </td>
                 <td>
                     @include('app.admin.points.record-details')
                 </td>
@@ -48,4 +66,4 @@
 <div class="px-3 pt-3 d-flex align-items-center">
     {{$points->withQueryString()->links()}}
     <div class="ml-4 mb-3">Showing <b>{{$points->firstItem()}}</b> to <b>{{$points->lastItem()}}</b> (page {{$points->currentPage()}}) of <b>{{$points->total()}}</b> points</div>
-</div>
+</div>

+ 1 - 1
resources/views/app/patient/module-specific-summary-renderers/lifestyle_physical_activity/subjective.blade.php

@@ -16,7 +16,7 @@
                 <?php $j = 0; foreach ($points as $point): $j++; ?>
                     <tr>
                         <td>
-                            @include('app.patient.module-specific-summary-renderers.data-dump', compact('point'))
+                          @include('app.patient.module-specific-summary-renderers.data-dump', compact('point'))
                         </td>
                     </tr>
                 <?php endforeach; ?>

+ 3 - 1
resources/views/app/patient/prescriptions/list.blade.php

@@ -402,7 +402,7 @@
                     <div v-else>-</div>
                 </div>
             </div>
-            <div class="pb-2 d-flex align-items-start" v-if="currentPrescription.has_hcp_pro_signed">
+            <div class="pb-2 d-flex align-items-start" v-if="currentPrescription.has_hcp_pro_signed || proType == 'ADMIN'">
                 <span class="min-width-140px text-secondary text-sm">PDF</span>
                 <div class="d-flex align-items-baseline">
                     <a class="pdf-viewer-trigger d-block mb-1" native target="_blank"
@@ -525,6 +525,7 @@ GROUP BY erx_category");
                 el: '#prescriptions-{{$patient->id}}',
                 delimiters: ['@{{', '}}'],
                 data: {
+                    proType: "{{$pro->pro_type}}",
                     includeCancelled: '',
 
                     prescriptions: <?= json_encode($prescriptions) ?>,
@@ -1616,6 +1617,7 @@ GROUP BY erx_category");
                 },
                 mounted: function() {
                     let self = this;
+
                     $(document).on('pro-changed', '.erx-hcp-pro-select', function() {
                         self.currentPrescriptionHcpPro.newHcpProUid = this.value;
                     });

+ 1 - 1
resources/views/app/patient/prescriptions/pdf/DRUG.blade.php

@@ -44,7 +44,7 @@ if($coverage) {
         <td style="vertical-align:top;padding: 5px;">
           <h4 style="line-height:20px;margin:0;">INSURANCE</h4>
           <span style="font-size:13px;line-height:20px;display:block">{{$payerName}}</span>
-          <span style="font-size:13px;line-height:20px;display:block">Member ID: {{$memberID}}</span>
+          {{-- <span style="font-size:13px;line-height:20px;display:block">Member ID: {{$memberID}}</span> --}}
           <span style="font-size:13px;line-height:20px;display:block">Insurance Contact:</span>
         </td>
       </tr>

+ 8 - 8
resources/views/app/patient/prescriptions/pdf/pdf-preview.blade.php

@@ -16,12 +16,12 @@
         $hcpCompanyProPayer = $note->hcpCompanyProPayer;
         $hcpCompanyLocation = $note->hcpCompanyLocation;
     }
-    $companyName = $hcpCompany ? $hcpCompany->name : 'Scholar Medical Group MD LLC';
-    $addressLine1 = $hcpCompanyLocation ? $hcpCompanyLocation->line1 : '133 Rollins Ave';
-    $addressLine2 = $hcpCompanyLocation ? $hcpCompanyLocation->line2 : 'Ste 3';
-    $city = $hcpCompanyLocation ? $hcpCompanyLocation->city : 'Rockville';
-    $state = $hcpCompanyLocation ? $hcpCompanyLocation->state : 'MD';
-    $zip = $hcpCompanyLocation ? $hcpCompanyLocation->zip : '20852';
+    $companyName = $hcpCompany ? $hcpCompany->name : config('app.defaultErxCompanyName');
+    $addressLine1 = $hcpCompanyLocation ? $hcpCompanyLocation->line1 : config('app.defaultErxCompanyLine_1');
+    $addressLine2 = $hcpCompanyLocation ? $hcpCompanyLocation->line2 : config('app.defaultErxCompanyLine_2');
+    $city = $hcpCompanyLocation ? $hcpCompanyLocation->city : config('app.defaultErxCompanyCity');
+    $state = $hcpCompanyLocation ? $hcpCompanyLocation->state : config('app.defaultErxCompanyState');
+    $zip = $hcpCompanyLocation ? $hcpCompanyLocation->zip : config('app.defaultErxCompanyZip');
     ?>
     <?php
     use App\Models\Erx;
@@ -46,13 +46,13 @@
         </div>
     </header>
 
-    <hr style="border-top: 2px solid #5ca4e8; border-bottom: 0; margin-top:-5px; margin-bottom:.5rem;">
+    <hr style="border-top: 2px solid #5ca4e8; border-bottom: 0; margin-top:5px; margin-bottom:.5rem;">
 
     @include('app.patient.prescriptions.pdf.' . $prescription->erx_category)
 
     <?php if($prescription->logistics_detail_json): ?>
         <?php $logistics = json_decode($prescription->logistics_detail_json); ?>
-        <hr style="margin: 0 0 0.5rem 0; border-top-width: 0; border-bottom-width: 1px; border-color: #bbb">
+        <hr style="margin: 0 0 0.5rem 0; border:0; border-color: #bbb">
         <div style="font-size: 14px; opacity: 0.75; ">
             <p style="margin: 0.5rem 0;"><b>{{ $logistics->facilityName }}</b></p>
             <p style="margin: 0.5rem 0;">{{$logistics->facilityCity}} {{$logistics->facilityState}} {{$logistics->facilityZip}}</p>

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

@@ -357,7 +357,6 @@
             });
 
 
-
         });
     </script>
     @endif

+ 61 - 0
resources/views/layouts/template-simple.blade.php

@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <meta name="csrf-token" content="{{ csrf_token() }}">
+
+    <title>{{ config('app.name') }}</title>
+    <link rel="icon" href="/img/icon.svg">
+
+    <!-- Fonts -->
+    <link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet">
+
+
+    {{-- Quill RTE --}}
+
+    <!-- <link href="{{ asset('bootstrap-4.5.0/css/bootstrap.css') }}" rel="stylesheet"> -->
+    <link rel="stylesheet" href="/fontawesome-free-5.13.1-web/css/all.min.css">
+    <link href="{{ asset('/css/app.css') }}?v={{config('app.asset_version')}}" rel="stylesheet">
+    <link href="{{ asset('/css/style.css') }}?v={{config('app.asset_version')}}" rel="stylesheet">
+    <link href="{{ asset('/css/yemi.css') }}?v={{config('app.asset_version')}}" rel="stylesheet">
+    <link rel="stylesheet" href="{{ asset('/css/toastr.min.css') }}">
+    <link href="{{asset('/css/z.css')}}?v={{config('app.asset_version')}}" rel=stylesheet>
+    <!-- Styles -->
+
+
+    @yield('head')
+</head>
+
+<body>
+
+    <nav class="navbar navbar-expand-md navbar-dark stag-primary-bg py-1 mcp-theme-1 px-2">
+        <a class="navbar-brand" href="/">
+            <img src="/img/logo_white.svg" alt="Leadership Health">
+        </a>
+        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navBar" aria-controls="navBar" aria-expanded="false" aria-label="Toggle navigation">
+            <span class="navbar-toggler-icon"></span>
+        </button>
+
+        <div class="collapse navbar-collapse" id="navBar">
+            <ul class="navbar-nav mr-auto">
+                    <li class="nav-item"><a class="nav-link" href="{{ route('admin.dashboard') }}"><i class="mr-1 fas fa-home"></i> Home</a> </li>
+                    <li class="nav-item"><a class="nav-link" href="{{ route('admin.points') }}"><i class="mr-1 fas fa-user"></i> Points</a> </li>
+            </ul>
+        </div>
+
+    </nav>
+
+    <main role="main" class="stag-content px-0">
+        @yield('content')
+    </main><!-- /.container -->
+
+    <!-- shortcut/suggest component -->
+    <link href="/css/shortcut.css?v={{config('app.asset_version')}}" rel=stylesheet>
+
+
+
+
+</body>
+
+</html>

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

@@ -275,7 +275,7 @@
                             <a class="dropdown-item" href="{{ route('admin.patientsMissingDefasultSettings') }}">Patients Missing Default Settings</a>
                             <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" target="_blank"  native href="{{ route('admin.points') }}">Points</a>
                         </div>
                     </li>
                     <li class="nav-item dropdown">

+ 1 - 1
routes/web.php

@@ -282,7 +282,7 @@ Route::middleware('pro.auth')->group(function () {
         Route::get('get-create-new-patient-script-template', 'AdminController@getCreateNewPatientScriptTemplate')->name('getCreateNewPatientScriptTemplate');
         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('patients-notes-points-filter', 'AdminController@patientsNotesPointsFilter')->name('patients-notes-points-filter');
     });
     Route::middleware('pro.auth.admin')->group(function () {
         Route::get('mgmt-stats', [ManagementStatsController::class, 'index'])->name('management-stats');