|
@@ -11,6 +11,16 @@ use \App\Models\Segment;
|
|
|
|
|
|
$goals = Point::getIntakePointsOfCategory($patient, 'GOAL', $note);
|
|
|
|
|
|
+$relevance = Point::where('added_in_segment_id', $segment->id)
|
|
|
+ ->where('category', 'GOALS_RELEVANT_TO_NOTE_ON_INTAKE')
|
|
|
+ ->orderBy('id', 'DESC')->first();
|
|
|
+if (!!@$relevance->data) {
|
|
|
+ $relevance = json_decode($relevance->data, true);
|
|
|
+}
|
|
|
+else {
|
|
|
+ $relevance = [];
|
|
|
+}
|
|
|
+
|
|
|
?>
|
|
|
<div>
|
|
|
|
|
@@ -18,6 +28,7 @@ $goals = Point::getIntakePointsOfCategory($patient, 'GOAL', $note);
|
|
|
<table class="table table-sm table-bordered table-striped mb-0 bg-white">
|
|
|
<thead>
|
|
|
<tr class="">
|
|
|
+ <th class="border-bottom-0 width-100px text-info">Relevant to<br>this visit</th>
|
|
|
<th class="border-bottom-0">Category</th>
|
|
|
<th class="border-bottom-0">Goal</th>
|
|
|
<th class="border-bottom-0">Most Recent Review</th>
|
|
@@ -30,6 +41,13 @@ $goals = Point::getIntakePointsOfCategory($patient, 'GOAL', $note);
|
|
|
<?php if(@($goal->data->category)): ?>
|
|
|
<?php $point = $goal; ?>
|
|
|
<tr>
|
|
|
+ <td class="p-0">
|
|
|
+ <label class="d-flex align-items-center px-2 py-1 m-0 c-pointer">
|
|
|
+ <input type="checkbox" class="m-0 chk-relevance"
|
|
|
+ data-uid="{{$goal->uid}}" {{in_array($goal->uid, $relevance) ? 'checked' : ''}}>
|
|
|
+ <span> </span>
|
|
|
+ </label>
|
|
|
+ </td>
|
|
|
<td>
|
|
|
<?php if($previousCategory === $goal->data->category): ?>
|
|
|
<span class="text-secondary"><?= $goal->data->category ?></span>
|
|
@@ -196,99 +214,109 @@ $goals = Point::getIntakePointsOfCategory($patient, 'GOAL', $note);
|
|
|
</table>
|
|
|
</div>
|
|
|
|
|
|
- <div visit-moe class="mt-1">
|
|
|
- <a href="#" start show class="btn btn-sm btn btn-outline-primary">+ Add goal patient is ALREADY having, prior to this visit</a>
|
|
|
- <form url="/api/visitPoint/addTopLevelOnIntake" class="mcp-theme-1 max-width-500px min-width-500px">
|
|
|
- <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
|
|
|
- <input type="hidden" name="category" value="GOAL">
|
|
|
- <input type="hidden" name="data">
|
|
|
-
|
|
|
- <p class="mb-2"><b>Add Goal (on intake)</b></p>
|
|
|
-
|
|
|
- <div class="mb-2">
|
|
|
- <label class="text-sm text-secondary mb-1">Category</label>
|
|
|
- <select type="text" data-name="category" class="form-control form-control-sm">
|
|
|
- <option value="">-- select --</option>
|
|
|
- <option value="NUTRITION">NUTRITION</option>
|
|
|
- <option value="ACTIVITY">ACTIVITY</option>
|
|
|
- <option value="SLEEP">SLEEP</option>
|
|
|
- <option value="SOCIAL CONNECTION">SOCIAL CONNECTION</option>
|
|
|
- <option value="STRESS REDUCTION">STRESS REDUCTION</option>
|
|
|
- <option value="RISKY SUBSTANCE AVOIDANCE">RISKY SUBSTANCE AVOIDANCE</option>
|
|
|
- <option value="OTHER">OTHER</option>
|
|
|
- </select>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="bg-light border mb-2 p-2 help-text d-none" data-category="NUTRITION">
|
|
|
- <div class="mb-1">Specific - What specific food would you like to add/change?</div>
|
|
|
- <div class="mb-1">Measurable - How much or how many will you add or change?</div>
|
|
|
- <div class="mb-1">Attainable - Do you have what it takes to follow through?</div>
|
|
|
- <div class="mb-1">Realistic - What can you do? (improvement over perfection)</div>
|
|
|
- <div class="mb-2">Time-Connected - How often or for how long will you make this change?</div>
|
|
|
- <div class="font-italic"><b>Example:</b> "I will add 1 cup of berries to breakfast and a small apple or orange as an afternoon snack at least five days this week."</div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="bg-light border mb-2 p-2 help-text d-none" data-category="ACTIVITY">
|
|
|
- <div class="mb-1">Specific - What specific activity would you like to add/change?</div>
|
|
|
- <div class="mb-1">Measurable - How much activity, how many sessions?</div>
|
|
|
- <div class="mb-1">Attainable - Do you have what it takes to follow through?</div>
|
|
|
- <div class="mb-1">Realistic - What can you actually do? (know your limits, start small, build)</div>
|
|
|
- <div class="mb-2">Time-Connected - How frequent or how long will you do the activity?</div>
|
|
|
- <div class="font-italic"><b>Example:</b> "I will walk with a friend or family member for at least 20 minutes after dinner, every weekday for the next two months."</div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="bg-light border mb-2 p-2 help-text d-none" data-category="SLEEP">
|
|
|
- <div class="mb-1">Specific - What are you going to do to improve your sleep quality/quantity?</div>
|
|
|
- <div class="mb-1">Measurable - How much time, how many sessions?</div>
|
|
|
- <div class="mb-1">Attainable - Do you have what it takes to follow through?</div>
|
|
|
- <div class="mb-1">Realistic - What can you actually do? (improvement over perfection)</div>
|
|
|
- <div class="mb-2">Time-Connected - How frequent? How long will you commit?</div>
|
|
|
- <div class="font-italic"><b>Example:</b> "I will begin a new bedtime routine of shutting off the television and instead, read a book for at least 30 minutes before bed, four nights this week."</div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="bg-light border mb-2 p-2 help-text d-none" data-category="SOCIAL CONNECTION">
|
|
|
- <div class="mb-1">Specific - What are you going to do to improve feelings of connectedness?</div>
|
|
|
- <div class="mb-1">Measurable - How much time, how many sessions?</div>
|
|
|
- <div class="mb-1">Attainable - Do you have what it takes to follow through?</div>
|
|
|
- <div class="mb-1">Realistic - What can you actually do? (improvement over perfection)</div>
|
|
|
- <div class="mb-2">Time-Connected - How frequent? How long will you commit?</div>
|
|
|
- <div class="font-italic"><b>Example:</b> "I will increase my feeling of social connectedness by joining a group fitness class that meets for an hour, three nights of the week."</div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="bg-light border mb-2 p-2 help-text d-none" data-category="STRESS REDUCTION">
|
|
|
- <div class="mb-1">Specific - What are you going to do to manage your stress?</div>
|
|
|
- <div class="mb-1">Measurable - How much time, how many sessions?</div>
|
|
|
- <div class="mb-1">Attainable - Do you have what it takes to follow through?</div>
|
|
|
- <div class="mb-1">Realistic - What can you actually do? (improvement over perfection)</div>
|
|
|
- <div class="mb-2">Time-Connected - How frequent? How long will you commit?</div>
|
|
|
- <div class="font-italic"><b>Example:</b> "I will write about what I am thankful for at least 10 minutes three times per week."</div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="bg-light border mb-2 p-2 help-text d-none" data-category="RISKY SUBSTANCE AVOIDANCE">
|
|
|
- <div class="mb-1">Specific - What are you going to do to decrease your substance use?</div>
|
|
|
- <div class="mb-1">Measurable - How much will you reduce it by?</div>
|
|
|
- <div class="mb-1">Attainable - Do you have what it takes to follow through?</div>
|
|
|
- <div class="mb-1">Realistic - What can you actually do? (improvement over perfection)</div>
|
|
|
- <div class="mb-2">Time-Connected - How frequent? How long will you commit?</div>
|
|
|
- <div class="font-italic"><b>Example:</b> "I will swap my morning cigarette with chewing gum at least 5 days this week for the next four weeks. I will ask my partner to help keep me on track and use the free texting service for more support."</div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="bg-light border mb-2 p-2 help-text d-none" data-category="OTHER">
|
|
|
- <div class="">Ensure that the goal is Specific, Measurable, Attainable, Realistic and Time-Connected.</div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="mb-2">
|
|
|
- <label class="text-sm text-secondary mb-1">Goal</label>
|
|
|
- <div note-rte
|
|
|
- class="form-group mb-2 border-left border-right rte-holder"
|
|
|
- data-field-name="goal"></div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div>
|
|
|
- <button submit class="btn btn-sm btn-primary mr-2">Submit</button>
|
|
|
- <button cancel class="btn btn-sm btn-default border">Cancel</button>
|
|
|
- </div>
|
|
|
- </form>
|
|
|
+ <div class="d-flex align-items-center">
|
|
|
+ <div visit-moe>
|
|
|
+ <form start show url="/api/visitPoint/upsertNoteSingleton" class="d-none" id="<?= $segment->uid ?>-relevance-form">
|
|
|
+ <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
|
|
|
+ <input type="hidden" name="category" value="GOALS_RELEVANT_TO_NOTE_ON_INTAKE">
|
|
|
+ <input type="hidden" name="data">
|
|
|
+ <button submit class="btn btn-sm btn-info font-weight-bold">Save Relevance</button>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ <div visit-moe large class="mt-1 w-100 border p-2 bg-white rounded">
|
|
|
+ <!--<a href="#" start show class="btn btn-sm btn btn-outline-primary">+ Add goal patient is ALREADY having, prior to this visit</a>-->
|
|
|
+ <form show url="/api/visitPoint/addTopLevelOnIntake" class="mcp-theme-1 w-100">
|
|
|
+ <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
|
|
|
+ <input type="hidden" name="category" value="GOAL">
|
|
|
+ <input type="hidden" name="data">
|
|
|
+
|
|
|
+ <p class="mb-2"><b>Add Goal (on intake)</b></p>
|
|
|
+
|
|
|
+ <div class="mb-2">
|
|
|
+ <label class="text-sm text-secondary mb-1">Category</label>
|
|
|
+ <select type="text" data-name="category" class="form-control form-control-sm">
|
|
|
+ <option value="">-- select --</option>
|
|
|
+ <option value="NUTRITION">NUTRITION</option>
|
|
|
+ <option value="ACTIVITY">ACTIVITY</option>
|
|
|
+ <option value="SLEEP">SLEEP</option>
|
|
|
+ <option value="SOCIAL CONNECTION">SOCIAL CONNECTION</option>
|
|
|
+ <option value="STRESS REDUCTION">STRESS REDUCTION</option>
|
|
|
+ <option value="RISKY SUBSTANCE AVOIDANCE">RISKY SUBSTANCE AVOIDANCE</option>
|
|
|
+ <option value="OTHER">OTHER</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="bg-light border mb-2 p-2 help-text d-none" data-category="NUTRITION">
|
|
|
+ <div class="mb-1">Specific - What specific food would you like to add/change?</div>
|
|
|
+ <div class="mb-1">Measurable - How much or how many will you add or change?</div>
|
|
|
+ <div class="mb-1">Attainable - Do you have what it takes to follow through?</div>
|
|
|
+ <div class="mb-1">Realistic - What can you do? (improvement over perfection)</div>
|
|
|
+ <div class="mb-2">Time-Connected - How often or for how long will you make this change?</div>
|
|
|
+ <div class="font-italic"><b>Example:</b> "I will add 1 cup of berries to breakfast and a small apple or orange as an afternoon snack at least five days this week."</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="bg-light border mb-2 p-2 help-text d-none" data-category="ACTIVITY">
|
|
|
+ <div class="mb-1">Specific - What specific activity would you like to add/change?</div>
|
|
|
+ <div class="mb-1">Measurable - How much activity, how many sessions?</div>
|
|
|
+ <div class="mb-1">Attainable - Do you have what it takes to follow through?</div>
|
|
|
+ <div class="mb-1">Realistic - What can you actually do? (know your limits, start small, build)</div>
|
|
|
+ <div class="mb-2">Time-Connected - How frequent or how long will you do the activity?</div>
|
|
|
+ <div class="font-italic"><b>Example:</b> "I will walk with a friend or family member for at least 20 minutes after dinner, every weekday for the next two months."</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="bg-light border mb-2 p-2 help-text d-none" data-category="SLEEP">
|
|
|
+ <div class="mb-1">Specific - What are you going to do to improve your sleep quality/quantity?</div>
|
|
|
+ <div class="mb-1">Measurable - How much time, how many sessions?</div>
|
|
|
+ <div class="mb-1">Attainable - Do you have what it takes to follow through?</div>
|
|
|
+ <div class="mb-1">Realistic - What can you actually do? (improvement over perfection)</div>
|
|
|
+ <div class="mb-2">Time-Connected - How frequent? How long will you commit?</div>
|
|
|
+ <div class="font-italic"><b>Example:</b> "I will begin a new bedtime routine of shutting off the television and instead, read a book for at least 30 minutes before bed, four nights this week."</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="bg-light border mb-2 p-2 help-text d-none" data-category="SOCIAL CONNECTION">
|
|
|
+ <div class="mb-1">Specific - What are you going to do to improve feelings of connectedness?</div>
|
|
|
+ <div class="mb-1">Measurable - How much time, how many sessions?</div>
|
|
|
+ <div class="mb-1">Attainable - Do you have what it takes to follow through?</div>
|
|
|
+ <div class="mb-1">Realistic - What can you actually do? (improvement over perfection)</div>
|
|
|
+ <div class="mb-2">Time-Connected - How frequent? How long will you commit?</div>
|
|
|
+ <div class="font-italic"><b>Example:</b> "I will increase my feeling of social connectedness by joining a group fitness class that meets for an hour, three nights of the week."</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="bg-light border mb-2 p-2 help-text d-none" data-category="STRESS REDUCTION">
|
|
|
+ <div class="mb-1">Specific - What are you going to do to manage your stress?</div>
|
|
|
+ <div class="mb-1">Measurable - How much time, how many sessions?</div>
|
|
|
+ <div class="mb-1">Attainable - Do you have what it takes to follow through?</div>
|
|
|
+ <div class="mb-1">Realistic - What can you actually do? (improvement over perfection)</div>
|
|
|
+ <div class="mb-2">Time-Connected - How frequent? How long will you commit?</div>
|
|
|
+ <div class="font-italic"><b>Example:</b> "I will write about what I am thankful for at least 10 minutes three times per week."</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="bg-light border mb-2 p-2 help-text d-none" data-category="RISKY SUBSTANCE AVOIDANCE">
|
|
|
+ <div class="mb-1">Specific - What are you going to do to decrease your substance use?</div>
|
|
|
+ <div class="mb-1">Measurable - How much will you reduce it by?</div>
|
|
|
+ <div class="mb-1">Attainable - Do you have what it takes to follow through?</div>
|
|
|
+ <div class="mb-1">Realistic - What can you actually do? (improvement over perfection)</div>
|
|
|
+ <div class="mb-2">Time-Connected - How frequent? How long will you commit?</div>
|
|
|
+ <div class="font-italic"><b>Example:</b> "I will swap my morning cigarette with chewing gum at least 5 days this week for the next four weeks. I will ask my partner to help keep me on track and use the free texting service for more support."</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="bg-light border mb-2 p-2 help-text d-none" data-category="OTHER">
|
|
|
+ <div class="">Ensure that the goal is Specific, Measurable, Attainable, Realistic and Time-Connected.</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="mb-2">
|
|
|
+ <label class="text-sm text-secondary mb-1">Goal</label>
|
|
|
+ <div note-rte
|
|
|
+ class="form-group mb-2 border-left border-right rte-holder"
|
|
|
+ data-field-name="goal"></div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <button submit class="btn btn-sm btn-primary mr-2">Submit</button>
|
|
|
+ <button cancel class="btn btn-sm btn-default border">Cancel</button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
@@ -305,5 +333,39 @@ $goals = Point::getIntakePointsOfCategory($patient, 'GOAL', $note);
|
|
|
$(this).closest('form').find('.help-text[data-category="' + this.value + '"]').removeClass('d-none');
|
|
|
});
|
|
|
|
|
|
+ // relevance
|
|
|
+ $(document).off('change', '[data-segment-template-name="<?= $segment->segmentTemplate->internal_name ?>"] .chk-relevance');
|
|
|
+ $(document).on('change', '[data-segment-template-name="<?= $segment->segmentTemplate->internal_name ?>"] .chk-relevance', function () {
|
|
|
+ let uids = $('#<?= $segment->uid ?>-relevance-form').find('[name="data"]').val();
|
|
|
+ if(!!uids) {
|
|
|
+ uids = JSON.parse(uids);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ uids = [];
|
|
|
+ }
|
|
|
+ let uid = $(this).attr('data-uid'), found = uids.indexOf(uid) > -1;
|
|
|
+ if(this.checked === found) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(this.checked) {
|
|
|
+ uids.push(uid);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ uids = uids.filter(_x => _x !== uid);
|
|
|
+ }
|
|
|
+ $('#<?= $segment->uid ?>-relevance-form').find('[name="data"]').val(JSON.stringify(uids));
|
|
|
+
|
|
|
+ // auto save
|
|
|
+ $('#<?= $segment->uid ?>-relevance-form [submit]').trigger('click');
|
|
|
+
|
|
|
+ return false;
|
|
|
+ });
|
|
|
+
|
|
|
+ // pre-fill relevance data
|
|
|
+ let uids = [];
|
|
|
+ $('[data-segment-template-name="<?= $segment->segmentTemplate->internal_name ?>"] .chk-relevance:checked').each(function() {
|
|
|
+ uids.push($(this).attr('data-uid'));
|
|
|
+ });
|
|
|
+ $('#<?= $segment->uid ?>-relevance-form').find('[name="data"]').val(JSON.stringify(uids));
|
|
|
};
|
|
|
</script>
|