|
@@ -4,6 +4,10 @@ use App\Models\Point;
|
|
|
|
|
|
$category = 'COVID_FOLLOW-UP';
|
|
$category = 'COVID_FOLLOW-UP';
|
|
|
|
|
|
|
|
+if(!@$sessionKey) {
|
|
|
|
+ $sessionKey = request()->cookie('sessionKey');
|
|
|
|
+}
|
|
|
|
+
|
|
$point = Point::getOrCreateOnlyTopLevelPointOfCategory($note, $category, $sessionKey, true);
|
|
$point = Point::getOrCreateOnlyTopLevelPointOfCategory($note, $category, $sessionKey, true);
|
|
|
|
|
|
$contentData = [
|
|
$contentData = [
|
|
@@ -50,7 +54,7 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
|
|
$submitFormUrl = '/api/visitPoint/upsertChildReview';
|
|
$submitFormUrl = '/api/visitPoint/upsertChildReview';
|
|
|
|
|
|
?>
|
|
?>
|
|
-<div visit-moe close-on-save close-on-cancel class="d-block p-3">
|
|
|
|
|
|
+<div id="covid-follow-up-{{$note->id}}" visit-moe close-on-save close-on-cancel class="d-block p-3 popup-content-container">
|
|
<form id="visitNoteForm" show url="{{ $submitFormUrl }}" class="mcp-theme-1">
|
|
<form id="visitNoteForm" show url="{{ $submitFormUrl }}" class="mcp-theme-1">
|
|
<input type="hidden" name="uid" value="<?= $point->uid ?>">
|
|
<input type="hidden" name="uid" value="<?= $point->uid ?>">
|
|
<input type="hidden" name="noteUid" value="<?= $note->uid ?>">
|
|
<input type="hidden" name="noteUid" value="<?= $note->uid ?>">
|
|
@@ -500,6 +504,7 @@ $submitFormUrl = '/api/visitPoint/upsertChildReview';
|
|
// PHQ
|
|
// PHQ
|
|
|
|
|
|
(function() {
|
|
(function() {
|
|
|
|
+ @if(@$segment->segmentTemplate && @$segment->segmentTemplate->internal_name)
|
|
window.segmentInitializers.covidFollowUp = function() {
|
|
window.segmentInitializers.covidFollowUp = function() {
|
|
var covidFollowUp = {
|
|
var covidFollowUp = {
|
|
parentSegment: $('[data-segment-template-name="<?= $segment->segmentTemplate->internal_name ?>"] '),
|
|
parentSegment: $('[data-segment-template-name="<?= $segment->segmentTemplate->internal_name ?>"] '),
|
|
@@ -527,5 +532,35 @@ $submitFormUrl = '/api/visitPoint/upsertChildReview';
|
|
};
|
|
};
|
|
covidFollowUp.init();
|
|
covidFollowUp.init();
|
|
};
|
|
};
|
|
|
|
+ @endif
|
|
|
|
+
|
|
|
|
+ addMCInitializer('covid-follow-up-{{$note->id}}', function() {
|
|
|
|
+ var covidFollowUp = {
|
|
|
|
+ parentSegment: $('#covid-follow-up-{{$note->id}}'),
|
|
|
|
+ initAutoCheckAll: function() {
|
|
|
|
+ var self = this;
|
|
|
|
+ var checkSegments = $('[check-all]');
|
|
|
|
+ $.each(checkSegments, function(i, segment) {
|
|
|
|
+ var target = $(segment).data('target');
|
|
|
|
+ var allChildrenCheckboxes = self.parentSegment.find('input[type=checkbox][' + target + ']');
|
|
|
|
+ $(segment).click(function() {
|
|
|
|
+ var checkAllInput = this;
|
|
|
|
+ var isChecked = checkAllInput.checked ? true : false;
|
|
|
|
+ allChildrenCheckboxes.attr('checked', isChecked);
|
|
|
|
+ });
|
|
|
|
+ var allCheckedChildrenCheckboxes = self.parentSegment.find('input[type=checkbox][' + target + ']:checked');
|
|
|
|
+ if (allChildrenCheckboxes.length === allCheckedChildrenCheckboxes.length) {
|
|
|
|
+ $(segment).attr('checked', true);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ init: function() {
|
|
|
|
+ $('div[moe] form').hide();
|
|
|
|
+ this.initAutoCheckAll();
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ covidFollowUp.init();
|
|
|
|
+ }, '#covid-follow-up-{{$note->id}}');
|
|
}).call(window);
|
|
}).call(window);
|
|
</script>
|
|
</script>
|