Bläddra i källkod

Merge branch 'master' into dev-vj

Vijayakrishnan 3 år sedan
förälder
incheckning
89c87ad256

+ 2 - 1
app/Models/Pro.php

@@ -1376,7 +1376,8 @@ 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
+       (c.name_first || ' ' || c.name_last) as client_name,
+       crfu.status AS status
 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

BIN
public/img/p-phone.png


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

@@ -440,7 +440,7 @@
                                         <tr>
                                             <th>Client</th>
                                             <th>Reason</th>
-                                            <th>Memo</th>
+                                            <th>Status</th>
                                         </tr>
                                         </thead>
                                         <tbody>
@@ -448,7 +448,7 @@
                                             <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>
+                                                <td>{{$fu->status}}</td>
                                             </tr>
                                         @endforeach
                                         </tbody>

+ 2 - 2
resources/views/app/dashboard-mcp.blade.php

@@ -395,7 +395,7 @@
                                             <tr>
                                                 <th>Client</th>
                                                 <th>Reason</th>
-                                                <th>Memo</th>
+                                                <th>Status</th>
                                             </tr>
                                             </thead>
                                             <tbody>
@@ -403,7 +403,7 @@
                                                 <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>
+                                                    <td>{{$fu->status}}</td>
                                                 </tr>
                                             @endforeach
                                             </tbody>

+ 9 - 7
resources/views/app/patient/coverage_column_renderer.blade.php

@@ -36,13 +36,15 @@
         <small class="ml-2 text-muted">(No insurance)</small>
     @endif
 </div>
-@if($coverage && $coverage->plan_type === 'MEDICARE')
-    @if(@$patient->mpb_remaining !== null)
-        <small class="text-muted d-block ml-3">Deductible: {{format_number(@$patient->mpb_remaining)}} </small>
+@if($coverage)
+    @if($coverage && $coverage->plan_type === 'MEDICARE')
+        @if(@$patient->mpb_remaining !== null)
+            <small class="text-muted d-block ml-3">Deductible: {{format_number(@$patient->mpb_remaining)}} </small>
+        @endif
     @endif
-@endif
-@if($coverage && $coverage->plan_type === 'COMMERCIAL')
-    @if(@$coverage->deductable_amount !== null)
-        <small class="text-muted d-block ml-3">Deductible: {{format_number(@$coverage->deductable_amount)}} </small>
+    @if($coverage->plan_type === 'COMMERCIAL')
+        @if(@$coverage->deductible_amount !== null)
+            <small class="text-muted d-block ml-3">Deductible: {{format_number(@$coverage->deductible_amount)}} </small>
+        @endif
     @endif
 @endif

+ 79 - 49
resources/views/app/patient/partials/fu-form.blade.php

@@ -1,22 +1,51 @@
+<?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)",
+    ];
+    $nextFUStatus = [
+        "SCHEDULED",
+        "CANCELLED",
+        "COMPLETED",
+    ];
+?>
 <div moe wide>
-    <a href="#" start show class="d-flex align-items-baseline" title="Next FU">Next FU</a>
+    <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' }}">
+        <div id="viewNextFuData" class="{{ $patient->clientRepFollowUp ? '':'d-none' }}" fu-screen>
             @if($patient->clientRepFollowUp)
-            <a id="updateNextFu" class="c-pointer">Update</a>
+            <div class="d-flex align-items-center">
+            <a id="updateNextFu" class="c-pointer" data-show="#updateNextFuData" next-fu-screen>Update</a>
+            <a id="updateFuStatus" class="c-pointer ml-3" data-show="#updateStatus" next-fu-screen >Update Status</a>
+            </div>
             <table class="table table-sm table-striped table-bordered">
-                <tr>
-                    <td><b>Created At</b></td>
-                    <td>{{ friendly_date_time($patient->clientRepFollowUp->created_at) }}</td>
-                </tr>
-                <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>Status</b></td>
+                    <td>{{ $patient->clientRepFollowUp->status }}</td>
+                </tr>
                 <tr>
                     <td><b>Next Followup Date</b></td>
                     <td>{{ friendly_date_time($patient->clientRepFollowUp->next_follow_up_date) }}</td>
@@ -25,56 +54,50 @@
                     <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>
+        @if($patient->clientRepFollowUp)
+            <div id="updateStatus" class="{{ $patient->clientRepFollowUp ? 'd-none':'' }}" fu-screen>
+            <a class="c-pointer mb-2" data-show="#updateNextFuData" next-fu-screen>View FU</a>
+                <div class="mb-2">
+                    <label for="" class="text-secondary mb-1">Update Status</label>
+                    <select class="form-control input-sm" data-uid="{{ $patient->clientRepFollowUp->uid }}"  submit-status>
+                        <option value=""></option>
+                        @foreach($nextFUStatus as $fuStatus)
+                            <option {{ $patient->clientRepFollowUp->status == $fuStatus ? 'selected':'' }}>{{ $fuStatus }}</option>
+                        @endforeach
+                    </select>
+                </div>
+            </div>
+        @endif
+        <div id="updateNextFuData" class="{{ $patient->clientRepFollowUp ? 'd-none':'' }}" fu-screen>
+            <a id="showNextFu" class="c-pointer" data-show="#viewNextFuData" next-fu-screen>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->next_follow_up_date }}" />
+                <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>
-                    <option>Appointment Confirmation</option>
-                    <option>New Appointment</option>
-                    <option>Missed Appointment</option>
-                    <option>Appointment Reschedule</option>
-                    <option>Appointment Cancellation</option>
-                    <option>Response to Pt's Voicemail</option>
-                    <option>Regarding ERx/Lab/Image Orders</option>
-                    <option>Regarding Supply Orders</option>
-                    <option>Regarding RPM</option>
-                    <option>Pt Profile Related Matters</option>
-                    <option>Pt Insurance Related Matters</option>
-                    <option>Incoming Referrals</option>
-                    <option>Outgoing Referrals</option>
-                    <option>Insurance Verification</option>
-                    <option>Questions Related to Past Visit</option>
-                    <option>Provider Recommended follow-up</option>
-                    <option>Care Coordination</option>
-                    <option>Patient Consent</option>
-                    <option>Patient Feedback</option>
-                    <option>Goals Follow Up</option>
-                    <option>Other-- (check recent memo)</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"></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>
@@ -85,13 +108,20 @@
 
 <script>
     $(document).ready(function() {
-        $('#updateNextFu').click(function(){
-            $('#viewNextFuData').addClass('d-none');
-            $('#updateNextFuData').removeClass('d-none');
+        $('[next-fu-screen]').click(function(){
+            var showRef = $(this).data('show');
+            $('[fu-screen]').addClass('d-none');
+            $(showRef).removeClass('d-none');
         });
-        $('#showNextFu').click(function(){
-            $('#viewNextFuData').removeClass('d-none');
-            $('#updateNextFuData').addClass('d-none');
+
+        $('[submit-status]').change(function(){
+            var value = $(this).val();
+            var uid = $(this).data('uid');
+            $.post('/api/clientRepFollowUp/update-status', {uid: uid, status: value}, function(response){
+                if(response.success){
+                    fastReload();
+                }
+            }, 'json')
         });
     });
 </script>

+ 1 - 1
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>

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

@@ -332,7 +332,7 @@ $addressParts .= implode(", ", $addressPart2);
           </div>
         </div>
         @endif
-        <?php $_cpc = $patient->getPrimaryCoverage(); ?>
+        <?php $_cpc = $patient->getPrimaryCoverage();?>
         <div class="d-flex">
           <div>DOB: {{friendly_date($patient->dob, false,null, true)}} </div>
           @if($_cpc && $patient->getPrimaryCoverageStatus() === 'YES')
@@ -360,9 +360,9 @@ $addressParts .= implode(", ", $addressPart2);
                 @endif
               @endif
               @if($_cpc->plan_type === 'COMMERCIAL')
-                @if(@$_cpc->deductable_amount !== null)
-                  <div class="ml-2">Deductible: {{format_number(@$_cpc->deductable_amount)}} </div>
-                @endif
+                
+                  <div class="ml-2">Deductible: {{@$_cpc->deductible_amount}} </div>
+                
               @endif
             @endif 
           @endif

+ 12 - 1
spec/rpt-queries.sql

@@ -94,4 +94,15 @@ group by mcp_pro_id
 -- DATE | MCP | COUNT
 
 UPDATE note SET visit_number = ((SELECT COUNT(*)
- FROM note n WHERE n.id < note.id AND n.client_id = note.client_id AND n.is_cancelled IS NOT TRUE AND n.is_core_note IS FALSE) + 1) WHERE is_cancelled IS NOT TRUE;
+ FROM note n WHERE n.id < note.id AND n.client_id = note.client_id AND n.is_cancelled IS NOT TRUE AND n.is_core_note IS FALSE) + 1) WHERE is_cancelled IS NOT TRUE;
+
+COPY (
+  SELECT 
+    name_first,
+    name_last,
+    next_mcp_appointment_date, 
+    (SELECT data FROM point WHERE category = 'CHIEF_COMPLAINT' AND point.client_id = client.id ORDER BY point.created_at DESC LIMIT 1) AS latest_chief_complaint,
+    client_engagement_status_category as status
+  FROM client 
+  WHERE shadow_pro_id IS NULL
+) TO '/tmp/client_appts.csv' CSV HEADER;