소스 검색

Visit UI - common includes fix

Vijayakrishnan 3 년 전
부모
커밋
fd7cf7f8cd

+ 25 - 0
resources/views/app/patient/segment-templates/_child_plan/edit-plan.php

@@ -0,0 +1,25 @@
+<?php
+$currentValue = '';
+if ($point->lastChildPlan && $point->last_child_plan_point_scoped_note_id === $note->id) {
+    $parsedPlan = json_decode($point->lastChildPlan->data);
+    $currentValue = $parsedPlan->value;
+}
+?>
+<div visit-moe relative>
+    <a start show href="#">Edit</a>
+    <form url="/api/visitPoint/upsertChildPlan" class="mcp-theme-1" right>
+        <input type="hidden" name="uid" value="<?= $point->uid ?>">
+        <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+        <input type="hidden" name="data">
+
+        <p class="mb-2"><b>Review</b></p>
+
+        <div class="mb-2">
+            <textarea data-name="value" class="form-control form-control-sm" rows="3"><?= $currentValue ?></textarea>
+        </div>
+        <div>
+            <button submit class="btn btn-sm btn-primary mr-2">Save</button>
+            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+        </div>
+    </form>
+</div>

+ 15 - 0
resources/views/app/patient/segment-templates/_child_plan/last-plan.php

@@ -0,0 +1,15 @@
+<?php if ($point->lastChildPlan): ?>
+    <?php $parsedPlan = json_decode($point->lastChildPlan->data); ?>
+    <div><?= $parsedPlan->value ?></div>
+    <div class="text-secondary text-sm"></div>
+    <?php if ($point->last_child_plan_point_scoped_note_id === $note->id): ?>
+        <span class="text-secondary text-sm">(added on this note)</span>
+    <?php else: ?>
+        <a native target="_blank"
+           href="<?= route('patients.view.notes.view.dashboard', ['patient' => $patient, 'note' => $point->lastChildPlanNote]) ?>">
+            <?= friendlier_date_time($point->last_child_plan_effective_date) ?>
+        </a>
+    <?php endif; ?>
+<?php else: ?>
+    <span class="text-secondary text-sm">None</span>
+<?php endif; ?>

+ 4 - 16
resources/views/app/patient/segment-templates/_child_review/edit-review.php

@@ -1,25 +1,13 @@
 <?php
-if (!@$intakeOrVisit) {
-    $intakeOrVisit = 'INTAKE'; // default
-}
-$epPart = ($intakeOrVisit === 'INTAKE') ? 'Review' : 'Plan';
 $currentValue = '';
-if($intakeOrVisit === 'INTAKE') {
-    if ($point->lastChildReview && $point->last_child_review_point_scoped_note_id === $note->id) {
-        $parsedReview = json_decode($point->lastChildReview->data);
-        $currentValue = $parsedReview->value;
-    }
-}
-else {
-    if ($point->lastChildPlan && $point->last_child_plan_point_scoped_note_id === $note->id) {
-        $parsedReview = json_decode($point->lastChildPlan->data);
-        $currentValue = $parsedReview->value;
-    }
+if ($point->lastChildReview && $point->last_child_review_point_scoped_note_id === $note->id) {
+    $parsedReview = json_decode($point->lastChildReview->data);
+    $currentValue = $parsedReview->value;
 }
 ?>
 <div visit-moe relative>
     <a start show href="#">Edit</a>
-    <form url="/api/visitPoint/upsertChild<?= $epPart ?>" class="mcp-theme-1" right>
+    <form url="/api/visitPoint/upsertChildReview" class="mcp-theme-1" right>
         <input type="hidden" name="uid" value="<?= $point->uid ?>">
         <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
         <input type="hidden" name="data">

+ 11 - 34
resources/views/app/patient/segment-templates/_child_review/last-review.php

@@ -1,38 +1,15 @@
-<?php
-if (!@$intakeOrVisit) {
-    $intakeOrVisit = 'INTAKE'; // default
-}
-?>
-<?php if ($intakeOrVisit === 'INTAKE'): ?>
-    <?php if ($point->lastChildReview): ?>
-        <?php $parsedReview = json_decode($point->lastChildReview->data); ?>
-        <div><?= $parsedReview->value ?></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 if ($point->lastChildReview): ?>
+    <?php $parsedReview = json_decode($point->lastChildReview->data); ?>
+    <div><?= $parsedReview->value ?></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: ?>
-        <span class="text-secondary text-sm">None</span>
+        <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 if ($point->lastChildPlan): ?>
-        <?php $parsedReview = json_decode($point->lastChildPlan->data); ?>
-        <div><?= $parsedReview->value ?></div>
-        <div class="text-secondary text-sm"></div>
-        <?php if ($point->last_child_plan_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->lastChildPlanNote]) ?>">
-                <?= friendlier_date_time($point->last_child_plan_effective_date) ?>
-            </a>
-        <?php endif; ?>
-    <?php else: ?>
-        <span class="text-secondary text-sm">None</span>
-    <?php endif; ?>
+    <span class="text-secondary text-sm">None</span>
 <?php endif; ?>

+ 7 - 1
resources/views/app/patient/segment-templates/_common_actions/remove-undo.php

@@ -22,7 +22,13 @@ $epNotPart = ($intakeOrVisit === 'INTAKE') ? 'DuringVisit' : 'OnIntake';
     </div>
 <?php else: ?>
     <?php if($point->added_in_note_id === $note->id): ?>
-        <span class="font-weight-bold text-success mx-2 text-nowrap">* Added <?= $whenLabel ?></span>
+        <?php if ($point->added_in_note_id === $note->id): ?>
+            <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>
+                <span class="mx-2 font-weight-bold text-success text-nowrap">* Added during visit</span>
+            <?php else: ?>
+                <span class="mx-2 font-weight-bold text-info text-nowrap">* Added on intake</span>
+            <?php endif;?>
+        <?php endif; ?>
     <?php endif; ?>
     <div visit-moe>
         <a start show href="#">Remove</a>