include_once $root_path . 'include/care_api_classes/class_tz_insurance.php';
$ins_obj = new Insurance_tz();
# create multi functional object
include_once $root_path . 'include/care_api_classes/class_multi.php';
$multi_obj = new multi();
$vct = $multi_obj->__genNumbers();
# Create insurance object
include_once $root_path . 'include/care_api_classes/class_mini_dental.php';
$mini_obj = new dental();
# Load date formatter
require_once $root_path . 'include/inc_date_format_functions.php';
require_once $root_path . 'global_conf/inc_remoteservers_conf.php';
if ($mode == '' || $mode == 'fresh') {
    if ($ward_info =& $ward_obj->getWardInfo($ward_nr)) {
        $room_obj =& $ward_obj->getRoomInfo($ward_nr, $ward_info['room_nr_start'], $ward_info['room_nr_end']);
        $all_info = $ward_obj->getAll_WardInfo($doclist);
        if (is_object($room_obj)) {
            $room_ok = true;
        } else {
            $room_ok = false;
        }
        # GEt the number of beds
        $nr_beds = $ward_obj->countBeds($ward_nr);
        //echo $ward_obj->getLastQuery();
        //echo $ward_obj->LastRecordCount();
        $ward_ok = true;
        # Create the waiting inpatients' list
        $wnr = isset($w_waitlist) && $w_waitlist ? 0 : $ward_nr;
        $waitlist = $ward_obj->createWaitingInpatientList($wnr);
        $waitlist_count = $ward_obj->LastRecordCount();
        # Get the doctor's on duty information