Parcourir la source

Rx wizard allow 'discontinue' even if added in note

Vijayakrishnan il y a 3 ans
Parent
commit
c22951a665
1 fichiers modifiés avec 37 ajouts et 2 suppressions
  1. 37 2
      resources/views/app/patient/medications-center.blade.php

+ 37 - 2
resources/views/app/patient/medications-center.blade.php

@@ -42,8 +42,15 @@ $medications = $points;
                 <th class="border-bottom-0 text-secondary">Last Plan</th>
             </tr>
             </thead>
+            <?php $prevRowRemoved = -1; ?>
             <?php foreach($medications as $medication): ?>
             <?php $point = $medication; ?>
+            @if($prevRowRemoved !== -1 && $prevRowRemoved !== $medication->is_removed)
+                <tr>
+                    <td colspan="9" class="px-0 pt-1 pb-0 on-hover-opaque bg-secondary"></td>
+                </tr>
+            @endif
+            <?php $prevRowRemoved = $medication->is_removed; ?>
             <tr class="{{$medication->is_removed ? 'on-hover-opaque' : ''}}">
                 <td>
                     <div class="d-flex align-items-baseline">
@@ -183,7 +190,7 @@ $medications = $points;
                 </td>
                 <td>
                     @if($medication->added_in_note_id === $note->id)
-                        <div moe>
+                        <div moe class="d-block">
                             <a start show href="#" title="Delete">Delete</a>
                             <form url="/api/visitPoint/updateTopLevel" class="mcp-theme-1">
                                 <input type="hidden" name="uid" value="<?= $medication->uid ?>">
@@ -199,6 +206,34 @@ $medications = $points;
                                 </div>
                             </form>
                         </div>
+                        @if(!$medication->is_removed)
+                            <div moe class="d-block">
+                                <a start show href="#" title="Discontinue">Discontinue</a>
+                                <form url="/api/visitPoint/updateTopLevel" class="mcp-theme-1">
+                                    <input type="hidden" name="uid" value="<?= $medication->uid ?>">
+                                    <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
+                                    <input type="hidden" name="isRemoved" value="1">
+                                    <input type="hidden" name="isRemovedDueToEntryError" value="0">
+                                    <input type="hidden" name="removalReasonCategory" value="DURING_VISIT">
+                                    <p class="mb-2"><b>Stop this medication?</b></p>
+                                    <div class="mb-2">
+                                        <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">Removal Effective Date</label>
+                                        <input type="date" name="removalEffectiveDate"
+                                               value="<?= date('Y-m-d') ?>"
+                                               max="<?= date('Y-m-d') ?>"
+                                               class="form-control form-control-sm">
+                                    </div>
+                                    <div>
+                                        <button submit class="btn btn-sm btn-danger mr-2">Stop</button>
+                                        <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                                    </div>
+                                </form>
+                            </div>
+                        @endif
                     @else
                         @if(!$medication->is_removed)
                             <div moe>
@@ -229,7 +264,7 @@ $medications = $points;
                                                class="form-control form-control-sm">
                                     </div>
                                     <div>
-                                        <button submit class="btn btn-sm btn-danger mr-2">Delete</button>
+                                        <button submit class="btn btn-sm btn-danger mr-2">Discontinue</button>
                                         <button cancel class="btn btn-sm btn-default border">Cancel</button>
                                     </div>
                                 </form>