Selaa lähdekoodia

Click to copy - global feature

Vijayakrishnan 4 vuotta sitten
vanhempi
commit
6f3fc26a4e

+ 8 - 0
public/css/style.css

@@ -1762,4 +1762,12 @@ form.non-interactive .form-content * {
     right: 0;
     padding: 0 0.5rem;
     background-color: inherit;
+}
+.mcp-theme-1 .click-to-copy {
+    background-color: #e4f7ed36;
+    cursor: copy;
+    border-bottom: 1px dotted #c0f7e86e;
+}
+.mcp-theme-1 .click-to-copy:hover {
+    border-bottom: 1px dotted #c0f7e8;
 }

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

@@ -0,0 +1,47 @@
+(function() {
+    function fallbackCopyTextToClipboard(text) {
+        var textArea = document.createElement("textarea");
+        textArea.value = text;
+
+        // Avoid scrolling to bottom
+        textArea.style.top = "0";
+        textArea.style.left = "0";
+        textArea.style.position = "fixed";
+
+        document.body.appendChild(textArea);
+        textArea.focus();
+        textArea.select();
+
+        try {
+            var successful = document.execCommand('copy');
+            var msg = successful ? 'successful' : 'unsuccessful';
+            console.log('Fallback: Copying text command was ' + msg);
+        } catch (err) {
+            console.error('Fallback: Oops, unable to copy', err);
+        }
+
+        document.body.removeChild(textArea);
+    }
+    function copyTextToClipboard(text) {
+        if (!navigator.clipboard) {
+            fallbackCopyTextToClipboard(text);
+            return;
+        }
+        navigator.clipboard.writeText(text).then(function() {
+            console.log('Async: Copying to clipboard was successful!');
+        }, function(err) {
+            console.error('Async: Could not copy text: ', err);
+        });
+    }
+
+    function init() {
+        $(document)
+            .off('click.click-to-copy', '.click-to-copy')
+            .on('click.click-to-copy', '.click-to-copy', function(event) {
+            copyTextToClipboard($(this).text());
+        });
+    }
+
+    addMCInitializer('click-to-copy', init);
+
+}).call(window);

+ 7 - 7
resources/views/app/practice-management/_claim-lines.blade.php

@@ -12,19 +12,19 @@
     <tbody>
     @foreach($claim->lines as $line)
         <tr class="claim-line">
-            <td class="width-100px">{{$line->cpt}}
+            <td class="width-100px"><span class="click-to-copy" title="Click to copy">{{$line->cpt}}</span>
                 @if($line->numberOfUnits)
-                    <div>Units: <b>{{$line->numberOfUnits}}</b></div>
+                    <div>Units: <b><span class="click-to-copy" title="Click to copy">{{$line->numberOfUnits}}</span></b></div>
                 @endif
             </td>
-            <td class="text-nowrap width-100px">95</td>
-            <td class="text-nowrap width-100px">{{friendlier_date($line->date_of_service)}}</td>
-            <td class="text-nowrap width-100px">$ {{round($line->expected_total, 3)}}</td>
-            <td class="text-nowrap width-100px">11</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">{{friendlier_date($line->date_of_service)}}</span></td>
+            <td class="text-nowrap width-100px">$ <span class="click-to-copy" title="Click to copy">{{round($line->expected_total, 3)}}</span></td>
+            <td class="text-nowrap width-100px"><span class="click-to-copy" title="Click to copy">11</span></td>
             <td class="text-nowrap">
                 @if(count($line->claimLineIcds))
                     @foreach($line->claimLineIcds as $icd)
-                        <span class="c-pointer border-secondary border-bottom mr-2" title="{{$icd->description}}">{{$icd->code}}</span>
+                        <span class="c-pointer border-secondary border-bottom mr-2" title="{{$icd->description}}"><span class="click-to-copy" title="Click to copy">{{$icd->code}}</span></span>
                     @endforeach
                 @else
                     <p>No ICDs set</p>

+ 24 - 20
resources/views/app/practice-management/process-claims.blade.php

@@ -55,15 +55,15 @@
                             <b class="p-2 border-right mr-2 bg-aliceblue" :class="claim.status === 'PICKED_UP' ? 'text-dark' : 'text-secondary'">@{{ claim.created }}</b>
 
                             <span class="text-secondary text-sm mr-1">Patient</span>
-                            <span>@{{ claim.client }}</span>
+                            <span class="click-to-copy" title="Click to copy">@{{ claim.client }}</span>
 
                             <span class="mx-2 text-secondary">/</span>
                             <span class="text-secondary text-sm mr-1">Pro</span>
-                            <span>@{{ claim.claim_pro }}</span>
+                            <span class="click-to-copy" title="Click to copy">@{{ claim.claim_pro }}</span>
 
                             <span class="mx-2 text-secondary">/</span>
                             <span class="text-secondary text-sm mr-1">CPT</span>
-                            <span>@{{ claim.cpts }}</span>
+                            <span class="click-to-copy" title="Click to copy">@{{ claim.cpts }}</span>
 
                             <span class="mx-2 text-secondary">/</span>
                             <span>@{{ claim.icds }} ICDs</span>
@@ -71,7 +71,7 @@
                             <span class="mx-2 text-secondary">/</span>
                             <div class="d-inline-flex align-items-center font-weight-bold text-secondary">
                                 <span class="text-sm mr-1">$</span>
-                                <span>@{{ claim.expected_total ? claim.expected_total : 0 }}</span>
+                                <span class="click-to-copy" title="Click to copy">@{{ claim.expected_total ? claim.expected_total : 0 }}</span>
                             </div>
                             <div class="ml-auto px-2" v-if="currentClaim && currentClaim.uid === claim.uid">
                                 <button v-if="claim.status !== 'PICKED_UP'"
@@ -100,7 +100,7 @@
                                     <!--payer-->
                                     <div class="d-flex align-items-center mb-1">
                                         <div class="text-secondary mr-3 min-width-140px">Payer</div>
-                                        <b class="text-secondary">@{{ currentMBClaim.payer_name }}</b>
+                                        <b class="text-secondary"><span class="click-to-copy" title="Click to copy">@{{ currentMBClaim.payer_name }}</span></b>
                                     </div>
 
                                     <hr class="my-2">
@@ -108,32 +108,34 @@
                                     <!--patient/subscriber-->
                                     <div class="d-flex align-items-center mb-1">
                                         <div class="text-secondary mr-3 min-width-140px">Subscriber</div>
-                                        <b class="text-secondary">@{{ claim.client }}</b>
+                                        <b class="text-secondary"><span class="click-to-copy" title="Click to copy">@{{ claim.client }}</span></b>
                                         <span class="mx-1 text-secondary text-sm">/</span>
-                                        <span class="">@{{ currentMBClaim.subscriber_dob }}</span>
+                                        <span class=" click-to-copy" title="Click to copy">@{{ currentMBClaim.subscriber_dob }}</span>
                                         <span class="mx-1 text-secondary text-sm">/</span>
-                                        <span class="">@{{ currentMBClaim.subscriber_gender }}</span>
+                                        <span class=" click-to-copy" title="Click to copy">@{{ currentMBClaim.subscriber_gender }}</span>
                                     </div>
                                     <div class="mb-2 pl-3">
                                         <div class="d-flex align-items-center">
                                             <span class="text-secondary text-sm min-width-140px text-right pr-3">Chart #</span>
-                                            @{{ claim.client_chart_number }}
+                                            <span class="click-to-copy" title="Click to copy">@{{ claim.client_chart_number }}</span>
                                         </div>
                                         <div class="d-flex align-items-center">
                                             <span class="text-secondary text-sm min-width-140px text-right pr-3">MCN</span>
-                                            @{{ currentMBClaim.subscriber_identifier }}
+                                            <span class="click-to-copy" title="Click to copy">@{{ currentMBClaim.subscriber_identifier }}</span>
                                         </div>
                                         <div class="d-flex align-items-center">
                                             <span class="text-secondary text-sm min-width-140px text-right pr-3">Address</span>
+                                            <span class="click-to-copy" title="Click to copy">
                                             @{{ currentMBClaim.subscriber_address_street_line1 }}
                                             @{{ currentMBClaim.subscriber_address_street_line2 }}
                                             @{{ currentMBClaim.subscriber_address_city }}
                                             @{{ currentMBClaim.subscriber_address_state }}
                                             @{{ currentMBClaim.subscriber_address_zip }}
+                                            </span>
                                         </div>
                                         <div class="d-flex align-items-center">
                                             <span class="text-secondary text-sm min-width-140px text-right pr-3">Phone</span>
-                                            @{{ claim.client_phone }}
+                                            <span class="click-to-copy" title="Click to copy">@{{ claim.client_phone }}</span>
                                         </div>
                                     </div>
 
@@ -142,30 +144,32 @@
                                     <!--billing provider-->
                                     <div class="d-flex align-items-center mb-1">
                                         <div class="text-secondary mr-3 min-width-140px">Billing Provider</div>
-                                        <b class="text-secondary">@{{ currentMBClaim.billing_provider_entity }}</b>
+                                        <b class="text-secondary"><span class="click-to-copy" title="Click to copy">@{{ currentMBClaim.billing_provider_entity }}</span></b>
                                     </div>
                                     <div class="mb-2 pl-3">
                                         <div class="d-flex align-items-center">
                                             <span class="text-secondary text-sm min-width-140px text-right pr-3">NPI</span>
-                                            @{{ currentMBClaim.billing_provider_npi }}
+                                            <span class="click-to-copy" title="Click to copy">@{{ currentMBClaim.billing_provider_npi }}</span>
                                         </div>
                                         <div class="d-flex align-items-center">
                                             <span class="text-secondary text-sm min-width-140px text-right pr-3">Tax ID / Type</span>
-                                            @{{ currentMBClaim.billing_provider_tax_id }}
-                                            /
-                                            @{{ currentMBClaim.billing_provider_tax_id_type }}
+                                            <span class="click-to-copy" title="Click to copy">@{{ currentMBClaim.billing_provider_tax_id }}</span>
+                                            <span class="text-secondary mx-1">/</span>
+                                            <span class="click-to-copy" title="Click to copy">@{{ currentMBClaim.billing_provider_tax_id_type }}</span>
                                         </div>
                                         <div class="d-flex align-items-center">
                                             <span class="text-secondary text-sm min-width-140px text-right pr-3">Taxonomy Code</span>
-                                            @{{ currentMBClaim.billing_provider_taxonomy_code }}
+                                            <span class="click-to-copy" title="Click to copy">@{{ currentMBClaim.billing_provider_taxonomy_code }}</span>
                                         </div>
                                         <div class="d-flex align-items-center">
                                             <span class="text-secondary text-sm min-width-140px text-right pr-3">Address</span>
+                                            <span class="click-to-copy" title="Click to copy">
                                             @{{ currentMBClaim.billing_provider_address_street_line1 }}
                                             @{{ currentMBClaim.billing_provider_address_street_line2 }}
                                             @{{ currentMBClaim.billing_provider_address_city }}
                                             @{{ currentMBClaim.billing_provider_address_state }}
                                             @{{ currentMBClaim.billing_provider_address_zip }}
+                                            </span>
                                         </div>
                                     </div>
 
@@ -174,12 +178,12 @@
                                     <!--attending provider-->
                                     <div class="d-flex align-items-center mb-1">
                                         <div class="text-secondary mr-3 min-width-140px">Attending Provider</div>
-                                        <b class="text-secondary">@{{ currentMBClaim.attending_provider_first_name }} @{{ currentMBClaim.attending_provider_last_name }}</b>
+                                        <b class="text-secondary"><span class="click-to-copy" title="Click to copy">@{{ currentMBClaim.attending_provider_first_name }} @{{ currentMBClaim.attending_provider_last_name }}</span></b>
                                     </div>
                                     <div class="mb-2 pl-3">
                                         <div class="d-flex align-items-center">
                                             <span class="text-secondary text-sm min-width-140px text-right pr-3">NPI</span>
-                                            @{{ currentMBClaim.attending_provider_npi }}
+                                            <span class="click-to-copy" title="Click to copy">@{{ currentMBClaim.attending_provider_npi }}</span>
                                         </div>
                                     </div>
 
@@ -203,7 +207,7 @@
                                     <!--total-->
                                     <div class="d-flex align-items-center mb-1">
                                         <div class="text-secondary mr-3 min-width-140px">Claim Total</div>
-                                        <b class="text-secondary">$ @{{ claim.expected_total ? claim.expected_total : 0 }}</b>
+                                        <b class="text-secondary">$ <span class="click-to-copy" title="Click to copy">@{{ claim.expected_total ? claim.expected_total : 0 }}</span></b>
                                     </div>
 
                                     <hr class="my-2">

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

@@ -321,6 +321,7 @@
             });
         });
     </script>
+    <script src="/js/click-to-copy.js?v={{config('app.asset_version')}}"></script>
     <script src="/js/stag-popup.js?v={{config('app.asset_version')}}"></script>
     <script src="/js/option-list.js?v={{config('app.asset_version')}}"></script>
     @include('app/pdf/viewer')