/* Get the insurance classes */
$insurance_classes =& $pinsure_obj->getInsuranceClassInfoObject('class_nr,name,LD_var');
/* Create new person object */
$person_obj = new Person($pid);
/* Create personell object */
$personell_obj = new Personell();
if ($pid || $personell_nr) {
    # Get the patient global configs
    $glob_obj = new GlobalConfig($GLOBAL_CONFIG);
    $glob_obj->getConfig('personell_%');
    $glob_obj->getConfig('person_foto_path');
    # Check whether config path exists, else use default path
    $photo_path = is_dir($root_path . $GLOBAL_CONFIG['person_foto_path']) ? $GLOBAL_CONFIG['person_foto_path'] : $default_photo_path;
    if ($pid) {
        # Check whether the person is currently admitted. If yes jump to display admission data
        if ($mode != 'save' && ($personell_nr = $personell_obj->Exists($pid))) {
            header('Location:personell_register_show.php' . URL_REDIRECT_APPEND . '&personell_nr=' . $personell_nr . '&origin=admit&sem=isadmitted&target=personell_reg');
            exit;
        }
        # Get the related insurance data
        $p_insurance =& $pinsure_obj->getPersonInsuranceObject($pid);
        if ($p_insurance == FALSE) {
            $insurance_show = TRUE;
        } else {
            if (!$p_insurance->RecordCount()) {
                $insurance_show = TRUE;
            } elseif ($p_insurance->RecordCount() == 1) {
                $buffer = $p_insurance->FetchRow();
                extract($buffer);
                //while(list($x,$v)=each($buffer)) {$$x=$v; }
                $insurance_show = TRUE;