|
@@ -8,20 +8,7 @@ use App\Models\Segment;
|
|
/** @var Client $patient */
|
|
/** @var Client $patient */
|
|
/** @var Note $note */
|
|
/** @var Note $note */
|
|
|
|
|
|
-$points = Point
|
|
|
|
- ::where('client_id', $patient->id)
|
|
|
|
- ->where('category', 'MEDICATION')
|
|
|
|
- ->where('is_removed_due_to_entry_error', false)
|
|
|
|
- ->orderBy('is_removed')
|
|
|
|
- ->orderBy('removal_effective_date', 'DESC')
|
|
|
|
- ->orderBy('created_at')
|
|
|
|
- ->get();
|
|
|
|
-foreach ($points as $point) {
|
|
|
|
- if ($point->data) {
|
|
|
|
- $point->data = json_decode($point->data);
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-$medications = $points;
|
|
|
|
|
|
+$medications = Point::getPointsOfCategoryExtended($patient, 'MEDICATION', $note);
|
|
|
|
|
|
?>
|
|
?>
|
|
|
|
|
|
@@ -43,15 +30,15 @@ $medications = $points;
|
|
<th class="border-bottom-0 text-secondary w-25">Review</th>
|
|
<th class="border-bottom-0 text-secondary w-25">Review</th>
|
|
</tr>
|
|
</tr>
|
|
</thead>
|
|
</thead>
|
|
- <?php $prevRowRemoved = -1; ?>
|
|
|
|
|
|
+ <?php $prevRowState = -1; ?>
|
|
<?php foreach($medications as $medication): ?>
|
|
<?php foreach($medications as $medication): ?>
|
|
<?php $point = $medication; ?>
|
|
<?php $point = $medication; ?>
|
|
- @if($prevRowRemoved !== -1 && $prevRowRemoved !== $medication->is_removed)
|
|
|
|
|
|
+ @if($prevRowState !== -1 && $prevRowState !== $medication->state)
|
|
<tr>
|
|
<tr>
|
|
<td colspan="10" class="px-0 pt-1 pb-0 on-hover-opaque bg-secondary"></td>
|
|
<td colspan="10" class="px-0 pt-1 pb-0 on-hover-opaque bg-secondary"></td>
|
|
</tr>
|
|
</tr>
|
|
@endif
|
|
@endif
|
|
- <?php $prevRowRemoved = $medication->is_removed; ?>
|
|
|
|
|
|
+ <?php $prevRowState = $medication->state; ?>
|
|
<?php $rel = $medication->relevanceToNote($note); ?>
|
|
<?php $rel = $medication->relevanceToNote($note); ?>
|
|
<tr class="{{$medication->is_removed ? '' : ''}}">
|
|
<tr class="{{$medication->is_removed ? '' : ''}}">
|
|
@if($patient->core_note_id !== $note->id)
|
|
@if($patient->core_note_id !== $note->id)
|
|
@@ -71,10 +58,14 @@ $medications = $points;
|
|
@endif
|
|
@endif
|
|
<td>
|
|
<td>
|
|
<div class="d-flex align-items-baseline">
|
|
<div class="d-flex align-items-baseline">
|
|
- @if($medication->is_removed)
|
|
|
|
- <i class="text-warning-mellow fa fa-circle text-sm on-hover-opaque mr-2"></i>
|
|
|
|
- @else
|
|
|
|
|
|
+ @if($medication->state === 1)
|
|
<i class="text-success fa fa-circle text-sm on-hover-opaque mr-2 active-record"></i>
|
|
<i class="text-success fa fa-circle text-sm on-hover-opaque mr-2 active-record"></i>
|
|
|
|
+ @elseif($medication->state === 2)
|
|
|
|
+ <i class="text-info fa fa-circle text-sm on-hover-opaque mr-2 active-record"></i>
|
|
|
|
+ @elseif($medication->state === 3)
|
|
|
|
+ <i class="text-warning-mellow fa fa-circle text-sm on-hover-opaque mr-2 active-record"></i>
|
|
|
|
+ @elseif($medication->state === 4)
|
|
|
|
+ <i class="text-secondary fa fa-circle text-sm on-hover-opaque mr-2"></i>
|
|
@endif
|
|
@endif
|
|
<div>
|
|
<div>
|
|
<b><?= !!@($medication->data->name) ? @($medication->data->name) : '-' ?></b>
|
|
<b><?= !!@($medication->data->name) ? @($medication->data->name) : '-' ?></b>
|