Browse Source

RTM feedback renderer UI

Vijayakrishnan 2 years ago
parent
commit
ba305330d6

+ 3 - 3
config/rtm.php

@@ -6,7 +6,7 @@ return [
             'name' => 'Bench Press',
             'name' => 'Bench Press',
             'description' => 'Description of bench press goes here. Not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset.',
             'description' => 'Description of bench press goes here. Not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset.',
             'image' => 'https://cdn.mos.cms.futurecdn.net/pLaRi5jXSHDKu6WRydetBo-970-80.jpg.webp',
             'image' => 'https://cdn.mos.cms.futurecdn.net/pLaRi5jXSHDKu6WRydetBo-970-80.jpg.webp',
-            'video' => 'https://www.youtube.com/watch?v=SCVCLChPQFY',
+            'video' => 'https://www.youtube.com/embed/aclHkVaku9U',
             'props' => [
             'props' => [
                 'Weekly', 'Daily', 'Sets', 'Reps'
                 'Weekly', 'Daily', 'Sets', 'Reps'
             ]
             ]
@@ -15,7 +15,7 @@ return [
             'name' => 'Squats',
             'name' => 'Squats',
             'description' => 'Description of squats goes here. Not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset.',
             'description' => 'Description of squats goes here. Not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset.',
             'image' => 'https://media.self.com/photos/5ea9bc77bb9c6b75996c7e91/4:3/w_640,c_limit/squats_woman_exercise.jpg',
             'image' => 'https://media.self.com/photos/5ea9bc77bb9c6b75996c7e91/4:3/w_640,c_limit/squats_woman_exercise.jpg',
-            'video' => 'https://www.youtube.com/watch?v=xqvCmoLULNY',
+            'video' => 'https://www.youtube.com/embed/aclHkVaku9U',
             'props' => [
             'props' => [
                 'Weekly', 'Daily', 'Sets', 'Reps'
                 'Weekly', 'Daily', 'Sets', 'Reps'
             ]
             ]
@@ -24,7 +24,7 @@ return [
             'name' => 'Walking',
             'name' => 'Walking',
             'description' => 'Description of walking goes here. Not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset.',
             'description' => 'Description of walking goes here. Not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset.',
             'image' => 'https://i0.wp.com/post.greatist.com/wp-content/uploads/sites/2/2020/04/GRT-female-walking-street-1296x728-header.jpg?w=1575',
             'image' => 'https://i0.wp.com/post.greatist.com/wp-content/uploads/sites/2/2020/04/GRT-female-walking-street-1296x728-header.jpg?w=1575',
-            'video' => 'https://www.youtube.com/watch?v=35G7AW78kxo',
+            'video' => 'https://www.youtube.com/embed/aclHkVaku9U',
             'props' => [
             'props' => [
                 'Weekly', 'Daily', 'Duration', 'Intensity'
                 'Weekly', 'Daily', 'Duration', 'Intensity'
             ]
             ]

+ 48 - 40
resources/views/app/patient/care-month/dashboard.blade.php

@@ -697,42 +697,46 @@
 
 
             <div class="pl-3">
             <div class="pl-3">
                 <div class="screen-only">
                 <div class="screen-only">
-        <div class="d-flex align-items-center mb-2">
-            <p class="font-weight-bold text-secondary m-0">Transmissions</p>
-        </div>
-        <?php $transmissions = $careMonth->rtmMskTransmissions; ?>
-        <table class="table table-striped table-sm table-bordered mt-2 mb-0">
-            <thead>
-            <tr>
-                <th class="text-secondary border-bottom-0">Effective Date</th>
-                <th class="text-secondary border-bottom-0">Instructions</th>
-                <th class="text-secondary border-bottom-0">Response</th>
-                <th class="text-secondary border-bottom-0">Stamp</th>
-            </tr>
-            </thead>
-            <tbody>
-            @if(!$transmissions || !count($transmissions))
-                <tr>
-                    <td class="text-secondary p-0 border-0" colspan="4">
-                        No items to show
-                    </td>
-                </tr>
-            @else
-                @foreach($transmissions as $transmission)
-                    <tr>
-                        <td>{{friendly_date($transmission->effective_date)}}</td>
-                        <td>{{$transmission->protocol_detail_json}}</td>
-                        <td>{{$transmission->feedback_detail_json}}</td>
-                        <td>
-                            @php $clientRtmTransmission = $transmission @endphp
-                            @include('app.patient.care-month._stamp_client_rtm_transmission')
-                        </td>
-                    </tr>
-                @endforeach
-            @endif
-            </tbody>
-        </table>
-    </div>
+                    <div class="d-flex align-items-center mb-2">
+                        <p class="font-weight-bold text-secondary m-0">Transmissions</p>
+                    </div>
+                    <?php $transmissions = $careMonth->rtmMskTransmissions; ?>
+                    <table class="table table-striped table-sm table-bordered mt-2 mb-0">
+                        <thead>
+                        <tr>
+                            <th class="text-secondary border-bottom-0">Effective Date</th>
+                            <th class="text-secondary border-bottom-0 w-35">Instructions</th>
+                            <th class="text-secondary border-bottom-0 w-35">Response</th>
+                            <th class="text-secondary border-bottom-0">Stamp</th>
+                        </tr>
+                        </thead>
+                        <tbody>
+                        @if(!$transmissions || !count($transmissions))
+                            <tr>
+                                <td class="text-secondary p-0 border-0" colspan="4">
+                                    No items to show
+                                </td>
+                            </tr>
+                        @else
+                            @foreach($transmissions as $transmission)
+                                <tr>
+                                    <td>{{friendly_date($transmission->effective_date)}}</td>
+                                    <td>
+                                        @include('app.patient.rtm.protocol-summary', ['json' => $transmission->protocol_detail_json])
+                                    </td>
+                                    <td>
+                                        @include('app.patient.rtm.feedback-summary', ['json' => $transmission->feedback_detail_json])
+                                    </td>
+                                    <td>
+                                        @php $clientRtmTransmission = $transmission @endphp
+                                        @include('app.patient.care-month._stamp_client_rtm_transmission')
+                                    </td>
+                                </tr>
+                            @endforeach
+                        @endif
+                        </tbody>
+                    </table>
+                </div>
 
 
                 <div class="screen-only mt-3">
                 <div class="screen-only mt-3">
                     <div class="d-flex align-items-center">
                     <div class="d-flex align-items-center">
@@ -796,8 +800,8 @@
                         <thead>
                         <thead>
                         <tr>
                         <tr>
                             <th class="text-secondary border-bottom-0">Effective Date</th>
                             <th class="text-secondary border-bottom-0">Effective Date</th>
-                            <th class="text-secondary border-bottom-0">Instructions</th>
-                            <th class="text-secondary border-bottom-0">Response</th>
+                            <th class="text-secondary border-bottom-0 w-35">Instructions</th>
+                            <th class="text-secondary border-bottom-0 w-35">Response</th>
                             <th class="text-secondary border-bottom-0">Stamp</th>
                             <th class="text-secondary border-bottom-0">Stamp</th>
                         </tr>
                         </tr>
                         </thead>
                         </thead>
@@ -812,8 +816,12 @@
                             @foreach($transmissions as $transmission)
                             @foreach($transmissions as $transmission)
                                 <tr>
                                 <tr>
                                     <td>{{friendly_date($transmission->effective_date)}}</td>
                                     <td>{{friendly_date($transmission->effective_date)}}</td>
-                                    <td>{{$transmission->protocol_detail_json}}</td>
-                                    <td>{{$transmission->feedback_detail_json}}</td>
+                                    <td>
+                                        @include('app.patient.rtm.protocol-summary', ['json' => $transmission->protocol_detail_json])
+                                    </td>
+                                    <td>
+                                        @include('app.patient.rtm.feedback-summary', ['json' => $transmission->feedback_detail_json])
+                                    </td>
                                     <td>
                                     <td>
                                         @php $clientRtmTransmission = $transmission @endphp
                                         @php $clientRtmTransmission = $transmission @endphp
                                         @include('app.patient.care-month._stamp_client_rtm_transmission')
                                         @include('app.patient.care-month._stamp_client_rtm_transmission')

+ 30 - 0
resources/views/app/patient/rtm/feedback-summary.blade.php

@@ -0,0 +1,30 @@
+<?php
+$parsed = null;
+if(@$json) {
+    try {
+        $parsed = json_decode($json);
+    }
+    catch (Exception $e) {}
+}
+?>
+@if($parsed)
+    <div>
+        @if(count($parsed))
+            @foreach($parsed as $activity)
+                <div class="">
+                    <div class="font-weight-bold">{{$activity->name}}</div>
+                    <div class="pl-3">
+                        <div>Completed: <b>{{$activity->done}}</b></div>
+                        @if($activity->done === 'No')
+                            <div>Reason: <b>{{$activity->notDoneReason}}</b></div>
+                        @else
+                            <div>Experience: <b>{{$activity->doneExperience}}</b></div>
+                            <div>Pain: <b>{{$activity->donePain}}</b></div>
+                            <div>Remarks: <b>{{$activity->doneRemarks}}</b></div>
+                        @endif
+                    </div>
+                </div>
+            @endforeach
+        @endif
+    </div>
+@endif

+ 16 - 8
resources/views/app/patient/rtm/protocol-summary.blade.php

@@ -1,6 +1,12 @@
 <?php
 <?php
 $parsed = null;
 $parsed = null;
-if($patient->rtm_msk_protocol_detail_json) {
+if(@$json) {
+    try {
+        $parsed = json_decode($json);
+    }
+    catch (Exception $e) {}
+}
+elseif($patient->rtm_msk_protocol_detail_json) {
     try {
     try {
         $parsed = json_decode($patient->rtm_msk_protocol_detail_json);
         $parsed = json_decode($patient->rtm_msk_protocol_detail_json);
     }
     }
@@ -14,13 +20,15 @@ if($patient->rtm_msk_protocol_detail_json) {
         @endif
         @endif
         @if(count($parsed->activities))
         @if(count($parsed->activities))
             @foreach($parsed->activities as $activity)
             @foreach($parsed->activities as $activity)
-                <div class="d-flex align-items-baseline flex-wrap">
-                    <b>{{$activity->name}}</b>
-                    @foreach($activity->props as $prop)
-                        @if($prop->include)
-                            <span class="ml-2">{{$prop->name}}: {{$prop->value}}</span>
-                        @endif
-                    @endforeach
+                <div class="">
+                    <div class="font-weight-bold">{{$activity->name}}</div>
+                    <div class="pl-3">
+                        @foreach($activity->props as $prop)
+                            @if($prop->include)
+                                <span class="ml-2">{{$prop->name}}: {{$prop->value}}</span>
+                            @endif
+                        @endforeach
+                    </div>
                 </div>
                 </div>
             @endforeach
             @endforeach
         @else
         @else