Sfoglia il codice sorgente

Common > remove-undo logic fix

Vijayakrishnan 3 anni fa
parent
commit
c7cae0be38

+ 5 - 3
resources/views/app/patient/segment-templates/_common_actions/remove-undo.php

@@ -4,6 +4,8 @@ if(!@$intakeOrVisit) {
 }
 $whenLabel = ($intakeOrVisit === 'INTAKE') ? 'on intake' : 'during visit';
 $epPart = ($intakeOrVisit === 'INTAKE') ? 'OnIntake' : 'DuringVisit';
+$whenNotLabel = ($intakeOrVisit === 'INTAKE') ? 'during visit' : 'on intake';
+$epNotPart = ($intakeOrVisit === 'INTAKE') ? 'DuringVisit' : 'OnIntake';
 ?>
 <?php if ($point->is_removed): ?>
     <?php if ($point->is_removed_due_to_entry_error): ?>
@@ -137,11 +139,11 @@ $epPart = ($intakeOrVisit === 'INTAKE') ? 'OnIntake' : 'DuringVisit';
             </div>
             <div class="border-bottom">
                 <div visit-moe>
-                    <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">
+                    <a start show href="#" class="px-2 py-1 d-block text-nowrap">Mark as added <?= $whenNotLabel ?></a>
+                    <form url="/api/visitPoint/markAdded<?= $epNotPart ?>" 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 <?= $whenLabel ?></b></p>
+                        <p class="mb-2"><b>Mark as added <?= $whenNotLabel ?></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>

+ 1 - 3
resources/views/app/patient/segment-templates/plan_medications/edit.blade.php

@@ -10,6 +10,7 @@ use App\Models\Segment;
 /** @var Segment $segment */
 
 $medications = Point::getPlanPointsOfCategory($patient, 'MEDICATION', $note);
+$intakeOrVisit = 'PLAN';
 
 ?>
 <div>
@@ -39,7 +40,6 @@ $medications = Point::getPlanPointsOfCategory($patient, 'MEDICATION', $note);
                                 <?php
                                 $point = $medication;
                                 $label = 'Medication';
-                                $intakeOrVisit = 'PLAN';
                                 include resource_path('views/app/patient/segment-templates/_common_actions/remove-undo.php');
                                 ?>
                             </div>
@@ -48,14 +48,12 @@ $medications = Point::getPlanPointsOfCategory($patient, 'MEDICATION', $note);
                     <td>
                         <?php
                         $point = $medication;
-                        $intakeOrVisit = 'PLAN';
                         include resource_path('views/app/patient/segment-templates/_child_review/last-review.php');
                         ?>
                     </td>
                     <td>
                         <?php
                         $point = $medication;
-                        $intakeOrVisit = 'PLAN';
                         include resource_path('views/app/patient/segment-templates/_child_review/edit-review.php');
                         ?>
                     </td>

+ 2 - 2
resources/views/app/patient/segment-templates/plan_medications/summary.blade.php

@@ -20,9 +20,9 @@ $medications = Point::getPlanPointsOfCategory($patient, 'MEDICATION', $note);
                 <?= !!@($medication->data->frequency) ? '/&nbsp;' . @($medication->data->frequency) : '' ?>
             </div>
             <?php if ($medication->is_removed): ?>
-                <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                <span class="ml-2 text-sm text-secondary">Removed during visit</span>
             <?php elseif ($medication->added_in_note_id === $note->id): ?>
-                <span class="ml-2 text-sm text-success">* Added on intake</span>
+                <span class="ml-2 text-sm text-success">* Added during visit</span>
             <?php endif; ?>
         </div>
     <?php endforeach; ?>