Explorar o código

Merge branch 'dev' of rav.triplestart.com:jmudaka/stagfe2

= %!s(int64=3) %!d(string=hai) anos
pai
achega
fc1da23a4c

+ 4 - 0
app/Models/Client.php

@@ -1034,4 +1034,8 @@ ORDER BY m.ts DESC
         return $this->hasOne(Pro::class, 'id', 'flag_acknowledged_by_pro_id');
     }
 
+    public function clientRepFollowUp(){
+        return $this->hasOne(ClientRepFollowUp::class, 'id', 'client_rep_follow_up_id');
+    }
+
 }

+ 15 - 0
app/Models/ClientRepFollowUp.php

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

+ 14 - 0
app/Models/Pro.php

@@ -1369,4 +1369,18 @@ ORDER BY cm.created_at DESC
         return $this->activeClientReviewRequests->where('client_id', $clientID)->where('scoped_month_start_date', date('Y-m-01'))->first();
 
     }
+
+    public function followupsScheduledForToday() {
+        return DB::select(DB::raw("
+SELECT crfu.id AS crfu_id,
+       crfu.next_follow_up_reason,
+       crfu.next_follow_up_memo,
+       c.uid as client_uid,
+       (c.name_first || ' ' || c.name_last) as client_name
+FROM client_rep_follow_up crfu join client c on crfu.id = c.client_rep_follow_up_id
+WHERE crfu.client_rep_pro_id = :pro_id
+  AND crfu.next_follow_up_date = :date
+  ORDER BY crfu.created_at DESC;
+        "), ["pro_id" => $this->id, 'date' => date('Y-m-d')]);
+    }
 }

BIN=BIN
public/img/p-phone.png


+ 32 - 2
resources/views/app/dashboard-admin.blade.php

@@ -430,6 +430,36 @@
 
                     <div class="row mt-3">
                         <div class="col-6">
+
+                            <div class="mb-3">
+                                <p class="mb-2 font-weight-bold text-secondary">Follow ups scheduled for today</p>
+                                <?php $fus = $pro->followupsScheduledForToday(); ?>
+                                @if(count($fus))
+                                    <table class="table table-sm table-striped">
+                                        <thead>
+                                        <tr>
+                                            <th>Client</th>
+                                            <th>Reason</th>
+                                            <th>Memo</th>
+                                        </tr>
+                                        </thead>
+                                        <tbody>
+                                        @foreach($fus as $fu)
+                                            <tr>
+                                                <td><a href="/patients/view/{{$fu->client_uid}}">{{$fu->client_name}}</a></td>
+                                                <td>{{$fu->next_follow_up_reason}}</td>
+                                                <td>{{$fu->next_follow_up_memo}}</td>
+                                            </tr>
+                                        @endforeach
+                                        </tbody>
+                                    </table>
+                                @else
+                                    <span class="text-secondary">No follow ups scheduled for today!</span>
+                                @endif
+                            </div>
+                        </div>
+                        <div class="col-6">
+
                             @if(request()->input('mcpas'))
                                 @if(count($newMCPAssociations))
                                     <div class="mb-3 border rounded px-3 py-2 ack-container">
@@ -535,8 +565,8 @@
                                     <a href="/?naas=1" class="d-block">You have <b>{{$newNAAssociations}}</b> new NA association{{$newNAAssociations === 1 ? '' : 's'}}</a>
                                 @endif
                             @endif
-                        </div>
-                        <div class="col-6">
+
+
                             @if(request()->input('mcpcm'))
                                 @if(count($mcpClientMemos))
                                     <div class="mb-3 border rounded px-3 py-2 ack-container table-responsive">

+ 34 - 0
resources/views/app/dashboard-mcp.blade.php

@@ -380,6 +380,40 @@
                 <div class="col-md-9 pl-1">
                     <div class="row mcp-theme-1">
                         <div class="col-md-6 mcp-theme-1">
+
+                            <div class="card mb-4">
+                                <div class="card-header pl-2">
+                                    <strong>
+                                        Follow ups scheduled for today
+                                    </strong>
+                                </div>
+                                <div class="card-body p-0">
+                                    <?php $fus = $pro->followupsScheduledForToday(); ?>
+                                    @if(count($fus))
+                                        <table class="table table-sm table-striped m-0">
+                                            <thead>
+                                            <tr>
+                                                <th>Client</th>
+                                                <th>Reason</th>
+                                                <th>Memo</th>
+                                            </tr>
+                                            </thead>
+                                            <tbody>
+                                            @foreach($fus as $fu)
+                                                <tr>
+                                                    <td><a href="/patients/view/{{$fu->client_uid}}">{{$fu->client_name}}</a></td>
+                                                    <td>{{$fu->next_follow_up_reason}}</td>
+                                                    <td>{{$fu->next_follow_up_memo}}</td>
+                                                </tr>
+                                            @endforeach
+                                            </tbody>
+                                        </table>
+                                    @else
+                                        <span class="text-secondary">No follow ups scheduled for today!</span>
+                                    @endif
+                                </div>
+                            </div>
+
                             <div id="mcp-dashboard-appointments" class="mb-4">
 
                             </div>

+ 106 - 0
resources/views/app/patient/partials/fu-form.blade.php

@@ -0,0 +1,106 @@
+<?php
+    $nextFUReasons = [
+        "Appointment Confirmation",
+        "New Appointment",
+        "Missed Appointment",
+        "Appointment Reschedule",
+        "Appointment Cancellation",
+        "Response to Pt's Voicemail",
+        "Regarding ERx/Lab/Image Orders",
+        "Regarding Supply Orders",
+        "Regarding RPM",
+        "Pt Profile Related Matters",
+        "Pt Insurance Related Matters",
+        "Incoming Referrals",
+        "Outgoing Referrals",
+        "Insurance Verification",
+        "Questions Related to Past Visit",
+        "Provider Recommended follow-up",
+        "Care Coordination",
+        "Patient Consent",
+        "Patient Feedback",
+        "Goals Follow Up",
+        "Other-- (check recent memo)",
+    ];
+?>
+<div moe wide>
+    <a href="#" start show class="d-flex align-items-baseline" title="Next FU"><img src="{{ asset('img/p-phone.png') }}" alt="" style="width:24px"></a>
+    <form url="/api/client/putClientRepFollowUp" class="mcp-theme-1">
+        <div id="viewNextFuData" class="{{ $patient->clientRepFollowUp ? '':'d-none' }}">
+            @if($patient->clientRepFollowUp)
+            <a id="updateNextFu" class="c-pointer">Update</a>
+            <table class="table table-sm table-striped table-bordered">
+                <tr>
+                    <td><b>Updated At</b></td>
+                    <td>{{ friendly_date_time($patient->clientRepFollowUp->updated_at) }}</td>
+                </tr>
+                <tr>
+                    <td><b>Client Rep</b></td>
+                    <td>{{ $patient->clientRepFollowUp->pro->displayName() }}</td>
+                </tr>
+                <tr>
+                    <td><b>Next Followup Date</b></td>
+                    <td>{{ friendly_date_time($patient->clientRepFollowUp->next_follow_up_date) }}</td>
+                </tr>
+                <tr>
+                    <td><b>Next Followup Reason</b></td>
+                    <td>{{ $patient->clientRepFollowUp->next_follow_up_reason }}</td>
+                </tr>
+                <tr>
+                    <td><b>Next Followup Memo</b></td>
+                    <td>{{ $patient->clientRepFollowUp->next_follow_up_memo }}</td>
+                </tr>
+            </table>
+            @endif
+        </div>
+        <div id="updateNextFuData" class="{{ $patient->clientRepFollowUp ? 'd-none':'' }}">
+            <a id="showNextFu" class="c-pointer">Show FU</a>
+            <input type="hidden" name="uid" value="{{ $patient->uid }}">
+            <div class="mb-2">
+                <label for="" class="text-sm text-secondary mb-1">Next Calling Date</label>
+                <input type="date" class="form-control input-sm" name="nextFollowUpDate" value="{{ $patient->clientRepFollowUp ? $patient->clientRepFollowUp->next_follow_up_date : '' }}" />
+            </div>
+            <div class="mb-2">
+                <label for="" class="text-sm text-secondary mb-1">Call Assigned To</label>
+                <select provider-search name="clientRepProUid" class="form-control input-sm">
+                    @if($patient->clientRepFollowUp)
+                    <option value="{{ $patient->clientRepFollowUp->pro->uid }}">{{ $patient->clientRepFollowUp->pro->displayName() }}</option>
+                    @endif
+                </select>
+                @if($patient->clientRepFollowUp)
+                    <small class="text-muted">Current: <b>{{ $patient->clientRepFollowUp->pro->displayName() }}</b></small>
+                @endif
+            </div>
+            <div class="mb-2">
+                <label for="" class="text-sm text-secondary mb-1">Call Reason</label>
+                <select name="nextFollowUpReason" class="form-control input-sm">
+                    <option value=""></option>
+                    @foreach($nextFUReasons as $fuReason)
+                        <option @if($patient->clientRepFollowUp){{ $patient->clientRepFollowUp->next_follow_up_reason == $fuReason ? 'selected':'' }} @endif>{{ $fuReason }}</option>
+                    @endforeach
+                </select>
+            </div>
+            <div class="mb-2">
+                <label for="" class="text-sm text-secondary mb-1">Memo</label>
+                <textarea class="form-control input-sm" name="nextFollowUpMemo">{{ $patient->clientRepFollowUp ? $patient->clientRepFollowUp->next_follow_up_memo :'' }}</textarea>
+            </div>
+            <div class="d-flex align-items-center">
+                <button class="btn btn-sm btn-primary mr-2" submit>Submit</button>
+                <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
+            </div>
+        </div>
+    </form>
+</div>
+
+<script>
+    $(document).ready(function() {
+        $('#updateNextFu').click(function(){
+            $('#viewNextFuData').addClass('d-none');
+            $('#updateNextFuData').removeClass('d-none');
+        });
+        $('#showNextFu').click(function(){
+            $('#viewNextFuData').removeClass('d-none');
+            $('#updateNextFuData').addClass('d-none');
+        });
+    });
+</script>

+ 3 - 2
resources/views/app/patient/partials/quick-actions-buttons.blade.php

@@ -1,4 +1,4 @@
-<div class="d-flex justify-content-around">
+<div class="d-flex justify-content-around align-items-center">
 	<div>
 		<div moe relative>
 			<a href="#" start show class="ml-3 d-flex align-items-baseline"><i class="fa fa-comment mr-1"></i></a>
@@ -48,7 +48,8 @@
 		<a href="#" start class="ml-2 d-block" show onclick="return openInRHS('/pro/check-video/{{ $patient->uid }}')"><i class="fa fa-eye mr-1"></i></a>
 	</div>
 	@endif
-	<div>
+	<div class="mr-2">
 		<a href="#" start class="ml-2 d-block" show onclick="return openInRHS('/pro/meet/{{ $patient->uid }}')"><i class="fa fa-video mr-1"></i></a>
 	</div>
+	@include('app.patient.partials.fu-form')
 </div>