Exemplo n.º 1
0
if (isset($mode)) {
    /* Prepare the common data */
    $_POST['history'] = "Create " . date('Y-m-d H:i:s') . " " . $_SESSION['sess_user_name'] . "\n";
    //$_POST['modify_id']=$_SESSION['sess_user_name'];
    $_POST['create_id'] = $_SESSION['sess_user_name'];
    $_POST['create_time'] = date('YmdHis');
    switch ($mode) {
        case 'save':
            $DRG_obj->useInternalDRGCodes();
            // Set the core variables
            $DRG_obj->setDataArray($_POST);
            // transfer the data
            if ($DRG_obj->insertDataFromInternalArray()) {
                $oid = $db->Insert_ID();
                // Get the insert ID
                $group_nr = $DRG_obj->LastInsertPK('nr', $oid);
                $saveok = true;
                //header("location:$thisfile?sid=$sid&lang=$lang&saveok=1&pn=$pn&opnr=$opnr&group_nr=$group_nr&ln=$ln&fn=$fn&bd=$bd&dept_nr=$dept_nr&oprm=$oprm&y=$y&m=$m&d=$d&display=$display&target=$target");
                //exit;
            } else {
                $saveok = false;
            }
            break;
        case 'linkgroup':
            if (!$DRG_obj->EncounterDRGGroupExists($group_nr)) {
                $DRG_obj->useInternalDRG();
                // Set the core variables to encounter DRG table
                $_POST['clinician'] = $_SESSION['sess_user_name'];
                $_POST['encounter_nr'] = $pn;
                $_POST['date'] = date('Y-m-d H:i:s');
                $DRG_obj->setDataArray($_POST);