<?php
$canvasData = [
    "items" => []
];
if ($patient->canvas_data) {
    $canvasData = json_decode($patient->canvas_data, true);
    if (isset($canvasData["dx"])) {
        $canvasData = $canvasData["dx"];
        if(!isset($canvasData["items"])) {
            $canvasData["items"] = [];
        }
        for ($i = 0; $i < count($canvasData["items"]); $i++) {
            $canvasData["items"][$i]["included"] = 1;
        }
    }
}
$contentData = $canvasData;
