Sfoglia il codice sorgente

Visit UI - medication logic fixes

Vijayakrishnan 3 anni fa
parent
commit
77a96d4806

+ 22 - 11
resources/views/app/patient/segment-templates/intake_medications/edit.php

@@ -49,8 +49,12 @@ foreach ($medications as $medication) {
                             </div>
                             <div class="ml-auto d-inline-flex align-items-baseline pr-2">
                                 <?php if ($medication->is_removed): ?>
-                                    <span class="font-weight-bold text-secondary">Removed on intake</span>
-                                    <div visit-moe class="ml-2">
+                                    <?php if ($medication->is_removed_due_to_entry_error): ?>
+                                        <span class="font-weight-bold text-secondary" class="mr-2">Entry error</span>
+                                    <?php else: ?>
+                                        <span class="font-weight-bold text-secondary" class="mr-2">Removed on intake</span>
+                                    <?php endif; ?>
+                                    <div visit-moe>
                                         <form show url="/api/visitPoint/undoMarkRemoved" class="mcp-theme-1">
                                             <input type="hidden" name="uid" value="<?= $medication->uid ?>">
                                             <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
@@ -58,8 +62,11 @@ foreach ($medications as $medication) {
                                         </form>
                                     </div>
                                 <?php else: ?>
+                                    <?php if($medication->added_in_note_id === $note->id): ?>
+                                        <span class="font-weight-bold text-success mr-2">* Added on intake</span>
+                                    <?php endif; ?>
                                     <div visit-moe>
-                                        <a start show href>Remove</a>
+                                        <a start show href="#">Remove</a>
                                         <form url="/api/visitPoint/markRemovedOnIntake" class="mcp-theme-1">
                                             <input type="hidden" name="uid" value="<?= $medication->uid ?>">
                                             <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
@@ -70,14 +77,18 @@ foreach ($medications as $medication) {
                                                 <label class="text-sm text-secondary mb-1">Removal Reason</label>
                                                 <textarea name="removalReasonMemo" class="form-control form-control-sm" rows="2"></textarea>
                                             </div>
-                                            <div class="mb-2">
-                                                <label class="text-sm text-secondary mb-1">Is Entry Error?  *</label>
-                                                <select name="isRemovedDueToEntryError" class="form-control form-control-sm" required>
-                                                    <option value="">-- select --</option>
-                                                    <option value="1">Yes</option>
-                                                    <option value="0">No</option>
-                                                </select>
-                                            </div>
+                                            <?php if($medication->added_in_note_id === $note->id): ?>
+                                                <div class="mb-2">
+                                                    <label class="text-sm text-secondary mb-1">Is Entry Error?  *</label>
+                                                    <select name="isRemovedDueToEntryError" class="form-control form-control-sm" required>
+                                                        <option value="">-- select --</option>
+                                                        <option value="1" selected>Yes</option>
+                                                        <option value="0">No</option>
+                                                    </select>
+                                                </div>
+                                            <?php else: ?>
+                                                <input type="hidden" name="isRemovedDueToEntryError" value="0">
+                                            <?php endif; ?>
                                             <div class="mb-2">
                                                 <label class="text-sm text-secondary mb-1">Removal Effective Date</label>
                                                 <input type="date" name="removalEffectiveDate"

+ 4 - 1
resources/views/app/patient/segment-templates/intake_medications/summary.php

@@ -13,6 +13,7 @@ $medications = Point
             ->where('is_removed', false)
             ->orWhere(function ($query2) use ($note) {
                 $query2->where('is_removed', true)
+                    ->where('is_removed_due_to_entry_error', false)
                     ->where('removed_in_note_id', $note->id);
             });
     })
@@ -39,7 +40,9 @@ foreach ($medications as $medication) {
                 <?= !!@($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 on intake</span>
+            <?php elseif ($medication->added_in_note_id === $note->id): ?>
+                <span class="ml-2 text-sm text-success">* Added on intake</span>
             <?php endif; ?>
         </div>
     <?php endforeach; ?>