function getAction()
{
    checkIdentity();
    $idTarget = $_POST['targetId'];
    $result = getProPage($idTarget);
    $resultJson = json_encode($result);
    echo $resultJson;
    die;
}
function setAction()
{
    checkIdentity();
    $idTarget = $_POST['id_patient'];
    $date = $_POST['date_psycho'];
    $miniBest = $_POST['minibesttest_score'];
    $grecoGlobal = $_POST['greco_global'];
    $grecoImmediat = $_POST['greco_immediat'];
    $grecoDiffere = $_POST['greco_differe'];
    $psyVisit = array('id_patient' => $idTarget, 'date_psycho' => $date, 'minibesttest_score' => $miniBest, 'greco_global' => $grecoGlobal, 'greco_immediat' => $grecoImmediat, 'greco_differe' => $grecoDiffere);
    $result = insertPsychoVisit($psyVisit);
    if ($result) {
        echo 'success';
        die;
    }
    echo 'fail';
    die;
}
function setAction()
{
    checkIdentity();
    $idTarget = $_POST['id_patient'];
    $date = $_POST['date_kine'];
    $tinettiPoma = $_POST['tinettiPoma'];
    $getUpAndGo = $_POST['getupandgo'];
    $slowWalk = $_POST['slow_walk'];
    $fastWalk = $_POST['fast_walk'];
    //TODO: add other fields
    $kineVisit = array('id_patient' => $idTarget, 'date_kine' => $date, 'tinettiPoma' => $tinettiPoma, 'getupandgo' => $getUpAndGo, 'slow_walk' => $slowWalk, 'fastWalk' => $fastWalk);
    $result = insertKineVisit($kineVisit);
    if ($result) {
        echo 'success';
        die;
    }
    echo 'fail';
    die;
}
function setAction()
{
    checkIdentity();
    $idTarget = $_POST['id_patient'];
    $date = $_POST['date_visit'];
    $height = $_POST['height'];
    $weight = $_POST['weight'];
    $bmi = $_POST['bmi'];
    $albumin = $_POST['albumin'];
    $crp = $_POST['crp'];
    $vitaminD = $_POST['vitamin_d'];
    $frequency = $_POST['frequency'];
    $pressure = $_POST['pressure'];
    $gir = $_POST['gir'];
    $medCheck = array('id_patient' => $idTarget, 'date' => $date, 'height' => $height, 'weight' => $weight, 'bmi' => $bmi, 'albumin' => $albumin, 'crp' => $crp, 'vitamin_d' => $vitaminD, 'frequency' => $frequency, 'pressure' => $pressure, 'gir' => $gir);
    $result = insertmedicalCheck($medCheck);
    if ($result) {
        echo 'success';
        die;
    }
    echo 'fail';
    die;
}