Pārlūkot izejas kodu

plan/intake exercise - summary html

Vijayakrishnan 3 gadi atpakaļ
vecāks
revīzija
7b34ed5f0f

+ 0 - 4
resources/views/app/patient/segment-templates/intake_exercise/edit.blade.php

@@ -1,4 +0,0 @@
-<?php
-$category = 'ROS';
-$endPoint = 'upsertNoteSingleton';
-include resource_path('views/app/patient/segment-templates/_simple_text_segment/edit.php');

+ 37 - 2
resources/views/app/patient/segment-templates/intake_exercise/summary.blade.php

@@ -1,3 +1,38 @@
 <?php
-$category = 'ROS';
-include resource_path('views/app/patient/segment-templates/_simple_text_segment/summary.php');
+
+use App\Models\Point;
+
+/** @var \App\Models\Client $patient */
+
+$aerobicActivity = Point::getOnlyPointOfCategory($patient, 'AEROBIC_ACTIVITY');
+$strengthTraining = Point::getOnlyPointOfCategory($patient, 'STRENGTH_TRAINING');
+$neat = Point::getOnlyPointOfCategory($patient, 'NEAT');
+
+$points = [
+    ["category" => 'AEROBIC_ACTIVITY', "name" => 'Aerobic Activity', "point" => $aerobicActivity],
+    ["category" => 'STRENGTH_TRAINING', "name" => 'Strength Training', "point" => $strengthTraining],
+    ["category" => 'NEAT', "name" => 'Non-Exercise Activity Time (NEAT)', "point" => $neat],
+];
+?>
+
+<?php foreach ($points as $p): ?>
+<?php $point = $p['point']; ?>
+<?php if(!!$point): ?>
+<?php $review = $point->lastChildReview; ?>
+<?php if ($review && @($review->data)) $review->data = json_decode($review->data); ?>
+<div class="mb-2">
+    <div class="d-flex align-items-baseline">
+        <b><?= $p['name'] ?></b>
+    </div>
+    <?php if(!!$review): ?>
+    <div class="pl-3 mt-1 d-flex align-items-baseline">
+        <span class="text-secondary font-weight-bold mr-2">Subjective:</span>
+        <div class="inline-html-container">
+            <?php $review = $review->data; ?>
+            <?php include(resource_path('views/app/patient/segment-templates/_child_review/exercise/' . $p['category'] . '/view-review.php')); ?>
+        </div>
+    </div>
+    <?php endif; ?>
+</div>
+<?php endif; ?>
+<?php endforeach; ?>

+ 0 - 4
resources/views/app/patient/segment-templates/plan_exercise/edit.blade.php

@@ -1,4 +0,0 @@
-<?php
-$category = 'ROS';
-$endPoint = 'upsertNoteSingleton';
-include resource_path('views/app/patient/segment-templates/_simple_text_segment/edit.php');

+ 37 - 2
resources/views/app/patient/segment-templates/plan_exercise/summary.blade.php

@@ -1,3 +1,38 @@
 <?php
-$category = 'ROS';
-include resource_path('views/app/patient/segment-templates/_simple_text_segment/summary.php');
+
+use App\Models\Point;
+
+/** @var \App\Models\Client $patient */
+
+$aerobicActivity = Point::getOnlyPointOfCategory($patient, 'AEROBIC_ACTIVITY');
+$strengthTraining = Point::getOnlyPointOfCategory($patient, 'STRENGTH_TRAINING');
+$neat = Point::getOnlyPointOfCategory($patient, 'NEAT');
+
+$points = [
+    ["category" => 'AEROBIC_ACTIVITY', "name" => 'Aerobic Activity', "point" => $aerobicActivity],
+    ["category" => 'STRENGTH_TRAINING', "name" => 'Strength Training', "point" => $strengthTraining],
+    ["category" => 'NEAT', "name" => 'Non-Exercise Activity Time (NEAT)', "point" => $neat],
+];
+?>
+
+<?php foreach ($points as $p): ?>
+<?php $point = $p['point']; ?>
+<?php if(!!$point): ?>
+<?php $plan = $point->lastChildPlan; ?>
+<?php if ($plan && @($plan->data)) $plan->data = json_decode($plan->data); ?>
+<div class="mb-2">
+    <div class="d-flex align-items-baseline">
+        <b><?= $p['name'] ?></b>
+    </div>
+    <?php if(!!$plan): ?>
+    <div class="pl-3 mt-1 d-flex align-items-baseline">
+        <span class="text-secondary font-weight-bold mr-2">Plan:</span>
+        <div class="inline-html-container">
+            <?php $plan = $plan->data; ?>
+            <?php include(resource_path('views/app/patient/segment-templates/_child_plan/exercise/' . $p['category'] . '/view-plan.php')); ?>
+        </div>
+    </div>
+    <?php endif; ?>
+</div>
+<?php endif; ?>
+<?php endforeach; ?>