<?php

/** @var \App\Models\Pro $hcpPro */
/** @var \App\Models\Pro $pro */
/** @var \App\Models\Note $note */

if(!@$hcpPro) {
    if(@$note) {
        $hcpPro = $note->hcpPro;
    }
    else {
        $hcpPro = $pro; // should never get here
    }
}

$canvasData = [];
if ($patient->canvas_data) {
    $canvasData = json_decode($patient->canvas_data, true);
    if(!isset($canvasData["next_fu"])) $canvasData["next_fu"] = [];
    if(!isset($canvasData["next_fu"][$hcpPro->id])) $canvasData["next_fu"][$hcpPro->id] = [];
    $canvasData = $canvasData['next_fu'][$hcpPro->id];
}
$contentData = $canvasData;
