Bladeren bron

"Copy All" feature

Vijayakrishnan 4 jaren geleden
bovenliggende
commit
826943a585

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

@@ -1100,6 +1100,13 @@ ORDER BY claim.created_at ASC
 
     public function currentClaimLines(Request $request, $claimUid) {
         $claim = Claim::where('uid', $claimUid)->first();
+        if($request->input('json')) {
+            foreach ($claim->lines as $line) {
+                $line->expected_total = round($line->expected_total, 3);
+                $x = $line->claimLineIcds;
+            }
+            return json_encode($claim->lines);
+        }
         return  view('app.practice-management._claim-lines', compact('claim'));
     }
 

+ 3 - 0
public/css/style.css

@@ -153,6 +153,9 @@ body.stag_rhs_collapsed .app-right-panel {
 .mcp-theme-1 .on-hover-opaque:hover {
     opacity: 1;
 }
+.mcp-theme-1 .opacity-0 {
+    opacity: 0 !important;
+}
 .mcp-theme-1 .opacity-60 {
     opacity: .6;
 }

+ 3 - 0
public/js/click-to-copy.js

@@ -16,6 +16,7 @@
             var successful = document.execCommand('copy');
             var msg = successful ? 'successful' : 'unsuccessful';
             console.log('Fallback: Copying text command was ' + msg);
+            toastr.success('Copied!');
         } catch (err) {
             console.error('Fallback: Oops, unable to copy', err);
         }
@@ -29,6 +30,7 @@
         }
         navigator.clipboard.writeText(text).then(function() {
             console.log('Async: Copying to clipboard was successful!');
+            toastr.success('Copied!');
         }, function(err) {
             console.error('Async: Could not copy text: ', err);
         });
@@ -40,6 +42,7 @@
             .on('click.click-to-copy', '.click-to-copy', function(event) {
             copyTextToClipboard($(this).text());
         });
+        window.copyTextToClipboard = copyTextToClipboard;
     }
 
     addMCInitializer('click-to-copy', init);

+ 51 - 3
resources/views/app/practice-management/process-claims.blade.php

@@ -101,6 +101,14 @@
                                     <div class="d-flex align-items-center mb-1">
                                         <div class="text-secondary mr-3 min-width-140px">Payer</div>
                                         <b class="text-secondary"><span class="click-to-copy" title="Click to copy">@{{ currentMBClaim.payer_name }}</span></b>
+                                        <div class="ml-auto d-inline-flex align-items-center">
+                                            <textarea class="copy-source opacity-0" v-html="jsonCopySource()"></textarea>
+                                            <button class="btn btn-sm btn-success on-hover-opaque text-sm font-weight-bold"
+                                                    v-on:click.prevent="fastCopy()">
+                                                <i class="fa fa-copy"></i>
+                                                Copy All
+                                            </button>
+                                        </div>
                                     </div>
 
                                     <hr class="my-2">
@@ -215,7 +223,36 @@
                                     <!--cpt, doc, icd-->
                                     <div class="d-flex align-items-start mb-1">
                                         <div class="text-secondary mr-3 min-width-140px">CPT Codes</div>
-                                        <div v-html="currentClaimLines"></div>
+                                        <div>
+                                            <table class="table table-sm table-condensed mb-0 table-bordered">
+                                                <thead>
+                                                <tr class="bg-light">
+                                                    <th class="border-0 width-100px">CPT</th>
+                                                    <th class="border-0 width-100px">Modifier</th>
+                                                    <th class="border-0 width-100px">DOS</th>
+                                                    <th class="border-0 width-100px">Amount</th>
+                                                    <th class="border-0 width-100px">POS</th>
+                                                    <th class="border-0 text-nowrap">ICDs</th>
+                                                </tr>
+                                                </thead>
+                                                <tbody>
+                                                <tr class="claim-line" v-for="(claimLine) in currentClaimLines">
+                                                    <td class="width-100px"><span class="click-to-copy" title="Click to copy">@{{ claimLine.cpt }}</span></td>
+                                                    <td class="text-nowrap width-100px"><span class="click-to-copy" title="Click to copy">95</span></td>
+                                                    <td class="text-nowrap width-100px"><span class="click-to-copy" title="Click to copy">@{{ claimLine.date_of_service }}</span></td>
+                                                    <td class="text-nowrap width-100px">$ <span class="click-to-copy" title="Click to copy">@{{ claimLine.expected_total }}</span></td>
+                                                    <td class="text-nowrap width-100px"><span class="click-to-copy" title="Click to copy">11</span></td>
+                                                    <td class="">
+                                                        <span v-for="(claimLineICD) in claimLine.claim_line_icds"
+                                                              class="c-pointer border-secondary border-bottom mr-2"
+                                                              :title="claimLineICD.description">
+                                                            <span class="click-to-copy" title="Click to copy">@{{ claimLineICD.code }}</span>
+                                                        </span>
+                                                    </td>
+                                                </tr>
+                                                </tbody>
+                                            </table>
+                                        </div>
                                     </div>
                                 </div>
                             </div>
@@ -328,9 +365,9 @@
                                 }
                                 this.currentMBClaim = _data;
                                 this.currentClaim = this.claims[_index];
-                                $.get('/claims/current-claim-lines/' + claim.uid, (_data) => {
+                                $.get('/claims/current-claim-lines/' + claim.uid + '?json=1', (_data) => {
                                     this.currentClaimLines = _data;
-                                });
+                                }, 'json');
                             }, 'json');
                         },
                         updateClaimStatus: function(_index, _status) {
@@ -395,6 +432,17 @@
                                 }
                             }
                             this.numUnsubmitted = count;
+                        },
+                        jsonCopySource: function() {
+                            if(!this.currentClaim || !this.currentMBClaim || !this.currentClaimLines) return '';
+                            return JSON.stringify({
+                                claim: this.currentClaim,
+                                mbClaim: this.currentMBClaim,
+                                claimLines: this.currentClaimLines
+                            }, null, 2);
+                        },
+                        fastCopy: function() {
+                            copyTextToClipboard($('.copy-source').first().val());
                         }
                     },
                     mounted: function() {