if ($pid) { if (isset($transFromOutp)) { //echo 'transFrom Outpatient'; if ($encoder == '') { $encoder = $_SESSION['sess_user_name']; } # Load date formatter require_once $root_path . 'include/care_api_classes/class_encounter.php'; $enc_obj = new Encounter(); $pn = $_GET['pn']; if ($encounter_obj->loadEncounterData($pn)) { //$db->debug=1; $date = empty($x_date) ? date('Y-m-d') : formatDate2STD($x_date, $date_format); $time = empty($x_time) ? date('H:i:s') : convertTimeToStandard($x_time); # Check the discharge type if ($enc_obj->DischargeFromDeptForAdmission($pn, 8, $date, $time)) { //echo 'discharge has been successfull'; } else { echo 'couldn\'t discharge outpatient'; } } else { echo 'could not load encounter data'; } } else { /* Check whether the person is currently admitted. If yes jump to display admission data */ if (!$update && ($encounter_nr = $encounter_obj->isPIDCurrentlyAdmitted($pid))) { header('Location:aufnahme_daten_zeigen.php' . URL_REDIRECT_APPEND . '&encounter_nr=' . $encounter_nr . '&origin=admit&sem=isadmitted&target=entry'); exit; } } /* Get the related insurance data */