Browse Source

Don't show entry error points

Vijayakrishnan 3 years ago
parent
commit
b64dfa9891

+ 2 - 0
app/Models/Point.php

@@ -94,6 +94,7 @@ class Point extends Model
         $points = Point
             ::where('client_id', $_patient->id)
             ->where('category', $_category)
+            ->where('is_removed_due_to_entry_error', false)
             ->where(function ($query1) use ($_note) {
                 $query1
                     ->where('addition_reason_category', 'ON_INTAKE')
@@ -124,6 +125,7 @@ class Point extends Model
         $points = Point
             ::where('client_id', $_patient->id)
             ->where('category', $_category)
+            ->where('is_removed_due_to_entry_error', false)
             ->where(function ($query1) use ($_note) {
                 $query1
                     ->where('is_removed', false)

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

@@ -11,9 +11,9 @@ $epNotPart = ($intakeOrVisit === 'INTAKE') ? 'DuringVisit' : 'OnIntake';
     <?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: ?>
-        <?php if($medication->removal_reason_category === 'DURING_VISIT'): ?>
+        <?php if($point->removal_reason_category === 'DURING_VISIT'): ?>
         <span class="ont-weight-bold text-secondary mr-2 text-nowrap">Removed during visit</span>
-        <?php elseif($medication->removal_reason_category === 'ON_INTAKE'): ?>
+        <?php elseif($point->removal_reason_category === 'ON_INTAKE'): ?>
         <span class="ont-weight-bold text-secondary mr-2 text-nowrap">Removed on intake</span>
         <?php endif; ?>
     <?php endif; ?>