Forráskód Böngészése

Update note->reasons() to use new icd/desc columns

Vijayakrishnan 3 éve
szülő
commit
d96b31fd85

+ 10 - 1
app/Models/Note.php

@@ -124,7 +124,16 @@ class Note extends Model
 
     public function reasons()
     {
-        return $this->hasMany(NoteReason::class, 'note_id', 'id');
+        $reasons = [];
+        for ($i = 1; $i <= 4; $i++) {
+            if($this->{'note_reason_icd' . $i}) {
+                $reason = new \stdClass();
+                $reason->code = $this->{'note_reason_icd' . $i};
+                $reason->description = $this->{'note_reason_icd' . $i . 'description'};
+                $reasons[] = $reason;
+            }
+        }
+        return $reasons;
     }
 
     public function claims()

+ 2 - 2
resources/views/app/admin/notes_pending_summary_suggestion.blade.php

@@ -28,10 +28,10 @@
                         </td>
                         <td>{{$row->client->displayName()}}</td>
                         <td>
-                            @foreach($row->reasons as $reason)
+                            @foreach($row->reasons() as $reason)
                                 <span class="pr-2">{{$reason->code}}</span>
                             @endforeach
-                            @if(!$row->reasons || !count($row->reasons))
+                            @if(!$row->reasons() || !count($row->reasons()))
                                 -
                             @endif
                         </td>

+ 2 - 2
resources/views/app/admin/notes_rejected_summary_suggestion.blade.php

@@ -28,10 +28,10 @@
                         </td>
                         <td>{{$row->client->displayName()}}</td>
                         <td>
-                            @foreach($row->reasons as $reason)
+                            @foreach($row->reasons() as $reason)
                                 <span class="pr-2">{{$reason->code}}</span>
                             @endforeach
-                            @if(!$row->reasons || !count($row->reasons))
+                            @if(!$row->reasons() || !count($row->reasons()))
                                 -
                             @endif
                         </td>

+ 2 - 2
resources/views/app/admin/patients-table.blade.php

@@ -163,8 +163,8 @@
 													{!! $note->hcpPro && $note->is_signed_by_hcp ? '<b class="text-success">Yes</b>' : 'No' !!}
 												</td>
 												<td class="max-width-200px">
-													@if(count($note->reasons))
-														@foreach ($note->reasons as $reason)
+													@if(count($note->reasons()))
+														@foreach ($note->reasons() as $reason)
 															<div class="mb-1">
 																<span>{{ $reason->code }}</span>
 																<span class="text-secondary text-sm">{{ $reason->description}}</span>

+ 2 - 2
resources/views/app/mcp/notes_pending_billing.blade.php

@@ -21,10 +21,10 @@
                         </td>
                         <td>{{$row->client->displayName()}}</td>
                         <td>
-                            @foreach($row->reasons as $reason)
+                            @foreach($row->reasons() as $reason)
                                 <span class="pr-2">{{$reason->code}}</span>
                             @endforeach
-                            @if(!$row->reasons || !count($row->reasons))
+                            @if(!$row->reasons() || !count($row->reasons()))
                                 -
                             @endif
                         </td>

+ 2 - 2
resources/views/app/mcp/notes_pending_signature.blade.php

@@ -28,10 +28,10 @@
                         </td>
                         <td>{{$row->client->displayName()}}</td>
                         <td>
-                            @foreach($row->reasons as $reason)
+                            @foreach($row->reasons() as $reason)
                                 <span class="pr-2">{{$reason->code}}</span>
                             @endforeach
-                            @if(!$row->reasons || !count($row->reasons))
+                            @if(!$row->reasons() || !count($row->reasons()))
                                 -
                             @endif
                         </td>

+ 2 - 2
resources/views/app/mcp/notes_pending_summary_suggestion.blade.php

@@ -28,10 +28,10 @@
                         </td>
                         <td>{{$row->client->displayName()}}</td>
                         <td>
-                            @foreach($row->reasons as $reason)
+                            @foreach($row->reasons() as $reason)
                                 <span class="pr-2">{{$reason->code}}</span>
                             @endforeach
-                            @if(!$row->reasons || !count($row->reasons))
+                            @if(!$row->reasons() || !count($row->reasons()))
                                 -
                             @endif
                         </td>

+ 2 - 2
resources/views/app/mcp/notes_rejected_summary_suggestion.blade.php

@@ -28,10 +28,10 @@
                         </td>
                         <td>{{$row->client->displayName()}}</td>
                         <td>
-                            @foreach($row->reasons as $reason)
+                            @foreach($row->reasons() as $reason)
                                 <span class="pr-2">{{$reason->code}}</span>
                             @endforeach
-                            @if(!$row->reasons || !count($row->reasons))
+                            @if(!$row->reasons() || !count($row->reasons()))
                                 -
                             @endif
                         </td>

+ 11 - 0
resources/views/app/patient/note/_create-claim.blade.php

@@ -126,6 +126,17 @@
         </div>
     </form>
 </div>
+<script>
+    window.noteReasons = [];
+    @if(count($note->reasons()))
+    @foreach($note->reasons() as $reason)
+    window.noteReasons.push({
+        code: '{{$reason->code}}',
+        description: '{{$reason->description}}'
+    });
+    @endforeach
+    @endif
+</script>
 <script>
     window.createClaimApp = new Vue({
         el: '#createClaimApp',

+ 4 - 4
resources/views/app/patient/note/_create-note-reason.blade.php

@@ -1,7 +1,7 @@
 <script>
     window.noteReasons = [];
-    @if(count($note->reasons))
-        @foreach($note->reasons as $reason)
+    @if(count($note->reasons()))
+        @foreach($note->reasons() as $reason)
         window.noteReasons.push({
             code: '{{$reason->code}}',
             description: '{{$reason->description}}'
@@ -22,8 +22,8 @@
                 </tr>
             </thead>
             <tbody>
-                @if(count($note->reasons))
-                @foreach($note->reasons as $reason)
+                @if(count($note->reasons()))
+                @foreach($note->reasons() as $reason)
                 <tr class="data-row">
                     <td><input type="text" class="form-control note-reason-icd" data-index="{{$loop->index}}" id="icd_{{$loop->index}}" name="noteReasonDTOs[{{$loop->index}}].code" value="{{$reason->code}}"></td>
                     <td><input type="text" class="form-control note-reason-description" data-index="{{$loop->index}}" id="description_{{$loop->index}}" name="noteReasonDTOs[{{$loop->index}}].description" value="{{$reason->description}}"></td>

+ 2 - 2
resources/views/app/patient/note/pdf.blade.php

@@ -354,10 +354,10 @@
     <!-- icds -->
     <div style="padding: 1rem; padding-bottom: 0;">
         <p><b style="font-size: 18px">ICDs</b></p>
-        @if(!count($note->reasons))
+        @if(!count($note->reasons()))
             Unavailable
         @else
-            @foreach ($note->reasons as $reason)
+            @foreach ($note->reasons() as $reason)
                 <div style="margin-bottom: 0.5rem;">
                     {{ $reason->description}} ({{ $reason->code }})
                 </div>

+ 2 - 2
resources/views/app/patient/notes.blade.php

@@ -304,8 +304,8 @@
                     {!! $note->hcpPro && $note->is_signed_by_hcp ? '<b class="text-success">Yes</b>' : 'No' !!}
                 </td>
                 <td class="max-width-200px">
-                    @if(count($note->reasons))
-                        @foreach ($note->reasons as $reason)
+                    @if(count($note->reasons()))
+                        @foreach ($note->reasons() as $reason)
                             <span class="d-inline-block mr-2" title="{{ $reason->description}}">{{ $reason->code }}</span>
                         @endforeach
                     @else

+ 1 - 1
resources/views/app/practice-management/billing-manager-v1.blade.php

@@ -162,7 +162,7 @@
                                         </tr>
                                         </thead>
                                         <tbody>
-                                        @foreach($note->reasons as $reason)
+                                        @foreach($note->reasons() as $reason)
                                             <tr>
                                                 <td>{{$reason->code}}</td>
                                                 <td>{{$reason->description}}</td>

+ 1 - 1
resources/views/app/practice-management/billing-manager.blade.php

@@ -130,7 +130,7 @@
                             @if($performer->pro->pro_type == 'ADMIN')
                                 <td>
                                     <div class="d-flex flex-wrap width-100px">
-                                        @foreach($note->reasons as $reason)
+                                        @foreach($note->reasons() as $reason)
                                             <span class="border-bottom c-pointer mr-2 mb-1" title="{{$reason->description}}">{{$reason->code}}</span>
                                         @endforeach
                                     </div>

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

@@ -146,7 +146,7 @@
                             </td>
                             <td>
                                 <div class="d-flex flex-wrap width-100px">
-                                    @foreach($note->reasons as $reason)
+                                    @foreach($note->reasons() as $reason)
                                         <span class="border-bottom c-pointer mr-2 mb-1" title="{{$reason->description}}">{{$reason->code}}</span>
                                     @endforeach
                                 </div>