|
@@ -4,30 +4,21 @@ use App\Models\Point;
|
|
|
|
|
|
/** @var \App\Models\Client $patient */
|
|
|
|
|
|
-list($problems, $counts) = Point::getPointsOfCategoryExtended($patient, 'PROBLEM', $note);
|
|
|
-
|
|
|
+$points = Point::getPlanPointsOfCategory($patient, 'PROBLEM', $note);
|
|
|
$numRelevant = 0;
|
|
|
$numVisible = 0;
|
|
|
-$numRelevantWithICD = 0;
|
|
|
+$plural = 'Problems';
|
|
|
?>
|
|
|
|
|
|
-<?php if (!count($problems)): ?>
|
|
|
- <div class="text-secondary">No problems</div>
|
|
|
+<?php if (!count($points)): ?>
|
|
|
+ <div class="text-secondary">No {{$plural}}</div>
|
|
|
<?php else: ?>
|
|
|
- <?php foreach ($problems as $problem): ?>
|
|
|
- <?php if($problem->is_removed && $problem->is_removed_due_to_entry_error) continue; ?>
|
|
|
- <?php $rel = $problem->relevanceToNote($note); ?>
|
|
|
- <?php $review = $problem->childPlanAddedInNote($note); ?>
|
|
|
- <?php $hpi = $problem->childReviewAddedInNote($note); ?>
|
|
|
-
|
|
|
- <!--show only if: relevant || added-in-note || removed-in-note || added-plan-in-note-->
|
|
|
- @if($rel ||
|
|
|
- (!$problem->is_removed && $problem->added_in_note_id === $note->id) ||
|
|
|
- ($problem->is_removed && $problem->removed_in_note_id === $note->id) ||
|
|
|
- !!$review
|
|
|
- )
|
|
|
-
|
|
|
- <?php $numVisible++; ?>
|
|
|
+ <?php foreach ($points as $point): ?>
|
|
|
+ <?php if($point->is_removed && $point->is_removed_due_to_entry_error) continue; ?>
|
|
|
+ <?php $rel = $point->relevanceToNote($note); ?>
|
|
|
+ <?php $plan = $point->lastChildPlan; ?>
|
|
|
+ <?php if($plan && @($plan->data)) $plan->data = json_decode($plan->data); ?>
|
|
|
+ <?php $numVisible++; ?>
|
|
|
<div class="mb-2">
|
|
|
<div class="d-flex align-items-baseline">
|
|
|
@if($rel)
|
|
@@ -35,65 +26,44 @@ $numRelevantWithICD = 0;
|
|
|
<i class="fa fa-star"></i>
|
|
|
</span>
|
|
|
<?php $numRelevant++; ?>
|
|
|
- @if(!!@($problem->data->icd) && !!$hpi)
|
|
|
- <?php $numRelevantWithICD++; ?>
|
|
|
- @endif
|
|
|
@endif
|
|
|
- <div class="<?= $problem->is_removed ? 'strike-through' : '' ?> <?= !$rel ? 'on-hover-opaque' : '' ?>">
|
|
|
- <b><?= !!@($problem->data->name) ? @($problem->data->name) : '-' ?></b>
|
|
|
- <?= !!@($problem->data->icd) ? '/ ' . @($problem->data->icd) : '' ?>
|
|
|
- <?= !!@($problem->data->description) ? '/ ' . @($problem->data->description) : '' ?>
|
|
|
+ <div class="<?= $point->is_removed ? 'strike-through' : '' ?>">
|
|
|
+ <b><?= !!@($point->data->name) ? @($point->data->name) : '-' ?></b>
|
|
|
</div>
|
|
|
- <?php if ($problem->is_removed): ?>
|
|
|
- @if($problem->removal_reason_category === 'DURING_VISIT')
|
|
|
+ <?php if ($point->is_removed): ?>
|
|
|
+ @if($point->removal_reason_category === 'DURING_VISIT')
|
|
|
<span class="ml-2 text-sm text-secondary">Removed during visit</span>
|
|
|
- @elseif($problem->removal_reason_category === 'ON_INTAKE')
|
|
|
+ @elseif($point->removal_reason_category === 'ON_INTAKE')
|
|
|
<span class="ml-2 text-sm text-secondary">Removed on intake</span>
|
|
|
@endif
|
|
|
- <?php elseif ($problem->added_in_note_id === $note->id): ?>
|
|
|
- <?php if ($problem->addition_reason_category === 'DURING_VISIT'): ?>
|
|
|
+ <?php elseif ($point->added_in_note_id === $note->id): ?>
|
|
|
+ <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>
|
|
|
<span class="ml-2 text-sm text-success">* Added during visit</span>
|
|
|
<?php else: ?>
|
|
|
<span class="ml-2 text-sm text-info">* Added on intake</span>
|
|
|
<?php endif;?>
|
|
|
<?php endif; ?>
|
|
|
</div>
|
|
|
- <?php if(!!$hpi): ?>
|
|
|
- <div class="pl-3 mt-1">
|
|
|
- <div class="text-secondary font-weight-bold">HPI</div>
|
|
|
- <div>{!! $hpi->data && @($hpi->data->value) ? $hpi->data->value : '-' !!}</div>
|
|
|
+ <?php if(!!$plan): ?>
|
|
|
+ <div class="pl-3 mt-1 d-flex align-items-baseline">
|
|
|
+ <span class="text-secondary font-weight-bold mr-2">Plan:</span>
|
|
|
+ <span>{!! $plan->data->value !!}</span>
|
|
|
</div>
|
|
|
<?php elseif($rel): ?>
|
|
|
- <div class="relevant-without-review block-signing text-danger text-sm mt-1" data-target-segment="<?= $segment->segmentTemplate->internal_name ?>">
|
|
|
- <i class="fa fa-exclamation-triangle mr-1"></i>HPI missing
|
|
|
- </div>
|
|
|
- <?php endif; ?>
|
|
|
- <?php if(!!$review): ?>
|
|
|
- <div class="pl-3 mt-1">
|
|
|
- <div class="text-secondary font-weight-bold">Plan</div>
|
|
|
- <div>{!! @$review->data->value !!}</div>
|
|
|
- </div>
|
|
|
- <?php elseif($rel && !$problem->is_removed): ?>
|
|
|
- <div class="relevant-without-plan block-signing text-danger text-sm mt-1" data-target-segment="<?= $segment->segmentTemplate->internal_name ?>">
|
|
|
- <i class="fa fa-exclamation-triangle mr-1"></i>Plan missing
|
|
|
- </div>
|
|
|
+ <div class="relevant-without-plan text-warning-mellow text-sm mt-1" data-target-segment="<?= $segment->segmentTemplate->internal_name ?>"><i class="fa fa-exclamation-triangle mr-1"></i>Plan missing</div>
|
|
|
<?php endif; ?>
|
|
|
</div>
|
|
|
- @endif
|
|
|
<?php endforeach; ?>
|
|
|
@if(!$numVisible)
|
|
|
<div class="d-flex align-items-baseline mr-1">
|
|
|
- <span class="text-secondary">No problems</span>
|
|
|
+ <span class="text-secondary">No {{$plural}}</span>
|
|
|
</div>
|
|
|
@endif
|
|
|
@if($numRelevant)
|
|
|
<div class="d-flex align-items-baseline text-info mr-1 mt-3">
|
|
|
<span class="text-sm mr-1"><i class="fa fa-star text-sm"></i></span>
|
|
|
- <span class="text-sm">Problems relevant to this note</span>
|
|
|
+ <span class="text-sm">{{$plural}} relevant to this note</span>
|
|
|
</div>
|
|
|
@endif
|
|
|
- @if(!$numRelevantWithICD)
|
|
|
- <div class="no-relevant-with-icd block-signing text-danger mt-1 text-sm" data-target-segment="<?= $segment->segmentTemplate->internal_name ?>"><i class="fa fa-exclamation-triangle mr-1"></i>Need at least 1 relevant problem (with ICD) with associated Subjective/HPI before the note can be signed</div>
|
|
|
- @endif
|
|
|
<?php endif; ?>
|
|
|
|