|
@@ -9,6 +9,7 @@ use App\Models\Segment;
|
|
|
/** @var Note $note */
|
|
|
|
|
|
list($allergies, $counts) = Point::getPointsOfCategoryExtended($patient, 'ALLERGY', $note);
|
|
|
+$numActiveItems = Point::getNumPointsOfCategory($patient, 'ALLERGY');
|
|
|
?>
|
|
|
|
|
|
<div class="mt-3 p-3 border-top" id="allergies-center-{{$note->id}}">
|
|
@@ -26,12 +27,12 @@ list($allergies, $counts) = Point::getPointsOfCategoryExtended($patient, 'ALLERG
|
|
|
<label class="border border-info d-inline-flex align-items-center my-0 mr-3 p-2 rounded">
|
|
|
<input type="checkbox" class="tracker-input mr-2"
|
|
|
{{$tracker && @($tracker->data->no_known_allergies_of_any_type) ? 'checked' : ''}}
|
|
|
- data-field-name="no_known_allergies_of_any_type">
|
|
|
+ data-field-name="no_known_allergies_of_any_type"
|
|
|
+ data-num-active-items="{{$numActiveItems}}">
|
|
|
<span>No Known Allergies of Any Type</span>
|
|
|
</label>
|
|
|
</div>
|
|
|
|
|
|
- @if(!$tracker || !@($tracker->data->no_known_allergies_of_any_type))
|
|
|
<table class="table table-sm table-bordered mb-0 bg-white mb-2">
|
|
|
<thead>
|
|
|
<tr class="">
|
|
@@ -230,7 +231,7 @@ list($allergies, $counts) = Point::getPointsOfCategoryExtended($patient, 'ALLERG
|
|
|
</form>
|
|
|
</div>
|
|
|
</div>
|
|
|
- @endif
|
|
|
+
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
@@ -260,6 +261,11 @@ list($allergies, $counts) = Point::getPointsOfCategoryExtended($patient, 'ALLERG
|
|
|
|
|
|
initSegmentMoes($('#allergies-center-{{$note->id}}'));
|
|
|
__initRTEs(parentSegment.find('[note-rte]:not(.ql-container)'));
|
|
|
+
|
|
|
+ // if there are active items, and it is marked NKAM, auto-unmark it
|
|
|
+ @if($numActiveItems && $tracker && @($tracker->data->no_known_allergies_of_any_type))
|
|
|
+ parentSegment.find('[data-field-name="no_known_allergies_of_any_type"]').prop('checked', false).trigger('change');
|
|
|
+ @endif
|
|
|
}
|
|
|
addMCInitializer('allergies-center-{{$note->id}}', init, '#allergies-center-{{$note->id}}');
|
|
|
}).call(window);
|