Commit bae733c0 authored by Pepe Márquez Romero's avatar Pepe Márquez Romero

ULSS connection

parent f3bc2913
...@@ -31,7 +31,8 @@ hospital_names <- c( #Añadir Los de Baskent y sacrocuore ...@@ -31,7 +31,8 @@ hospital_names <- c( #Añadir Los de Baskent y sacrocuore
"UdeA", "UdeA",
"Inantro", "Inantro",
"UNSA", "UNSA",
"UZA" "UZA",
"ULSS6"
) )
project_names <- c( project_names <- c(
...@@ -65,7 +66,8 @@ project_names <- c( ...@@ -65,7 +66,8 @@ project_names <- c(
"INS_Data", "INS_Data",
"INANTRO", "INANTRO",
"UnCoVer-BiH-Final", "UnCoVer-BiH-Final",
"UZA" "UZA",
"ULSS6"
) )
resource_names <- c( resource_names <- c(
...@@ -99,7 +101,8 @@ resource_names <- c( ...@@ -99,7 +101,8 @@ resource_names <- c(
"colombia_all", "colombia_all",
"20220919_INANTRO", "20220919_INANTRO",
"20220919_UNSAInpatient", "20220919_UNSAInpatient",
"20220919_UZA" "20220919_UZA",
"20220919_ULSS6"
) )
urls <- c( urls <- c(
...@@ -133,8 +136,8 @@ urls <- c( ...@@ -133,8 +136,8 @@ urls <- c(
"https://fenfisdi.udea.edu.co/opal", "https://fenfisdi.udea.edu.co/opal",
"https://192.168.1.200:8007", "https://192.168.1.200:8007",
"https://192.168.1.200:8008", "https://192.168.1.200:8008",
"https://uncover.itg.be" "https://uncover.itg.be",
"https://opal.aulss6.veneto.it"
) )
users <- c( users <- c(
...@@ -168,7 +171,8 @@ users <- c( ...@@ -168,7 +171,8 @@ users <- c(
"user_analisis", "user_analisis",
"user_analisis", "user_analisis",
"user_analisis", "user_analisis",
"emertens" "emertens",
"user_analisis"
) )
pass <- c( pass <- c(
...@@ -202,5 +206,6 @@ pass <- c( ...@@ -202,5 +206,6 @@ pass <- c(
"Ekfl07UUgz", "Ekfl07UUgz",
"Ekfl07UUgz", "Ekfl07UUgz",
"Ekfl07UUgz", "Ekfl07UUgz",
"3^z4AV.)hG5~PT/]" "3^z4AV.)hG5~PT/]",
"Ekfl07UUgz"
) )
connect <- function (){ connect <- function (){
cat("\n\n\n----------------------------------------------------------------------------------------------------------") cat("\n\n\n----------------------------------------------------------------------------------------------------------")
cat("\nPlease select the number corresponding to the hospital you want to analyse, if you want to do a combined analysis select multiple hospitals") cat("\nPlease select the number corresponding to the hospital you want to analyse, if you want to do a combined analysis select multiple hospitals")
cat("\n cat("\n
Princesa -> 1 Princesa -> 1
CIPH -> 2 CIPH -> 2
UMF_Iasis -> 3 UMF_Iasis -> 3
SMUC -> 4 SMUC -> 4
HM -> 5 HM -> 5
Porto -> 6 Porto -> 6
FJD -> 7 FJD -> 7
Coimbra -> 8 Coimbra -> 8
UNAV -> 9 UNAV -> 9
TU -> 10 TU -> 10
Baskent: Baskent:
Ankara Impatient -> 11 Ankara Impatient -> 11
Konya Impatient -> 12 Konya Impatient -> 12
Istambul Impatient -> 13 Istambul Impatient -> 13
Izmir Impatient -> 14 Izmir Impatient -> 14
Alanya Impatient -> 15 Alanya Impatient -> 15
Adana Impatient -> 16 Adana Impatient -> 16
Ankara Outpatient -> 17 Ankara Outpatient -> 17
Konya Outpatient -> 18 Konya Outpatient -> 18
Istambul Outpatient -> 19 Istambul Outpatient -> 19
Izmir Outpatient -> 20 Izmir Outpatient -> 20
Alanya Outpatient -> 21 Alanya Outpatient -> 21
Sacrocuore: Sacrocuore:
Emergency database -> 22 Emergency database -> 22
Employees database -> 23 Employees database -> 23
Verona database -> 24 Verona database -> 24
Isaric -> 25 Isaric -> 25
TU Dublin -> 26 TU Dublin -> 26
UMF Cluj -> 27 UMF Cluj -> 27
UdeA -> 28 UdeA -> 28
Inantro -> 29 Inantro -> 29
UNSA -> 30 UNSA -> 30
UZA -> 31 UZA -> 31
ULSS6 -> 32
")
")
inp <- scan()
inp <- scan()
builder <- DSI::newDSLoginBuilder()
builder <- DSI::newDSLoginBuilder()
hospital_names <- hospital_names[inp]
project_names <- project_names[inp] hospital_names <- hospital_names[inp]
resource_names <- resource_names[inp] project_names <- project_names[inp]
urls <- urls[inp] resource_names <- resource_names[inp]
users <- users[inp] urls <- urls[inp]
pass <- pass[inp] users <- users[inp]
pass <- pass[inp]
print(hospital_names)
print(project_names) print(hospital_names)
print(resource_names) print(project_names)
print(urls) print(resource_names)
print(users) print(urls)
print(pass) print(users)
print(pass)
url_ctr <- 0
for(i in 1:length(urls)){ url_ctr <- 0
print(paste("Connecting to Server with URL:", urls[i], sep=" ")) for(i in 1:length(urls)){
builder$append(server = hospital_names[i], url = urls[i], print(paste("Connecting to Server with URL:", urls[i], sep=" "))
user = users[i], password = pass[i], builder$append(server = hospital_names[i], url = urls[i],
resource = paste(project_names[i], resource_names[i], sep="."), user = users[i], password = pass[i],
driver = "OpalDriver", options="list(ssl_verifyhost=0,ssl_verifypeer=0)") resource = paste(project_names[i], resource_names[i], sep="."),
driver = "OpalDriver", options="list(ssl_verifyhost=0,ssl_verifypeer=0)")
url_ctr <- url_ctr+1
} url_ctr <- url_ctr+1
}
logindata <- builder$build()
logindata <- builder$build()
connections <- DSI::datashield.login(logins = logindata, assign = TRUE, symbol = "D", failSafe = TRUE)
connections <- DSI::datashield.login(logins = logindata, assign = TRUE, symbol = "D", failSafe = TRUE)
datashield.assign.expr(connections, symbol = 'data', expr = quote(as.resource.data.frame(D)))
#datashield.assign.expr(connections, symbol = 'auxDf', expr = quote(as.resource.data.frame(D))) datashield.assign.expr(connections, symbol = 'data', expr = quote(as.resource.data.frame(D)))
#datashield.assign.expr(connections, symbol = 'auxDf', expr = quote(as.resource.data.frame(D)))
print("Successful connection to servers.")
print("Successful connection to servers.")
return(list(connections,inp))
} return(list(connections,inp))
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment