Pārlūkot izejas kodu

added claims resolver view

unknown 4 gadi atpakaļ
vecāks
revīzija
a52da2d2dc
1 mainītis faili ar 25 papildinājumiem un 30 dzēšanām
  1. 25 30
      resources/views/app/patient/claims-resolver.blade.php

+ 25 - 30
resources/views/app/patient/claims-resolver.blade.php

@@ -11,7 +11,7 @@
             <th>Date</th>
             <th>Day in Program</th>
             <th>Day in MCP Program</th>
-            <th>Days since Prv. Note</th>
+            <th>Days Since Last Note by HCP</th>
             <th>Signed By HCP?</th>
             <th>Content</th>
             <th></th>
@@ -34,41 +34,29 @@
                     }
                 }
                 $dayInProgram = (strtotime($d) - strtotime($firstDateEverSeenByAnyone)) / (60 * 60 * 24);
-                $dayInProgram = (strtotime($d) - strtotime($firstDateEverSeenByMcpTypePro)) / (60 * 60 * 24);
-            }
-        ?>
-        @foreach($patient->notesAscending as $note)
-
-        <?php
-            $date = $note->effective_dateest;
-            $firstDateEverSeenByAnyone = $firstDateEverSeenByAnyone ? $firstDateEverSeenByAnyone : $date;
-
-
-        if ($note->hcpPro->is_mcp) {
-            $firstDate = $firstDate ? $firstDate : $note->effective_dateest;
-            $lastDate = $lastDate ? $lastDate : $note->effective_dateest;
-        }
-
-        $dayInProgram = null;
-        $daysSincePreviousNote = null;
-        if ($firstDate) {
-            $dayInProgram = (strtotime($note->effective_dateest) - strtotime($firstDate)) / (60 * 60 * 24);
-        }
-
-        if ($note->hcpPro->is_mcp) {
-            $daysSincePreviousNote = (strtotime($note->effective_dateest) - strtotime($lastDate)) / (60 * 60 * 24);
-            $lastDate = $note->effective_dateest;
-        }
-        ?>
+                $dayInMcpProgram = (strtotime($d) - strtotime($firstDateEverSeenByMcpTypePro)) / (60 * 60 * 24);
+                $daysSinceLastMcpVisit = null;
+                if($note->hcpPro->is_mcp){
+                    $daysSinceLastMcpTypeVisit = (strtotime($d) - strtotime($loopLastDateSeenByMcpTypePro)) / (60 * 60 * 24);
+                }
+                $lastVisitWithHcp = isset($loopLastDateSeenByHcpMap[$note->hcp_pro_id]) ? $loopLastDateSeenByHcpMap[$note->hcp_pro_id] : null;
+                $daysSinceLastHcpVisit = null;
+                if($lastVisitWithHcp){
+                    $daysSinceLastHcpVisit = (strtotime($d) - strtotime($lastVisitWithHcp)) / (60 * 60 * 24);
+                }
+                ?>
         <tr>
             <td>
-                {{ $note->effective_dateest }}
+                {{ $d }}
             </td>
             <td>
                 {{ $dayInProgram }}
             </td>
             <td>
-                {{ $daysSincePreviousNote }}
+                {{ $dayInMcpProgram }}
+            </td>
+            <td>
+                {{$daysSinceLastHcpVisit}}
             </td>
             <td>
                 {{ $note->is_signed_by_hcp }}
@@ -78,7 +66,14 @@
             </td>
             <td></td>
         </tr>
-        <? endforeach; ?>
+        <?php
+                $loopLastDateSeenByHcpMap[$note->hcpPro->id] = $d;
+                if($note->hcpPro->is_mcp){
+                    $loopLastDateSeenByMcpTypePro = $d;
+                }
+            }
+        ?>
+
         </tbody>
     </table>
 @endsection