|
@@ -1,21 +1,31 @@
|
|
<?php
|
|
<?php
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+Format:
|
|
|
|
+{
|
|
|
|
+ active: true/false,
|
|
|
|
+ muscleStrengthening: true/false,
|
|
|
|
+ allMajorMuscleGroups: true/false,
|
|
|
|
+ reps: number,
|
|
|
|
+ sets: number,
|
|
|
|
+ resistanceBandsBodyWeight: true/false,
|
|
|
|
+ memo: text
|
|
|
|
+}
|
|
|
|
+ */
|
|
|
|
+
|
|
$currentValue = '';
|
|
$currentValue = '';
|
|
$previousValue = '';
|
|
$previousValue = '';
|
|
$previousChildReview = null;
|
|
$previousChildReview = null;
|
|
if (@$point) {
|
|
if (@$point) {
|
|
if ($point->lastChildReview && $point->last_child_review_point_scoped_note_id === $note->id) {
|
|
if ($point->lastChildReview && $point->last_child_review_point_scoped_note_id === $note->id) {
|
|
- $parsedReview = json_decode($point->lastChildReview->data);
|
|
|
|
- if(@$parsedReview->value) {
|
|
|
|
- $currentValue = $parsedReview->value;
|
|
|
|
- $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) {
|
|
|
|
- $parsedReview = json_decode($previousChildReview->data);
|
|
|
|
- $previousValue = $parsedReview->value;
|
|
|
|
- }
|
|
|
|
|
|
+ $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 {
|
|
else {
|
|
@@ -24,79 +34,87 @@ if (@$point) {
|
|
->orderBy('id', 'DESC')
|
|
->orderBy('id', 'DESC')
|
|
->first();
|
|
->first();
|
|
if($previousChildReview && $previousChildReview->data) {
|
|
if($previousChildReview && $previousChildReview->data) {
|
|
- $parsedReview = json_decode($previousChildReview->data);
|
|
|
|
- if(@$parsedReview->value) {
|
|
|
|
- $previousValue = $parsedReview->value;
|
|
|
|
- }
|
|
|
|
|
|
+ $previousValue = json_decode($previousChildReview->data);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
?>
|
|
?>
|
|
-<div moe wide class="d-inline">
|
|
|
|
|
|
+<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'?>">
|
|
<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>
|
|
<i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
|
|
</a>
|
|
</a>
|
|
- <?php if($point): ?>
|
|
|
|
- <form url="/api/visitPoint/upsertChildReview" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
|
|
|
|
|
|
+ <form url="/api/visitPoint/<?= $point ? 'upsertChildReview' : 'addTopLevel' ?>"
|
|
|
|
+ class="mcp-theme-1 frm-review-plan-exercise" right>
|
|
|
|
+
|
|
|
|
+ <?php if($point): ?>
|
|
<input type="hidden" name="uid" value="<?= $point->uid ?>">
|
|
<input type="hidden" name="uid" value="<?= $point->uid ?>">
|
|
<input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
|
|
<input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
|
|
- <input type="hidden" name="data">
|
|
|
|
-
|
|
|
|
- <?php if($segment->segmentTemplate->internal_name === 'intake_problems' && $previousValue): ?>
|
|
|
|
- <div class="d-none disallow-if-value-same-as"><?= str_compact($previousValue) ?></div>
|
|
|
|
- <?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) ?>) (click to copy)</span>
|
|
|
|
- </div>
|
|
|
|
- <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
|
|
|
|
- </div>
|
|
|
|
- <?php endif; ?>
|
|
|
|
-
|
|
|
|
- <p class="mb-2"><b>Current Daily Calories</b></p>
|
|
|
|
-
|
|
|
|
- <div class="mb-2">
|
|
|
|
- <div note-rte
|
|
|
|
- <?= $segment->segmentTemplate->internal_name === 'intake_problems' ? 'use-shortcuts="hpi,user"' : '' ?>
|
|
|
|
- class="form-group mb-2 border-left border-right rte-holder"
|
|
|
|
- data-field-name="value"><?= $currentValue ?></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>
|
|
|
|
- <?php else: ?>
|
|
|
|
- <form url="/api/visitPoint/addTopLevel" class="mcp-theme-1 frm-add-review-plan-nutrition w-100" left>
|
|
|
|
|
|
+ <?php else: ?>
|
|
<input type="hidden" name="noteUid" value="<?= $note->uid ?>">
|
|
<input type="hidden" name="noteUid" value="<?= $note->uid ?>">
|
|
<input type="hidden" name="category" value="<?= $p['category'] ?>">
|
|
<input type="hidden" name="category" value="<?= $p['category'] ?>">
|
|
<input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
|
|
<input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
|
|
|
|
+ <?php endif; ?>
|
|
|
|
+
|
|
|
|
+ <?php if ($point): ?>
|
|
<input type="hidden" name="data">
|
|
<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) ?>) (click to copy)</span>
|
|
|
|
- </div>
|
|
|
|
- <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
|
|
|
|
|
|
+ <?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/exercise/' . $p['category'] . '/view-review.php')); ?>
|
|
</div>
|
|
</div>
|
|
- <?php endif; ?>
|
|
|
|
|
|
+ </div>
|
|
|
|
+ <?php endif; ?>
|
|
|
|
|
|
- <p class="mb-2"><b>Current Daily Calories</b></p>
|
|
|
|
|
|
+ <p class="mb-2"><b>Current Strength Training</b></p>
|
|
|
|
|
|
- <div class="mb-2">
|
|
|
|
- <div note-rte
|
|
|
|
- class="form-group mb-2 border-left border-right rte-holder"
|
|
|
|
- data-field-name="reviewValue"><?= $currentValue ?></div>
|
|
|
|
|
|
+ <label class="mb-2 d-flex align-items-center">
|
|
|
|
+ <input type="checkbox" data-name="active" <?= @($currentValue->active) ? 'checked' : ''?>>
|
|
|
|
+ <span class="ml-2">Currently doing strength training?</span>
|
|
|
|
+ </label>
|
|
|
|
+
|
|
|
|
+ <div if-active>
|
|
|
|
+ <label class="mb-2 d-flex align-items-baseline">
|
|
|
|
+ <input type="checkbox" data-name="muscleStrengthening" <?= @($currentValue->muscleStrengthening) ? 'checked' : ''?>>
|
|
|
|
+ <span class="ml-2">Currently doing muscle strengthening exercises on moderate or greater intensity at least two days per week</span>
|
|
|
|
+ </label>
|
|
|
|
+ <label class="mb-2 d-flex align-items-baseline">
|
|
|
|
+ <input type="checkbox" data-name="allMajorMuscleGroups" <?= @($currentValue->allMajorMuscleGroups) ? 'checked' : ''?>>
|
|
|
|
+ <span class="ml-2">Currently doing exercises to strengthen all major muscle groups: legs, hips, back, chest, abdomen, shoulders and arms</span>
|
|
|
|
+ </label>
|
|
|
|
+ <div class="row mb-2">
|
|
|
|
+ <div class="col-6">
|
|
|
|
+ <label class="mb-1">Number of sets for each exercise</label>
|
|
|
|
+ <input type="text" data-name="sets" class="form-control form-control-sm" value="<?= @($currentValue->sets) ?>">
|
|
|
|
+ </div>
|
|
|
|
+ <div class="col-6">
|
|
|
|
+ <label class="mb-1">Number of repetitions per set</label>
|
|
|
|
+ <input type="text" data-name="reps" class="form-control form-control-sm" value="<?= @($currentValue->reps) ?>">
|
|
|
|
+ </div>
|
|
</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>
|
|
|
|
|
|
+ <label class="mb-2 d-flex align-items-baseline">
|
|
|
|
+ <input type="checkbox" data-name="resistanceBandsBodyWeight" <?= @($currentValue->resistanceBandsBodyWeight) ? 'checked' : ''?>>
|
|
|
|
+ <span class="ml-2">Currently using resistance bands or using body weight to do exercises</span>
|
|
|
|
+ </label>
|
|
|
|
+ <div if-active 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-field-name="memo"><?= @($currentValue->memo) ?></div>
|
|
</div>
|
|
</div>
|
|
- </form>
|
|
|
|
- <?php endif; ?>
|
|
|
|
|
|
+ </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>
|
|
</div>
|
|
<?php if(!empty($currentValue)): ?>
|
|
<?php if(!empty($currentValue)): ?>
|
|
<div visit-moe relative class="d-inline">
|
|
<div visit-moe relative class="d-inline">
|