|
@@ -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);
|
|
|
|
|
|
?>
|
|
|
|