瀏覽代碼

Visit UI - type specific review "view"

Vijayakrishnan 3 年之前
父節點
當前提交
580e479615

+ 13 - 60
resources/views/app/patient/segment-templates/_review/problem/last-review.php

@@ -1,66 +1,19 @@
 <?php if ($point->lastChildReview): ?>
 <?php if ($point->lastChildReview): ?>
-    <?php $parsedReview = json_decode($point->lastChildReview->data); ?>
-    <div class="border px-2 py-1 bg-light">
-        <div class="mb-1">
-            <label class="text-secondary text-sm mb-0">Explain the problem.</label>
-            <div class="ml-2" data-name="problem_explanation"><?= $parsedReview ? @$parsedReview->problem_explanation : '' ?></div>
-        </div>
-        <?php if ($point->lastChildReview && $point->last_child_review_point_scoped_note_id !== $note->id): ?>
-            <div class="mb-1">
-                <label class="text-secondary text-sm mb-0">What happened between today and our last visit?</label>
-                <div class="ml-2" data-name="events_between_last_visit_and_this"><?= $parsedReview ? @$parsedReview->events_between_last_visit_and_this : '' ?></div>
-            </div>
-            <div class="mb-1">
-                <label class="text-secondary text-sm mb-0">How did it go with the plan I gave you?</label>
-                <div class="ml-2" data-name="current_plan_status"><?= $parsedReview ? @$parsedReview->current_plan_status : '' ?></div>
-            </div>
-            <div class="mb-1">
-                <label class="text-secondary text-sm mb-0">What barriers have you felt following the plan?</label>
-                <div class="ml-2" data-name="barriers_following_current_plan"><?= $parsedReview ? @$parsedReview->barriers_following_current_plan : '' ?></div>
-            </div>
+    <?php
+    $review = json_decode($point->lastChildReview->data);
+    include resource_path('views/app/patient/segment-templates/_review/problem/view.php');
+    ?>
+    <div class="mb-2">
+        <?php if ($point->last_child_review_point_scoped_note_id === $note->id): ?>
+            <span class="text-secondary text-sm">(reviewed on this note)</span>
+        <?php else: ?>
+            <span class="text-sm">Reviewed on:</span>
+            <a native target="_blank" class="text-sm"
+               href="<?= route('patients.view.notes.view.dashboard', ['patient' => $patient, 'note' => $point->lastChildReviewNote]) ?>">
+                <?= friendlier_date_time($point->last_child_review_effective_date) ?>
+            </a>
         <?php endif; ?>
         <?php endif; ?>
-        <div class="mb-1">
-            <label class="text-secondary text-sm mb-0">How long have you had this?</label>
-            <div class="ml-2" data-name="how_long"><?= $parsedReview ? @$parsedReview->how_long : '' ?></div>
-        </div>
-        <div class="mb-1">
-            <label class="text-secondary text-sm mb-0">When does it get worse?</label>
-            <div class="ml-2" data-name="when_worse"><?= $parsedReview ? @$parsedReview->when_worse : '' ?></div>
-        </div>
-        <div class="mb-1">
-            <label class="text-secondary text-sm mb-0">When does it get better?</label>
-            <div class="ml-2" data-name="when_better"><?= $parsedReview ? @$parsedReview->when_better : '' ?></div>
-        </div>
-        <div class="mb-1">
-            <label class="text-secondary text-sm mb-0">What have you done for treatment?</label>
-            <div class="ml-2" data-name="treatments_done"><?= $parsedReview ? @$parsedReview->treatments_done : '' ?></div>
-        </div>
-        <div class="mb-1">
-            <label class="text-secondary text-sm mb-0">How does it affect your ADLs?</label>
-            <div class="ml-2" data-name="how_it_affects_ADLs"><?= $parsedReview ? @$parsedReview->how_it_affects_ADLs : '' ?></div>
-        </div>
-        <div class="mb-1">
-            <label class="text-secondary text-sm mb-0">How do you cope?</label>
-            <div class="ml-2" data-name="how_cope"><?= $parsedReview ? @$parsedReview->how_cope : '' ?></div>
-        </div>
-        <div class="mb-1">
-            <label class="text-secondary text-sm mb-0">How does this affect you emotionally?</label>
-            <div class="ml-2" data-name="how_affect_emotionally"><?= $parsedReview ? @$parsedReview->how_affect_emotionally : '' ?></div>
-        </div>
-        <div class="">
-            <label class="text-secondary text-sm mb-0">Memo</label>
-            <div class="ml-2" data-name="memo"><?= $parsedReview ? @$parsedReview->memo : '' ?></div>
-        </div>
     </div>
     </div>
-    <div class="text-secondary text-sm"></div>
-    <?php if ($point->last_child_review_point_scoped_note_id === $note->id): ?>
-        <span class="text-secondary text-sm">(reviewed on this note)</span>
-    <?php else: ?>
-        <a native target="_blank"
-           href="<?= route('patients.view.notes.view.dashboard', ['patient' => $patient, 'note' => $point->lastChildReviewNote]) ?>">
-            <?= friendlier_date_time($point->last_child_review_effective_date) ?>
-        </a>
-    <?php endif; ?>
 <?php else: ?>
 <?php else: ?>
     <span class="text-secondary text-sm">None</span>
     <span class="text-secondary text-sm">None</span>
 <?php endif; ?>
 <?php endif; ?>

+ 50 - 0
resources/views/app/patient/segment-templates/_review/problem/view.php

@@ -0,0 +1,50 @@
+<table class="table table-sm table-striped m-0 bg-white">
+    <tr class="mb-1">
+        <td class="w-50 text-secondary text-sm mb-0">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 class="w-50 text-secondary text-sm mb-0">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 class="w-50 text-secondary text-sm mb-0">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 class="w-50 text-secondary text-sm mb-0">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 class="w-50 text-secondary text-sm mb-0">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 class="w-50 text-secondary text-sm mb-0">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 class="w-50 text-secondary text-sm mb-0">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 class="w-50 text-secondary text-sm mb-0">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 class="w-50 text-secondary text-sm mb-0">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 class="w-50 text-secondary text-sm mb-0">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 class="w-50 text-secondary text-sm mb-0">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 class="w-50 text-secondary text-sm mb-0">Memo</td>
+        <td class="ml-2" data-name="memo"><?= $review && @$review->memo ? @$review->memo : '-' ?></td>
+    </div>
+</table>