Przeglądaj źródła

Visit UI - PDF (wip)

Vijayakrishnan 3 lat temu
rodzic
commit
5829a3d6b0
1 zmienionych plików z 131 dodań i 2 usunięć
  1. 131 2
      resources/views/app/patient/note/pdf.blade.php

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

@@ -97,13 +97,15 @@
     $vitalsSegment = null;
     $medicationsSegment = null;
     $ccSegment = null;
-    $problemsSegment = null;
+    $problemsIntakeSegment = null;
+    $problemsPlanSegment = null;
     $rosSegment = null;
     $objectiveFreeTextSegment = null;
     $objectiveImagingSegment = null;
     $objectiveLabsSegment = null;
     $objectiveMeasurementsSegment = null;
     $objectiveOtherInvestigationsSegment = null;
+    $planFreeTextSegment = null;
 
     // find and store handle to specific segments
     foreach($note->segments as $segment) {
@@ -120,8 +122,11 @@
             case 'chief_complaint':
                 $ccSegment = $segment;
                 break;
+            case 'intake_problems':
+                $problemsIntakeSegment = $segment;
+                break;
             case 'plan_problems':
-                $problemsSegment = $segment;
+                $problemsPlanSegment = $segment;
                 break;
             case 'ros':
                 $rosSegment = $segment;
@@ -141,6 +146,9 @@
             case 'objective_other_investigations':
                 $objectiveOtherInvestigationsSegment = $segment;
                 break;
+            case 'plan_free_text':
+                $planFreeTextSegment = $segment;
+                break;
         }
     }
     ?>
@@ -206,6 +214,82 @@
         @endif
     </div>
 
+    <!-- hpi -->
+    <div style="padding: 1rem; padding-bottom: 0;">
+        <p><b style="font-size: 18px">History of Present Illness</b></p>
+        @if(!$problemsIntakeSegment || empty(trim($problemsIntakeSegment->summary_html)))
+            Unavailable
+        @else
+            <?php $problems = \App\Models\Point::getIntakePointsOfCategory($patient, 'PROBLEM', $note); ?>
+            @if(!$problems || !count($problems)))
+                Unavailable
+            @endif
+            @foreach($problems as $problem)
+                <?php $childReviews = $problem->childReviews; ?>
+                @foreach($childReviews as $childReview)
+                    @if($childReview->added_in_note_id === $note->id)
+                        <div style="font-weight:bold;">{{$problem->data->name}}</div>
+                        <div style="padding-left: 1rem;">
+                            <?php
+                            $review = json_decode($childReview->data);
+                            ?>
+                                <table style="border: 0; width: 100%; border: 0" border="0" cellspacing="0" cellpadding="0">
+                                    <tr class="mb-1">
+                                        <td style="width: 50%">Explain the problem.</td>
+                                        <td class="ml-2" data-name="problem_explanation"><?= $review && @$review->problem_explanation ? @$review->problem_explanation : '-' ?></td>
+                                    </tr>
+                                    <tr class="mb-1">
+                                        <td style="width: 50%">What happened between today and our last visit?</td>
+                                        <td class="ml-2" data-name="events_between_last_visit_and_this"><?= $review && @$review->events_between_last_visit_and_this ? @$review->events_between_last_visit_and_this : '-' ?></td>
+                                    </tr>
+                                    <tr class="mb-1">
+                                        <td style="width: 50%">How did it go with the plan I gave you?</td>
+                                        <td class="ml-2" data-name="current_plan_status"><?= $review && @$review->current_plan_status ? @$review->current_plan_status : '-' ?></td>
+                                    </tr>
+                                    <tr class="mb-1">
+                                        <td style="width: 50%">What barriers have you felt following the plan?</td>
+                                        <td class="ml-2" data-name="barriers_following_current_plan"><?= $review && @$review->barriers_following_current_plan ? @$review->barriers_following_current_plan : '-' ?></td>
+                                    </tr>
+                                    <tr class="mb-1">
+                                        <td style="width: 50%">How long have you had this?</td>
+                                        <td class="ml-2" data-name="how_long"><?= $review && @$review->how_long ? @$review->how_long : '-' ?></td>
+                                    </tr>
+                                    <tr class="mb-1">
+                                        <td style="width: 50%">When does it get worse?</td>
+                                        <td class="ml-2" data-name="when_worse"><?= $review && @$review->when_worse ? @$review->when_worse : '-' ?></td>
+                                    </tr>
+                                    <tr class="mb-1">
+                                        <td style="width: 50%">When does it get better?</td>
+                                        <td class="ml-2" data-name="when_better"><?= $review && @$review->when_better ? @$review->when_better : '-' ?></td>
+                                    </tr>
+                                    <tr class="mb-1">
+                                        <td style="width: 50%">What have you done for treatment?</td>
+                                        <td class="ml-2" data-name="treatments_done"><?= $review && @$review->treatments_done ? @$review->treatments_done : '-' ?></td>
+                                    </tr>
+                                    <tr class="mb-1">
+                                        <td style="width: 50%">How does it affect your ADLs?</td>
+                                        <td class="ml-2" data-name="how_it_affects_ADLs"><?= $review && @$review->how_it_affects_ADLs ? @$review->how_it_affects_ADLs : '-' ?></td>
+                                    </tr>
+                                    <tr class="mb-1">
+                                        <td style="width: 50%">How do you cope?</td>
+                                        <td class="ml-2" data-name="how_cope"><?= $review && @$review->how_cope ? @$review->how_cope : '-' ?></td>
+                                    </tr>
+                                    <tr class="mb-1">
+                                        <td style="width: 50%">How does this affect you emotionally?</td>
+                                        <td class="ml-2" data-name="how_affect_emotionally"><?= $review && @$review->how_affect_emotionally ? @$review->how_affect_emotionally : '-' ?></td>
+                                    </tr>
+                                    <div class="">
+                                        <td style="width: 50%">Memo</td>
+                                        <td class="ml-2" data-name="memo"><?= $review && @$review->memo ? @$review->memo : '-' ?></td>
+                                    </div>
+                                </table>
+                        </div>
+                    @endif
+                @endforeach
+            @endforeach
+        @endif
+    </div>
+
     <!-- ros -->
     <div style="padding: 1rem; padding-bottom: 0;">
         <p><b style="font-size: 18px">Review of Systems</b></p>
@@ -236,6 +320,51 @@
         @endif
     </div>
 
+    <!-- icds -->
+    <div style="padding: 1rem; padding-bottom: 0;">
+        <p><b style="font-size: 18px">ICDs</b></p>
+        @if(!count($note->reasons))
+            Unavailable
+        @else
+            @foreach ($note->reasons as $reason)
+                <div style="margin-bottom: 0.5rem;">
+                    {{ $reason->description}} ({{ $reason->code }})
+                </div>
+            @endforeach
+        @endif
+    </div>
+
+    <!-- plan -->
+    <div style="padding: 1rem; padding-bottom: 0;">
+        <p><b style="font-size: 18px">Plan</b></p>
+        @if(!$problemsPlanSegment || empty(trim($problemsPlanSegment->summary_html)))
+
+        @else
+            <?php $problems = \App\Models\Point::getPlanPointsOfCategory($patient, 'PROBLEM', $note); ?>
+            @if(!$problems || !count($problems)))
+                Unavailable
+            @endif
+            @foreach($problems as $problem)
+                <?php $childPlans = $problem->childPlans; ?>
+                @foreach($childPlans as $childPlan)
+                    @if($childPlan->added_in_note_id === $note->id)
+                        <div style="font-weight:bold;">{{$problem->data->name}} {{$problem->data->icd ? ' / ' . $problem->data->icd : ''}}</div>
+                        <div style="padding-left: 1rem;">
+                            <?php
+                            $review = json_decode($childPlan->data);
+                            ?>
+                            <p>{!! $review->value !!}</p>
+                        </div>
+                    @endif
+                @endforeach
+            @endforeach
+        @endif
+        @if($planFreeTextSegment && !empty(trim($planFreeTextSegment->summary_html)))
+            {!! $planFreeTextSegment->summary_html !!}
+        @endif
+    </div>
+
+
 </div>
 </body>
 </html>