|
@@ -17,30 +17,27 @@ if(!@$sectionPro) {
|
|
|
$canvasData = [];
|
|
|
if ($patient->canvas_data) {
|
|
|
$canvasData = json_decode($patient->canvas_data, true);
|
|
|
- if (isset($canvasData["lifestyle_rx_review"])) {
|
|
|
- $canvasData = $canvasData["lifestyle_rx_review"];
|
|
|
+ if (!isset($canvasData["lifestyle_rx_review"])) $canvasData["lifestyle_rx_review"] = [];
|
|
|
+ if (!isset($canvasData["lifestyle_rx_review"][$sectionPro->uid])) $canvasData["lifestyle_rx_review"][$sectionPro->uid] = [
|
|
|
+ 'physical_activity' => [
|
|
|
+ 'type' => '',
|
|
|
+ 'frequency' => '',
|
|
|
+ 'time' => '',
|
|
|
+ 'intensity' => '',
|
|
|
+ 'enjoyment' => '',
|
|
|
+ ],
|
|
|
+ 'barriers' => '', // free text
|
|
|
+ 'assessment' => '', // Inactive, Insufficiently Active, Active, Highly Active
|
|
|
+ ];
|
|
|
+
|
|
|
+ // if lifestyle_rx_update available, prefill with that
|
|
|
+ if (isset($canvasData["lifestyle_rx_update"]) &&
|
|
|
+ isset($canvasData["lifestyle_rx_update"][$sectionPro->uid]) &&
|
|
|
+ isset($canvasData["lifestyle_rx_update"][$sectionPro->uid]['prescription'])) {
|
|
|
+ $canvasData["lifestyle_rx_review"][$sectionPro->uid]['adherence'] = $canvasData["lifestyle_rx_update"][$sectionPro->uid]['prescription'];
|
|
|
}
|
|
|
|
|
|
- // if lifestyle_rx_review available, prefill with that
|
|
|
- /*if (isset($canvasData["next_fu"]) && isset($canvasData["next_fu"][$sectionPro])) {
|
|
|
- $nextFU = $canvasData["next_fu"][$sectionPro];
|
|
|
- if(isset($nextFU['list']) && count($nextFU['list'])) {
|
|
|
- if(!isset($canvasData[$sectionPro])) {
|
|
|
- $canvasData[$sectionPro] = [];
|
|
|
- }
|
|
|
- $prefillData = array_map(function($_x) {
|
|
|
- if(!isset($_x['icd'])) $_x['icd'] = '';
|
|
|
- if(!isset($_x['memo'])) $_x['memo'] = '';
|
|
|
- $_x['hpi'] = [
|
|
|
- 'free_text' => ''
|
|
|
- ];
|
|
|
- return $_x;
|
|
|
- }, $nextFU['list']);
|
|
|
- $canvasData[$sectionPro]['current_cch'] = [
|
|
|
- 'list' => $prefillData
|
|
|
- ];
|
|
|
- }
|
|
|
- }*/
|
|
|
+ $canvasData = $canvasData["lifestyle_rx_review"];
|
|
|
|
|
|
}
|
|
|
$contentData = $canvasData;
|