Просмотр исходного кода

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

= 3 лет назад
Родитель
Сommit
9858f454d7
24 измененных файлов с 286 добавлено и 135 удалено
  1. 5 0
      app/Http/Controllers/HomeController.php
  2. 1 3
      app/Http/Controllers/NoteController.php
  3. 4 0
      app/Http/Controllers/PracticeManagementController.php
  4. 10 0
      app/Models/Client.php
  5. 1 0
      app/Models/Pro.php
  6. 6 0
      public/css/style.css
  7. 6 2
      resources/views/app/dashboard.blade.php
  8. 26 1
      resources/views/app/generic-bills/add-bill-form/Note.blade.php
  9. 4 0
      resources/views/app/generic-bills/add-bill-form/_default-actions.blade.php
  10. 30 24
      resources/views/app/generic-bills/add-bill-form/_default-fields.blade.php
  11. 54 37
      resources/views/app/generic-bills/add-bill-form/_default-script.blade.php
  12. 3 0
      resources/views/app/generic-bills/add-bill-form/default.blade.php
  13. 5 1
      resources/views/app/generic-bills/inline.blade.php
  14. 3 1
      resources/views/app/patient/note/_create-bill.blade.php
  15. 73 27
      resources/views/app/patient/note/dashboard.blade.php
  16. 12 6
      resources/views/app/patient/tickets.blade.php
  17. 1 1
      resources/views/app/patient/tickets/erx.blade.php
  18. 1 1
      resources/views/app/patient/tickets/imaging.blade.php
  19. 1 1
      resources/views/app/patient/tickets/lab.blade.php
  20. 12 0
      resources/views/app/patient/tickets/other.blade.php
  21. 1 0
      resources/views/app/practice-management/notes.blade.php
  22. 25 30
      resources/views/app/practice-management/processing-bill-matrix.blade.php
  23. 1 0
      resources/views/layouts/template-no-mc.blade.php
  24. 1 0
      resources/views/layouts/template.blade.php

+ 5 - 0
app/Http/Controllers/HomeController.php

@@ -238,6 +238,11 @@ class HomeController extends Controller
             })->count();
             $keyNumbers['pendingNotesToSign'] = $pendingNotesToSign;
 
+        $pendingNotesToSignAllySigned = Note::where(function ($query) use ($performerProID) {
+            $query->where('hcp_pro_id', $performerProID)->where('is_signed_by_hcp', false)->where('is_signed_by_ally', true)->where('is_cancelled', false);;
+        })->count();
+        $keyNumbers['pendingNotesToSignAllySigned'] = $pendingNotesToSignAllySigned;
+
 
         $signedNotesWithoutBills = Note::where(function ($query) use ($performerProID) {
             $query->where('hcp_pro_id', $performerProID)->where('is_signed_by_hcp', true)->where('is_cancelled', false);;

+ 1 - 3
app/Http/Controllers/NoteController.php

@@ -34,8 +34,6 @@ class NoteController extends Controller
             }
         }
 
-        $allyPros = Pro::all(); //TODO: paginate, use select2
-
         // load tickets created on note->effective_date for patient
         $ticketsOnNote = Ticket::where('client_id', $patient->id)
             ->where('is_entry_error', false)
@@ -63,7 +61,7 @@ class NoteController extends Controller
             ->get();
 
         return view('app.patient.note.dashboard', compact('patient', 'note',
-            'allyPros', 'allSections',
+            'allSections',
             'ticketsOnNote', 'otherOpenTickets',
             'supplyOrdersOnNote', 'otherOpenSupplyOrders'));
     }

+ 4 - 0
app/Http/Controllers/PracticeManagementController.php

@@ -116,6 +116,10 @@ class PracticeManagementController extends Controller
                 $query = $query->where('is_signed_by_hcp', false);
                 break;
 
+            case 'not-yet-signed-but-ally-signed':
+                $query = $query->where('is_signed_by_hcp', false)->where('is_signed_by_ally', true);
+                break;
+
             case 'without-bills':
                 $query = $query->where('is_signed_by_hcp', true)->where('is_cancelled', false)->whereDoesntHave('bills');
 

+ 10 - 0
app/Models/Client.php

@@ -402,6 +402,8 @@ class Client extends Model
         if ($pro && $pro->id) $pros[] = ["pro" => $pro->displayName(), "association" => 'RMM'];
         $pro = $this->rme;
         if ($pro && $pro->id) $pros[] = ["pro" => $pro->displayName(), "association" => 'RME'];
+        $pro = $this->defaultNaPro;
+        if ($pro && $pro->id) $pros[] = ["pro" => $pro->displayName(), "association" => 'Default NA'];
 
         // via client pro access
         $cpAccesses = ClientProAccess::where('client_id', $this->id)->where('is_active', true)->get();
@@ -552,4 +554,12 @@ class Client extends Model
             ->get();
     }
 
+    public function firstPageByCategoryAndKey($_category, $_key) {
+        return Page
+            ::where('client_id', $this->id)
+            ->where('category', $_category)
+            ->where('key', $_key)
+            ->first();
+    }
+
 }

+ 1 - 0
app/Models/Pro.php

@@ -311,6 +311,7 @@ class Pro extends Model
                     ->orWhere('rmm_pro_id', $proID)
                     ->orWhere('rme_pro_id', $proID)
                     ->orWhere('physician_pro_id', $proID)
+                    ->orWhere('default_na_pro_id', $proID)
                     ->orWhereRaw('id IN (SELECT client_id FROM client_pro_access WHERE is_active AND pro_id = ?)', [$proID])
                     ->orWhereRaw('id IN (SELECT client_id FROM appointment WHERE status NOT IN (\'CANCELLED\', \'ABANDONED\') AND pro_id = ?)', [$proID])
                     ->orWhereRaw('id IN (SELECT mcp_pro_id FROM client_program WHERE client_id = client.id AND is_active = TRUE)')

+ 6 - 0
public/css/style.css

@@ -1860,3 +1860,9 @@ form.non-interactive .form-content * {
     overflow-y: auto;
     max-height: calc(100vh - 60px);
 }
+.zero-height-field {
+    height: 1px !important;
+    opacity: 0 !important;
+    pointer-events: none;
+    position: absolute;
+}

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

@@ -37,6 +37,12 @@
                                     <th class="px-2 text-center">{{$keyNumbers['pendingNotesToSign']}}</th>
                                     <th class="pl-2"><a href="/practice-management/notes/not-yet-signed">Pending notes to sign</a></th>
                                 </tr>
+                                @if(!!$keyNumbers['pendingNotesToSignAllySigned'])
+                                <tr>
+                                    <th class="px-2 text-center">{{$keyNumbers['pendingNotesToSignAllySigned']}}</th>
+                                    <th class="pl-2"><a href="/practice-management/notes/not-yet-signed-but-ally-signed">Pending notes to sign (ally signed)</a></th>
+                                </tr>
+                                @endif
                                
                                 <tr>
                                     <th class="px-2 text-center">{{$keyNumbers['numOpenTickets']}}</th>
@@ -153,7 +159,6 @@
             <div class="col-md-9">
 
                 <!-- new associations -->
-                <?php /*
                 @if(count($newMCPAssociations))
                     <div class="mb-3 border rounded px-3 py-2 ack-container">
                         <p class="pt-1 mb-2"><b>New Patients</b></p>
@@ -175,7 +180,6 @@
                         @endforeach
                     </div>
                 @endif
-                */ ?>
 
                 <ul class="nav nav-tabs">
                     <li class="nav-item">

+ 26 - 1
resources/views/app/generic-bills/add-bill-form/Note.blade.php

@@ -1,11 +1,36 @@
+<?php $genericPro = @$note && $note->allyPro ? $note->allyPro : $pro; ?>
+<?php $genericRates = $genericPro->genericRates(); ?>
 <form url="/api/bill/createForGeneric">
-    @if(hasActiveGenericBill($pro, @$patient, @$entityType, @$entityUid))
+    @if(hasActiveGenericBill($genericPro, @$patient, @$entityType, @$entityUid))
         <div class="border rounded bg-aliceblue p-2 width-200px">
             <i class="fa fa-exclamation-triangle text-warning-mellow mr-1"></i>
             An uncancelled NA bill already exists for this note!
         </div>
     @else
         @include('app.generic-bills.add-bill-form._default-fields')
+        <div class="mb-2 border px-2 pt-2 generic-bill-actions">
+            <p class="text-sm mb-1 text-secondary font-weight-bold">Please indicate the activities time was spent on:</p>
+            <input type="text" name="genericDescription" value="" class="zero-height-field m-0 p-0 border-0" required>
+            <label class="d-flex align-items-center">
+                <input type="checkbox" class="mr-2 my-0 generic-bill-action"
+                       data-action="Note reviewed."
+                       onchange="return updateGenericBillAction(this)">
+                <span>Note reviewed.</span>
+            </label>
+            <label class="d-flex align-items-center">
+                <input type="checkbox" class="mr-2 my-0 generic-bill-action"
+                       data-action="Care coordinated."
+                       onchange="return updateGenericBillAction(this)">
+                <span>Care coordinated.</span>
+            </label>
+            <label class="d-flex align-items-center">
+                <input type="checkbox" class="mr-2 my-0 generic-bill-action"
+                       data-action="Admin. support for follow-up."
+                       onchange="return updateGenericBillAction(this)">
+                <span>Admin. support for follow-up.</span>
+            </label>
+        </div>
+        @include('app.generic-bills.add-bill-form._default-actions')
     @endif
 </form>
 @include('app.generic-bills.add-bill-form._default-script')

+ 4 - 0
resources/views/app/generic-bills/add-bill-form/_default-actions.blade.php

@@ -0,0 +1,4 @@
+<div class="">
+    <button class="btn btn-primary btn-sm" submit>Submit</button>
+    <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+</div>

+ 30 - 24
resources/views/app/generic-bills/add-bill-form/_default-fields.blade.php

@@ -1,8 +1,8 @@
-<div class="mb-2">
+<div class="mb-2 min-width-300px">
     <label for="" class="text-secondary text-sm">Pro</label>
-    <input type="text" class="form-control form-control-sm" value="{{$pro->displayName()}}" readonly>
+    <input type="text" class="form-control form-control-sm" value="{{$genericPro->displayName()}}" readonly>
 </div>
-<input type="hidden" name="genericProUid" value="{{$pro->uid}}">
+<input type="hidden" name="genericProUid" value="{{$genericPro->uid}}">
 @if(@$note)
     <input type="hidden" name="optionalNoteUid" value="{{$note->uid}}">
 @endif
@@ -15,19 +15,27 @@
 @if(@$entityUid)
     <input type="hidden" name="genericTargetEntityUid" value="{{$entityUid}}">
 @endif
-<div class="mb-2">
-    <label for="" class="text-secondary text-sm">Service</label>
-    <select autofocus class="form-control" name="code"
-            data-entity-type="{{$entityType}}"
-            onchange="switchGenericRate(this)">
-        <option value="">-- Select Code --</option>
-        @foreach($pro->genericRates() as $genericRate)
-            <option data-amount="{{ $genericRate->amount }}" value="{{ $genericRate->code }}">
-                {{ $genericRate->code }} (${{ $genericRate->amount }})
-            </option>
-        @endforeach
-    </select>
-</div>
+@if(count($genericRates) === 1)
+    <input type="hidden" name="code"
+           data-entity-type="{{$entityType}}"
+           data-amount="{{ $genericRates[0]->amount }}"
+           value="{{$genericRates[0]->code}}">
+    <p class="mb-2">Service: <br><b>{{ $genericRates[0]->code }} (${{ $genericRates[0]->amount }}/hr)</b></p>
+@else
+    <div class="mb-2">
+        <label for="" class="text-secondary text-sm">Service</label>
+        <select autofocus class="form-control" name="code"
+                data-entity-type="{{$entityType}}"
+                onchange="switchGenericRate(this)">
+            <option value="">-- Select Code --</option>
+            @foreach($genericPro->genericRates() as $genericRate)
+                <option data-amount="{{ $genericRate->amount }}" value="{{ $genericRate->code }}">
+                    {{ $genericRate->code }} (${{ $genericRate->amount }})
+                </option>
+            @endforeach
+        </select>
+    </div>
+@endif
 <div class="mb-2">
     <?php $maxMinutes = 240; ?>
     <label for="" class="text-secondary text-sm">Minutes</label>
@@ -42,15 +50,13 @@
     </div>
     <div class="mb-2" calculated-generic-amount></div>
 </div>
-<div class="mb-2">
-    <label for="" class="text-secondary text-sm">Description</label>
-    <input type="text" name="genericDescription" class="form-control form-control-sm" value="">
-</div>
+@if($entityType !== 'Note')
+    <div class="mb-2">
+        <label for="" class="text-secondary text-sm">Description</label>
+        <input type="text" name="genericDescription" class="form-control form-control-sm" value="">
+    </div>
+@endif
 <div class="mb-2">
     <label for="" class="text-secondary text-sm">Effective Date</label>
     <input type="date" name="effectiveDate" class="form-control form-control-sm" value="{{date('Y-m-d')}}" required>
 </div>
-<div class="">
-    <button class="btn btn-primary btn-sm" submit>Submit</button>
-    <button class="btn btn-default border btn-sm" cancel>Cancel</button>
-</div>

+ 54 - 37
resources/views/app/generic-bills/add-bill-form/_default-script.blade.php

@@ -1,48 +1,65 @@
 <script>
     (function() {
-        let selectedGenericRate = 0;
-        window.switchGenericRate = function(_trigger) {
-            selectedGenericRate = 0;
-            if($(_trigger).find('option:selected').first().length) {
-                selectedGenericRate = +($(_trigger).find('option:selected').first().attr('data-amount'));
-            }
-            $(_trigger).closest('form').find('[name="numberOfUnits"]').val('');
+        function init() {
+            let selectedGenericRate = 0;
+            window.switchGenericRate = function (_trigger) {
+                selectedGenericRate = 0;
+                if ($(_trigger).find('option:selected').first().length) {
+                    selectedGenericRate = +($(_trigger).find('option:selected').first().attr('data-amount'));
+                }
+                $(_trigger).closest('form').find('[name="numberOfUnits"]').val('');
 
-            // max num units to limit at $15
-            if($(_trigger).attr('data-entity-type') === 'Note') {
-                let maxNABillableAmount = 15,
-                    amountPer5Minutes = selectedGenericRate / 12,
-                    maxNumberOf5Minutes =  Math.ceil(maxNABillableAmount / amountPer5Minutes),
-                    maxHours = (maxNumberOf5Minutes * 5) / 60,
-                    unitsSelect = $(_trigger).closest('form').find('[name="numberOfUnits"]');
-                unitsSelect.find('option').each(function() {
-                    if(this.value) {
-                        if(+this.value > maxHours) {
-                            $(this).hide();
+                @if($genericRates && count($genericRates) && count($genericRates) === 1)
+                    selectedGenericRate = {{ $genericRates[0]->amount }};
+                @endif
+
+                // max num units to limit at $15
+                if ($(_trigger).attr('data-entity-type') === 'Note') {
+                    let maxNABillableAmount = 15,
+                        amountPer5Minutes = selectedGenericRate / 12,
+                        maxNumberOf5Minutes = Math.ceil(maxNABillableAmount / amountPer5Minutes),
+                        maxHours = (maxNumberOf5Minutes * 5) / 60,
+                        unitsSelect = $(_trigger).closest('form').find('[name="numberOfUnits"]');
+                    unitsSelect.find('option').each(function () {
+                        if (this.value) {
+                            if (+this.value > maxHours) {
+                                $(this).hide();
+                            }
+                            else {
+                                $(this).show();
+                            }
                         }
                         else {
                             $(this).show();
                         }
-                    }
-                    else {
-                        $(this).show();
-                    }
-                });
-            }
+                    });
+                }
 
-            calculateGenericBillAmount($(_trigger).closest('form').find('[name="numberOfUnits"]'));
-        };
-        window.calculateGenericBillAmount = function(_trigger) {
-            _trigger = $(_trigger);
-            let amountTarget = _trigger.closest('form').find('[calculated-generic-amount]');
-            if(!_trigger.find('option:selected').length) {
-                amountTarget.text('');
-                return;
-            }
-            let hours = +_trigger.find('option:selected').attr('value'),
-                reimbursable = hours * selectedGenericRate;
-            if(isNaN(reimbursable)) reimbursable = 0;
-            amountTarget.html('<b>Reimbursable:</b> $' + reimbursable.toFixed(2));
+                calculateGenericBillAmount($(_trigger).closest('form').find('[name="numberOfUnits"]'));
+            };
+            window.calculateGenericBillAmount = function (_trigger) {
+                _trigger = $(_trigger);
+                let amountTarget = _trigger.closest('form').find('[calculated-generic-amount]');
+                if (!_trigger.find('option:selected').length) {
+                    amountTarget.text('');
+                    return;
+                }
+                let hours = +_trigger.find('option:selected').attr('value'),
+                    reimbursable = hours * selectedGenericRate;
+                if (isNaN(reimbursable)) reimbursable = 0;
+                amountTarget.html('<b>Reimbursable:</b> $' + reimbursable.toFixed(2));
+            };
+            window.updateGenericBillAction = function (_trigger) {
+                let actions = [];
+                $(_trigger).closest('.generic-bill-actions').find('.generic-bill-action:checked').each(function () {
+                    actions.push($(this).attr('data-action'));
+                });
+                $(_trigger).closest('.generic-bill-actions').find('[name="genericDescription"]').val(actions.join("<br>"));
+            };
+            @if($genericRates && count($genericRates) && count($genericRates) === 1)
+            switchGenericRate($('[name="code"][data-entity-type]'));
+            @endif
         }
+        addMCInitializer('init-generic-add-bill', init);
     }).call(window);
 </script>

+ 3 - 0
resources/views/app/generic-bills/add-bill-form/default.blade.php

@@ -1,5 +1,8 @@
+<?php $genericPro = @$note && $note->allyPro ? $note->allyPro : $pro; ?>
+<?php $genericRates = $genericPro->genericRates(); ?>
 <form url="/api/bill/createForGeneric">
     @include('app.generic-bills.add-bill-form._default-fields')
+    @include('app.generic-bills.add-bill-form._default-actions')
 </form>
 @include('app.generic-bills.add-bill-form._default-script')
 

+ 5 - 1
resources/views/app/generic-bills/inline.blade.php

@@ -73,7 +73,11 @@ $genericBills = genericBills($pro, @$patient, @$entityType, @$entityUid);
                                 @include('app.generic-bills.context')
                             </td>
                         @endif
-                        <td>{{$bill->code}}</td>
+                        <td>{{$bill->code}}
+                            @if($bill->generic_description)
+                                <pre class="mb-0 text-sm text-secondary font-italic">{!! $bill->generic_description !!}</pre>
+                            @endif
+                        </td>
                         <td class="">
                             <?php
                             $totalSeconds = $bill->number_of_units * 3600;

+ 3 - 1
resources/views/app/patient/note/_create-bill.blade.php

@@ -1,4 +1,4 @@
-<?php $noteRates = $pro->noteRates(); ?>
+<?php $noteRates = $note->hcpPro->noteRates(); ?>
 @if(!$note->is_bill_closed && !$note->is_billing_marked_done)
     <span class="mx-2 text-secondary">|</span>
     <div moe wide class="">
@@ -62,9 +62,11 @@
 
             </div>
 
+            @if(@$note && $note->hcpPro->id === $pro->id)
             <div class="my-3">
                 <input type="checkbox" name="signAndMarkBillingDone" checked>&nbsp;Sign and Mark Billing Done
             </div>
+            @endif
 
             <div class="">
                 <button class="btn btn-primary btn-sm" submit>Submit</button>

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

@@ -252,11 +252,8 @@
                                 <input type="hidden" name="uid" value="{{$note->uid}}">
                                 <div class="form-group">
                                     <label for="" class="control-label">NA</label>
-                                    <select name="naProUid" class="form-control">
+                                    <select name="naProUid" class="form-control" provider-search>
                                         <option value="">--select--</option>
-                                        @foreach($allyPros as $allyPro)
-                                            <option value="{{$allyPro->uid}}">{{$allyPro->name_first}} {{$allyPro->name_last}}</option>
-                                        @endforeach
                                     </select>
                                 </div>
                                 <div class="mb-0">
@@ -336,23 +333,23 @@
                 <div class="">
                     <div>
                         @if($note->is_signed_by_hcp)
-                            <span class="text-secondary">
-                        <i class="fa fa-check"></i>
-                        Note Signed
-                        @if($pro->pro_type == 'ADMIN')
-                        <span moe class="ml-2">
-                            <a class="" href="" show start>Undo sign?</a>
-                            <form url="/api/note/adminUndoSignAsHcp" right>
-                                <input type="hidden" name="uid" value="{{$note->uid}}">
-                                <p>Undo sign?</p>
-                                <div class="mb-0">
-                                    <button class="btn btn-success btn-sm" submit>Submit</button>
-                                    <button class="btn btn-default border btn-sm" cancel>Cancel</button>
-                                </div>
-                            </form>
-                        </span>
-                        @endif
-                    </span>
+                            <div class="text-secondary">
+                                <i class="fa fa-check"></i>
+                                Note Signed
+                                @if($pro->pro_type == 'ADMIN')
+                                <span moe class="ml-2">
+                                    <a class="" href="" show start>Undo sign?</a>
+                                    <form url="/api/note/adminUndoSignAsHcp" right>
+                                        <input type="hidden" name="uid" value="{{$note->uid}}">
+                                        <p>Undo sign?</p>
+                                        <div class="mb-0">
+                                            <button class="btn btn-success btn-sm" submit>Submit</button>
+                                            <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                                        </div>
+                                    </form>
+                                </span>
+                                @endif
+                            </div>
                         @else
                             <div moe
                                  class="{{ $note->hcp_pro_id !== $pro->id ? 'moe-disabled' : '' }}"
@@ -370,14 +367,27 @@
                         @endif
                     </div>
                 </div>
-                @if($note->allyPro)
+                @if($note->allyPro && $pro->id === $note->allyPro->id)
                 <div class="mx-4">
                     <div>
                         @if($note->is_signed_by_ally)
                             <span class="text-secondary">
-                        <i class="fa fa-check"></i>
-                        Note Signed By NA
-                    </span>
+                                <i class="fa fa-check"></i>
+                                Note Signed By NA
+                                @if(!$note->is_signed_by_hcp)
+                                <span moe class="ml-2">
+                                    <a class="" href="" show start>Undo sign?</a>
+                                    <form url="/api/note/undoSignAsAlly" right>
+                                        <input type="hidden" name="uid" value="{{$note->uid}}">
+                                        <p>Undo sign?</p>
+                                        <div class="mb-0">
+                                            <button class="btn btn-success btn-sm" submit>Submit</button>
+                                            <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                                        </div>
+                                    </form>
+                                </span>
+                                @endif
+                            </span>
                         @else
                             <div moe
                                  class="{{ $note->ally_pro_id !== $pro->id ? 'moe-disabled' : '' }}"
@@ -1181,7 +1191,7 @@
                                                 <span class="font-weight-bold">${{ $bill->hcp_payment_amount }}</span>
                                             </div>
                                         @endif
-                                        @if($bill->ally)
+                                        @if($bill->ally && !!floatval($bill->na_expected_payment_amount))
                                             <hr>
                                             <div class="text-nowrap font-weight-bold text-secondary">{{ $bill->ally->displayName() }} (NA)</div>
                                             <div class="text-nowrap mt-1 screen-only">
@@ -1453,7 +1463,7 @@
                             @endforeach
                             </tbody>
                         </table>
-                        @else
+                        @elseif($note->hcpPro && $pro->id === $note->hcpPro->id)
                         <table class="table table-sm tabe-striped mb-3 border-left border-right border-bottom">
                             <thead class="bg-light">
                             <tr>
@@ -1599,6 +1609,42 @@
                                                 <span class="d-block text-secondary">
                                                     Cancelled
                                                 </span>
+                                                @if($bill->is_cancelled && !$bill->is_cancellation_acknowledged)
+                                                    <div class="ml-2 text-secondary">
+                                                        <i class="fa fa-exclamation-triangle"></i>
+                                                        Not Acknowledged
+                                                    </div>
+                                                    <div class="d-block ml-2" moe>
+                                                        <a class="" href="" show start>Ack. Cancellation</a>
+                                                        <form url="/api/bill/acknowledgeCancellation">
+                                                            <input type="hidden" name="uid" value="{{$bill->uid}}">
+                                                            <p>Acknowledge Cancellation?</p>
+                                                            <div class="mb-0">
+                                                                {{--<input type="text" class="text form-control form-control-sm" name="cancellationMemo" value="{{$bill->cancellation_memo}}" placeholder=""><br>--}}
+                                                                <button class="btn btn-primary btn-sm" submit>Submit</button>
+                                                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                                                            </div>
+                                                        </form>
+                                                    </div>
+                                                @endif
+
+                                                @if($bill->is_cancellation_acknowledged && !$note->is_billing_marked_done)
+                                                    <div class="ml-2 text-secondary">
+                                                        <i class="fa fa-check"></i>
+                                                        Acknowledged
+                                                    </div>
+                                                    <div class="d-block ml-2" moe>
+                                                        <a class="" href="" show start>Undo</a>
+                                                        <form url="/api/bill/undoAcknowledgeCancellation">
+                                                            <input type="hidden" name="uid" value="{{$bill->uid}}">
+                                                            <p>Undo Acknowledge Cancellation?</p>
+                                                            <div class="mb-0">
+                                                                <button class="btn btn-success btn-sm" submit>Submit</button>
+                                                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                                                            </div>
+                                                        </form>
+                                                    </div>
+                                                @endif
                                             @else
                                                 <span class="mx-2 text-secondary">|</span>
                                                 <span class="d-block" moe>

+ 12 - 6
resources/views/app/patient/tickets.blade.php

@@ -191,16 +191,22 @@
                         <?php } ?>
 
                         <?php
-                            $contentData = false;
-                            if ($patient->canvas_data) {
-                                $canvasData = json_decode($patient->canvas_data, true);
-                                if (isset($canvasData['rx'])) {
-                                    $contentData = $canvasData['rx'];
+                            $contentData = $patient->firstPageByCategoryAndKey('CANVAS', 'rx');
+                            if ($contentData) {
+                                $contentData = json_decode($contentData);
+                                if($contentData && $contentData->data) {
+                                    $contentData = json_decode($contentData->data);
                                 }
+                                else {
+                                    $contentData = false;
+                                }
+                            }
+                            else {
+                                $contentData = false;
                             }
                         ?>
 
-                        patientRx: <?= $contentData ? json_encode($contentData['items']) : '[]' ?>,
+                        patientRx: <?= $contentData ? json_encode($contentData->items) : '[]' ?>,
                     },
                     computed: {
                         numAll: function() {

+ 1 - 1
resources/views/app/patient/tickets/erx.blade.php

@@ -246,7 +246,7 @@
             @include('app.patient.tickets.faxes', ['category' => 'erx'])
 
             <!-- bills -->
-            <div class="px-3 py-3 border-top">
+            <div class="px-3 py-3 border-top" v-if="erxPopupMode !== 'add'">
                 <a class="mb-0 font-weight-normal font-size-16 d-flex align-items-center"
                    native target="_blank"
                    open-in-stag-popup

+ 1 - 1
resources/views/app/patient/tickets/imaging.blade.php

@@ -133,7 +133,7 @@
             @include('app.patient.tickets.attachments', ['category' => 'imaging'])
 
             <!-- bills -->
-            <div class="px-3 py-3 border-top">
+            <div class="px-3 py-3 border-top" v-if="imagingPopupMode !== 'add'">
                 <a class="mb-0 font-weight-normal font-size-16 d-flex align-items-center"
                    native target="_blank"
                    open-in-stag-popup

+ 1 - 1
resources/views/app/patient/tickets/lab.blade.php

@@ -137,7 +137,7 @@
             @include('app.patient.tickets.attachments', ['category' => 'lab'])
 
             <!-- bills -->
-            <div class="px-3 py-3 border-top">
+            <div class="px-3 py-3 border-top" v-if="labPopupMode !== 'add'">
                 <a class="mb-0 font-weight-normal font-size-16 d-flex align-items-center"
                    native target="_blank"
                    open-in-stag-popup

+ 12 - 0
resources/views/app/patient/tickets/other.blade.php

@@ -98,6 +98,18 @@
             <!-- attachments -->
             @include('app.patient.tickets.attachments', ['category' => 'other'])
 
+            <!-- bills -->
+            <div class="px-3 py-3 border-top" v-if="otherPopupMode !== 'add'">
+                <a class="mb-0 font-weight-normal font-size-16 d-flex align-items-center"
+                   native target="_blank"
+                   open-in-stag-popup
+                   popup-style="tall"
+                   title="Generic Bills"
+                   :href="'/generic-bill-view/Ticket/' + otherPopupMode.uid">
+                    Generic Bills
+                </a>
+            </div>
+
             <!-- comments -->
             @include('app.patient.tickets.comments', ['category' => 'other'])
         </form>

+ 1 - 0
resources/views/app/practice-management/notes.blade.php

@@ -13,6 +13,7 @@
             <select class="ml-auto max-width-300px form-control form-control-sm" onchange="fastLoad('/practice-management/notes/' + this.value, true, false, false)">
                 <option value="" {{ $filter === '' ? 'selected' : '' }}>All notes</option>
                 <option value="not-yet-signed" {{ $filter === 'not-yet-signed' ? 'selected' : '' }}>Notes not yet signed</option>
+                <option value="not-yet-signed-but-ally-signed" {{ $filter === 'not-yet-signed-but-ally-signed' ? 'selected' : '' }}>Notes not yet signed (but ally signed)</option>
             </select>
         </div>
         <div class="card-body p-0">

+ 25 - 30
resources/views/app/practice-management/processing-bill-matrix.blade.php

@@ -26,14 +26,20 @@
                     <select name="filter" class="form-control form-control-sm mr-auto width-200px"
                             onchange="fastLoad('/practice-management/processing-bill-matrix/{{@$targetPro ? $targetPro->uid : ''}}?f=' + this.value + '&t={{request()->input('t')}}')">
                         <option {{request()->input('f') === '' ? 'selected' : ''}} value="">All Bills</option>
-                        <option {{request()->input('f') === 'verified' ? 'selected' : ''}} value="verified">Verified Only</option>
-                        <option {{request()->input('f') === 'not-verified' ? 'selected' : ''}} value="not-verified">Not Verified Only</option>
+                        <option {{request()->input('f') === 'verified' ? 'selected' : ''}} value="verified">Verified
+                            Only
+                        </option>
+                        <option {{request()->input('f') === 'not-verified' ? 'selected' : ''}} value="not-verified">Not
+                            Verified Only
+                        </option>
                     </select>
                 </div>
                 <div class="width-200px ml-2">
                     <select name="filter" class="form-control form-control-sm mr-auto width-200px"
                             onchange="fastLoad('/practice-management/processing-bill-matrix/{{@$targetPro ? $targetPro->uid : ''}}?f={{request()->input('f')}}&t=' + this.value)">
-                        <option {{!request()->input('t') || request()->input('t') === 'hcp' ? 'selected' : ''}} value="hcp">HCP Bills</option>
+                        <option {{!request()->input('t') || request()->input('t') === 'hcp' ? 'selected' : ''}} value="hcp">
+                            HCP Bills
+                        </option>
                         <option {{request()->input('t') === 'na' ? 'selected' : ''}} value="na">NA Bills</option>
                     </select>
                 </div>
@@ -42,43 +48,38 @@
                 <table class="table table-sm table-condensed p-0 m-0">
                     <thead class="bg-light">
                     <tr>
-			<th><input type="checkbox"/> All</th>
+                        <th><input type="checkbox"/> All</th>
                         <th>Note Link</th>
                         <td>Effective Date</td>
-			<td>Balance Post Date</td>
-
+                        <td>Balance Post Date</td>
                         @if(!request()->input('t') || request()->input('t') === 'hcp')
                             <td>HCP Pro</td>
                         @elseif(request()->input('t') === 'na')
                             <td>NA Pro</td>
                         @endif
-
                         <td>Client</td>
                         <td>Code</td>
                         <td>Units</td>
-			<td>Verified?</td>
-
+                        <td>Verified?</td>
                         @if(!request()->input('t') || request()->input('t') === 'hcp')
                             <td>HCP Expected Amount</td>
                         @elseif(request()->input('t') === 'na')
                             <td>NA Expected Amount</td>
                         @endif
-
-                        <td>HCP Signed?</td>
-{{--                        <td>HCP Signed At</td>--}}
+                        <td>Pro Signed?</td>
                     </tr>
                     </thead>
                     <tbody>
                     @foreach ($bills as $row)
                         <tr class="">
-			    <td>
-				<input type="checkbox"/>
-			    </td>
+                            <td>
+                                <input type="checkbox"/>
+                            </td>
                             <td>
                                 @if($row->note)
-                                <a href="/patients/view/{{ $row->client->uid }}/notes/view/{{ $row->note->uid }}">
-                                    Note Link
-                                </a>
+                                    <a href="/patients/view/{{ $row->client->uid }}/notes/view/{{ $row->note->uid }}">
+                                        Note Link
+                                    </a>
                                 @else
                                     <a href="/patients/view/{{ $row->client->uid }}">
                                         Chart
@@ -86,8 +87,7 @@
                                 @endif
                             </td>
                             <td>{{friendly_date($row->effective_date)}}</td>
-			    <td>{{friendly_date($row->balance_post_date)}}</td>
-
+                            <td>{{friendly_date($row->balance_post_date)}}</td>
                             @if(!request()->input('t') || request()->input('t') === 'hcp')
                                 <td>{{$row->hcp->name_last}}, {{$row->hcp->name_first}}</td>
                             @elseif(request()->input('t') === 'na')
@@ -95,23 +95,18 @@
                             @endif
                             <td>{{$row->client->name_last}}, {{$row->client->name_first}}</td>
                             <td>{{$row->code}}</td>
-                            <td>{{$row->number_of_units}}</td>
-			    <td>{{$row->is_verified ? 'Verified: ' . friendly_date($row->marked_verified_at, true) : 'Not Verified'}} </td>
-
+                            <td>{{str_contains($row->code, 'Treatment Services') || str_contains($row->code, 'Administrative Services') ? ceil((float) $row->number_of_units * 60) . ' mins' : $row->number_of_units}}</td>
+                            <td>{{$row->is_verified ? 'Verified: ' . friendly_date($row->marked_verified_at, true) : 'Not Verified'}} </td>
                             @if(!request()->input('t') || request()->input('t') === 'hcp')
                                 <td>{{$row->hcp_expected_payment_amount}}</td>
                             @elseif(request()->input('t') === 'na')
-                                <td>{{$row->generic_pro_expected_payment_amount}}</td>
+                                <td><b>${{number_format($row->generic_pro_expected_payment_amount, 2)}}</b></td>
                             @endif
-
                             @if(!request()->input('t') || request()->input('t') === 'hcp')
-                                <td>{{$row->is_signed_by_hcp}}</td>
+                                <td>{{$row->is_signed_by_hcp ? 'Yes' : 'No'}}</td>
                             @elseif(request()->input('t') === 'na')
-                                <td>{{$row->is_signed_by_generic_pro}}</td>
+                                <td>{{$row->is_signed_by_generic_pro ? 'Yes' : 'No'}}</td>
                             @endif
-
-
-{{--                            <td>{{$row->signed_by_hcp_at}}</td>--}}
                         </tr>
                     @endforeach
                     </tbody>

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

@@ -107,6 +107,7 @@
                         <a class="dropdown-item" href="{{ route('practice-management.financialTransactions') }}">Financial Transactions</a>
                         <a class="dropdown-item" href="/practice-management/bills/not-yet-signed">Pending Bills to Sign</a>
                         <a class="dropdown-item" href="/practice-management/notes/not-yet-signed">Pending Notes to Sign</a>
+                        <a class="dropdown-item" href="/practice-management/notes/not-yet-signed-but-ally-signed">Pending Notes to Sign (Ally Signed)</a>
                         <a class="dropdown-item" href="{{ route('unmapped-sms') }}">Unmapped SMS</a>
                         <a class="dropdown-item" href="{{ route('practice-management.myTickets') }}">My Tickets</a>
                         <a class="dropdown-item" href="{{ route('practice-management.myTextShortcuts') }}">My Text Shortcuts</a>

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

@@ -110,6 +110,7 @@
                         <a class="dropdown-item" href="{{ route('practice-management.financialTransactions') }}">Financial Transactions</a>
                         <a class="dropdown-item" href="/practice-management/bills/not-yet-signed">Pending Bills to Sign</a>
                         <a class="dropdown-item" href="/practice-management/notes/not-yet-signed">Pending Notes to Sign</a>
+                        <a class="dropdown-item" href="/practice-management/notes/not-yet-signed-but-ally-signed">Pending Notes to Sign (Ally Signed)</a>
                         <a class="dropdown-item" href="{{ route('unmapped-sms') }}">Unmapped SMS</a>
                         <a class="dropdown-item" href="{{ route('practice-management.myTickets') }}">My Tickets</a>
                         <a class="dropdown-item" href="{{ route('practice-management.myTextShortcuts') }}">My Text Shortcuts</a>