@@ -837,4 +837,11 @@ ORDER BY m.ts DESC
public function coreNote(){
return $this->hasOne(Note::class, 'id', 'core_note_id');
}
+
+ public function nonCoreVisitNotes() {
+ return $this->hasMany(Note::class, 'client_id', 'id')
+ ->where('id', '<>', $this->core_note_id)
+ ->whereNotNull('visit_template_id')
+ ->orderBy('created_at', 'desc');
+ }
@@ -27,6 +27,9 @@
<?php $vitalLabels = ['Ht. (in.)','Wt. (lbs.)','Temp. (F)','Pulse','Resp.','Pulse Ox.','SBP','DBP','Smoking Status', 'BMI']; ?>
<?php $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_create($patient->created_at))->invert === 1); ?>
+ <?php $nonCoreVisitNotes = $patient->nonCoreVisitNotes; ?>
+ <?php $disallowPointEdits = $nonCoreVisitNotes && count($nonCoreVisitNotes); ?>
<div class="row client-single-dashboard">
<div class="col-6">
@@ -2,12 +2,13 @@
$allergies = \App\Models\Point::getPointsOfCategory($patient, "ALLERGY");
?>
<div class="pt-2 mt-2">
- <div class="d-flex align-items-center pb-2">
+ <div class="d-flex align-items-baseline pb-2">
<h6 class="my-0 font-weight-bold text-secondary">Allergies</h6>
@if($isOldClient)
<div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
@endif
@if($patient->coreNote)
+ @if(!@$disallowPointEdits)
<a native target="_blank"
class="c-pointer d-inline-flex align-items-center ml-3 text-decoration-none"
open-in-stag-popup
@@ -19,6 +20,9 @@ $allergies = \App\Models\Point::getPointsOfCategory($patient, "ALLERGY");
<i class="fa fa-bolt mr-1"></i>
<span>Manage</span>
</a>
+ @else
+ <span class="text-secondary text-sm ml-3">Editable from within notes.</span>
+ @endif
</div>
<div class="bg-light border p-2 mb-3 point-content">
@@ -8,6 +8,7 @@ $careTeamMembers = \App\Models\Point::getPointsOfCategory($patient, "CARE_TEAM_M
@@ -19,6 +20,9 @@ $careTeamMembers = \App\Models\Point::getPointsOfCategory($patient, "CARE_TEAM_M
@@ -8,6 +8,7 @@ $problems = \App\Models\Point::getPointsOfCategory($patient, "PROBLEM");
@@ -19,6 +20,9 @@ $problems = \App\Models\Point::getPointsOfCategory($patient, "PROBLEM");
@@ -8,6 +8,7 @@ $medications = \App\Models\Point::getPointsOfCategory($patient, "MEDICATION");
@@ -19,6 +20,9 @@ $medications = \App\Models\Point::getPointsOfCategory($patient, "MEDICATION");