Prechádzať zdrojové kódy

ERx list - include/exclude cancelled filter

Vijayakrishnan 3 rokov pred
rodič
commit
6ff346e71b

+ 11 - 1
resources/views/app/patient/prescriptions/list.blade.php

@@ -25,6 +25,12 @@
         @else
             <span class="ml-3 text-warning-mellow">MCP not set on the patient</span>
         @endif
+        <div class="ml-5 width-200px">
+            <select class="form-control form-control-sm" v-model="includeCancelled">
+                <option value="">Exclude Cancelled</option>
+                <option value="include-cancelled">Include Cancelled</option>
+            </select>
+        </div>
     </div>
     <div class="d-flex align-items-start bg-white">
         <div :class="currentPrescription ? 'max-width-300px' : 'flex-grow-1'">
@@ -40,7 +46,9 @@
                 </tr>
                 </thead>
                 <tbody>
-                <tr v-for="(prescription, index) in prescriptions" :class="currentPrescription && currentPrescription.id === prescription.id ? 'bg-aliceblue' : ''">
+                <tr v-for="(prescription, index) in prescriptions"
+                    v-if="includeCancelled === 'include-cancelled' || prescription.pro_declared_status !== 'CANCELLED'"
+                    :class="currentPrescription && currentPrescription.id === prescription.id ? 'bg-aliceblue' : ''">
                     <td class="width-150px" :class="currentPrescription && currentPrescription.id === prescription.id ? 'row-selection-highlight' : ''">
                         <div :class="prescription.pro_declared_status === 'CANCELLED' ? 'on-hover-opaque' : ''">
                             <a href="#" v-on:click.prevent="setCurrentPrescription(prescription, '');"
@@ -497,6 +505,8 @@ GROUP BY erx_category");
                 delimiters: ['@{{', '}}'],
                 data: {
 
+                    includeCancelled: '',
+
                     prescriptions: <?= json_encode($prescriptions) ?>,
 
                     numUnsigned: <?= json_encode($uCounts) ?>,