Browse Source

Merge branch 'master' of rav.triplestart.com:TigerPHP/staghrm6

= 3 years ago
parent
commit
e9774a5059

+ 6 - 1
app/Http/Controllers/PatientController.php

@@ -30,6 +30,7 @@ use Illuminate\Support\Facades\File;
 
 use Illuminate\Support\Facades\Http;
 use PDF;
+use App\Models\Department;
 
 class PatientController extends Controller
 {
@@ -76,8 +77,12 @@ class PatientController extends Controller
             ->where('is_removed', false)
             ->orderBy('content_text', 'asc')
             ->get();
+
+            $adminPros = Pro::where('pro_type', 'ADMIN')->orderBy('name_first','ASC')->get();
+            $departments = Department::all();
+
         return view('app.patient.dashboard',
-            compact('patient', 'facilities', 'devices', 'dxInfoLines'));
+            compact('patient', 'facilities', 'devices', 'dxInfoLines', 'departments', 'adminPros'));
     }
 
     public function canvasMigrate(Request $request, Client $patient )

+ 15 - 0
app/Http/Controllers/SystemFileController.php

@@ -0,0 +1,15 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use App\Models\SystemFile;
+use Illuminate\Http\Request;
+
+class SystemFileController extends Controller
+{
+    
+    public function serve($uid){
+        $systemFile = SystemFile::where('uid', $uid)->first();
+        return response()->file($systemFile->file_path);
+    }
+}

+ 11 - 0
app/Models/Department.php

@@ -0,0 +1,11 @@
+<?php
+
+namespace App\Models;
+
+# use Illuminate\Database\Eloquent\Model;
+
+class Department extends Model
+{
+    protected $table = 'department';
+
+}

+ 1 - 1
resources/views/app/admin/patients_filters.blade.php

@@ -68,7 +68,7 @@
 		</div>
 	</div>
 
-	<div class="sm-section">
+	<div class="sm-section" style="width: 130px !important;">
 		<div class="">
 			<label>Chart # ends with:</label>
 			<select class="form-control"  name="chart_number_ends_with" v-model="filters.chart_number_ends_with">

+ 27 - 156
resources/views/app/patient/dashboard.blade.php

@@ -31,167 +31,38 @@
         <?php $disallowPointEdits = $nonCoreVisitNotes && count($nonCoreVisitNotes); ?>
 
 	    <div class="row client-single-dashboard">
-            <div class="col-6">
-                @include('app/patient/partials/appointments')
-            </div>
-            <div class="col-6">
-            <div  class="mb-2 pt-3 pb-2 border-top">
-                <div class="">
-                        <div class="d-flex align-items-start pb-2">
-                            <h6 class="my-0 font-weight-bold text-secondary">Memos</h6>
+            <div class="col-12">
+                <div class="row">
+                    <div class="col-md-4">
+                        <div class="row">
+                            <div class="col-12">
+                                @include('app/patient/partials/appointments')
+                                @include('app/patient/partials/memos')
+                            </div>
                         </div>
-                        <div moe class="w-100 p-2 border mb-3">
-                            <form url="/api/clientMemo/create" show>
-                                <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                                <label class="text-secondary font-weight-bold">+ New Memo</label>
-                                <div class="mb-2">
-                                    <select class="form-control form-control-sm" name="category" required>
-                                        <option value="">-- select --</option>
-                                        <option value="Incoming Call">Incoming Call</option>
-                                        <option value="Outgoing Call">Outgoing Call</option>
-                                        <option value="Call Unspecified">Call Unspecified</option>
-                                        <option value="Other">Other</option>
-                                    </select>
-                                </div>
-                                <div class="mb-2">
-                                    <textarea class="form-control form-control-sm" rows="5" name="content" placeholder="Content"></textarea>
-                                </div>
-                                @if($performer->pro->pro_type === 'ADMIN')
-                                <div class="mb-2">
-                                    <label for="" class="checkbox">
-                                        <input type="checkbox" name="isAdminOnly">
-                                        Admins only
-                                    </label>
-                                </div>
-                                @endif
-                                <div class="d-flex align-items-center">
-                                    <button class="btn btn-sm btn-primary mr-2" type="button" submit>Save</button>
-                                </div>
-                            </form>
+                    </div>
+                    <div class="col-md-4">
+                        <div class="row">
+                            <div class="col-12">
+                                @include('app/patient/partials/messages')
+                            </div>
+                        </div>
+                    </div>
+                    <div class="col-md-4">
+                        <div class="row">
+                            <div class="col-12">
+                                @include('app/patient/partials/hr-stages')
+                            </div>
                         </div>
-                        <table class="table table-striped table-sm table-bordered mb-0">
-                            @if($patient->memos && count($patient->memos))
-                                <thead class="bg-light">
-                                <tr class="text-nowrap">
-                                    <th class="border-0 text-secondary">Category</th>
-                                    <th class="border-0 text-secondary w-50">Summary</th>
-                                    <th class="border-0 text-secondary">Created</th>
-                                    @if($performer->pro->pro_type === 'ADMIN')
-                                    <th class="border-0 text-secondary">Admins Only</th>
-                                    @endif
-                                    <th class="border-0 text-secondary">Ack. by MCP</th>
-                                    <th class="border-0 text-secondary delete-column">&nbsp;</th>
-                                </tr>
-                                </thead>
-                                <tbody>
-                                @foreach($patient->memos as $memo)
-                                    @if(!$memo->is_admin_only || ($memo->is_admin_only && $performer->pro->pro_type === 'ADMIN') )
-                                    <tr>
-                                        <td class="text-nowrap">{{ $memo->category }}</td>
-                                        <td class="px-2">
-                                            <pre class="m-0 break-spaces">{{ $memo->content }}</pre>
-                                        </td>
-                                        <td class="text-nowrap">
-                                            @if($performer->pro->pro_type == 'ADMIN')
-                                            <strong>{{$memo->createdBy->proname_first}} {{$memo->createdBy->pro->name_last}}</strong><br/>
-                                            @endif
-                                            {{ friendly_date_time($memo->created_at) }}
-                                        </td>
-                                        @if($performer->pro->pro_type === 'ADMIN' )
-                                        <td class="text-secondary">
-                                            @if($memo->is_admin_only)
-                                                <span class="text-success"><i class="fas fa-lock"></i> YES</span>
-                                            @else
-                                                <span><i class="fas fa-unlock"></i> NO</span>
-                                            @endif
-                                        </td>
-                                        @endif
-                                        <td>
-                                            @if($memo->mcp_stamp_id)
-                                            <span class="text-success">YES <i class="fas fa-info-circle c-pointer" data-toggle="tooltip" data-placement="bottom" title="{{ friendly_date_time($memo->stamp->created_at) }}"></i></span>
-                                            @else
-                                            <span class="text-secondary">NO</span>
-                                            @endif
-                                        </td>
-                                        <td class="text-center delete-column">
-                                            @if($performer->pro->pro_type == 'ADMIN')
-                                                <div moe relative bottom class="mr-2">
-                                                    <a start show><i class="fa fa-history"></i></a>
-                                                    <div action="" url right bottom>
-                                                        <table class="table table-condensed table-striped table-sm">
-                                                            <thead>
-                                                            <th>Category</th>
-                                                            <th>Summary</th>
-                                                            <th>Created</th>
-
-                                                            </thead>
-                                                            <tbody>
-                                                            @foreach($memo->updates as $update)
-                                                                <tr>
-                                                                    <td>{{$update->category}}</td>
-                                                                    <td>{{$update->content}}</td>
-                                                                    <td><strong>{{$update->createdBy->proname_first}} {{$update->createdBy->pro->name_last}}</strong><br/>{{ friendly_date_time($update->created_at) }}</td>
-
-                                                                </tr>
-                                                            @endforeach
-                                                            </tbody>
-                                                        </table>
-                                                    </div>
-                                                </div>
-                                            @endif
-                                            <div moe wide relative class="mr-2">
-                                                <a class="on-hover-opaque" start show title="Edit">
-                                                    <i class="font-size-11 fa fa-edit"></i>
-                                                </a>
-                                                <form url="/api/clientMemo/update" right>
-                                                    <input type="hidden" name="uid" value="{{ $memo->uid }}">
-                                                    <div class="mb-2">
-                                                        <select class="form-control form-control-sm" name="category" required>
-                                                            <option value="">-- select --</option>
-                                                            <option {{ $memo->category === "Incoming Call" ? "selected" : "" }} value="Incoming Call">Incoming Call</option>
-                                                            <option {{ $memo->category === "Outgoing Call" ? "selected" : "" }} value="Outgoing Call">Outgoing Call</option>
-                                                            <option {{ $memo->category === "Call Unspecified" ? "selected" : "" }} value="Call Unspecified">Call Unspecified</option>
-                                                            <option {{ $memo->category === "Other" ? "selected" : "" }} value="Other">Other</option>
-                                                        </select>
-                                                    </div>
-                                                    <div class="mb-2">
-                                                        <textarea class="form-control form-control-sm" name="content" rows="5"
-                                                            placeholder="Content"><?= $memo->content ?></textarea>
-                                                    </div>
-                                                    <div class="d-flex align-items-center">
-                                                        <button class="btn btn-sm btn-primary mr-2" type="button" submit>Save</button>
-                                                        <button class="btn btn-sm btn-default mr-2 border" type="button"
-                                                                cancel>Cancel</button>
-                                                    </div>
-                                                </form>
-                                            </div>
-                                            <div moe relative>
-                                                <a start show class="on-hover-opaque"><i class="fa fa-trash-alt text-danger"></i></a>
-                                                <form url="/api/clientMemo/cancel" right>
-                                                    <input type="hidden" name="uid" value="{{ $memo->uid }}">
-                                                    <p class="small">Are you sure you want to cancel this memo?</p>
-                                                    <div class="d-flex align-items-center">
-                                                        <button class="btn btn-sm btn-danger mr-2" submit>Delete</button>
-                                                        <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                                    </div>
-                                                </form>
-                                            </div>
-                                        </td>
-                                    </tr>
-                                    @endif
-                                @endforeach
-                                </tbody>
-                            @else
-                                <tbody>
-                                <tr>
-                                    <td class="text-secondary p-3">No memos have been created for this patient</td>
-                                </tr>
-                                </tbody>
-                            @endif
-                        </table>
                     </div>
                 </div>
             </div>
+            <div class="col-6">
+                
+            </div>
+            <div class="col-6">
+            
+            </div>
         </div>
     
     </div>

+ 1 - 1
resources/views/app/patient/partials/appointments.blade.php

@@ -1,4 +1,4 @@
-<div class="mt-0 pb-1">
+<div class="mb-2 pt-2 pb-2 border-top">
     <div class="d-flex align-items-center mb-2 pt-2">
         <h6 class="my-0 font-weight-bold">Appointments</h6>
         <span class="mx-2 text-secondary">|</span>

+ 593 - 0
resources/views/app/patient/partials/hr-stages.blade.php

@@ -0,0 +1,593 @@
+<?php
+$items =[
+
+    [
+        'label' => 'Application Submitted',
+        'bool_prop' => 'is_application_submitted',
+        'set_true' => 'setIsApplicationSubmittedToTrue',
+        'set_false' => 'setIsApplicationSubmittedToFalse'
+    ],
+
+    [
+        'label' => 'Non Responsive',
+        'bool_prop' => 'is_non_responsive',
+        'set_true' => 'setIsNonResponsiveToTrue',
+        'set_false' => 'setIsNonResponsiveToFalse'
+    ],
+
+    [
+        'label' => 'Withdrawn',
+        'bool_prop' => 'is_withdrawn',
+        'set_true' => 'setIsWithdrawnToTrue',
+        'set_false' => 'setIsWithdrawnToFalse'
+
+    ],
+
+    [
+        'label' => 'Withdrawn Communication Done',
+        'bool_prop' => 'is_withdrawn_communication_done',
+        'set_true' => 'setIsWithdrawnCommunicationDoneToTrue',
+        'set_false' => 'setIsWithdrawnCommunicationDoneToFalse',
+        'preconditions' => 'is_withdrawn'
+    ],
+
+    [
+        'label' => 'Cancelled',
+        'bool_prop' => 'is_cancelled',
+        'set_true' => 'setIsCancelledToTrue',
+        'set_false' => 'setIsCancelledToFalse'
+    ],
+
+    [
+        'label' => 'CancelledCommunicationDone',
+        'bool_prop' => 'is_cancelled_communication_done',
+        'set_true' => 'setIsCancelledCommunicationDoneToTrue',
+        'set_false' => 'setIsCancelledCommunicationDoneToFalse',
+        'preconditions' => 'is_cancelled'
+    ],
+
+    [
+        'label' => 'Spam',
+        'bool_prop' => 'is_spam',
+        'set_true' => 'setIsSpamToTrue',
+        'set_false' => 'setIsSpamToFalse'
+    ],
+
+    [
+        'label' => 'Waitlisted',
+        'bool_prop' => 'is_waitlisted',
+        'set_true' => 'setIsWaitlistedToTrue',
+        'set_false' => 'setIsWaitlistedToFalse'
+    ],
+
+    [
+        'label' => 'Waitlisted Communication Done',
+        'bool_prop' => 'is_waitlisted_communication_done',
+        'set_true' => 'setIsWaitlistedCommunicationDoneToTrue',
+        'set_false' => 'setIsWaitlistedCommunicationDoneToFalse',
+        'preconditions' => 'is_cancelled'
+    ],
+
+    [
+        'label' => 'Rejected',
+        'bool_prop' => 'is_rejected',
+        'set_true' => 'setIsRejectedToTrue',
+        'set_false' => 'setIsRejectedToFalse'
+    ],
+
+    [
+        'label' => 'RejectedCommunicationDone',
+        'bool_prop' => 'is_rejected_communication_done',
+        'set_true' => 'setIsRejectedCommunicationDoneToTrue',
+        'set_false' => 'setIsRejectedCommunicationDoneToFalse',
+        'preconditions' => 'is_rejected'
+    ],
+
+    [
+        'label' => 'Resigned',
+        'bool_prop' => 'is_resigned',
+        'set_true' => 'setIsResignedToTrue',
+        'set_false' => 'setIsResignedToFalse'
+    ],
+
+    [
+        'label' => 'ResignedCommunicationDone',
+        'bool_prop' => 'is_resigned_communication_done',
+        'set_true' => 'setIsResignedCommunicationDoneToTrue',
+        'set_false' => 'setIsResignedCommunicationDoneToFalse',
+        'preconditions' => 'is_resigned'
+    ],
+
+    [
+        'label' => 'Terminated',
+        'bool_prop' => 'is_terminated',
+        'set_true' => 'setIsTerminatedToTrue',
+        'set_false' => 'setIsTerminatedToFalse'
+    ],
+
+    [
+        'label' => 'TerminatedCommunicationDone',
+        'bool_prop' => 'is_terminated_communication_done',
+        'set_true' => 'setIsTerminatedCommunicationDoneToTrue',
+        'set_false' => 'setIsTerminatedCommunicationDoneToFalse',
+        'preconditions' => 'is_terminated'
+    ],
+
+    [
+        'label' => 'DNC',
+        'bool_prop' => 'is_dnc',
+        'set_true' => 'setIsDncToTrue',
+        'set_false' => 'setIsDncToFalse'
+    ],
+
+    [
+        'label' => 'Application Received',
+        'bool_prop' => 'is_application_received',
+        'set_true' => 'setIsApplicationReceivedToTrue',
+        'set_false' => 'setIsApplicationReceivedToFalse'
+    ],
+
+    [
+        'label' => 'Problem w/ Application',
+        'bool_prop' => 'is_problem_with_application',
+        'set_true' => 'setIsProblemWithApplicationToTrue',
+        'set_false' => 'setIsProblemWithApplicationToFalse'
+    ],
+
+    [
+        'label' => 'Applicant Contacted',
+        'bool_prop' => 'has_applicant_been_contacted',
+        'set_true' => 'setHasApplicantBeenContactedToTrue',
+        'set_false' => 'setHasApplicantBeenContactedToFalse'
+    ],
+
+    [
+        'label' => 'Awaiting Interviewer Decision',
+        'bool_prop' => 'is_awaiting_interviewer_decision',
+        'set_true' => 'setIsAwaitingInterviewerDecisionToTrue',
+        'set_false' => 'setIsAwaitingInterviewerDecisionToFalse'
+    ],
+
+    [
+        'label' => 'Accepted By HR',
+        'bool_prop' => 'is_accepted_by_hr',
+        'set_true' => 'setIsAcceptedByHrToTrue',
+        'set_false' => 'setIsAcceptedByHrToFalse'
+    ],
+
+    [
+        'label' => 'All Needed Documents Sent',
+        'bool_prop' => 'are_all_needed_documents_sent',
+        'set_true' => 'setAreAllNeededDocumentsSentToTrue',
+        'set_false' => 'setAreAllNeededDocumentsSentToFalse'
+    ],
+
+    [
+        'label' => 'Problem With Documents',
+        'bool_prop' => 'is_problem_with_documents',
+        'set_true' => 'setIsProblemWithDocumentsToTrue',
+        'set_false' => 'setIsProblemWithDocumentsToFalse'
+    ],
+
+    [
+        'label' => 'Exp. Profile Submitted',
+        'bool_prop' => 'is_payroll_and_credentialing_submitted',
+        'set_true' => 'setIsPayrollAndCredentialingSubmittedToTrue',
+        'set_false' => 'setIsPayrollAndCredentialingSubmittedToFalse'
+    ],
+
+    [
+        'label' => 'Problem With Payroll Or Credentialing',
+        'bool_prop' => 'is_problem_with_payroll_or_credentialing',
+        'set_true' => 'setIsProblemWithPayrollOrCredentialingToTrue',
+        'set_false' => 'setIsProblemWithPayrollOrCredentialingToFalse'
+    ],
+
+    [
+        'label' => 'Exp. Profile Verified - L1',
+        'bool_prop' => 'is_payroll_information_verified',
+        'set_true' => 'setIsPayrollInformationVerifiedToTrue',
+        'set_false' => 'setIsPayrollInformationVerifiedToFalse'
+    ],
+
+    [
+        'label' => 'Exp. Profile Verified - L2',
+        'bool_prop' => 'is_credentialing_information_verified',
+        'set_true' => 'setIsCredentialingInformationVerifiedToTrue',
+        'set_false' => 'setIsCredentialingInformationVerifiedToFalse'
+    ],
+
+    [
+        'label' => 'Background Check Cleared',
+        'bool_prop' => 'is_background_check_cleared',
+        'set_true' => 'setIsBackgroundCheckClearedToTrue',
+        'set_false' => 'setIsBackgroundCheckClearedToFalse'
+    ],
+
+    [
+        'label' => 'Trained',
+        'bool_prop' => 'is_trained',
+        'set_true' => 'setIsTrainedToTrue',
+        'set_false' => 'setIsTrainedToFalse'
+    ],
+
+    [
+        'label' => 'Working',
+        'bool_prop' => 'is_working',
+        'set_true' => 'setIsWorkingToTrue',
+        'set_false' => 'setIsWorkingToFalse'
+    ]
+];
+
+$currentPro = $patient->shadowOfPro;
+?>
+
+<div class="mb-2 pt-2 pb-2 border-top">
+<div class="hr-steps-container">
+    <div>
+        <div>
+            @if($currentPro->is_training_needed)
+                <div class="d-flex align-items-center justify-content-between mb-2">
+                    <h2 class="mb-0 font-weight-bold">Training Is Needed: </h2>
+                    <div>
+                        <div moe relative large>
+                        <a href="#" start show class="text-sm font-weight-bold">
+                            <i class="fa fa-edit"></i> Update
+                        </a>
+                        <form url="/api/proHr/updateTrainingNeededInformation" right>
+                            <input type="hidden" name="uid" value="{{$currentPro->uid}}">
+
+                            <div class="form-group">
+                                <label for="" class="control-label">Category</label>
+                                <input type="text" name="category" class="form-control input-sm" value="{{$currentPro->training_needed_for_category}}">
+                            </div>
+                            <div class="form-group">
+                                <label for="" class="control-label">Description</label>
+                                <textarea name="description" class="form-control input-sm">{{$currentPro->training_needed_for_description}}</textarea>
+                            </div>
+                            <div class="form-group">
+                                <label for="" class="control-label">Memo</label>
+                                <textarea name="memo" class="form-control input-sm">{{$currentPro->is_training_needed_memo}}</textarea>
+                            </div>
+                            <div class="form-group">
+                                <label for="" class="control-label">Training Needed with Department</label>
+                                <select name="trainingNeededWithDepartmentUid" id="" class="form-control input-sm">
+                                    <option value="">--select--</option>
+                                    @foreach($departments as $department)
+                                        <option value="{{$department->uid}}" {{$department->id == $currentPro->training_needed_with_department_id? 'selected': ''}}>{{$department->name}}</option>
+                                    @endforeach
+                                </select>
+                            </div>
+                            <div class="form-group">
+                                <label for="" class="control-label">Training Needed with Pro</label>
+                                <select name="trainingNeededWithProUid" id="" class="form-control input-sm">
+                                    <option value="">--select--</option>
+                                    @foreach($adminPros as $adminPro)
+                                        <option value="{{$adminPro->uid}}" {{$adminPro->id == $currentPro->training_needed_with_pro_id? 'selected': ''}}>{{$adminPro->name_first}} {{$adminPro->name_last}}</option>
+                                    @endforeach
+                                </select>
+                            </div>
+
+                            <div class="">
+                                <button type="button" class="btn btn-sm btn-primary" submit>Submit</button>
+                                <button type="button" class="btn btn-sm btn-default border" cancel>Cancel</button>
+                            </div>
+                        </form>
+                    </div>
+
+                    <div moe relative>
+                        <a href="#" class="ml-2 text-sm font-weight-bold" start show>
+                            <i class="fa fa-undo text-danger"></i> Undo
+                        </a>
+                        <form url="/api/proHr/undoMakeTrainingNeeded" right>
+                            <input type="hidden" name="uid" value="{{$currentPro->uid}}">
+
+                            <div class="form-group">
+                                <label for="" class="control-label">Are you sure?</label>
+                            </div>
+
+                            <div class="">
+                                <button type="button" class="btn btn-sm btn-primary" submit>Submit</button>
+                                <button type="button" class="btn btn-sm btn-default border" cancel>Cancel</button>
+                            </div>
+                        </form>
+                    </div>
+                    </div>
+                </div>
+                <div class="table-responsive mb-2">
+                  <table class="table table-sm table-condensed table-bordered mb-0">
+                    <tr>
+                      <td class="text-secondary">Category</td>
+                      <td>{{$currentPro->training_needed_for_category}}</td>
+                    </tr>
+                    <tr>
+                      <td class="text-secondary">Description</td>
+                      <td>{{$currentPro->training_needed_for_description}}</td>
+                    </tr>
+                    <tr>
+                      <td class="text-secondary">Memo</td>
+                      <td>{{$currentPro->is_training_needed_memo}}</td>
+                    </tr>
+                    <tr>
+                      <td class="text-secondary">Pro</td>
+                      <td>{{$currentPro->trainingNeededWithPro ? $currentPro->trainingNeededWithPro->name_display : '-'}}</td>
+                    </tr>
+                    <tr>
+                      <td class="text-secondary">Department</td>
+                      <td>{{$currentPro->trainingNeededWithDepartment ? $currentPro->trainingNeededWithDepartment->name : '-'}}</td>
+                    </tr>
+                  </table>
+                </div>
+            @else
+                <div moe relative large>
+                    <a href="#" start show>
+                        <i class="fas fa-chalkboard-teacher"></i> Set Training Needed
+                    </a>
+                    <form url="/api/proHr/makeTrainingNeeded" right>
+                        <input type="hidden" name="uid" value="{{$currentPro->uid}}">
+                        <div class="form-group">
+                            <label for="" class="control-label">Category</label>
+                            <input type="text" name="category" class="form-control input-sm">
+                        </div>
+                        <div class="form-group">
+                            <label for="" class="control-label">Description</label>
+                            <textarea name="description" class="form-control input-sm"></textarea>
+                        </div>
+                        <div class="form-group">
+                            <label for="" class="control-label">Memo</label>
+                            <textarea name="memo" class="form-control input-sm"></textarea>
+                        </div>
+                        <div class="form-group">
+                            <label for="" class="control-label">Training Needed with Department</label>
+                            <select name="trainingNeededWithDepartmentUid" id="" class="form-control input-sm">
+                                <option value="">--select--</option>
+                                @foreach($departments as $department)
+                                    <option value="{{$department->uid}}">{{$department->name}}</option>
+                                @endforeach
+                            </select>
+                        </div>
+                        <div class="form-group">
+                            <label for="" class="control-label">Training Needed with Pro</label>
+                            <select name="trainingNeededWithProUid" id="" class="form-control input-sm">
+                                <option value="">--select--</option>
+                                @foreach($adminPros as $adminPro)
+                                    <option value="{{$adminPro->uid}}" >{{$adminPro->name_first}} {{$adminPro->name_last}}</option>
+                                @endforeach
+                            </select>
+                        </div>
+                        <div class="">
+                            <button type="button" class="btn btn-sm btn-primary" submit>Submit</button>
+                            <button type="button" class="btn btn-sm btn-default border" cancel>Cancel</button>
+                        </div>
+                    </form>
+                </div>
+            @endif
+        </div>
+        
+        <div>
+            @if($currentPro->is_interview_needed)
+                <div class="d-flex align-items-center justify-content-between mb-2">
+                  <h2 class="mb-0 font-weight-bold">Interview Is Needed </h2>  
+                    <div>
+                        <div moe relative large>
+                        <a href="#" start show class="text-sm font-weight-bold">
+                            <i class="fa fa-edit"></i> Update
+                        </a>
+                        <form url="/api/proHr/updateInterviewNeededInformation" right>
+                            <input type="hidden" name="uid" value="{{$currentPro->uid}}">
+
+                            <div class="form-group">
+                                <label for="" class="control-label">Category</label>
+                                <input type="text" name="category" class="form-control input-sm" value="{{$currentPro->interview_needed_for_category}}">
+                            </div>
+                            <div class="form-group">
+                                <label for="" class="control-label">Description</label>
+                                <textarea name="description" class="form-control input-sm">{{$currentPro->interview_needed_for_description}}</textarea>
+                            </div>
+                            <div class="form-group">
+                                <label for="" class="control-label">Memo</label>
+                                <textarea name="memo" class="form-control input-sm">{{$currentPro->is_interview_needed_memo}}</textarea>
+                            </div>
+                            <div class="form-group">
+                                <label for="" class="control-label">Training Needed with Department</label>
+                                <select name="interviewNeededWithDepartmentUid" id="" class="form-control input-sm">
+                                    <option value="">--select--</option>
+                                    @foreach($departments as $department)
+                                        <option value="{{$department->uid}}" {{$department->id == $currentPro->interview_needed_with_department_id? 'selected': ''}}>{{$department->name}}</option>
+                                    @endforeach
+                                </select>
+                            </div>
+                            <div class="form-group">
+                                <label for="" class="control-label">Training Needed with Pro</label>
+                                <select name="interviewNeededWithProUid" class="form-control input-sm">
+                                    <option value="">--select--</option>
+                                    @foreach($adminPros as $adminPro)
+                                        <option value="{{$adminPro->uid}}" {{$adminPro->id == $currentPro->interview_needed_with_pro_id? 'selected': ''}}>{{$adminPro->name_first}} {{$adminPro->name_last}}</option>
+                                    @endforeach
+                                </select>
+                            </div>
+
+                            <div class="">
+                                <button type="button" class="btn btn-sm btn-primary" submit>Submit</button>
+                                <button type="button" class="btn btn-sm btn-default border" cancel>Cancel</button>
+                            </div>
+                        </form>
+                    </div>
+                    <div moe relative>
+                        <a href="#" start show class="ml-2 text-sm font-weight-bold">
+                            <i class="fa fa-undo text-danger"></i> Undo
+                        </a>
+                        <form url="/api/proHr/undoMakeInterviewNeeded" right>
+                            <input type="hidden" name="uid" value="{{$currentPro->uid}}">
+
+                            <div class="form-group">
+                                <label for="" class="control-label">Are you sure?</label>
+                            </div>
+
+                            <div class="">
+                                <button type="button" class="btn btn-sm btn-primary" submit>Submit</button>
+                                <button type="button" class="btn btn-sm btn-default border" cancel>Cancel</button>
+                            </div>
+                        </form>
+                    </div>
+                    </div>
+                </div>
+                
+                <div class="table-responsive mb-2">
+                  <table class="table table-sm table-condensed table-bordered mb-0">
+                    <tr>
+                      <td class="text-secondary">Category</td>
+                      <td>{{$currentPro->interview_needed_for_category}}</td>
+                    </tr>
+                    <tr>
+                      <td class="text-secondary">Description</td>
+                      <td>{{$currentPro->interview_needed_for_description}}</td>
+                    </tr>
+                    <tr>
+                      <td class="text-secondary">Memo</td>
+                      <td>{{$currentPro->is_interview_needed_memo}}</td>
+                    </tr>
+                    <tr>
+                      <td class="text-secondary">Pro</td>
+                      <td>{{$currentPro->interviewNeededWithPro ? $currentPro->interviewNeededWithPro->name_display : '-'}}</td>
+                    </tr>
+                    <tr>
+                      <td class="text-secondary">Department</td>
+                      <td>{{$currentPro->interviewNeededWithDepartment ? $currentPro->interviewNeededWithDepartment->name : '-'}}</td>
+                    </tr>
+                  </table>
+                </div>
+            @else
+                <div moe relative large>
+                    <a href="#" start show>
+                        <i class="fa fa-handshake"></i> Set Interview Needed
+                    </a>
+                    <form url="/api/proHr/makeInterviewNeeded" right>
+                        <input type="hidden" name="uid" value="{{$currentPro->uid}}">
+                        <div class="form-group">
+                            <label for="" class="control-label">Category</label>
+                            <input type="text" name="category" class="form-control input-sm">
+                        </div>
+                        <div class="form-group">
+                            <label for="" class="control-label">Description</label>
+                            <textarea name="description" class="form-control input-sm"></textarea>
+                        </div>
+                        <div class="form-group">
+                            <label for="" class="control-label">Memo</label>
+                            <textarea name="memo" class="form-control input-sm"></textarea>
+                        </div>
+                        <div class="form-group">
+                            <label for="" class="control-label">Interview Needed with Department</label>
+                            <select name="interviewNeededWithDepartmentUid" id="" class="form-control input-sm">
+                                <option value="">--select--</option>
+                                @foreach($departments as $department)
+                                    <option value="{{$department->uid}}">{{$department->name}}</option>
+                                @endforeach
+                            </select>
+                        </div>
+                        <div class="form-group">
+                            <label for="" class="control-label">Interview Needed with Pro</label>
+                            <select name="interviewNeededWithProUid"  class="form-control input-sm">
+                                <option value="">--select--</option>
+                                @foreach($adminPros as $adminPro)
+                                    <option value="{{$adminPro->uid}}">{{$adminPro->name_first}} {{$adminPro->name_last}}</option>
+                                @endforeach
+                            </select>
+                        </div>
+                        <div class="">
+                            <button type="button" class="btn btn-sm btn-primary" submit>Submit</button>
+                            <button type="button" class="btn btn-sm btn-default border" cancel>Cancel</button>
+                        </div>
+                    </form>
+                </div>
+            @endif
+        </div>
+        
+        <div class="mt-3">
+            <div class="d-flex align-items-baseline">
+                <div class="mb-0 mr-4">
+                    <p class="mb-1"><b>New HR Stage:</b> {{ucwords(implode(' ', explode('_', $currentPro->new_hr_stage)))}} </p>
+                    <p class="mb-1"><b>New HR Stage By:</b> {{$currentPro->newHrStageByPro ? $currentPro->newHrStageByPro->displayName() : '-'}} </p>
+                </div>
+                <div moe relative>
+                    <a start show>
+                        <i class="fa fa-sync"></i>
+                    </a>
+                    <form url="/api/pro/refreshHrStage" class="mcp-theme-1" right>
+                        <input type="hidden" name="uid" value="{{$patient->shadowOfPro->uid}}">
+                        <div class="mb-2">
+                            <label class="text-secondary text-sm">Are you sure?</label>
+                        </div>
+
+                        <div>
+                            <button submit class="btn btn-sm btn-primary mr-1">Submit</button>
+                            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                        </div>
+                    </form>
+                </div>
+            </div>
+            
+        </div>
+        <div>
+            <div class="mb-1 mr-3">
+                <p class="mb-1"><b>Previous HR Stage:</b> {{ucwords(implode(' ', explode('_', $currentPro->previous_hr_stage)))}} </p>
+                <p class="mb-1"><b>Previous HR Stage By:</b> {{$currentPro->previousHrStageByPro ? $currentPro->previousHrStageByPro->displayName() : '-'}} </p>
+            </div>
+        </div>
+        
+        <table class="table table-sm table-striped table-bordered vertical-align-middle mt-3">
+            @foreach($items as $item)
+                @if(!isset($item['preconditions'] )|| (isset($item['preconditions']) && $currentPro->{$item['preconditions']}) )
+                @if( $item['bool_prop'] == 'is_problem_with_application' || $item['bool_prop'] == 'is_non_responsive') @continue @endif
+                <tr>
+                    <td>
+                        {{ $item['label'] }}
+                    </td>
+                    <td>
+                        @if($currentPro->{$item['bool_prop']})
+                        <div moe relative>
+                            <a href="#" start show>
+                                <div class="custom-control custom-switch">
+                                    <input type="checkbox" class="custom-control-input" id="{{ $item['bool_prop'] }}-switch" checked />
+                                    <label class="custom-control-label" for="{{ $item['bool_prop'] }}-switch">&nbsp;</label>
+                                </div>
+                            </a>
+                            <form url="/api/proHr/{{$item['set_false']}}" right>
+                                <input type="hidden" name="uid" value="{{$currentPro->uid}}">
+                                <div class="form-group">
+                                    <label for="" class="control-label">Are you sure?</label>
+                                </div>
+                                <div class="">
+                                    <button type="button" class="btn btn-sm btn-primary" submit>Submit</button>
+                                    <button type="button" class="btn btn-sm btn-default border" cancel>Cancel</button>
+                                </div>
+                            </form>
+                        </div>
+                        @else
+                        <div moe relative>
+                            <a href="#" start show>
+                                <div class="custom-control custom-switch">
+                                    <input type="checkbox" class="custom-control-input" id="{{ $item['bool_prop'] }}-switch" />
+                                    <label class="custom-control-label" for="{{ $item['bool_prop'] }}-switch">&nbsp;</label>
+                                </div>
+                            </a>
+                            <form url="/api/proHr/{{$item['set_true']}}" right>
+                                <input type="hidden" name="uid" value="{{$currentPro->uid}}">
+                                <div class="form-group">
+                                    <label for="" class="control-label">Are you sure?</label>
+                                </div>
+                                <div class="">
+                                    <button type="button" class="btn btn-sm btn-primary" submit>Submit</button>
+                                    <button type="button" class="btn btn-sm btn-default border" cancel>Cancel</button>
+                                </div>
+                            </form>
+                        </div>
+                        @endif
+                    </td>
+                </tr>
+                @endif
+            @endforeach
+        </table>
+    </div>
+</div>
+</div>

+ 156 - 0
resources/views/app/patient/partials/memos.blade.php

@@ -0,0 +1,156 @@
+<div class="mb-2 pt-3 pb-2 border-top">
+	<div class="">
+		<div class="d-flex align-items-start pb-2">
+			<h6 class="my-0 font-weight-bold text-secondary">Memos</h6>
+		</div>
+		<div moe class="w-100 p-2 border mb-3">
+			<form url="/api/clientMemo/create" show>
+				<input type="hidden" name="clientUid" value="{{ $patient->uid }}">
+				<label class="text-secondary font-weight-bold">+ New Memo</label>
+				<div class="mb-2">
+					<select class="form-control form-control-sm" name="category" required>
+						<option value="">-- select --</option>
+						<option value="Incoming Call">Incoming Call</option>
+						<option value="Outgoing Call">Outgoing Call</option>
+						<option value="Call Unspecified">Call Unspecified</option>
+						<option value="Other">Other</option>
+					</select>
+				</div>
+				<div class="mb-2">
+					<textarea class="form-control form-control-sm" rows="5" name="content" placeholder="Content"></textarea>
+				</div>
+				@if($performer->pro->pro_type === 'ADMIN')
+				<div class="mb-2">
+					<label for="" class="checkbox">
+						<input type="checkbox" name="isAdminOnly">
+						Admins only
+					</label>
+				</div>
+				@endif
+				<div class="d-flex align-items-center">
+					<button class="btn btn-sm btn-primary mr-2" type="button" submit>Save</button>
+				</div>
+			</form>
+		</div>
+		<div class="">
+		<table class="table table-striped table-sm table-bordered mb-0">
+			@if($patient->memos && count($patient->memos))
+			<thead class="bg-light">
+				<tr class="">
+					<th class="border-0 text-secondary">Category</th>
+					<th class="border-0 text-secondary w-50">Summary</th>
+					<th class="border-0 text-secondary">Created</th>
+					@if($performer->pro->pro_type === 'ADMIN')
+					<th class="border-0 text-secondary">Admins Only</th>
+					@endif
+					<th class="border-0 text-secondary">Ack. by MCP</th>
+					<th class="border-0 text-secondary delete-column">&nbsp;</th>
+				</tr>
+			</thead>
+			<tbody>
+				@foreach($patient->memos as $memo)
+				@if(!$memo->is_admin_only || ($memo->is_admin_only && $performer->pro->pro_type === 'ADMIN') )
+				<tr>
+					<td class="">{{ $memo->category }}</td>
+					<td class="px-2">
+						<pre class="m-0 break-spaces">{{ $memo->content }}</pre>
+					</td>
+					<td class="">
+						@if($performer->pro->pro_type == 'ADMIN')
+						<strong>{{$memo->createdBy->proname_first}} {{$memo->createdBy->pro->name_last}}</strong><br />
+						@endif
+						{{ friendly_date_time($memo->created_at) }}
+					</td>
+					@if($performer->pro->pro_type === 'ADMIN' )
+					<td class="text-secondary">
+						@if($memo->is_admin_only)
+						<span class="text-success"><i class="fas fa-lock"></i> YES</span>
+						@else
+						<span><i class="fas fa-unlock"></i> NO</span>
+						@endif
+					</td>
+					@endif
+					<td>
+						@if($memo->mcp_stamp_id)
+						<span class="text-success">YES <i class="fas fa-info-circle c-pointer" data-toggle="tooltip" data-placement="bottom" title="{{ friendly_date_time($memo->stamp->created_at) }}"></i></span>
+						@else
+						<span class="text-secondary">NO</span>
+						@endif
+					</td>
+					<td class="text-center delete-column">
+						@if($performer->pro->pro_type == 'ADMIN')
+						<div moe relative bottom class="mr-2">
+							<a start show><i class="fa fa-history"></i></a>
+							<div action="" url right bottom>
+								<table class="table table-condensed table-striped table-sm">
+									<thead>
+										<th>Category</th>
+										<th>Summary</th>
+										<th>Created</th>
+
+									</thead>
+									<tbody>
+										@foreach($memo->updates as $update)
+										<tr>
+											<td>{{$update->category}}</td>
+											<td>{{$update->content}}</td>
+											<td><strong>{{$update->createdBy->proname_first}} {{$update->createdBy->pro->name_last}}</strong><br />{{ friendly_date_time($update->created_at) }}</td>
+
+										</tr>
+										@endforeach
+									</tbody>
+								</table>
+							</div>
+						</div>
+						@endif
+						<div moe wide relative class="mr-2">
+							<a class="on-hover-opaque" start show title="Edit">
+								<i class="font-size-11 fa fa-edit"></i>
+							</a>
+							<form url="/api/clientMemo/update" right>
+								<input type="hidden" name="uid" value="{{ $memo->uid }}">
+								<div class="mb-2">
+									<select class="form-control form-control-sm" name="category" required>
+										<option value="">-- select --</option>
+										<option {{ $memo->category === "Incoming Call" ? "selected" : "" }} value="Incoming Call">Incoming Call</option>
+										<option {{ $memo->category === "Outgoing Call" ? "selected" : "" }} value="Outgoing Call">Outgoing Call</option>
+										<option {{ $memo->category === "Call Unspecified" ? "selected" : "" }} value="Call Unspecified">Call Unspecified</option>
+										<option {{ $memo->category === "Other" ? "selected" : "" }} value="Other">Other</option>
+									</select>
+								</div>
+								<div class="mb-2">
+									<textarea class="form-control form-control-sm" name="content" rows="5" placeholder="Content"><?= $memo->content ?></textarea>
+								</div>
+								<div class="d-flex align-items-center">
+									<button class="btn btn-sm btn-primary mr-2" type="button" submit>Save</button>
+									<button class="btn btn-sm btn-default mr-2 border" type="button" cancel>Cancel</button>
+								</div>
+							</form>
+						</div>
+						<div moe relative>
+							<a start show class="on-hover-opaque"><i class="fa fa-trash-alt text-danger"></i></a>
+							<form url="/api/clientMemo/cancel" right>
+								<input type="hidden" name="uid" value="{{ $memo->uid }}">
+								<p class="small">Are you sure you want to cancel this memo?</p>
+								<div class="d-flex align-items-center">
+									<button class="btn btn-sm btn-danger mr-2" submit>Delete</button>
+									<button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
+								</div>
+							</form>
+						</div>
+					</td>
+				</tr>
+				@endif
+				@endforeach
+			</tbody>
+			@else
+			<tbody>
+				<tr>
+					<td class="text-secondary p-3">No memos have been created for this patient</td>
+				</tr>
+			</tbody>
+			@endif
+		</table>
+		</div>
+	</div>
+</div>

+ 46 - 0
resources/views/app/patient/partials/messages.blade.php

@@ -0,0 +1,46 @@
+<div class="mb-2 pt-2 pb-1 border-top">
+	<div class="">
+		<div class="d-flex align-items-start pb-2">
+			<h6 class="my-1 font-weight-bold text-secondary">Messages</h6>
+		</div>
+		<?php
+		try {
+			$opentok = new \OpenTok\OpenTok(config('app.opentokApiKey'), config('app.opentokApiSecret'));
+			$otSession = $opentok->createSession(array('mediaMode' => \OpenTok\MediaMode::ROUTED));
+			$otSessionId = $otSession->getSessionId();
+			$otToken = $opentok->generateToken($otSessionId);
+			$regardingClient = $patient;
+			$messages = \Illuminate\Support\Facades\DB::select(
+				"
+select
+    im.uid, im.regarding_client_id, im.is_read, im.message_video_file_id, sf.uid as message_video_file_system_file_uid,
+    im.content_text, im.id, im.from_pro_id, im.created_at,
+    (p.name_first  || ' ' || p.name_last) as from_name,
+    im.is_from_shadow_client, im.is_to_shadow_client,
+    im.is_removed, im.is_cleared, im.is_edited,
+    im.original_content_text, im.cleared_content_text,
+    (select count(ima.id) from internal_message_attachment ima where ima.internal_message_id = im.id) as num_attachments
+from internal_message im
+    join pro p on im.from_pro_id = p.id
+    left join system_file sf ON sf.id = im.message_video_file_id
+where im.regarding_client_id = ?
+order by im.created_at asc
+        ",
+				[$regardingClient->id]
+			);
+		} catch (\Exception $e) {
+			//unable to open opentok connection
+		}
+		?>
+		<div class="im-body inline" id="messages">
+			<div class="im-container border-top h-100">
+				<div class="im-rhs p-0 inline">
+					@include('app.messages.rhs')
+				</div>
+			</div>
+		</div>
+	</div>
+</div>
+
+
+@include('app.messages.script')

+ 4 - 2
resources/views/layouts/patient.blade.php

@@ -151,10 +151,12 @@ $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_creat
 											</div>
 										</div>
 										
-                                    </section>
-                                
+                                    </section>                                
 
 									<section class="mr-4 align-self-start mt-2 ml-auto">
+										<div id="hr-stage-heading" class="hr-steps-container">
+											<span>HR Stage:</span> <b>{{ucwords(implode(' ', explode('_', $patient->shadowOfPro->new_hr_stage)))}}</b>
+										</div>
 										<div>
 											<label>Sticky Note:</label> <span class="text-secondary">{{$patient->sticky_note ?? '-' }}</span>
 											<div moe relative wide class="ml-2 hide-inside-popup">

+ 1 - 0
routes/web.php

@@ -356,6 +356,7 @@ Route::middleware('pro.auth')->group(function () {
     Route::get('messages/thread', 'MessageController@thread')->name('messages-thread');
     Route::get('messages/{message}/attachments', 'MessageController@attachments')->name('messages-attachments');
     Route::get("/video-test", 'VideoTestController@index')->name('video-test');
+    Route::get('/serve-system-file/{uid}', 'SystemFileController@serve')->name('serve-system-file');
 
 });