Ver código fonte

Visit UI - $intakeOrVisit param in remove-undo include

Vijayakrishnan 3 anos atrás
pai
commit
6d43e1cf3c

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

@@ -1,8 +1,15 @@
+<?php
+if(!@$intakeOrVisit) {
+    $intakeOrVisit = 'INTAKE'; // default
+}
+$whenLabel = ($intakeOrVisit === 'INTAKE') ? 'on intake' : 'during visit';
+$epPart = ($intakeOrVisit === 'INTAKE') ? 'OnIntake' : 'DuringVisit';
+?>
 <?php if ($point->is_removed): ?>
     <?php if ($point->is_removed_due_to_entry_error): ?>
         <span class="font-weight-bold text-secondary mr-2 text-nowrap">Entry error</span>
     <?php else: ?>
-        <span class="font-weight-bold text-secondary mr-2 text-nowrap">Removed on intake</span>
+        <span class="font-weight-bold text-secondary mr-2 text-nowrap">Removed <?= $whenLabel ?></span>
     <?php endif; ?>
     <div visit-moe>
         <form show url="/api/visitPoint/undoMarkRemoved" class="mcp-theme-1">
@@ -13,15 +20,15 @@
     </div>
 <?php else: ?>
     <?php if($point->added_in_note_id === $note->id): ?>
-        <span class="font-weight-bold text-success mx-2 text-nowrap">* Added on intake</span>
+        <span class="font-weight-bold text-success mx-2 text-nowrap">* Added <?= $whenLabel ?></span>
     <?php endif; ?>
     <div visit-moe>
         <a start show href="#">Remove</a>
-        <form url="/api/visitPoint/markRemovedOnIntake" class="mcp-theme-1">
+        <form url="/api/visitPoint/markRemoved<?= $epPart ?>" class="mcp-theme-1">
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
             <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
 
-            <p class="mb-2"><b>Remove <?= $label ?> (on intake)</b></p>
+            <p class="mb-2"><b>Remove <?= $label ?> <?= $whenLabel ?></b></p>
 
             <div class="mb-2">
                 <label class="text-sm text-secondary mb-1">Removal Reason</label>
@@ -130,11 +137,11 @@
             </div>
             <div class="border-bottom">
                 <div visit-moe>
-                    <a start show href="#" class="px-2 py-1 d-block text-nowrap">Mark as added during visit</a>
-                    <form url="/api/visitPoint/markAddedDuringVisit" class="mcp-theme-1">
+                    <a start show href="#" class="px-2 py-1 d-block text-nowrap">Mark as added <?= $whenLabel ?></a>
+                    <form url="/api/visitPoint/markAdded<?= $epPart ?>" class="mcp-theme-1">
                         <input type="hidden" name="uid" value="<?= $point->uid ?>">
                         <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
-                        <p class="mb-2"><b>Mark as added during visit</b></p>
+                        <p class="mb-2"><b>Mark as added <?= $whenLabel ?></b></p>
                         <div class="mb-2">
                             <label class="text-sm text-secondary mb-1">Addition Reason</label>
                             <textarea name="additionReasonMemo" class="form-control form-control-sm" rows="2"></textarea>