瀏覽代碼

RPM matrix - rmm bill sign moe

Vijayakrishnan 3 年之前
父節點
當前提交
8497190bd0

+ 16 - 6
app/Http/Controllers/PracticeManagementController.php

@@ -1409,14 +1409,27 @@ WHERE care_month.uid = '{$careMonthUid}' AND client.uid = '{$clientUid}'
         }
 
         $proTypeCondition = '';
+        $genericBillIdColumns = '';
+        $genericBillJoinClause = '';
         switch($mode) {
             case 'mcp':
                 $proTypeCondition = "care_month.mcp_pro_id = {$performer->pro->id}";
+                $genericBillIdColumns = "care_month.mcp_rm_generic_bill_id,
+                   bill.uid as mcp_rm_generic_bill_uid,
+                   bill.generic_pro_id as mcp_rm_generic_bill_generic_pro_id,
+                   bill.generic_pro_expected_payment_amount as mcp_rm_generic_bill_expected_payment_amount";
+                $genericBillJoinClause = 'left join bill on care_month.mcp_rm_generic_bill_id = bill.id';
                 break;
             case 'rmm':
                 $proTypeCondition = "care_month.rmm_pro_id = {$performer->pro->id}";
+                $genericBillIdColumns = "care_month.rmm_rm_generic_bill_id,
+                   bill.uid as rmm_rm_generic_bill_uid,
+                   bill.generic_pro_id as rmm_rm_generic_bill_generic_pro_id,
+                   bill.generic_pro_expected_payment_amount as rmm_rm_generic_bill_expected_payment_amount";
+                $genericBillJoinClause = 'left join bill on care_month.rmm_rm_generic_bill_id = bill.id';
+                break;
             case 'rme':
-                $proTypeCondition = "care_month.rme_pro_id = {$performer->pro->id}";
+                $proTypeCondition = "left join bill on care_month.rme_pro_id = {$performer->pro->id}";
                 break;
         }
 
@@ -1457,12 +1470,9 @@ SELECT client.name_first, client.name_last,
        care_month.most_recent_cellular_bp_measurement_at,      
        care_month.most_recent_cellular_weight_value,
        care_month.most_recent_cellular_weight_measurement_at,
-       care_month.mcp_rm_generic_bill_id,
-       bill.uid as mcp_rm_generic_bill_uid,
-       bill.generic_pro_id as mcp_rm_generic_bill_generic_pro_id,
-       bill.generic_pro_expected_payment_amount as mcp_rm_generic_bill_expected_payment_amount 
+       {$genericBillIdColumns}
 FROM care_month join client on care_month.client_id = client.id join note mrnote on client.most_recent_completed_mcp_note_id = mrnote.id
-    left join bill  on care_month.mcp_rm_generic_bill_id = bill.id
+    {$genericBillJoinClause}
     left join note mrmnote on mrmnote.id = (
         select max(n.id) from note n 
         where 

+ 33 - 18
resources/views/app/practice-management/remote-monitoring-row-markup-by-pro-type.blade.php

@@ -218,25 +218,24 @@
             @if($lastVisitWithin90Days && $iPatient->has_mcp_interacted_with_client_about_rm && $iPatient->number_of_days_with_remote_measurements >= 16 && $iPatient->rm_total_time_in_seconds_by_mcp >= 1200)
                 <span class="text-success font-weight-bold">
                     <i class="fa fa-check"></i>
-                    Yes 
-                    @if($iPatient->mcp_rm_generic_bill_id)
-                        (Billable: ${{friendly_money($iPatient->mcp_rm_generic_bill_expected_payment_amount)}})
-                        
-                        <div moe
-                                class="d-inline-block {{ $iPatient->mcp_rm_generic_bill_generic_pro_id !== $pro->id ? 'moe-disabled' : '' }}"
-                                title="{{ $iPatient->mcp_rm_generic_bill_generic_pro_id !== $pro->id ? 'Only the bill\'s pro can sign' : '' }}">
-                            <a class="text-nowrap" href="" show start>Sign</a>
-                            <form url="/api/bill/signAsGenericPro">
-                                <input type="hidden" name="uid" value="{{$iPatient->mcp_rm_generic_bill_uid}}">
-                                <p>Sign this bill?</p>
-                                <div class="mb-0">
-                                    <button class="btn btn-success btn-sm" submit>Sign</button>
-                                    <button class="btn btn-default border btn-sm" cancel>Cancel</button>
-                                </div>
-                            </form>
-                        </div>
-                    @endif
+                    Yes
                 </span>
+                @if($iPatient->mcp_rm_generic_bill_id)
+                    (${{friendly_money($iPatient->mcp_rm_generic_bill_expected_payment_amount)}})
+                    <div moe relative
+                         class="d-inline-block {{ $iPatient->mcp_rm_generic_bill_generic_pro_id !== $pro->id ? 'moe-disabled' : '' }}"
+                         title="{{ $iPatient->mcp_rm_generic_bill_generic_pro_id !== $pro->id ? 'Only the bill\'s pro can sign' : '' }}">
+                        <a class="font-weight-bold" href="" show start>Sign</a>
+                        <form url="/api/bill/signAsGenericPro" right>
+                            <input type="hidden" name="uid" value="{{$iPatient->mcp_rm_generic_bill_uid}}">
+                            <p>Sign this bill?</p>
+                            <div class="mb-0">
+                                <button class="btn btn-success btn-sm" submit>Sign</button>
+                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                            </div>
+                        </form>
+                    </div>
+                @endif
             @else
                 <span class="text-danger font-weight-normal">
                     Not yet
@@ -248,6 +247,22 @@
                     <i class="fa fa-check"></i>
                     Yes
                 </span>
+                @if($iPatient->rmm_rm_generic_bill_id)
+                    (${{friendly_money($iPatient->rmm_rm_generic_bill_expected_payment_amount)}})
+                    <div moe relative
+                         class="d-inline-block {{ $iPatient->rmm_rm_generic_bill_generic_pro_id !== $pro->id ? 'moe-disabled' : '' }}"
+                         title="{{ $iPatient->rmm_rm_generic_bill_generic_pro_id !== $pro->id ? 'Only the bill\'s pro can sign' : '' }}">
+                        <a class="font-weight-bold" href="" show start>Sign</a>
+                        <form url="/api/bill/signAsGenericPro" right>
+                            <input type="hidden" name="uid" value="{{$iPatient->rmm_rm_generic_bill_uid}}">
+                            <p>Sign this bill?</p>
+                            <div class="mb-0">
+                                <button class="btn btn-success btn-sm" submit>Sign</button>
+                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                            </div>
+                        </form>
+                    </div>
+                @endif
             @else
                 <span class="text-danger font-weight-normal">
                     Not yet