소스 검색

Visit UI - meds on intake - query update

Vijayakrishnan 3 년 전
부모
커밋
fc7eb9f055
1개의 변경된 파일1개의 추가작업 그리고 21개의 파일을 삭제
  1. 1 21
      resources/views/app/patient/segment-templates/intake_medications/summary.blade.php

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

@@ -4,27 +4,7 @@ use App\Models\Point;
 
 /** @var \App\Models\Client $patient */
 
-$medications = Point
-    ::where('client_id', $patient->id)
-    ->where('category', 'MEDICATION')
-    ->where('addition_reason_category', 'ON_INTAKE')
-    ->where(function ($query1) use ($note) {
-        $query1
-            ->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);
-            });
-    })
-    ->orderBy('created_at')
-    ->get();
-
-foreach ($medications as $medication) {
-    if ($medication->data) {
-        $medication->data = json_decode($medication->data);
-    }
-}
+$medications = Point::getIntakePointsOfCategory($patient, 'MEDICATION', $note);
 
 ?>