* CARE2X Integrated Hospital Information System Deployment 2.1 - 2004-10-02
* GNU General Public License
* Copyright 2002,2003,2004,2005 Elpidio Latorilla
* elpidio@care2x.org, 
*
* See the file "copy_notice.txt" for the licence notice
*/
$lang_tables = array('date_time.php', 'departments.php');
define('LANG_FILE', 'nursing.php');
$local_user = '******';
//define('NO_2LEVEL_CHK',1);
require_once $root_path . 'include/inc_front_chain_lang.php';
/* Create nursing notes object */
require_once $root_path . 'include/care_api_classes/class_notes_nursing.php';
require_once $root_path . 'include/care_api_classes/class_person.php';
$report_obj = new NursingNotes();
$person_obj = new Person();
require_once $root_path . 'include/care_api_classes/class_notes.php';
$notes_obj = new Notes();
$pid = $person_obj->GetPidFromEncounter($pn);
//if ($station=='') { $station='Non-department specific';  }
if ($pday == '') {
    $pday = date('d');
}
if ($pmonth == '') {
    $pmonth = date('m');
}
if ($pyear == '') {
    $pyear = date('Y');
}
$s_date = $pyear . '-' . $pmonth . '-' . $pday;
$lang_tables = array('actions.php');
define('LANG_FILE', 'nursing.php');
$local_user = '******';
require_once $root_path . 'include/inc_front_chain_lang.php';
if ($edit && !$_COOKIE[$local_user . $sid]) {
    header('Location:' . $root_path . 'language/' . $lang . '/lang_' . $lang . '_invalid-access-warning.php');
    exit;
}
$thisfile = basename($_SERVER['PHP_SELF']);
$breakfile = "nursing-station-patientdaten.php?sid={$sid}&lang={$lang}&station={$station}&pn={$pn}&edit={$edit}";
/* Create encounter object */
require_once $root_path . 'include/care_api_classes/class_encounter.php';
$enc_obj = new Encounter();
/* Create nursing notes object */
require_once $root_path . 'include/care_api_classes/class_notes_nursing.php';
$report_obj = new NursingNotes();
/* Load global configs */
require_once $root_path . 'include/care_api_classes/class_globalconfig.php';
$GLOBAL_CONFIG = array();
$glob_obj = new GlobalConfig($GLOBAL_CONFIG);
$glob_obj->getConfig('patient_%');
/* Establish db connection */
if (!isset($db) || !$db) {
    include $root_path . 'include/inc_db_makelink.php';
}
if ($dblink_ok) {
    /* Load date formatter */
    include_once $root_path . 'include/inc_date_format_functions.php';
    if ($mode == 'save') {
        if ($dateput && $timeput && $berichtput && $author || $dateput2 && $berichtput2 && $author2) {
            // Load the editor functions