<?php

//define ('XIM_APP_NAME',"EODACS");
//define ('XIM_APP_CLIENT',"XIMEO-PC01");

$GLOBALS['default_language'] = 'fr';


//empty if eoDACS is located at htdocs root								   
$GLOBALS['approot'] 	= '/eoDACSBootstrap';
$GLOBALS['ximlibwebbasepath'] = '/ximlibweb';								   
$config_servernameorip= (isset($_SERVER['HTTPS']) ? "https" : "http")."://$_SERVER[HTTP_HOST]";

$GLOBALS['eodacs_ip'] = $config_servernameorip;

$config_cssversion = '1';

//BE - FR
$config_eodacs_country = 'BE';

//XMLMANAGER

								   
$GLOBALS['XMLTEMPLATE_DIR'] = 'C:/Ximeo/eoDACSCtrl/XMLProfiles';
$GLOBALS['XMLTEMPLATE_BACKUP_DIR'] = $GLOBALS['XMLTEMPLATE_DIR'].'/backup';
$GLOBALS['XML_FOLDER_FEEDER_CLEANER'] = 'c:/Ximeo/eoDACSCtrl/msgcleaner';

$GLOBALS['InstitutionName'] = "CR Rixensart";

$GLOBALS['DELETE_REPLAY_FOLDER_REQUEST'] = "select distinct replayfolder as foldertocheck
from storagelist where recdate < now() - interval '3 month' and split_part(lower(replayfolder), '/replay/',2) != '' limit 1000;";


//delete all received OK
//delete all CT image
//delete all dapcare worklist if it sill exists
//delete all not_primary if SR received and integrated
$GLOBALS['DELETE_REPLAY_FOLDER_REQUEST_TEMPLATE'] = "select distinct replayfolder as foldertocheck
from storagelist
where recdate < now() - interval '3 month'
and split_part(lower(replayfolder), '/replay/',2) != '' and storagelist.status = 2 and integration_message = ''
union all
select distinct replayfolder from storagelist
where recdate < now() - interval '1 month'
and split_part(lower(replayfolder), '/error/',2) != '' and modalitytitle ='CT' and integration_error = 'INTEGRATE_MODALITYPROFILE_NO_DICOMTAG' and status = 3
union all
select distinct replayfolder from storagelist
where filename ilike 'MWL-%'
union all
select distinct replayfolder  from (select stuid from storagelist where integration_error  in ('INTEGRATE_IMAGE_TYPE_NOT_ORIGINAL_PRIMARY','INTEGRATE_MODALITYPROFILE_NO_DICOMTAG')
group by stuid) theStuid, study, v_sopclass_precedence vmc,storagelist
where integration_error in ('INTEGRATE_IMAGE_TYPE_NOT_ORIGINAL_PRIMARY','INTEGRATE_MODALITYPROFILE_NO_DICOMTAG') and recdate < now() - interval '3 month' and type ='SR' and theStuid.stuid = study.stuid and study.pro_id = vmc.pro_id and storagelist.stuid = study.stuid
limit 10000;";

$GLOBALS['DB_RIS_PORT'] = '5432';
$GLOBALS['DB_RIS_NAME'] = 'eoRIS';
$GLOBALS['DB_RIS_IP'] = '10.0.0.130';
$GLOBALS["DB_RIS_USER"] = "postgres";
$GLOBALS["DB_RIS_PWD"] = "manager";

//DB INFO
$GLOBALS["DB_PORT"] = "5432";
$GLOBALS["DB_IP"] = "127.0.0.1";
$GLOBALS["DB_NAME"] = "eoDACS";

$GLOBALS["DB_USER"] = "postgres";
$GLOBALS["DB_PWD"] = "manager";

$GLOBALS['eoxserverreport_ip']="127.0.0.1";
$GLOBALS['eoxserverreport_port']="6590";
$GLOBALS['eoxserverreport_eoc']="\3";

/** DEBUG **/
$GLOBALS["active_debug"] = false;
$GLOBALS["debug_dir"] = 'c:/foo/eodacslog/';


$workinglist_result_limit = 300;
$GLOBALS["alertplanning_enabled"] = false;							
$plannedexamhist_nday = 3;
$plannedexamhist_date = 'coalesce(study.date::date,now()::date) >= now()::date - interval \''.$plannedexamhist_nday.' day\'';
$exam_list_refresh_interval = 60000; // every 1 minute;

$GLOBALS['dashboard_alert_periodday'] = '7';
$GLOBALS['dashboard_alert_periodtime'] =  "now() - interval '{$GLOBALS['dashboard_alert_periodday']} day'";

$GLOBALS['dashboard_alertpatient_periodday'] = '365';
$GLOBALS['dashboard_alertpatient_periodtime'] =  "now() - interval '{$GLOBALS['dashboard_alertpatient_periodday']} day'";													  

//Brief Report
$GLOBALS["BRIEF_REPORT_HEADER"] = "Centre Radiologie de Rixensart<br>Avenue John Fitzgerald Kennedy 5, <br>1330 Rixensart";


//xml name for alert
$GLOBALS["alertxml_NRDALERT"] = 'createjobmail_nrdalert';
$GLOBALS["alertxml_NEWMODIDENT"] = 'createjobmail_newmodalityidentity';

$EODACS_FOLDER = $GLOBALS['approot'];
$GLOBALS['approotpath'] = $EODACS_FOLDER;										 
$EODACS_ROOT = $EODACS_FOLDER.'/eoDACS';
$DHTMLX_ROOT = $_SERVER['DOCUMENT_ROOT'].'/dhtmlx';
$DHTMLX_URL = '/dhtmlx';
$DHTMLX_EOADDON = '/dhtmlx_addon';
$EXTERN_CSS = '/extern_css';

$tmpdir = $_SERVER['DOCUMENT_ROOT'].$EODACS_FOLDER.'/eoDACS/tmp';

$GLOBALS["afcnfolder"] = $_SERVER['DOCUMENT_ROOT'].$EODACS_FOLDER;

/** Query**/
$GLOBALS['eoquery_ip']="127.0.0.1";
$GLOBALS['eoquery_port'] = "8975";
$GLOBALS['eomovescu_ip']="127.0.0.1";
$GLOBALS['eomovescu_port']="8976";

$GLOBALS['serverquery_aet']='ATTIMO';
$GLOBALS['serverquery_ip']='10.0.0.127';
$GLOBALS['serverquery_port']='2700';

$GLOBALS['dacsquery_aet']='EODACSQR';

//reconciliation data by Query (joblist 5)
$GLOBALS['query_during_inday']='5';
$GLOBALS['query_delay_request_in_us'] = 500000;

//delay retrieve data when receiving an order of Retrieve (joblist 6)
$GLOBALS['retrieve_delay_inminute'] = '10';
$GLOBALS['retrieve_delay_request_in_us'] = 500000;

//chart list
$GLOBALS['connector_dacs_chart'] = '../../../Common/statistic/get_eodacs_chart.php';

//eoDACS configuration files:
$GLOBALS['CTRXML'] = "C:/Ximeo/eoDACSCtrl/bin/eoDACSCtrl.xml";
$GLOBALS['DAPCAREMPPSCONFIG_ARRAY'] =
[];



$GLOBALS['eoDACS_FDW'] = array();

$_fdw_site["groupname"]=$GLOBALS['InstitutionName'];
$_fdw_site["servername"]="";
$_fdw_site["dblinkconnectionname"] = "";
$_fdw_site["schema"] = "public"; // local site
$_fdw_site["schemaremote"] = "public";
$_fdw_site["fetch_alert"] = true;
$_fdw_site["online"] = true;
$_fdw_site["id"] = 0;
$GLOBALS['eoDACS_FDW'][$_fdw_site["id"]] = $_fdw_site;

$_fdw_site["groupname"]="OVH";
$_fdw_site["servername"] = "eodacs_ximserver";
$_fdw_site["dblinkconnectionname"] = "eodacs_ximserver_conn";
$_fdw_site["schema"] = "srv_ximeo";
$_fdw_site["schemaremote"] = "public";
$_fdw_site["fetch_alert"] = false;
$_fdw_site["online"] = false;
$_fdw_site["id"] = 1;
//$GLOBALS['eoDACS_FDW'][$_fdw_site["id"]] = $_fdw_site;

/******************************************************************************/
/** JASPER **/
$GLOBALS["JASPER_APP_FOLDER"] = 'C:/Ximeo/eoJASPERTools';
$GLOBALS["JAVA_EXE"] = '"C:\Program Files\Java\jdk-25\bin\java.exe"';
$GLOBALS["JASPER_TEMPLATES_FOLDER"]     = 'C:/Apache24/htdocs/eoDACSBootstrap/JasperTemplates';					 
$GLOBALS["onlyoffice_temp_folder"] 	= "/var/www/html/eoQUALBootstrap/OnlyOffice/documents";
$GLOBALS["onlyoffice_server"]  	    = "http://10.0.0.114:8085";  // OnlyOffice Document Server														

$GLOBALS['jwt_secret'] = 'ximeoonlyoffice@5678';

?>
