Procházet zdrojové kódy

lifestyle_rx_review => default data model when canvas empty

Vijayakrishnan před 4 roky
rodič
revize
ca63da5673

+ 102 - 0
resources/views/app/patient/canvas-sections/lifestyle_rx_review/default.php

@@ -28,6 +28,108 @@ if ($patient->canvas_data) {
             ],
             'barriers' => '',   // free text
             'assessment' => '', // Inactive, Insufficiently Active, Active, Highly Active
+            'adherence' => [
+                'seated' => [
+                    'active' => false,
+                    'memo' => '',
+                    'adherence' => '',
+                    'adherence_memo' => '',
+                ],
+                'arm' => [
+                    'active' => false,
+                    'memo' => '',
+                    'adherence' => '',
+                    'adherence_memo' => '',
+                ],
+                'aquatic' => [
+                    'active' => false,
+                    'memo' => '',
+                    'adherence' => '',
+                    'adherence_memo' => '',
+                ],
+                'aerobic' => [
+                    'active' => false,
+                    'walk' => [
+                        'active' => false,
+                        'days_per_week' => '',
+                        'minutes_per_day' => '',
+                        'intensity' => '', // Light, Moderate, Vigorous
+                        'memo' => '',
+                        'adherence' => '',
+                        'adherence_memo' => '',
+                    ],
+                    'jog' => [
+                        'active' => false,
+                        'days_per_week' => '',
+                        'minutes_per_day' => '',
+                        'intensity' => '', // Light, Moderate, Vigorous
+                        'memo' => '',
+                        'adherence' => '',
+                        'adherence_memo' => '',
+                    ],
+                    'elliptical' => [
+                        'active' => false,
+                        'days_per_week' => '',
+                        'minutes_per_day' => '',
+                        'intensity' => '', // Light, Moderate, Vigorous
+                        'memo' => '',
+                        'adherence' => '',
+                        'adherence_memo' => '',
+                    ],
+                    'swim' => [
+                        'active' => false,
+                        'days_per_week' => '',
+                        'minutes_per_day' => '',
+                        'intensity' => '', // Light, Moderate, Vigorous
+                        'memo' => '',
+                        'adherence' => '',
+                        'adherence_memo' => '',
+                    ],
+                    'bike' => [
+                        'active' => false,
+                        'days_per_week' => '',
+                        'minutes_per_day' => '',
+                        'intensity' => '', // Light, Moderate, Vigorous
+                        'memo' => '',
+                        'adherence' => '',
+                        'adherence_memo' => '',
+                    ],
+                ],
+                'strength' => [
+                    'active' => false,
+                    'exercises' => [
+                        [
+                            'name' => '',
+                            'days_per_week' => '',
+                            'reps' => '',
+                            'intensity' => '', // Light, Moderate, Vigorous
+                            'memo' => '',
+                            'adherence' => '',
+                            'adherence_memo' => '',
+                        ]
+                    ]
+                ],
+                'neat' => [
+                    'active' => false,
+                    'recommendations' => [
+                        'park_farther' => false,
+                        'park_farther_adherence' => '',
+                        'park_farther_adherence_memo' => '',
+                        'steps_instead_of_elevator' => false,
+                        'steps_instead_of_elevator_adherence' => '',
+                        'steps_instead_of_elevator_adherence_memo' => '',
+                        'stand_instead_of_sit' => false,
+                        'stand_instead_of_sit_adherence' => '',
+                        'stand_instead_of_sit_adherence_memo' => '',
+                        'steps_goal_per_day' => '',
+                        'steps_goal_per_day_adherence' => '',
+                        'steps_goal_per_day_adherence_memo' => '',
+                        'other' => '',
+                        'other_adherence' => '',
+                        'other_adherence_memo' => '',
+                    ]
+                ]
+            ]
         ];
     }
 

+ 117 - 0
resources/views/app/patient/canvas-sections/lifestyle_rx_review/summary.php

@@ -21,9 +21,125 @@ if(!@$contentData) {
         if(isset($canvasData["lifestyle_rx_review"]) && isset($canvasData["lifestyle_rx_review"][$hcpPro->id])) {
             $contentData = $canvasData["lifestyle_rx_review"][$hcpPro->id];
         }
+        else { // default data structure
+            $contentData = [
+                'physical_activity' => [
+                    'type' => '',
+                    'frequency' => '',
+                    'time' => '',
+                    'intensity' => '',
+                    'enjoyment' => '',
+                ],
+                'barriers' => '',   // free text
+                'assessment' => '', // Inactive, Insufficiently Active, Active, Highly Active
+                'adherence' => [
+                    'seated' => [
+                        'active' => false,
+                        'memo' => '',
+                        'adherence' => '',
+                        'adherence_memo' => '',
+                    ],
+                    'arm' => [
+                        'active' => false,
+                        'memo' => '',
+                        'adherence' => '',
+                        'adherence_memo' => '',
+                    ],
+                    'aquatic' => [
+                        'active' => false,
+                        'memo' => '',
+                        'adherence' => '',
+                        'adherence_memo' => '',
+                    ],
+                    'aerobic' => [
+                        'active' => false,
+                        'walk' => [
+                            'active' => false,
+                            'days_per_week' => '',
+                            'minutes_per_day' => '',
+                            'intensity' => '', // Light, Moderate, Vigorous
+                            'memo' => '',
+                            'adherence' => '',
+                            'adherence_memo' => '',
+                        ],
+                        'jog' => [
+                            'active' => false,
+                            'days_per_week' => '',
+                            'minutes_per_day' => '',
+                            'intensity' => '', // Light, Moderate, Vigorous
+                            'memo' => '',
+                            'adherence' => '',
+                            'adherence_memo' => '',
+                        ],
+                        'elliptical' => [
+                            'active' => false,
+                            'days_per_week' => '',
+                            'minutes_per_day' => '',
+                            'intensity' => '', // Light, Moderate, Vigorous
+                            'memo' => '',
+                            'adherence' => '',
+                            'adherence_memo' => '',
+                        ],
+                        'swim' => [
+                            'active' => false,
+                            'days_per_week' => '',
+                            'minutes_per_day' => '',
+                            'intensity' => '', // Light, Moderate, Vigorous
+                            'memo' => '',
+                            'adherence' => '',
+                            'adherence_memo' => '',
+                        ],
+                        'bike' => [
+                            'active' => false,
+                            'days_per_week' => '',
+                            'minutes_per_day' => '',
+                            'intensity' => '', // Light, Moderate, Vigorous
+                            'memo' => '',
+                            'adherence' => '',
+                            'adherence_memo' => '',
+                        ],
+                    ],
+                    'strength' => [
+                        'active' => false,
+                        'exercises' => [
+                            [
+                                'name' => '',
+                                'days_per_week' => '',
+                                'reps' => '',
+                                'intensity' => '', // Light, Moderate, Vigorous
+                                'memo' => '',
+                                'adherence' => '',
+                                'adherence_memo' => '',
+                            ]
+                        ]
+                    ],
+                    'neat' => [
+                        'active' => false,
+                        'recommendations' => [
+                            'park_farther' => false,
+                            'park_farther_adherence' => '',
+                            'park_farther_adherence_memo' => '',
+                            'steps_instead_of_elevator' => false,
+                            'steps_instead_of_elevator_adherence' => '',
+                            'steps_instead_of_elevator_adherence_memo' => '',
+                            'stand_instead_of_sit' => false,
+                            'stand_instead_of_sit_adherence' => '',
+                            'stand_instead_of_sit_adherence_memo' => '',
+                            'steps_goal_per_day' => '',
+                            'steps_goal_per_day_adherence' => '',
+                            'steps_goal_per_day_adherence_memo' => '',
+                            'other' => '',
+                            'other_adherence' => '',
+                            'other_adherence_memo' => '',
+                        ]
+                    ]
+                ]
+            ];
+        }
     }
 }
 
+/*
 if($contentData === false) {
     ?>
     <div class="text-secondary">No data in this section yet</div>
@@ -235,4 +351,5 @@ else {
 
     <?php
 }
+*/
 ?>