|
@@ -0,0 +1,180 @@
|
|
|
|
+<?php
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+Format:
|
|
|
|
+{
|
|
|
|
+ weighInsPerWeek: number,
|
|
|
|
+ tracking: {
|
|
|
|
+ calorieIntake: bool,
|
|
|
|
+ dailyCarbIntake: bool,
|
|
|
|
+ portionSize: bool,
|
|
|
|
+ eatingSpeed: bool,
|
|
|
|
+ other: bool
|
|
|
|
+ otherDetail: text
|
|
|
|
+ },
|
|
|
|
+ foodMonitoring: {
|
|
|
|
+ phoneTracker: bool,
|
|
|
|
+ dailyFoodLog: bool
|
|
|
|
+ }
|
|
|
|
+ memo: text
|
|
|
|
+}
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+$currentValue = '';
|
|
|
|
+$previousValue = '';
|
|
|
|
+$previousChildReview = null;
|
|
|
|
+if (@$point) {
|
|
|
|
+ if ($point->lastChildReview && $point->last_child_review_point_scoped_note_id === $note->id) {
|
|
|
|
+ $currentValue = json_decode($point->lastChildReview->data);
|
|
|
|
+ $previousChildReview = \App\Models\Point::where('id', '<', $point->lastChildReview->id)
|
|
|
|
+ ->where('category', 'REVIEW')
|
|
|
|
+ ->where('parent_point_id', $point->id)
|
|
|
|
+ ->orderBy('id', 'DESC')
|
|
|
|
+ ->first();
|
|
|
|
+ if($previousChildReview && $previousChildReview->data) {
|
|
|
|
+ $previousValue = json_decode($previousChildReview->data);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ $previousChildReview = \App\Models\Point::where('parent_point_id', $point->id)
|
|
|
|
+ ->where('category', 'REVIEW')
|
|
|
|
+ ->orderBy('id', 'DESC')
|
|
|
|
+ ->first();
|
|
|
|
+ if($previousChildReview && $previousChildReview->data) {
|
|
|
|
+ $previousValue = json_decode($previousChildReview->data);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+?>
|
|
|
|
+<div visit-moe fixed-center largest relative class="d-inline">
|
|
|
|
+ <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Subjective' : 'Add Subjective'?>">
|
|
|
|
+ <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
|
|
|
|
+ </a>
|
|
|
|
+ <form url="/api/visitPoint/<?= $point ? 'upsertChildReview' : 'addTopLevel' ?>"
|
|
|
|
+ class="mcp-theme-1 frm-review-plan-lifestyle frm-review-plan-behavior" right>
|
|
|
|
+
|
|
|
|
+ <?php if($point): ?>
|
|
|
|
+ <input type="hidden" name="uid" value="<?= $point->uid ?>">
|
|
|
|
+ <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
|
|
|
|
+ <?php else: ?>
|
|
|
|
+ <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
|
|
|
|
+ <input type="hidden" name="category" value="<?= $p['category'] ?>">
|
|
|
|
+ <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
|
|
|
|
+ <?php endif; ?>
|
|
|
|
+
|
|
|
|
+ <?php if ($point): ?>
|
|
|
|
+ <input type="hidden" name="data">
|
|
|
|
+ <?php else: ?>
|
|
|
|
+ <input type="hidden" name="childReviewData">
|
|
|
|
+ <?php endif; ?>
|
|
|
|
+
|
|
|
|
+ <?php if($previousValue): ?>
|
|
|
|
+ <div class="mb-2">
|
|
|
|
+ <div class="d-flex align-items-baseline mb-1">
|
|
|
|
+ <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>)</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="p-2 bg-light border inline-html-container">
|
|
|
|
+ <?php $review = $previousValue; ?>
|
|
|
|
+ <?php include(resource_path('views/app/patient/segment-templates/_child_review/behavior/' . $p['category'] . '/view-review.php')); ?>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <?php endif; ?>
|
|
|
|
+
|
|
|
|
+ <p class="mb-2"><b>Self Monitoring</b></p>
|
|
|
|
+
|
|
|
|
+ <div class="mb-2 d-flex align-items-center">
|
|
|
|
+ <label class="my-0 mr-2">Current number of weigh-ins per week:</label>
|
|
|
|
+ <input type="text" data-name="weighInsPerWeek" class="form-control form-control-sm min-width-unset width-100px" value="<?= @($currentValue->weighInsPerWeek) ?>">
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="mb-2">
|
|
|
|
+ <label class="mb-2 font-weight-bold text-secondary">Currently tracking:</label>
|
|
|
|
+ <div class="row mb-1">
|
|
|
|
+ <div class="col-4">
|
|
|
|
+ <label class="d-flex align-items-center mb-1">
|
|
|
|
+ <input type="checkbox" data-name="tracking->calorieIntake" <?= @($currentValue->tracking->calorieIntake) ? 'checked' : ''?>>
|
|
|
|
+ <span class="ml-2">Calorie Intake</span>
|
|
|
|
+ </label>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="col-4">
|
|
|
|
+ <label class="d-flex align-items-center mb-1">
|
|
|
|
+ <input type="checkbox" data-name="tracking->dailyCarbIntake" <?= @($currentValue->tracking->dailyCarbIntake) ? 'checked' : ''?>>
|
|
|
|
+ <span class="ml-2">Daily Carb Intake</span>
|
|
|
|
+ </label>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="col-4">
|
|
|
|
+ <label class="d-flex align-items-center mb-1">
|
|
|
|
+ <input type="checkbox" data-name="tracking->portionSize" <?= @($currentValue->tracking->portionSize) ? 'checked' : ''?>>
|
|
|
|
+ <span class="ml-2">Portion Size</span>
|
|
|
|
+ </label>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="row">
|
|
|
|
+ <div class="col-4">
|
|
|
|
+ <label class="d-flex align-items-center mb-1">
|
|
|
|
+ <input type="checkbox" data-name="tracking->eatingSpeed" <?= @($currentValue->tracking->eatingSpeed) ? 'checked' : ''?>>
|
|
|
|
+ <span class="ml-2">Eating Speed</span>
|
|
|
|
+ </label>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="col-8">
|
|
|
|
+ <label class="d-flex align-items-center mb-1">
|
|
|
|
+ <input type="checkbox" data-name="tracking->other" <?= @($currentValue->tracking->other) ? 'checked' : ''?>>
|
|
|
|
+ <span class="ml-2">Other</span>
|
|
|
|
+ <input if-tracking-other type="text" class="form-control form-control-sm min-width-unset flex-grow-1 ml-2" data-name="tracking->otherDetail" value="<?= @($currentValue->tracking->otherDetail) ?>">
|
|
|
|
+ </label>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="mb-2">
|
|
|
|
+ <label class="mb-2 font-weight-bold text-secondary">Current food monitoring:</label>
|
|
|
|
+ <div class="row">
|
|
|
|
+ <div class="col-4">
|
|
|
|
+ <label class="d-flex align-items-center mb-1">
|
|
|
|
+ <input type="checkbox" data-name="foodMonitoring->phoneTracker" <?= @($currentValue->foodMonitoring->phoneTracker) ? 'checked' : ''?>>
|
|
|
|
+ <img src="/img/behavior-rx/phone-tracker.png" class="icon-nutrition-rx-md mx-2">
|
|
|
|
+ <span class="">Phone Tracker</span>
|
|
|
|
+ </label>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="col-4">
|
|
|
|
+ <label class="d-flex align-items-center mb-1">
|
|
|
|
+ <input type="checkbox" data-name="foodMonitoring->dailyFoodLog" <?= @($currentValue->foodMonitoring->dailyFoodLog) ? 'checked' : ''?>>
|
|
|
|
+ <img src="/img/behavior-rx/food-log.png" class="icon-nutrition-rx-md mx-2">
|
|
|
|
+ <span class="">Daily Food Log</span>
|
|
|
|
+ </label>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="mb-2">
|
|
|
|
+ <label for="" class="mb-1">Memo</label>
|
|
|
|
+ <div note-rte slim-rte
|
|
|
|
+ class="form-group mb-2 border-left border-right rte-holder"
|
|
|
|
+ data-container-name="<?= $point ? 'data' : 'childReviewData' ?>"
|
|
|
|
+ data-field-name="memo"><?= @($currentValue->memo) ?></div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div>
|
|
|
|
+ <button type="submit" class="btn btn-sm btn-primary mr-2">Save</button>
|
|
|
|
+ <button cancel class="btn btn-sm btn-default border">Cancel</button>
|
|
|
|
+ </div>
|
|
|
|
+ </form>
|
|
|
|
+</div>
|
|
|
|
+<?php if(!empty($currentValue)): ?>
|
|
|
|
+ <div visit-moe relative class="d-inline">
|
|
|
|
+ <a start show href="#" class="px-1 text-center d-block" title="Delete Subjective">
|
|
|
|
+ <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
|
|
|
|
+ </a>
|
|
|
|
+ <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1" right>
|
|
|
|
+ <input type="hidden" name="uid" value="<?= $point->uid ?>">
|
|
|
|
+
|
|
|
|
+ <p class="mb-2">Delete this subjective?</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>
|
|
|
|
+<?php endif; ?>
|
|
|
|
+
|