Przeglądaj źródła

Merge branch 'dev' into dev-vj

Vijayakrishnan 3 lat temu
rodzic
commit
cd399beef1

+ 7 - 1
app/Http/Controllers/PracticeManagementController.php

@@ -47,6 +47,7 @@ use Illuminate\Http\Request;
 use App\Models\SegmentTemplate;
 use App\Models\VisitTemplate;
 use App\Models\VisitTemplateSegmentTemplate;
+use App\Models\VisitTemplateAccess;
 
 class PracticeManagementController extends Controller
 {
@@ -2599,10 +2600,15 @@ ORDER BY c.name_last, c.name_first
         $visitTemplateSegmentTemplates = VisitTemplateSegmentTemplate::query();
         $visitTemplateSegmentTemplates = $visitTemplateSegmentTemplates->where('visit_template_id', $visitTemplate->id);
         $visitTemplateSegmentTemplates = $visitTemplateSegmentTemplates->orderBy('position_index', 'DESC');
-        $visitTemplateSegmentTemplates = $visitTemplateSegmentTemplates->paginate(30);
+        $visitTemplateSegmentTemplates = $visitTemplateSegmentTemplates->paginate(50);
         return view('app.practice-management.visit-templates.visit-template-segment-templates.index', compact('visitTemplate','visitTemplateSegmentTemplates'));
     }
 
+    public function visitTemplateAccess(Request $request, VisitTemplate $visitTemplate){
+        $visitTemplateAccesses = VisitTemplateAccess::where('visit_template_id', $visitTemplate->id)->paginate(50);
+        return view('app.practice-management.visit-templates.visit-template-accesses.index', compact('visitTemplate','visitTemplateAccesses'));
+    }
+
     public function clientCcmRmStatus(Request $request){
         $filters = $request->all();
         $patients = Client::whereNull('shadow_pro_id');

+ 1 - 1
app/Models/Pro.php

@@ -141,7 +141,7 @@ class Pro extends Model
 
     public function visitTemplates() {
         //TODO: use visit access
-        return VisitTemplate::where('is_active', true)->get();
+        return VisitTemplate::select('visit_template.*')->join('visit_template_access', 'visit_template.id', 'visit_template_access.visit_template_id')->where('visit_template_access.pro_id', $this->id)->where('visit_template.is_active', true)->get();
     }
 
     public function currentWork() {

+ 17 - 0
app/Models/VisitTemplateAccess.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace App\Models;
+
+# use Illuminate\Database\Eloquent\Model;
+
+class VisitTemplateAccess extends Model
+{
+    protected $table = 'visit_template_access';
+
+    public function pro() {
+        return $this->hasOne(Pro::class, 'id', 'pro_id');
+    }
+    public function visitTemplate() {
+        return $this->hasOne(Pro::class, 'id', 'visit_template_id');
+    }
+}

+ 28 - 1
public/css/style.css

@@ -2982,4 +2982,31 @@ body .vakata-context .vakata-context-separator>a {
 
 .phq .table thead th {
     border-bottom: 0;
-}
+}
+
+.page-tabs {
+    width: 100%;
+}
+.page-tabs .links {
+    width: 100%;
+    display: flex;
+    align-items: center;
+}
+.page-tabs .links a {
+    padding: 5px 10px;
+    border: 1px solid #224587;
+    border-right: none;
+    border-bottom: none;
+    font-weight: bold;
+}
+.page-tabs .links a:last-child {
+    border-right: 1px solid #224587;
+}
+.page-tabs .links a.active {
+    background-color: #224587;
+    color: #fff;
+}
+.page-tabs .page-tab {
+    border: 1px solid #ddd;
+    padding: 10px;
+}

+ 75 - 0
resources/views/app/practice-management/visit-templates/single.blade.php

@@ -0,0 +1,75 @@
+@extends ('layouts/template')
+
+@section('content')
+<link href="/select2/select2.min.css" rel="stylesheet" />
+<script src="/select2/select2.min.js"></script>
+
+<style>
+    #visit-template-segment-template-list .select2-container {
+        width: 100% !important;
+    }
+</style>
+
+<?php
+$routeName = request()->route()->getName();
+?>
+
+<div class="p-3 mcp-theme-1" id="visit-template-segment-template-list">
+    <a href="{{ route('practice-management.visitTemplates') }}" class="d-block mb-1"><i class="fas fa-arrow-left"></i> Back to Visit Templates</a>
+    <div class="card mb-3">
+        <div class="card-header">
+            <div class="d-flex align-items-center justify-content-between">
+                <strong>{{ $visitTemplate->title }}</strong>
+                <div>
+                    @include('app.practice-management.visit-templates.update', ['template' => $visitTemplate ])
+                </div>
+            </div>
+        </div>
+        <div class="card-body">
+            <div class="d-flex align-items-start">
+                <span class="mr-3"><b>Internal Name:</b> {{ $visitTemplate->internal_name }}</span>
+                <span class="mr-3"><b>Title:</b> {{ $visitTemplate->title }}</span>
+                <span class="mr-3"><b>Created At:</b> {{ friendly_date_time($visitTemplate->created_at) }}</span>
+                <span class="mr-3">
+                    <b>Status:</b>
+                    @if($visitTemplate->is_active)
+                    <span class="text-success mr-2">ACTIVE</span>
+                    @else
+                    <span class="text-danger mr-2">INACTIVE</span>
+                    @endif
+                    @include('app.practice-management.visit-templates.activate-deactivate', ['template' => $visitTemplate, 'leftPosition' => true ])
+                </span>
+
+                <div class="mr-3 d-flex align-items-start">
+                    @if($visitTemplate->is_active)
+                    @if($visitTemplate->reactivation_memo)
+                    <span class="mr-3"><b>Reactivation Memo:</b></span>
+                    <div style="width:300px;">
+                        <small class="text-muted"><b>Memo: </b>{{ $visitTemplate->reactivation_memo }}</small>
+                        @include('app.practice-management.visit-templates.update-memo', ['template' => $visitTemplate ])
+                    </div>
+                    @endif
+                    @else
+                    @if($visitTemplate->deactivation_memo)
+                    <span class="mr-3"><b>Deactivation Memo:</b></span>
+                    <div style="width:300px;">
+                        <small class="text-muted"><b>Memo: </b>{{ $visitTemplate->deactivation_memo }}</small>
+                        @include('app.practice-management.visit-templates.update-memo', ['template' => $visitTemplate ])
+                    </div>
+                    @endif
+                    @endif
+                </div>
+            </div>
+        </div>
+    </div>
+    <div class="page-tabs">
+        <div class="links">
+            <a href="{{ route('practice-management.visitTemplate', $visitTemplate) }}" class="{{ $routeName === 'practice-management.visitTemplate' ? 'active':'' }}">Segment Templates</a>
+            <a href="{{ route('practice-management.visitTemplateAccess', $visitTemplate) }}" class="{{ $routeName === 'practice-management.visitTemplateAccess' ? 'active':'' }}">Pro Access</a>
+        </div>
+        <div class="page-tab">
+            @yield('visitTemplateTab')
+        </div>
+    </div>
+</div>
+@endsection

+ 27 - 0
resources/views/app/practice-management/visit-templates/visit-template-accesses/activate-deactivate.blade.php

@@ -0,0 +1,27 @@
+<div moe>
+		<a start show href="#">
+			@if($access->is_active)
+				<span class="text-danger">Deactivate</span>
+			@else
+			<span class="text-success">Reactivate</span>
+			@endif
+		</a>
+		<form url="{{ $access->is_active ? '/api/visitTemplateAccess/deactivate' : '/api/visitTemplateAccess/reactivate' }}" class="mt-2">
+			<input type="hidden" name="uid" value="{{ $access->uid }}">
+			<div class="mb-2 w-100">
+				<label>Are you sure?</label>
+			</div>
+			<div class="mb-2 w-100">
+				<label>Memo</label>
+				<textarea name="memo" class="form-control"><?= $access->is_active ? $access->deactivation_memo: $access->reactivation_memo ?></textarea>
+			</div>
+			<div class="mt-3">
+				@if($access->is_active)
+				<button submit class="btn btn-sm btn-danger mr-2">Deactivate</button>
+				@else
+				<button submit class="btn btn-sm btn-primary mr-2">Reactivate</button>
+				@endif
+				<button cancel class="btn btn-default border">Cancel</button>
+			</div>
+		</form>
+	</div>

+ 56 - 0
resources/views/app/practice-management/visit-templates/visit-template-accesses/create.blade.php

@@ -0,0 +1,56 @@
+<div id="createVisitTemplateProAccess">
+	<div moe>
+		<a start show href="#">Create</a>
+		<form url="/api/visitTemplateAccess/create" class="mt-2">
+			<input type="hidden" name="visitTemplateUid" value="{{ $visitTemplate->uid }}">
+
+			<div class="sm-section" style="width: 250px !important;">
+				<div class="">
+					<label class="mb-1 text-secondary">Pro:</label>
+					<select id="searchForProInput" name="proUid" class="form-control input-sm"></select>
+				</div>
+			</div>
+
+			<div class="mt-3">
+				<button submit class="btn btn-sm btn-primary mr-2">Update</button>
+				<button cancel class="btn btn-default border">Cancel</button>
+			</div>
+		</form>
+	</div>
+</div>
+
+
+<script>
+	(function() {
+		function init() {
+			var select2 = $("#searchForProInput").select2({
+				placeholder: "Search Pro(s) by Name",
+				minimumInputLength: 2,
+				ajax: {
+					url: '/pro-suggest',
+					dataType: 'json',
+					type: "GET",
+					quietMillis: 50,
+					data: function(params) {
+						return {
+							term: params.term,
+							json: true
+						};
+					},
+					processResults: function(response) {
+						var data = response.results;
+						return {
+							results: $.map(data, function(item) {
+								return {
+									text: item.text,
+									id: item.uid
+								}
+							})
+						};
+					}
+				}
+			});
+		}
+		addMCInitializer('createVisitTemplateProAccess', init, '#createVisitTemplateProAccess');
+	}).call(window);
+</script>

+ 80 - 0
resources/views/app/practice-management/visit-templates/visit-template-accesses/index.blade.php

@@ -0,0 +1,80 @@
+@extends('app.practice-management.visit-templates.single')
+@section('visitTemplateTab')
+<div class="row">
+    <div class="col-md-12">
+        <div class="card mb-2">
+            <div class="card-header border-bottom-0 px-1 py-2 d-flex align-items-center">
+                <div class="d-flex align-items-center">
+                <strong class="mr-4">
+                    <i class="fas fa-users"></i>
+                    Visit Template Pro Accesses
+                </strong>
+                <div class="ml-4">
+                    @include('app.practice-management.visit-templates.visit-template-accesses.create')
+                </div>
+                </div>
+            </div>
+            <div class="card-body p-0">
+                <div class="table-responsive">
+                    <table class="table table-sm table-striped border-top p-0 m-0">
+                        <thead class="bg-light">
+                            <tr>
+                                <th class="border-0">Pro</th>
+                                <th class="border-0">Type</th>
+                                <th class="border-0">Status</th>
+                                <th class="border-0">&nbsp;</th>
+                            </tr>
+                        </thead>
+                        <tbody>
+                            @foreach($visitTemplateAccesses as $access)
+                            <tr>
+                                <td>{{ $access->pro->displayName() }}</td>
+                                <td>{{ $access->type }}</td>
+                                <td>
+                                    <div>
+                                        @if($access->is_active)
+                                        <span class="text-success">ACTIVE</span>
+                                        @if($access->reactivation_memo)
+                                        <div style="width:300px;">
+                                            <small class="text-muted"><b>Memo: </b>{{ $access->reactivation_memo }}</small>
+                                            @include('app.practice-management.visit-templates.visit-template-accesses.update-memo')
+                                        </div>
+                                        @endif
+                                        @else
+                                        <span class="text-danger">INACTIVE</span>
+                                        @if($access->deactivation_memo)
+                                        <div style="width:300px;">
+                                            <small class="text-muted"><b>Memo: </b>{{ $access->deactivation_memo }}</small>
+                                            @include('app.practice-management.visit-templates.visit-template-accesses.update-memo')
+                                        </div>
+                                        @endif
+                                        @endif
+                                    </div>
+                                </td>
+                                <td>
+                                    <div class="d-flex align-items-center">
+                                        <div>
+                                            @include('app.practice-management.visit-templates.visit-template-accesses.activate-deactivate')
+                                        </div>
+                                    </div>
+                                </td>
+                            </tr>
+                            @endforeach
+                            @if(!count($visitTemplateAccesses))
+                            <tr>
+                                <td colspan="8">No records found!</td>
+                            </tr>
+                            @endif
+                        </tbody>
+
+                    </table>
+                </div>
+            </div>
+        </div>
+
+        <div class="mt-3">
+            {{ $visitTemplateAccesses->appends(request()->input())->links() }}
+        </div>
+    </div>
+</div>
+@endSection

+ 19 - 0
resources/views/app/practice-management/visit-templates/visit-template-accesses/update-memo.blade.php

@@ -0,0 +1,19 @@
+<div moe>
+		<a start show href="#">
+			<i class="far fa-edit"></i>
+		</a>
+		<form url="{{ $access->is_active ? '/api/visitTemplateAccess/update-reactivation-memo' : '/api/visitTemplateAccess/update-deactivation-memo' }}" class="mt-2">
+			<input type="hidden" name="uid" value="{{ $access->uid }}">
+			<div class="mb-2 w-100">
+				<label>Are you sure?</label>
+			</div>
+			<div class="mb-2 w-100">
+				<label>Memo</label>
+				<textarea name="memo" class="form-control"><?= $access->is_active ? $access->reactivation_memo: $access->deactivation_memo ?></textarea>
+			</div>
+			<div class="mt-3">
+				<button submit class="btn btn-sm btn-primary mr-2">Update</button>
+				<button cancel class="btn btn-default border">Cancel</button>
+			</div>
+		</form>
+	</div>

+ 10 - 6
resources/views/app/practice-management/visit-templates/visit-template-segment-templates/create.blade.php

@@ -1,8 +1,8 @@
-<div id="createVisitTemplateSegmentTemplate" class="d-inline">
-	<div moe>
+<div id="createVisitTemplateSegmentTemplate{{@$position}}" class="d-inline">
+	<div moe relative>
 		<a class="" href="" show start>+ Create</a>
-		<form url="/api/visitTemplateSegmentTemplate/create">
-			<div id="createVisitTemplateSegmentTemplateComponent" v-cloak>
+		<form url="/api/visitTemplateSegmentTemplate/create" right>
+			<div id="createVisitTemplateSegmentTemplate{{@$position}}Component{{@$position}}" v-cloak>
 				<input type="hidden" name="visitTemplateUid" value="{{ $visitTemplate->uid }}" />
 				<div class="mb-2">
 					<label>Segment Template<sup class="text-danger">*</sup></label>
@@ -11,6 +11,9 @@
 						<option v-for="t in segmentTemplates" v-bind:value="t.uid">@{{ t.default_display_title }}</option>
 					</select>
 				</div>
+				@if(@$position)
+				<input type="hidden" name="leftOrRight" value="{{ $position }}">
+				@else
 				<div class="mb-2">
 					<label>Left or Right</label>
 					<select name="leftOrRight" class="form-control" required>
@@ -19,6 +22,7 @@
 						<option value="RIGHT">Right</option>
 					</select>
 				</div>
+				@endif
 				<div class="mb-2">
 					<label>Position Index<sup class="text-danger">*</sup></label>
 					<input type="number" name="positionIndex" class="form-control" required />
@@ -50,7 +54,7 @@
 	(function() {
 		function init() {
 			visitTemplateComponent = new Vue({
-				el: '#createVisitTemplateSegmentTemplateComponent',
+				el: '#createVisitTemplateSegmentTemplate{{@$position}}Component{{@$position}}',
 				data: {
 					segmentTemplates:[]
 				},
@@ -83,6 +87,6 @@
 				}
 			});
 		}
-		addMCInitializer('createVisitTemplateSegmentTemplate', init);
+		addMCInitializer('createVisitTemplateSegmentTemplate{{@$position}}', init);
 	})();
 </script>

+ 43 - 135
resources/views/app/practice-management/visit-templates/visit-template-segment-templates/index.blade.php

@@ -1,145 +1,53 @@
-@extends ('layouts/template')
-
-@section('content')
-<link href="/select2/select2.min.css" rel="stylesheet" />
-<script src="/select2/select2.min.js"></script>
-
-<style>
-    #visit-template-segment-template-list .select2-container {
-        width: 100% !important;
-    }
-</style>
-
-<div class="p-3 mcp-theme-1" id="visit-template-segment-template-list">
-    <a href="{{ route('practice-management.visitTemplates') }}" class="d-block mb-1"><i class="fas fa-arrow-left"></i> Back to Visit Templates</a>
-    <div class="card mb-3">
-        <div class="card-header">
-            <div class="d-flex align-items-center justify-content-between">
-            <strong>{{ $visitTemplate->title }}</strong>
-            <div>
-            @include('app.practice-management.visit-templates.update', ['template' => $visitTemplate ])
-            </div>
+@extends('app.practice-management.visit-templates.single')
+@section('visitTemplateTab')
+<div class="row">
+    <div class="col-md-12">
+        <div class="card mb-2">
+            <div class="card-header border-bottom-0 px-1 py-2 d-flex align-items-center">
+                <strong class="mr-4">
+                    <i class="fas fa-notes-medical"></i>
+                    Visit Template Segment Templates
+                </strong>
             </div>
         </div>
-        <div class="card-body">
-                <div class="d-flex align-items-start">
-                    <span class="mr-3"><b>Internal Name:</b> {{ $visitTemplate->internal_name }}</span>
-                    <span class="mr-3"><b>Title:</b> {{ $visitTemplate->title }}</span>
-                    <span class="mr-3"><b>Created At:</b> {{ friendly_date_time($visitTemplate->created_at) }}</span>
-                    <span class="mr-3">
-                        <b>Status:</b> 
-                    @if($visitTemplate->is_active)
-                        <span class="text-success mr-2">ACTIVE</span>
-                    @else
-                        <span class="text-danger mr-2">INACTIVE</span>
-                    @endif
-                    @include('app.practice-management.visit-templates.activate-deactivate', ['template' => $visitTemplate, 'leftPosition' => true ])
-                    </span>
 
-                    <div class="mr-3 d-flex align-items-start">
-                    @if($visitTemplate->is_active)
-                        @if($visitTemplate->reactivation_memo)
-                            <span class="mr-3"><b>Reactivation Memo:</b></span>
-                            <div style="width:300px;">
-                                <small class="text-muted"><b>Memo: </b>{{ $visitTemplate->reactivation_memo }}</small>
-                                @include('app.practice-management.visit-templates.update-memo', ['template' => $visitTemplate ])
-                            </div>
-                        @endif
-                    @else
-                        @if($visitTemplate->deactivation_memo)
-                            <span class="mr-3"><b>Deactivation Memo:</b></span>
-                            <div style="width:300px;">
-                                <small class="text-muted"><b>Memo: </b>{{ $visitTemplate->deactivation_memo }}</small>
-                                @include('app.practice-management.visit-templates.update-memo', ['template' => $visitTemplate ])
-                            </div>
-                        @endif
-                    @endif
+        <div class="row">
+            <div class="col-md-6">
+                <div class="card">
+                    <div class="card-header border-bottom-0 px-1 py-2 d-flex align-items-center">
+                        <div class="d-flex align-items-center justify-content-between w-100">
+                            <strong>Left Position</strong>
+                            @include('app.practice-management.visit-templates.visit-template-segment-templates.create', ['position' => 'LEFT'])
+                        </div>
+
+                    </div>
+                    <div class="card-body p-0">
+                        <div class="table-responsive">
+                            @include('app.practice-management.visit-templates.visit-template-segment-templates.segment-templates-list', ['position' => 'LEFT'])
+                        </div>
                     </div>
                 </div>
-        </div>
-    </div>
-    <div class="card">
-
-        <div class="card-header border-bottom-0 px-1 py-2 d-flex align-items-center">
-            <strong class="mr-4">
-                <i class="fas fa-notes-medical"></i>
-                Visit Template Segment Templates
-            </strong>
-            @include('app.practice-management.visit-templates.visit-template-segment-templates.create')
+            </div>
+            <div class="col-md-6">
+                <div class="card">
+                    <div class="card-header border-bottom-0 px-1 py-2 d-flex align-items-center">
+                        <div class="d-flex align-items-center justify-content-between w-100">
+                            <strong>Right Position</strong>
+                            @include('app.practice-management.visit-templates.visit-template-segment-templates.create', ['position' => 'RIGHT'])
+                        </div>
+                    </div>
+                    <div class="card-body p-0">
+                        <div class="table-responsive">
+                            @include('app.practice-management.visit-templates.visit-template-segment-templates.segment-templates-list', ['position' => 'RIGHT'])
+                        </div>
+                    </div>
+                </div>
+            </div>
         </div>
 
-        <div class="card-body p-0">
-            <table class="table table-sm table-striped border-top p-0 m-0">
-                <thead class="bg-light">
-                    <tr>
-                        <th class="border-0">Display title</th>
-                        <th class="border-0">Heading</th>
-                        <th class="border-0">Sub-heading</th>
-                        <th class="border-0">Left or Right</th>
-                        <th class="border-0">Position Index</th>
-                        <th class="border-0">Segment Template</th>
-                        <th class="border-0">Created At</th>
-                        <th class="border-0">Status</th>
-                        <th class="border-0">&nbsp;</th>
-                    </tr>
-                </thead>
-                <tbody>
-                    @foreach($visitTemplateSegmentTemplates as $template)
-                    <tr>
-                        <td>{{ $template->display_title }}</td>
-                        <td>{{ $template->heading }}</td>
-                        <td>{{ $template->subheading }}</td>
-                        <td>{{ $template->left_or_right }}</td>
-                        <td>{{ $template->position_index }}</td>
-                        <td>{{ $template->segmentTemplate ? $template->segmentTemplate->default_display_title : '---' }}</td>
-                        <td>{{ friendly_date_time($template->created_at) }}</td>
-                        <td>
-                            <div>
-                                @if($template->is_active)
-                                    <span class="text-success">ACTIVE</span>
-                                    @if($template->reactivation_memo)
-                                        <div style="width:300px;">
-                                            <small class="text-muted"><b>Memo: </b>{{ $template->reactivation_memo }}</small>
-                                            @include('app.practice-management.visit-templates.visit-template-segment-templates.update-memo')
-                                        </div>
-                                    @endif
-                                @else
-                                    <span class="text-danger">INACTIVE</span>
-                                    @if($template->deactivation_memo)
-                                        <div style="width:300px;">
-                                            <small class="text-muted"><b>Memo: </b>{{ $template->deactivation_memo }}</small>
-                                            @include('app.practice-management.visit-templates.visit-template-segment-templates.update-memo')
-                                        </div>
-                                    @endif
-                                @endif
-                            </div>
-                        </td>
-                        <td>
-                            <div class="d-flex align-items-center">
-                                <div class="mr-2">
-                                @include('app.practice-management.visit-templates.visit-template-segment-templates.update')
-                                </div>
-                                <div>
-                                @include('app.practice-management.visit-templates.visit-template-segment-templates.activate-deactivate')
-                                </div>
-                            </div>
-                        </td>                
-                    </tr>
-                    @endforeach
-
-                    @if(count($visitTemplateSegmentTemplates) === 0)
-                    <tr>
-                        <td colspan="8">No records found!</td>
-                    </tr>
-                    @endif
-                </tbody>
-
-            </table>
-
+        <div class="mt-3">
+            {{ $visitTemplateSegmentTemplates->appends(request()->input())->links() }}
         </div>
     </div>
-    <div class="mt-3">
-        {{ $visitTemplateSegmentTemplates->appends(request()->input())->links() }}
-    </div>
 </div>
-@endsection
+@endSection

+ 67 - 0
resources/views/app/practice-management/visit-templates/visit-template-segment-templates/segment-templates-list.blade.php

@@ -0,0 +1,67 @@
+<table class="table table-sm table-striped border-top p-0 m-0">
+	<thead class="bg-light">
+		<tr>
+			<th class="border-0">Display title</th>
+			<th class="border-0">Heading</th>
+			<th class="border-0">Sub-heading</th>
+			<th class="border-0">Position Index</th>
+			<th class="border-0">Segment Template</th>
+			<th class="border-0">Created At</th>
+			<th class="border-0">Status</th>
+			<th class="border-0">&nbsp;</th>
+		</tr>
+	</thead>
+	<tbody>
+		<?php $rowsCount = 0; ?>
+		@foreach($visitTemplateSegmentTemplates as $template)
+			@if(@$position === $template->left_or_right)
+				<?php $rowsCount++; ?>
+				<tr>
+					<td>{{ $template->display_title }}</td>
+					<td>{{ $template->heading }}</td>
+					<td>{{ $template->subheading }}</td>
+					<td>{{ $template->position_index }}</td>
+					<td>{{ $template->segmentTemplate ? $template->segmentTemplate->default_display_title : '---' }}</td>
+					<td>{{ friendly_date_time($template->created_at) }}</td>
+					<td>
+						<div>
+							@if($template->is_active)
+							<span class="text-success">ACTIVE</span>
+							@if($template->reactivation_memo)
+							<div style="width:300px;">
+								<small class="text-muted"><b>Memo: </b>{{ $template->reactivation_memo }}</small>
+								@include('app.practice-management.visit-templates.visit-template-segment-templates.update-memo')
+							</div>
+							@endif
+							@else
+							<span class="text-danger">INACTIVE</span>
+							@if($template->deactivation_memo)
+							<div style="width:300px;">
+								<small class="text-muted"><b>Memo: </b>{{ $template->deactivation_memo }}</small>
+								@include('app.practice-management.visit-templates.visit-template-segment-templates.update-memo')
+							</div>
+							@endif
+							@endif
+						</div>
+					</td>
+					<td>
+						<div class="d-flex align-items-center">
+							<div class="mr-2">
+								@include('app.practice-management.visit-templates.visit-template-segment-templates.update', ['position' => @$position])
+							</div>
+							<div>
+								@include('app.practice-management.visit-templates.visit-template-segment-templates.activate-deactivate')
+							</div>
+						</div>
+					</td>
+				</tr>
+			@endif
+		@endforeach
+		@if(!$rowsCount)
+		<tr>
+			<td colspan="8">No records found!</td>
+		</tr>
+		@endif
+	</tbody>
+
+</table>

+ 4 - 0
resources/views/app/practice-management/visit-templates/visit-template-segment-templates/update.blade.php

@@ -3,6 +3,9 @@
 	<form url="/api/visitTemplateSegmentTemplate/updateBasic" right>
 		<div>
 			<input type="hidden" name="uid" value="{{ $template->uid }}" />
+			@if(@$position)
+			<input type="hidden" name="leftOrRight" value="{{ $position }}">
+			@else
 			<div class="mb-2">
 				<label>Left or Right</label>
 				<select name="leftOrRight" class="form-control" required>
@@ -11,6 +14,7 @@
 					<option {{$template->left_or_right == 'RIGHT' ? 'selected': ''}} value="RIGHT">Right</option>
 				</select>
 			</div>
+			@endif
 			<div class="mb-2">
 				<label>Position Index<sup class="text-danger">*</sup></label>
 				<input type="number" name="positionIndex" class="form-control" value="{{ $template->position_index }}" required />

+ 1 - 0
routes/web.php

@@ -263,6 +263,7 @@ Route::middleware('pro.auth')->group(function () {
         Route::get('segment-templates', 'PracticeManagementController@segmentTemplates')->name('segmentTemplates');
         Route::get('visit-templates', 'PracticeManagementController@visitTemplates')->name('visitTemplates');
         Route::get('visit-template/{visitTemplate}', 'PracticeManagementController@visitTemplate')->name('visitTemplate');
+        Route::get('visit-template-access/{visitTemplate}', 'PracticeManagementController@visitTemplateAccess')->name('visitTemplateAccess');
         Route::get('client-ccm-rm-status', 'PracticeManagementController@clientCcmRmStatus')->name('client-ccm-rm-status');
 
         Route::get('hcp-note-activity', 'PracticeManagementController@hcpNoteActivity')->name('hcp-note-activity');