|
@@ -0,0 +1,669 @@
|
|
|
|
+<?php
|
|
|
|
+
|
|
|
|
+use App\Models\Point;
|
|
|
|
+use App\Models\Client;
|
|
|
|
+use App\Models\Note;
|
|
|
|
+use App\Models\Segment;
|
|
|
|
+
|
|
|
|
+/** @var Client $patient */
|
|
|
|
+/** @var Note $note */
|
|
|
|
+
|
|
|
|
+$points = Point
|
|
|
|
+ ::where('client_id', $patient->id)
|
|
|
|
+ ->where('category', 'GOAL')
|
|
|
|
+ ->where('is_removed_due_to_entry_error', false)
|
|
|
|
+ ->orderBy('category')
|
|
|
|
+ ->orderBy('is_removed')
|
|
|
|
+ ->orderBy('removal_effective_date', 'DESC')
|
|
|
|
+ ->orderBy('created_at')
|
|
|
|
+ ->get();
|
|
|
|
+foreach ($points as $point) {
|
|
|
|
+ if ($point->data) {
|
|
|
|
+ $point->data = json_decode($point->data);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+$goals = $points;
|
|
|
|
+
|
|
|
|
+?>
|
|
|
|
+
|
|
|
|
+<div class="mt-3 p-3 border-top min-height-500px" id="goals-center-{{$note->id}}">
|
|
|
|
+ <div>
|
|
|
|
+
|
|
|
|
+ <table class="table table-sm table-bordered table-striped mb-0 bg-white mb-2">
|
|
|
|
+ <thead>
|
|
|
|
+ <tr class="">
|
|
|
|
+ <th class="border-bottom-0 text-secondary">Goal</th>
|
|
|
|
+ <th class="border-bottom-0 text-secondary">Category</th>
|
|
|
|
+ <th class="border-bottom-0 text-secondary">Active?</th>
|
|
|
|
+ <th class="border-bottom-0 text-secondary">Edit</th>
|
|
|
|
+ <th class="border-bottom-0 text-secondary">Delete</th>
|
|
|
|
+ <th class="border-bottom-0 text-secondary">Started</th>
|
|
|
|
+ <th class="border-bottom-0 text-secondary">Ended</th>
|
|
|
|
+ <th class="border-bottom-0 text-secondary">Last Review</th>
|
|
|
|
+ <th class="border-bottom-0 text-secondary">Last Plan</th>
|
|
|
|
+ </tr>
|
|
|
|
+ </thead>
|
|
|
|
+ <?php foreach($goals as $goal): ?>
|
|
|
|
+ <?php $point = $goal; ?>
|
|
|
|
+ <tr class="{{$goal->is_removed ? 'on-hover-opaque' : ''}}">
|
|
|
|
+ <td>
|
|
|
|
+ <div class="d-flex align-items-baseline">
|
|
|
|
+ @if($goal->is_removed)
|
|
|
|
+ <i class="text-warning-mellow fa fa-circle text-sm on-hover-opaque mr-2"></i>
|
|
|
|
+ @else
|
|
|
|
+ <i class="text-success fa fa-circle text-sm on-hover-opaque mr-2"></i>
|
|
|
|
+ @endif
|
|
|
|
+ <div>
|
|
|
|
+ <b><?= !!@($goal->data->goal) ? @($goal->data->goal) : '-' ?></b>
|
|
|
|
+ @if(!$goal->is_removed && $goal->added_in_note_id === $note->id)
|
|
|
|
+ <div class="mt-1 text-sm text-secondary">Added during this visit
|
|
|
|
+ @if($goal->addition_reason_category === 'ON_INTAKE')
|
|
|
|
+ (existing)
|
|
|
|
+ @elseif($goal->addition_reason_category === 'DURING_VISIT')
|
|
|
|
+ (new)
|
|
|
|
+ @endif
|
|
|
|
+ </div>
|
|
|
|
+ @endif
|
|
|
|
+ @if($goal->is_removed && ($goal->added_in_note_id !== $note->id && $goal->removed_in_note_id === $note->id))
|
|
|
|
+ <div class="mt-1 text-sm text-secondary">Discontinued during this visit</div>
|
|
|
|
+ @endif
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ <?= !!@($goal->data->category) ? @($goal->data->category) : '-' ?>
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ @if($goal->is_removed)
|
|
|
|
+ NO
|
|
|
|
+ @else
|
|
|
|
+ <b>YES</b>
|
|
|
|
+ @endif
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ @if($goal->added_in_note_id === $note->id)
|
|
|
|
+ <div moe wide>
|
|
|
|
+ <a start show href="#" title="Edit">Edit</a>
|
|
|
|
+ <form url="/api/visitPoint/updateTopLevel" class="mcp-theme-1 frm-edit-goal">
|
|
|
|
+ <input type="hidden" name="uid" value="<?= $goal->uid ?>">
|
|
|
|
+ <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
|
|
|
|
+ <p class="mb-2"><b>Update Goal</b></p>
|
|
|
|
+
|
|
|
|
+ <input type="hidden" name="data">
|
|
|
|
+
|
|
|
|
+ <input type="hidden" name="additionReasonCategory" value="{{@$goal->addition_reason_category}}">
|
|
|
|
+ <input type="hidden" name="isRemoved" value="{{@$goal->is_removed}}">
|
|
|
|
+ <input type="hidden" name="removalReasonCategory" value="{{@$goal->removal_reason_category}}">
|
|
|
|
+ <input type="hidden" name="isRemovedDueToEntryError" value="{{@$goal->is_removed_due_to_entry_error}}">
|
|
|
|
+
|
|
|
|
+ <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 {{ @($goal->data->category) === 'NUTRITION' ? 'selected' : '' }} value="NUTRITION">NUTRITION</option>
|
|
|
|
+ <option {{ @($goal->data->category) === 'ACTIVITY' ? 'selected' : '' }} value="ACTIVITY">ACTIVITY</option>
|
|
|
|
+ <option {{ @($goal->data->category) === 'SLEEP' ? 'selected' : '' }} value="SLEEP">SLEEP</option>
|
|
|
|
+ <option {{ @($goal->data->category) === 'SOCIAL CONNECTION' ? 'selected' : '' }} value="SOCIAL CONNECTION">SOCIAL CONNECTION</option>
|
|
|
|
+ <option {{ @($goal->data->category) === 'STRESS REDUCTION' ? 'selected' : '' }} value="STRESS REDUCTION">STRESS REDUCTION</option>
|
|
|
|
+ <option {{ @($goal->data->category) === 'RISKY SUBSTANCE AVOIDANCE' ? 'selected' : '' }} value="RISKY SUBSTANCE AVOIDANCE">RISKY SUBSTANCE AVOIDANCE</option>
|
|
|
|
+ <option {{ @($goal->data->category) === 'OTHER' ? 'selected' : '' }} 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>
|
|
|
|
+ <input type="text" class="form-control form-control-sm min-width-unset"
|
|
|
|
+ data-name="goal"
|
|
|
|
+ value="{{@$goal->data->goal}}">
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="mb-2">
|
|
|
|
+ <label class="text-sm text-secondary mb-0">Historic / Preexisting / New</label>
|
|
|
|
+ <select class="form-control form-control-sm additionReasonCategory_ui" name="additionReasonCategory_ui" required>
|
|
|
|
+ <option value="">-- select --</option>
|
|
|
|
+ <option value="HISTORIC" {{$goal->addition_reason_category === 'ON_INTAKE' && $goal->is_removed ? 'selected' : ''}}>Historic</option>
|
|
|
|
+ <option value="PRE_EXISTING" {{$goal->addition_reason_category === 'ON_INTAKE' && !$goal->is_removed ? 'selected' : ''}}>Preexisting</option>
|
|
|
|
+ <option value="NEW" {{$goal->addition_reason_category === 'DURING_VISIT' ? 'selected' : ''}}>New (Prescribed during this visit)</option>
|
|
|
|
+ </select>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="d-flex align-items-start">
|
|
|
|
+ <div class="w-50 mb-2">
|
|
|
|
+ <div class="start_date_ui" style="display: none">
|
|
|
|
+ <label class="text-sm text-secondary mb-0">Start Date</label>
|
|
|
|
+ <input type="date"
|
|
|
|
+ data-name="start_date"
|
|
|
|
+ class="form-control form-control-sm min-width-unset">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="w-50 pl-2 mb-2">
|
|
|
|
+ <div class="prescriber_ui" style="display: none">
|
|
|
|
+ <label class="text-sm text-secondary mb-0">Prescribed By</label>
|
|
|
|
+ <input type="text"
|
|
|
|
+ data-name="prescriber"
|
|
|
|
+ class="form-control form-control-sm min-width-unset">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="d-flex align-items-start">
|
|
|
|
+ <div class="w-50 mb-2">
|
|
|
|
+ <div class="removalEffectiveDate_ui" style="display: none">
|
|
|
|
+ <label class="text-sm text-secondary mb-0">End Date</label>
|
|
|
|
+ <input type="date"
|
|
|
|
+ name="removalEffectiveDate"
|
|
|
|
+ class="form-control form-control-sm min-width-unset">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="w-50 pl-2 mb-2">
|
|
|
|
+ <div class="removalReasonMemo_ui" style="display: none">
|
|
|
|
+ <label class="text-sm text-secondary mb-0">Removal By/Memo</label>
|
|
|
|
+ <input type="text"
|
|
|
|
+ name="removalReasonMemo"
|
|
|
|
+ class="form-control form-control-sm min-width-unset">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="mb-2">
|
|
|
|
+ <label class="text-sm text-secondary mb-1">Description</label>
|
|
|
|
+ <textarea rows="1" data-name="description" class="form-control form-control-sm">{{@$goal->data->description}}</textarea>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div>
|
|
|
|
+ <button type="submit" class="btn-save-goal btn btn-sm btn-primary mr-2">Save</button>
|
|
|
|
+ <button cancel class="btn btn-sm btn-default border">Cancel</button>
|
|
|
|
+ </div>
|
|
|
|
+ </form>
|
|
|
|
+ </div>
|
|
|
|
+ @endif
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ @if($goal->added_in_note_id === $note->id)
|
|
|
|
+ <div moe>
|
|
|
|
+ <a start show href="#" title="Delete">Delete</a>
|
|
|
|
+ <form url="/api/visitPoint/updateTopLevel" class="mcp-theme-1">
|
|
|
|
+ <input type="hidden" name="uid" value="<?= $goal->uid ?>">
|
|
|
|
+ <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
|
|
|
|
+ <input type="hidden" name="isRemoved" value="1">
|
|
|
|
+ <input type="hidden" name="isRemovedDueToEntryError" value="1">
|
|
|
|
+ <input type="hidden" name="removalReasonMemo" value="Entry Error">
|
|
|
|
+ <input type="hidden" name="removalEffectiveDate" value="<?= date('Y-m-d') ?>">
|
|
|
|
+ <p class="mb-2"><b>Delete this goal?</b></p>
|
|
|
|
+ <div>
|
|
|
|
+ <button submit class="btn btn-sm btn-danger mr-2">Delete</button>
|
|
|
|
+ <button cancel class="btn btn-sm btn-default border">Cancel</button>
|
|
|
|
+ </div>
|
|
|
|
+ </form>
|
|
|
|
+ </div>
|
|
|
|
+ @else
|
|
|
|
+ @if(!$goal->is_removed)
|
|
|
|
+ <div moe>
|
|
|
|
+ <a start show href="#" title="Discontinue">Delete</a>
|
|
|
|
+ <form url="/api/visitPoint/updateTopLevel" class="mcp-theme-1">
|
|
|
|
+ <input type="hidden" name="uid" value="<?= $goal->uid ?>">
|
|
|
|
+ <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
|
|
|
|
+ <input type="hidden" name="isRemoved" value="1">
|
|
|
|
+ <input type="hidden" name="isRemovedDueToEntryError" value="0">
|
|
|
|
+ <p class="mb-2"><b>Delete this goal?</b></p>
|
|
|
|
+ <div class="mb-2">
|
|
|
|
+ <label class="text-sm text-secondary mb-1">Already stopped / Stop now</label>
|
|
|
|
+ <select class="form-control form-control-sm" name="removalReasonCategory" required>
|
|
|
|
+ <option value="">-- select --</option>
|
|
|
|
+ <option value="ON_INTAKE">Already stopped (before this visit)</option>
|
|
|
|
+ <option value="DURING_VISIT">Stop now</option>
|
|
|
|
+ </select>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="mb-2">
|
|
|
|
+ <label class="text-sm text-secondary mb-1">Removal Reason</label>
|
|
|
|
+ <textarea name="removalReasonMemo" class="form-control form-control-sm" rows="2"></textarea>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="mb-2">
|
|
|
|
+ <label class="text-sm text-secondary mb-1">Removal Effective Date</label>
|
|
|
|
+ <input type="date" name="removalEffectiveDate"
|
|
|
|
+ value="<?= date('Y-m-d') ?>"
|
|
|
|
+ max="<?= date('Y-m-d') ?>"
|
|
|
|
+ class="form-control form-control-sm">
|
|
|
|
+ </div>
|
|
|
|
+ <div>
|
|
|
|
+ <button submit class="btn btn-sm btn-danger mr-2">Delete</button>
|
|
|
|
+ <button cancel class="btn btn-sm btn-default border">Cancel</button>
|
|
|
|
+ </div>
|
|
|
|
+ </form>
|
|
|
|
+ </div>
|
|
|
|
+ @endif
|
|
|
|
+ @endif
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ <?= !!@($goal->data->start_date) ? @($goal->data->start_date) : '-' ?>
|
|
|
|
+ @if(!!@($goal->data->prescriber))
|
|
|
|
+ <div class="mt-1 text-sm text-secondary">By: <?= !!@($goal->data->prescriber) ? @($goal->data->prescriber) : '-' ?></div>
|
|
|
|
+ @endif
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ <?= !!@($goal->removal_effective_date) ? @($goal->removal_effective_date) : '-' ?>
|
|
|
|
+ @if(!!@($goal->removal_reason_memo))
|
|
|
|
+ <div class="mt-1 text-sm text-secondary">By: <?= !!@($goal->removal_reason_memo) ? @($goal->removal_reason_memo) : '-' ?></div>
|
|
|
|
+ @endif
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ <div class="d-flex align-items-start">
|
|
|
|
+ <div class="flex-grow-1">
|
|
|
|
+ <?php
|
|
|
|
+ $point = $goal;
|
|
|
|
+ include resource_path('views/app/patient/segment-templates/_child_review/last-review.php');
|
|
|
|
+ ?>
|
|
|
|
+ </div>
|
|
|
|
+ <a class="px-2 view-review-log"
|
|
|
|
+ native target="_blank"
|
|
|
|
+ open-in-stag-popup
|
|
|
|
+ popup-style="stag-popup-md"
|
|
|
|
+ title="Review log<?= !!@($goal->data->goal) ? ' for ' . @($goal->data->goal) : '' ?>"
|
|
|
|
+ href="/point/review-log/<?= $goal->uid ?>?popupmode=1">
|
|
|
|
+ <i class="fa fa-history"></i>
|
|
|
|
+ </a>
|
|
|
|
+ </div>
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ <div class="d-flex align-items-start">
|
|
|
|
+ <div class="flex-grow-1">
|
|
|
|
+ <?php
|
|
|
|
+ include resource_path('views/app/patient/segment-templates/_child_plan/last-plan.php');
|
|
|
|
+ ?>
|
|
|
|
+ </div>
|
|
|
|
+ <a class="px-2 view-review-log"
|
|
|
|
+ native target="_blank"
|
|
|
|
+ open-in-stag-popup
|
|
|
|
+ popup-style="stag-popup-md"
|
|
|
|
+ title="Plan log<?= !!@($goal->data->goal) ? ' for ' . @($goal->data->goal) : '' ?>"
|
|
|
|
+ href="/point/plan-log/<?= $goal->uid ?>?popupmode=1">
|
|
|
|
+ <i class="fa fa-history"></i>
|
|
|
|
+ </a>
|
|
|
|
+ </div>
|
|
|
|
+ </td>
|
|
|
|
+ </tr>
|
|
|
|
+ <?php endforeach; ?>
|
|
|
|
+ </table>
|
|
|
|
+
|
|
|
|
+ <div class="d-flex align-items-center">
|
|
|
|
+ <div class="mt-1 w-100 border p-2 bg-aliceblue border-info rounded">
|
|
|
|
+ <form action="/api/visitPoint/addTopLevel" class="mcp-theme-1 w-100" id="frm-add-goal">
|
|
|
|
+ <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
|
|
|
|
+ <input type="hidden" name="category" value="GOAL">
|
|
|
|
+ <input type="hidden" name="data">
|
|
|
|
+
|
|
|
|
+ <input type="hidden" name="additionReasonCategory">
|
|
|
|
+ <input type="hidden" name="isRemoved">
|
|
|
|
+ <input type="hidden" name="removalReasonCategory">
|
|
|
|
+ <input type="hidden" name="isRemovedDueToEntryError">
|
|
|
|
+
|
|
|
|
+ <p class="mb-2"><b>Add Goal</b></p>
|
|
|
|
+
|
|
|
|
+ <div class="row">
|
|
|
|
+ <div class="col-7">
|
|
|
|
+ <div class="row mb-2">
|
|
|
|
+ <div class="col-12">
|
|
|
|
+
|
|
|
|
+ <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>
|
|
|
|
+
|
|
|
|
+ <label class="text-sm text-secondary mb-0">Goal</label>
|
|
|
|
+ <input type="text"
|
|
|
|
+ data-name="goal"
|
|
|
|
+ class="form-control form-control-sm"
|
|
|
|
+ required>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="row mb-2">
|
|
|
|
+ <div class="col-12">
|
|
|
|
+ <label class="text-sm text-secondary mb-0">Historic / Preexisting / New</label>
|
|
|
|
+ <select class="form-control form-control-sm additionReasonCategory_ui" name="additionReasonCategory_ui" required>
|
|
|
|
+ <option value="">-- select --</option>
|
|
|
|
+ <option value="HISTORIC">Historic</option>
|
|
|
|
+ <option value="PRE_EXISTING">Preexisting</option>
|
|
|
|
+ <option value="NEW">New (Prescribed during this visit)</option>
|
|
|
|
+ </select>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="d-flex align-items-start mb-2">
|
|
|
|
+ <div class="w-25">
|
|
|
|
+ <div class="start_date_ui" style="display: none">
|
|
|
|
+ <label class="text-sm text-secondary mb-0">Start Date</label>
|
|
|
|
+ <input type="date"
|
|
|
|
+ data-name="start_date"
|
|
|
|
+ class="form-control form-control-sm min-width-unset">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="w-25 pl-2">
|
|
|
|
+ <div class="prescriber_ui" style="display: none">
|
|
|
|
+ <label class="text-sm text-secondary mb-0">Prescribed By</label>
|
|
|
|
+ <input type="text"
|
|
|
|
+ data-name="prescriber"
|
|
|
|
+ class="form-control form-control-sm min-width-unset">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="w-25 pl-2">
|
|
|
|
+ <div class="removalEffectiveDate_ui" style="display: none">
|
|
|
|
+ <label class="text-sm text-secondary mb-0">End Date</label>
|
|
|
|
+ <input type="date"
|
|
|
|
+ name="removalEffectiveDate"
|
|
|
|
+ class="form-control form-control-sm min-width-unset">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="w-25 pl-2">
|
|
|
|
+ <div class="removalReasonMemo_ui" style="display: none">
|
|
|
|
+ <label class="text-sm text-secondary mb-0">Removal By/Memo</label>
|
|
|
|
+ <input type="text"
|
|
|
|
+ name="removalReasonMemo"
|
|
|
|
+ class="form-control form-control-sm min-width-unset">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="col-5 border-left">
|
|
|
|
+
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="d-flex align-items-center">
|
|
|
|
+ <button type="submit" class="btn btn-sm btn-primary mr-2 my-1">Save Goal</button>
|
|
|
|
+ </div>
|
|
|
|
+ </form>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+</div>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+ (function() {
|
|
|
|
+ function init() {
|
|
|
|
+ let parentSegment = $('#goals-center-{{$note->id}}');
|
|
|
|
+
|
|
|
|
+ parentSegment.find('select[data-name="category"]')
|
|
|
|
+ .off('change')
|
|
|
|
+ .on('change', function() {
|
|
|
|
+ $(this).closest('form').find('.help-text').addClass('d-none');
|
|
|
|
+ $(this).closest('form').find('.help-text[data-category="' + this.value + '"]').removeClass('d-none');
|
|
|
|
+ })
|
|
|
|
+ .trigger('change');
|
|
|
|
+
|
|
|
|
+ parentSegment.find('.additionReasonCategory_ui')
|
|
|
|
+ .off('change')
|
|
|
|
+ .on('change', function() {
|
|
|
|
+
|
|
|
|
+ let form = $(this).closest('form');
|
|
|
|
+
|
|
|
|
+ // additionReasonCategory
|
|
|
|
+ // isRemoved
|
|
|
|
+ // removalReasonCategory
|
|
|
|
+ form.find('[name="isRemovedDueToEntryError"]').val('0');
|
|
|
|
+
|
|
|
|
+ form.find('.start_date_ui').hide();
|
|
|
|
+ form.find('.prescriber_ui').hide();
|
|
|
|
+ form.find('.removalEffectiveDate_ui').hide();
|
|
|
|
+ form.find('.removalReasonMemo_ui').hide();
|
|
|
|
+
|
|
|
|
+ if(this.value === 'HISTORIC') {
|
|
|
|
+ form.find('[name="additionReasonCategory"]').val('ON_INTAKE');
|
|
|
|
+ form.find('[name="isRemoved"]').val('1');
|
|
|
|
+ form.find('.start_date_ui').show();
|
|
|
|
+ form.find('.prescriber_ui').show();
|
|
|
|
+ form.find('.removalEffectiveDate_ui').show();
|
|
|
|
+ form.find('.removalReasonMemo_ui').show();
|
|
|
|
+ }
|
|
|
|
+ else if(this.value === 'PRE_EXISTING') {
|
|
|
|
+ form.find('[name="additionReasonCategory"]').val('ON_INTAKE');
|
|
|
|
+ form.find('[name="isRemoved"]').val('0');
|
|
|
|
+ form.find('.start_date_ui').show();
|
|
|
|
+ form.find('.prescriber_ui').show();
|
|
|
|
+ }
|
|
|
|
+ else if(this.value === 'NEW') {
|
|
|
|
+ form.find('[name="additionReasonCategory"]').val('DURING_VISIT');
|
|
|
|
+ form.find('[name="isRemoved"]').val('0');
|
|
|
|
+ form.find('.start_date_ui').show().find('input').val('{{date('Y-m-d')}}');
|
|
|
|
+ form.find('.prescriber_ui').show().find('input').val('{{$note->hcpPro->displayName()}}');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ parentSegment.find('#frm-add-goal')
|
|
|
|
+ .off('submit')
|
|
|
|
+ .on('submit', function () {
|
|
|
|
+
|
|
|
|
+ let form = $(this);
|
|
|
|
+
|
|
|
|
+ if (!form[0].checkValidity()) {
|
|
|
|
+ form[0].reportValidity();
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // add [data-name] values to payload
|
|
|
|
+ let dataField = form.find('[name="data"]').first();
|
|
|
|
+ let parsed = null;
|
|
|
|
+ if(dataField.val()) {
|
|
|
|
+ parsed = JSON.parse(dataField.val());
|
|
|
|
+ }
|
|
|
|
+ form.find('[data-name]').each(function() {
|
|
|
|
+ if(!parsed) parsed = {};
|
|
|
|
+
|
|
|
|
+ let keys = $(this).attr('data-name').split('->');
|
|
|
|
+ let currentNode = parsed;
|
|
|
|
+ for (let i = 0; i < keys.length; i++) {
|
|
|
|
+ if(i !== keys.length - 1) {
|
|
|
|
+ if(typeof currentNode[keys[i]] === 'undefined') {
|
|
|
|
+ currentNode[keys[i]] = {};
|
|
|
|
+ }
|
|
|
|
+ currentNode = currentNode[keys[i]];
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ if($(this).is(':checkbox')) {
|
|
|
|
+ currentNode[keys[i]] = $(this).prop('checked');
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ currentNode[keys[i]] = $(this).val();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ if(parsed) {
|
|
|
|
+ dataField.val(JSON.stringify(parsed));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $.post(form.attr('action'), form.serialize(), _data => {
|
|
|
|
+ if(!hasResponseError(_data)) {
|
|
|
|
+ hideMask();
|
|
|
|
+ refreshDynamicStagPopup();
|
|
|
|
+ $('.visit-segment[data-segment-template-name="intake_goals"]').find('.refresh-segment').trigger('click');
|
|
|
|
+ }
|
|
|
|
+ }, 'json');
|
|
|
|
+ return false;
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ parentSegment.find('.frm-edit-goal')
|
|
|
|
+ .off('submit')
|
|
|
|
+ .on('submit', function () {
|
|
|
|
+
|
|
|
|
+ let form = $(this);
|
|
|
|
+
|
|
|
|
+ if (!form[0].checkValidity()) {
|
|
|
|
+ form[0].reportValidity();
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // add [data-name] values to payload
|
|
|
|
+ let dataField = form.find('[name="data"]').first();
|
|
|
|
+ let parsed = null;
|
|
|
|
+ if(dataField.val()) {
|
|
|
|
+ parsed = JSON.parse(dataField.val());
|
|
|
|
+ }
|
|
|
|
+ form.find('[data-name]').each(function() {
|
|
|
|
+ if(!parsed) parsed = {};
|
|
|
|
+
|
|
|
|
+ let keys = $(this).attr('data-name').split('->');
|
|
|
|
+ let currentNode = parsed;
|
|
|
|
+ for (let i = 0; i < keys.length; i++) {
|
|
|
|
+ if(i !== keys.length - 1) {
|
|
|
|
+ if(typeof currentNode[keys[i]] === 'undefined') {
|
|
|
|
+ currentNode[keys[i]] = {};
|
|
|
|
+ }
|
|
|
|
+ currentNode = currentNode[keys[i]];
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ if($(this).is(':checkbox')) {
|
|
|
|
+ currentNode[keys[i]] = $(this).prop('checked');
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ currentNode[keys[i]] = $(this).val();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ if(parsed) {
|
|
|
|
+ dataField.val(JSON.stringify(parsed));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $.post(form.attr('url'), form.serialize(), _data => {
|
|
|
|
+ if(!hasResponseError(_data)) {
|
|
|
|
+ hideMask();
|
|
|
|
+ refreshDynamicStagPopup();
|
|
|
|
+ $('.visit-segment[data-segment-template-name="intake_goals"]').find('.refresh-segment').trigger('click');
|
|
|
|
+ }
|
|
|
|
+ }, 'json');
|
|
|
|
+ return false;
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ initStagSuggest();
|
|
|
|
+
|
|
|
|
+ $('.additionReasonCategory_ui').trigger('change');
|
|
|
|
+ }
|
|
|
|
+ addMCInitializer('goals-center-{{$note->id}}', init, '#goals-center-{{$note->id}}')
|
|
|
|
+ }).call(window);
|
|
|
|
+</script>
|