Browse Source

Create claim: auto suggest new dos to use (last used + 30)

Vijayakrishnan Krishnan 1 day ago
parent
commit
ce8cd10351
1 changed files with 12 additions and 2 deletions
  1. 12 2
      resources/views/app/patient/care-month/_create-claim.blade.php

+ 12 - 2
resources/views/app/patient/care-month/_create-claim.blade.php

@@ -126,6 +126,11 @@
         </div>
     </form>
 </div>
+<?php
+$lastRPMDOS = \App\Models\AppSetting::getSetting('LAST_RPM_DOS');
+$suggestedRPMDOS = date_add(date_create($lastRPMDOS), date_interval_create_from_date_string("31 days"));
+$suggestedRPMDOS = $suggestedRPMDOS->format('Y-m-d');
+?>
 <script>
     window.rmReasons = [];
     window.createCareMonthClaimApp = new Vue({
@@ -136,7 +141,7 @@
                 lines: [
                     {
                         cpt: '',
-                        dateOfService: '{{date("Y-m-d", strtotime($careMonth->created_at))}}',
+                        dateOfService: '{{$suggestedRPMDOS}}',
                         icds: JSON.parse(JSON.stringify(window.rmReasons)),
                         numberOfUnits: 1
                     }
@@ -147,7 +152,7 @@
             addLine: function () {
                 this.payload.lines.push({
                     cpt: '',
-                    dateOfService: '{{date('Y-m-d')}}',
+                    dateOfService: '{{$suggestedRPMDOS}}',
                     icds: JSON.parse(JSON.stringify(window.rmReasons)),
                     numberOfUnits: 1
                 });
@@ -231,6 +236,11 @@
                     if(csj && csj.lines && csj.lines.length) {
                         this.payload.lines.splice(0, 1);
                         this.payload.lines = csj.lines;
+
+                        // override dos with suggested!
+                        for (let i = 0; i < this.payload.lines.length; i++) {
+                            this.payload.lines[i].dateOfService = '{{$suggestedRPMDOS}}';
+                        }
                     }
                 @endif
             }