|
@ -299,13 +299,13 @@ server <- function(input, output) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (input$dbtype == "UM"){ |
|
|
if (input$dbtype == "UM"){ |
|
|
values[["DF"]]<-merge(values[["DF"]], sqlFetch(dta, "UMID")) |
|
|
|
|
|
|
|
|
values[["DF"]]<-merge(values[["DF"]], sqlFetch(dta, "UMID", as.is=T)) |
|
|
} |
|
|
} |
|
|
if (input$dbtype == "OV"){ |
|
|
if (input$dbtype == "OV"){ |
|
|
values[["DF"]]<-merge(values[["DF"]], sqlFetch(dta, "OVID")) |
|
|
|
|
|
|
|
|
values[["DF"]]<-merge(values[["DF"]], sqlFetch(dta, "OVID", as.is=T)) |
|
|
} |
|
|
} |
|
|
if (input$dbtype == "CC"){ |
|
|
if (input$dbtype == "CC"){ |
|
|
values[["DF"]]<-merge(values[["DF"]], sqlFetch(dta, "PATID")) |
|
|
|
|
|
|
|
|
values[["DF"]]<-merge(values[["DF"]], sqlFetch(dta, "PATID", as.is=T)) |
|
|
} |
|
|
} |
|
|
print(values[["DF"]]) |
|
|
print(values[["DF"]]) |
|
|
}) |
|
|
}) |
|
@ -313,9 +313,9 @@ server <- function(input, output) { |
|
|
observeEvent(input$filltemplate,{ |
|
|
observeEvent(input$filltemplate,{ |
|
|
today=T |
|
|
today=T |
|
|
if (input$dbtype == "UM"){ |
|
|
if (input$dbtype == "UM"){ |
|
|
upd.umid<-sqlFetch(dta, "UMID") %>% filter(NHC %in% values[["DF"]]$NHC) |
|
|
|
|
|
|
|
|
upd.umid<-sqlFetch(dta, "UMID", as.is=T) %>% filter(NHC %in% values[["DF"]]$NHC) |
|
|
## Generar código para las nuevas muestras |
|
|
## Generar código para las nuevas muestras |
|
|
samples<-sqlFetch(dta, "MUESTRAS") |
|
|
|
|
|
|
|
|
samples<-sqlFetch(dta, "MUESTRAS", as.is=T) |
|
|
if(sum(grepl(paste0("UM",Sys.time() %>% format("%y")), samples$CODIGO)) > 0){ |
|
|
if(sum(grepl(paste0("UM",Sys.time() %>% format("%y")), samples$CODIGO)) > 0){ |
|
|
next.samp<-gsub(paste0("UM",Sys.time() %>% format("%y")),"", samples$CODIGO) %>% as.numeric %>% max(na.rm=T)+1 |
|
|
next.samp<-gsub(paste0("UM",Sys.time() %>% format("%y")),"", samples$CODIGO) %>% as.numeric %>% max(na.rm=T)+1 |
|
|
}else{ |
|
|
}else{ |
|
@ -323,7 +323,7 @@ server <- function(input, output) { |
|
|
} |
|
|
} |
|
|
last.samp<-next.samp+(length(values[["DF"]]$NHC)-1) |
|
|
last.samp<-next.samp+(length(values[["DF"]]$NHC)-1) |
|
|
new.samp<-sprintf("UM%s%02d",Sys.time() %>% format("%y"),next.samp:last.samp) |
|
|
new.samp<-sprintf("UM%s%02d",Sys.time() %>% format("%y"),next.samp:last.samp) |
|
|
new.samp.df<-data.frame("NHC"=values[["DF"]]$NHC, "CODIGO"=new.samp) %>% merge(sqlFetch(dta,"UMID"), all.x=T) %>% arrange(CODIGO) |
|
|
|
|
|
|
|
|
new.samp.df<-data.frame("NHC"=values[["DF"]]$NHC, "CODIGO"=new.samp) %>% merge(sqlFetch(dta,"UMID", as.is=T), all.x=T) %>% arrange(CODIGO) |
|
|
samples.exp<-merge(samples %>% slice(0), new.samp.df %>% select(-NHC), all=T) %>% select(colnames(samples)) %>% arrange(CODIGO) |
|
|
samples.exp<-merge(samples %>% slice(0), new.samp.df %>% select(-NHC), all=T) %>% select(colnames(samples)) %>% arrange(CODIGO) |
|
|
if (today==TRUE){ |
|
|
if (today==TRUE){ |
|
|
samples.exp$FECHA_RECEPCION<-format(Sys.Date(), "%d/%m/%y") |
|
|
samples.exp$FECHA_RECEPCION<-format(Sys.Date(), "%d/%m/%y") |
|
@ -333,30 +333,30 @@ server <- function(input, output) { |
|
|
|
|
|
|
|
|
if (any(sapply(nhc.table$Samples, function(x) "cnag" %in% strsplit(x,",")[[1]]) == T)){ |
|
|
if (any(sapply(nhc.table$Samples, function(x) "cnag" %in% strsplit(x,",")[[1]]) == T)){ |
|
|
nhcs.cnag<-nhc.table[sapply(nhc.table$Samples, function(x) "cnag" %in% strsplit(x,",")[[1]]),"NHC"] |
|
|
nhcs.cnag<-nhc.table[sapply(nhc.table$Samples, function(x) "cnag" %in% strsplit(x,",")[[1]]),"NHC"] |
|
|
umid.cnag<-sqlFetch(dta, "UMID") %>% filter(NHC %in% nhcs.cnag) %>% pull(UMID) |
|
|
|
|
|
|
|
|
umid.cnag<-sqlFetch(dta, "UMID", as.is=T) %>% filter(NHC %in% nhcs.cnag) %>% pull(UMID) |
|
|
sample.cnag<-samples.exp %>% filter(UMID %in% umid.cnag) %>% pull(CODIGO) |
|
|
sample.cnag<-samples.exp %>% filter(UMID %in% umid.cnag) %>% pull(CODIGO) |
|
|
cnag.exp<-merge(data.frame("UMID"=umid.cnag, "CODIGO"=sample.cnag), sqlFetch(dta, "CNAG") %>% slice(0), all=T) |
|
|
|
|
|
|
|
|
cnag.exp<-merge(data.frame("UMID"=umid.cnag, "CODIGO"=sample.cnag), sqlFetch(dta, "CNAG", as.is=T) %>% slice(0), all=T) |
|
|
if (today==TRUE){ |
|
|
if (today==TRUE){ |
|
|
cnag.exp$FECHA_ENVIO<-format(Sys.Date(), "%d/%m/%y") |
|
|
cnag.exp$FECHA_ENVIO<-format(Sys.Date(), "%d/%m/%y") |
|
|
} |
|
|
} |
|
|
}else{ |
|
|
}else{ |
|
|
cnag.exp<-sqlFetch(dta, "CNAG") %>% slice(0) %>% |
|
|
|
|
|
|
|
|
cnag.exp<-sqlFetch(dta, "CNAG", as.is=T) %>% slice(0) %>% |
|
|
mutate(across(lubridate::is.POSIXct, as.character)) |
|
|
mutate(across(lubridate::is.POSIXct, as.character)) |
|
|
} |
|
|
} |
|
|
if (any(sapply(nhc.table$Samples, function(x) "rna" %in% strsplit(x,",")[[1]]) == T)){ |
|
|
if (any(sapply(nhc.table$Samples, function(x) "rna" %in% strsplit(x,",")[[1]]) == T)){ |
|
|
nhcs.rna<-nhc.table[sapply(nhc.table$Samples, function(x) "rna" %in% strsplit(x,",")[[1]]),"NHC"] |
|
|
nhcs.rna<-nhc.table[sapply(nhc.table$Samples, function(x) "rna" %in% strsplit(x,",")[[1]]),"NHC"] |
|
|
umid.rna<-sqlFetch(dta, "UMID") %>% filter(NHC %in% nhcs.rna) %>% pull(UMID) |
|
|
|
|
|
|
|
|
umid.rna<-sqlFetch(dta, "UMID", as.is=T) %>% filter(NHC %in% nhcs.rna) %>% pull(UMID) |
|
|
sample.rna<-samples.exp %>% filter(UMID %in% umid.rna) %>% pull(CODIGO) |
|
|
sample.rna<-samples.exp %>% filter(UMID %in% umid.rna) %>% pull(CODIGO) |
|
|
rna.exp<-merge(data.frame("UMID"=umid.rna, "CODIGO"=sample.rna), sqlFetch(dta, "RNADNA") %>% slice(0)%>% |
|
|
|
|
|
|
|
|
rna.exp<-merge(data.frame("UMID"=umid.rna, "CODIGO"=sample.rna), sqlFetch(dta, "RNADNA", as.is=T) %>% slice(0)%>% |
|
|
mutate(across(lubridate::is.POSIXct, as.character)), all=T) |
|
|
mutate(across(lubridate::is.POSIXct, as.character)), all=T) |
|
|
}else{ |
|
|
}else{ |
|
|
rna.exp<-sqlFetch(dta, "RNADNA") %>% slice(0) %>% |
|
|
|
|
|
|
|
|
rna.exp<-sqlFetch(dta, "RNADNA", as.is=T) %>% slice(0) %>% |
|
|
mutate(across(lubridate::is.POSIXct, as.character)) |
|
|
mutate(across(lubridate::is.POSIXct, as.character)) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
## Importar los datos clínicos de pacientes existentes y generar nueva entrada par los nuevos |
|
|
## Importar los datos clínicos de pacientes existentes y generar nueva entrada par los nuevos |
|
|
upd.clinics<-sqlFetch(dta, "CLINICOS") |
|
|
|
|
|
umid.new<-sqlFetch(dta, "UMID") %>% filter(NHC %in% values[["DF"]]$NHC) |
|
|
|
|
|
|
|
|
upd.clinics<-sqlFetch(dta, "CLINICOS", as.is=T) |
|
|
|
|
|
umid.new<-sqlFetch(dta, "UMID", as.is=T) %>% filter(NHC %in% values[["DF"]]$NHC) |
|
|
upd.clinics<-merge(umid.new,upd.clinics, all.x=T, by="UMID") |
|
|
upd.clinics<-merge(umid.new,upd.clinics, all.x=T, by="UMID") |
|
|
upd.clinics$NHC<-as.character(upd.clinics$NHC) |
|
|
upd.clinics$NHC<-as.character(upd.clinics$NHC) |
|
|
for (i in colnames(upd.clinics)[sapply(upd.clinics, lubridate::is.POSIXct)]){upd.clinics[,i]<-as.Date(upd.clinics[,i])} |
|
|
for (i in colnames(upd.clinics)[sapply(upd.clinics, lubridate::is.POSIXct)]){upd.clinics[,i]<-as.Date(upd.clinics[,i])} |
|
@ -367,9 +367,9 @@ server <- function(input, output) { |
|
|
values[["rna"]]<-rna.exp |
|
|
values[["rna"]]<-rna.exp |
|
|
} |
|
|
} |
|
|
if (input$dbtype == "OV"){ |
|
|
if (input$dbtype == "OV"){ |
|
|
upd.umid<-sqlFetch(dta, "OVID") %>% filter(NHC %in% values[["DF"]]$NHC) |
|
|
|
|
|
|
|
|
upd.umid<-sqlFetch(dta, "OVID", as.is=T) %>% filter(NHC %in% values[["DF"]]$NHC) |
|
|
## Generar código para las nuevas muestras |
|
|
## Generar código para las nuevas muestras |
|
|
samples<-sqlFetch(dta, "SAMPLES") |
|
|
|
|
|
|
|
|
samples<-sqlFetch(dta, "SAMPLES", as.is=T) |
|
|
if(sum(grepl(paste0("OV",Sys.time() %>% format("%y")), samples$samples)) > 0){ |
|
|
if(sum(grepl(paste0("OV",Sys.time() %>% format("%y")), samples$samples)) > 0){ |
|
|
next.samp<-gsub(paste0("OV",Sys.time() %>% format("%y")),"", samples$samples) %>% as.numeric %>% max(na.rm=T)+1 |
|
|
next.samp<-gsub(paste0("OV",Sys.time() %>% format("%y")),"", samples$samples) %>% as.numeric %>% max(na.rm=T)+1 |
|
|
}else{ |
|
|
}else{ |
|
@ -377,7 +377,7 @@ server <- function(input, output) { |
|
|
} |
|
|
} |
|
|
last.samp<-next.samp+(length(values[["DF"]]$NHC)-1) |
|
|
last.samp<-next.samp+(length(values[["DF"]]$NHC)-1) |
|
|
new.samp<-sprintf("OV%s%02d",Sys.time() %>% format("%y"),next.samp:last.samp) |
|
|
new.samp<-sprintf("OV%s%02d",Sys.time() %>% format("%y"),next.samp:last.samp) |
|
|
new.samp.df<-data.frame("NHC"=values[["DF"]]$NHC, "samples"=new.samp) %>% merge(sqlFetch(dta,"OVID"), all.x=T) %>% arrange(samples) |
|
|
|
|
|
|
|
|
new.samp.df<-data.frame("NHC"=values[["DF"]]$NHC, "samples"=new.samp) %>% merge(sqlFetch(dta,"OVID", as.is=T), all.x=T) %>% arrange(samples) |
|
|
samples.exp<-merge(samples %>% slice(0), new.samp.df %>% select(-NHC), all=T) %>% select(colnames(samples)) %>% arrange(samples) |
|
|
samples.exp<-merge(samples %>% slice(0), new.samp.df %>% select(-NHC), all=T) %>% select(colnames(samples)) %>% arrange(samples) |
|
|
if (today==TRUE){ |
|
|
if (today==TRUE){ |
|
|
samples.exp$IQ_date<-format(Sys.Date(), "%d/%m/%y") |
|
|
samples.exp$IQ_date<-format(Sys.Date(), "%d/%m/%y") |
|
@ -386,8 +386,8 @@ server <- function(input, output) { |
|
|
nhc.table<-values[["DF"]] |
|
|
nhc.table<-values[["DF"]] |
|
|
|
|
|
|
|
|
## Importar los datos clínicos de pacientes existentes y generar nueva entrada par los nuevos |
|
|
## Importar los datos clínicos de pacientes existentes y generar nueva entrada par los nuevos |
|
|
upd.clinics<-sqlFetch(dta, "CLINICS") |
|
|
|
|
|
umid.new<-sqlFetch(dta, "OVID") %>% filter(NHC %in% values[["DF"]]$NHC) |
|
|
|
|
|
|
|
|
upd.clinics<-sqlFetch(dta, "CLINICS", as.is=T) |
|
|
|
|
|
umid.new<-sqlFetch(dta, "OVID", as.is=T) %>% filter(NHC %in% values[["DF"]]$NHC) |
|
|
upd.clinics<-merge(umid.new,upd.clinics, all.x=T, by="OVID") |
|
|
upd.clinics<-merge(umid.new,upd.clinics, all.x=T, by="OVID") |
|
|
upd.clinics$NHC<-as.character(upd.clinics$NHC) |
|
|
upd.clinics$NHC<-as.character(upd.clinics$NHC) |
|
|
for (i in colnames(upd.clinics)[sapply(upd.clinics, lubridate::is.POSIXct)]){upd.clinics[,i]<-as.Date(upd.clinics[,i])} |
|
|
for (i in colnames(upd.clinics)[sapply(upd.clinics, lubridate::is.POSIXct)]){upd.clinics[,i]<-as.Date(upd.clinics[,i])} |
|
@ -397,9 +397,9 @@ server <- function(input, output) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (input$dbtype %in% c("CC")){ |
|
|
if (input$dbtype %in% c("CC")){ |
|
|
upd.umid<-sqlFetch(dta, "PATID") %>% filter(NHC %in% values[["DF"]]$NHC) |
|
|
|
|
|
|
|
|
upd.umid<-sqlFetch(dta, "PATID", as.is=T) %>% filter(NHC %in% values[["DF"]]$NHC) |
|
|
## Generar código para las nuevas muestras |
|
|
## Generar código para las nuevas muestras |
|
|
samples<-sqlFetch(dta, "MUESTRAS") |
|
|
|
|
|
|
|
|
samples<-sqlFetch(dta, "MUESTRAS", as.is=T) |
|
|
if(sum(grepl(paste0(input$dbtype,Sys.time() %>% format("%y")), samples$CODIGO)) > 0){ |
|
|
if(sum(grepl(paste0(input$dbtype,Sys.time() %>% format("%y")), samples$CODIGO)) > 0){ |
|
|
next.samp<-gsub(paste0(input$dbtype,Sys.time() %>% format("%y")),"", samples$CODIGO) %>% as.numeric %>% max(na.rm=T)+1 |
|
|
next.samp<-gsub(paste0(input$dbtype,Sys.time() %>% format("%y")),"", samples$CODIGO) %>% as.numeric %>% max(na.rm=T)+1 |
|
|
}else{ |
|
|
}else{ |
|
@ -407,7 +407,7 @@ server <- function(input, output) { |
|
|
} |
|
|
} |
|
|
last.samp<-next.samp+(length(values[["DF"]]$NHC)-1) |
|
|
last.samp<-next.samp+(length(values[["DF"]]$NHC)-1) |
|
|
new.samp<-sprintf("%s%s%02d",input$dbtype,Sys.time() %>% format("%y"),next.samp:last.samp) |
|
|
new.samp<-sprintf("%s%s%02d",input$dbtype,Sys.time() %>% format("%y"),next.samp:last.samp) |
|
|
new.samp.df<-data.frame("NHC"=values[["DF"]]$NHC, "CODIGO"=new.samp) %>% merge(sqlFetch(dta,"PATID"), all.x=T) %>% arrange(CODIGO) |
|
|
|
|
|
|
|
|
new.samp.df<-data.frame("NHC"=values[["DF"]]$NHC, "CODIGO"=new.samp) %>% merge(sqlFetch(dta,"PATID", as.is=T), all.x=T) %>% arrange(CODIGO) |
|
|
samples.exp<-merge(samples %>% slice(0), new.samp.df %>% select(-NHC), all=T) %>% select(colnames(samples)) %>% arrange(CODIGO) |
|
|
samples.exp<-merge(samples %>% slice(0), new.samp.df %>% select(-NHC), all=T) %>% select(colnames(samples)) %>% arrange(CODIGO) |
|
|
if (today==TRUE){ |
|
|
if (today==TRUE){ |
|
|
samples.exp$FECHA_RECEPCION<-format(Sys.Date(), "%d/%m/%y") |
|
|
samples.exp$FECHA_RECEPCION<-format(Sys.Date(), "%d/%m/%y") |
|
@ -417,30 +417,30 @@ server <- function(input, output) { |
|
|
|
|
|
|
|
|
if (any(sapply(nhc.table$Samples, function(x) "cnag" %in% strsplit(x,",")[[1]]) == T)){ |
|
|
if (any(sapply(nhc.table$Samples, function(x) "cnag" %in% strsplit(x,",")[[1]]) == T)){ |
|
|
nhcs.cnag<-nhc.table[sapply(nhc.table$Samples, function(x) "cnag" %in% strsplit(x,",")[[1]]),"NHC"] |
|
|
nhcs.cnag<-nhc.table[sapply(nhc.table$Samples, function(x) "cnag" %in% strsplit(x,",")[[1]]),"NHC"] |
|
|
umid.cnag<-sqlFetch(dta, "PATID") %>% filter(NHC %in% nhcs.cnag) %>% pull(PATID) |
|
|
|
|
|
|
|
|
umid.cnag<-sqlFetch(dta, "PATID", as.is=T) %>% filter(NHC %in% nhcs.cnag) %>% pull(PATID) |
|
|
sample.cnag<-samples.exp %>% filter(PATID %in% umid.cnag) %>% pull(CODIGO) |
|
|
sample.cnag<-samples.exp %>% filter(PATID %in% umid.cnag) %>% pull(CODIGO) |
|
|
cnag.exp<-merge(data.frame("PATID"=umid.cnag, "CODIGO"=sample.cnag), sqlFetch(dta, "CNAG") %>% slice(0), all=T) |
|
|
|
|
|
|
|
|
cnag.exp<-merge(data.frame("PATID"=umid.cnag, "CODIGO"=sample.cnag), sqlFetch(dta, "CNAG", as.is=T) %>% slice(0), all=T) |
|
|
if (today==TRUE){ |
|
|
if (today==TRUE){ |
|
|
cnag.exp$FECHA_ENVIO<-format(Sys.Date(), "%d/%m/%y") |
|
|
cnag.exp$FECHA_ENVIO<-format(Sys.Date(), "%d/%m/%y") |
|
|
} |
|
|
} |
|
|
}else{ |
|
|
}else{ |
|
|
cnag.exp<-sqlFetch(dta, "CNAG") %>% slice(0) %>% |
|
|
|
|
|
|
|
|
cnag.exp<-sqlFetch(dta, "CNAG", as.is=T) %>% slice(0) %>% |
|
|
mutate(across(lubridate::is.POSIXct, as.character)) |
|
|
mutate(across(lubridate::is.POSIXct, as.character)) |
|
|
} |
|
|
} |
|
|
if (any(sapply(nhc.table$Samples, function(x) "rna" %in% strsplit(x,",")[[1]]) == T)){ |
|
|
if (any(sapply(nhc.table$Samples, function(x) "rna" %in% strsplit(x,",")[[1]]) == T)){ |
|
|
nhcs.rna<-nhc.table[sapply(nhc.table$Samples, function(x) "rna" %in% strsplit(x,",")[[1]]),"NHC"] |
|
|
nhcs.rna<-nhc.table[sapply(nhc.table$Samples, function(x) "rna" %in% strsplit(x,",")[[1]]),"NHC"] |
|
|
umid.rna<-sqlFetch(dta, "PATID") %>% filter(NHC %in% nhcs.rna) %>% pull(PATID) |
|
|
|
|
|
|
|
|
umid.rna<-sqlFetch(dta, "PATID", as.is=T) %>% filter(NHC %in% nhcs.rna) %>% pull(PATID) |
|
|
sample.rna<-samples.exp %>% filter(PATID %in% umid.rna) %>% pull(CODIGO) |
|
|
sample.rna<-samples.exp %>% filter(PATID %in% umid.rna) %>% pull(CODIGO) |
|
|
rna.exp<-merge(data.frame("PATID"=umid.rna, "CODIGO"=sample.rna), sqlFetch(dta, "RNADNA") %>% slice(0)%>% |
|
|
|
|
|
|
|
|
rna.exp<-merge(data.frame("PATID"=umid.rna, "CODIGO"=sample.rna), sqlFetch(dta, "RNADNA", as.is=T) %>% slice(0)%>% |
|
|
mutate(across(lubridate::is.POSIXct, as.character)), all=T) |
|
|
mutate(across(lubridate::is.POSIXct, as.character)), all=T) |
|
|
}else{ |
|
|
}else{ |
|
|
rna.exp<-sqlFetch(dta, "RNADNA") %>% slice(0) %>% |
|
|
|
|
|
|
|
|
rna.exp<-sqlFetch(dta, "RNADNA", as.is=T) %>% slice(0) %>% |
|
|
mutate(across(lubridate::is.POSIXct, as.character)) |
|
|
mutate(across(lubridate::is.POSIXct, as.character)) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
## Importar los datos clínicos de pacientes existentes y generar nueva entrada par los nuevos |
|
|
## Importar los datos clínicos de pacientes existentes y generar nueva entrada par los nuevos |
|
|
upd.clinics<-sqlFetch(dta, "CLINICOS") |
|
|
|
|
|
umid.new<-sqlFetch(dta, "PATID") %>% filter(NHC %in% values[["DF"]]$NHC) |
|
|
|
|
|
|
|
|
upd.clinics<-sqlFetch(dta, "CLINICOS", as.is=T) |
|
|
|
|
|
umid.new<-sqlFetch(dta, "PATID", as.is=T) %>% filter(NHC %in% values[["DF"]]$NHC) |
|
|
upd.clinics<-merge(umid.new,upd.clinics, all.x=T, by="PATID") |
|
|
upd.clinics<-merge(umid.new,upd.clinics, all.x=T, by="PATID") |
|
|
upd.clinics$NHC<-as.character(upd.clinics$NHC) |
|
|
upd.clinics$NHC<-as.character(upd.clinics$NHC) |
|
|
for (i in colnames(upd.clinics)[sapply(upd.clinics, lubridate::is.POSIXct)]){upd.clinics[,i]<-as.Date(upd.clinics[,i])} |
|
|
for (i in colnames(upd.clinics)[sapply(upd.clinics, lubridate::is.POSIXct)]){upd.clinics[,i]<-as.Date(upd.clinics[,i])} |
|
@ -473,8 +473,8 @@ server <- function(input, output) { |
|
|
|
|
|
|
|
|
## Entradas modificadas en CLINICOS |
|
|
## Entradas modificadas en CLINICOS |
|
|
upd.clinics<-values[["CLINICS"]] |
|
|
upd.clinics<-values[["CLINICS"]] |
|
|
umid.mod<-upd.clinics$UMID[upd.clinics$UMID %in% (sqlFetch(dta, "CLINICOS") %>% pull(UMID))] |
|
|
|
|
|
rnames<-sqlFetch(dta, "CLINICOS") %>% filter(UMID %in% umid.mod) %>% rownames |
|
|
|
|
|
|
|
|
umid.mod<-upd.clinics$UMID[upd.clinics$UMID %in% (sqlFetch(dta, "CLINICOS", as.is=T) %>% pull(UMID))] |
|
|
|
|
|
rnames<-sqlFetch(dta, "CLINICOS", as.is=T) %>% filter(UMID %in% umid.mod) %>% rownames |
|
|
clinics.mod<-upd.clinics %>% filter(UMID %in% umid.mod) %>% select(-NHC) |
|
|
clinics.mod<-upd.clinics %>% filter(UMID %in% umid.mod) %>% select(-NHC) |
|
|
rownames(clinics.mod)<-rnames |
|
|
rownames(clinics.mod)<-rnames |
|
|
|
|
|
|
|
@ -487,8 +487,8 @@ server <- function(input, output) { |
|
|
print("Tabla CLINICOS modificada.") |
|
|
print("Tabla CLINICOS modificada.") |
|
|
|
|
|
|
|
|
## Nuevas entradas en CLINICOS |
|
|
## Nuevas entradas en CLINICOS |
|
|
nsamples.clin<-sqlFetch(dta, "CLINICOS") %>% nrow |
|
|
|
|
|
umid.new<-upd.clinics$UMID[!upd.clinics$UMID %in% (sqlFetch(dta, "CLINICOS") %>% pull(UMID))] |
|
|
|
|
|
|
|
|
nsamples.clin<-sqlFetch(dta, "CLINICOS", as.is=T) %>% nrow |
|
|
|
|
|
umid.new<-upd.clinics$UMID[!upd.clinics$UMID %in% (sqlFetch(dta, "CLINICOS", as.is=T) %>% pull(UMID))] |
|
|
clinics.new<-upd.clinics %>% filter(UMID %in% umid.new) %>% select(-NHC) |
|
|
clinics.new<-upd.clinics %>% filter(UMID %in% umid.new) %>% select(-NHC) |
|
|
if (length(umid.new) > 0){rownames(clinics.new)<-(nsamples.clin+1):(nsamples.clin+nrow(clinics.new)) %>% as.character} |
|
|
if (length(umid.new) > 0){rownames(clinics.new)<-(nsamples.clin+1):(nsamples.clin+nrow(clinics.new)) %>% as.character} |
|
|
|
|
|
|
|
@ -505,7 +505,7 @@ server <- function(input, output) { |
|
|
## Nuevas entradas en CNAG |
|
|
## Nuevas entradas en CNAG |
|
|
if (nrow(values[["cnag"]]) > 0){ |
|
|
if (nrow(values[["cnag"]]) > 0){ |
|
|
cnag.sync<-values[["cnag"]] |
|
|
cnag.sync<-values[["cnag"]] |
|
|
fechas<-colnames(cnag.sync)[sqlFetch(dta, "CNAG") %>% sapply(lubridate::is.POSIXct)] |
|
|
|
|
|
|
|
|
fechas<-colnames(cnag.sync)[sqlFetch(dta, "CNAG", as.is=T) %>% sapply(lubridate::is.POSIXct)] |
|
|
varTypes<-rep("Date",length(fechas)) |
|
|
varTypes<-rep("Date",length(fechas)) |
|
|
names(varTypes)<-fechas |
|
|
names(varTypes)<-fechas |
|
|
print(fechas) |
|
|
print(fechas) |
|
@ -518,7 +518,7 @@ server <- function(input, output) { |
|
|
## Nuevas entradas en RNADNA |
|
|
## Nuevas entradas en RNADNA |
|
|
if (nrow(values[["rna"]]) > 0){ |
|
|
if (nrow(values[["rna"]]) > 0){ |
|
|
rna.sync<-values[["rna"]] |
|
|
rna.sync<-values[["rna"]] |
|
|
fechas<-colnames(rna.sync)[sqlFetch(dta, "RNADNA") %>% sapply(lubridate::is.POSIXct)] |
|
|
|
|
|
|
|
|
fechas<-colnames(rna.sync)[sqlFetch(dta, "RNADNA", as.is=T) %>% sapply(lubridate::is.POSIXct)] |
|
|
varTypes<-rep("Date",length(fechas)) |
|
|
varTypes<-rep("Date",length(fechas)) |
|
|
names(varTypes)<-fechas |
|
|
names(varTypes)<-fechas |
|
|
for (i in fechas){ |
|
|
for (i in fechas){ |
|
@ -534,7 +534,7 @@ server <- function(input, output) { |
|
|
if (nrow(upd.samples) > 0){rownames(upd.samples)<-(nsamples+1):(nsamples+nrow(upd.samples)) %>% as.character} |
|
|
if (nrow(upd.samples) > 0){rownames(upd.samples)<-(nsamples+1):(nsamples+nrow(upd.samples)) %>% as.character} |
|
|
|
|
|
|
|
|
if (nrow(upd.samples) > 0){ |
|
|
if (nrow(upd.samples) > 0){ |
|
|
fechas<-colnames(upd.samples)[sqlFetch(dta, "SAMPLES") %>% sapply(lubridate::is.POSIXct)] |
|
|
|
|
|
|
|
|
fechas<-colnames(upd.samples)[sqlFetch(dta, "SAMPLES", as.is=T) %>% sapply(lubridate::is.POSIXct)] |
|
|
for (i in fechas){ |
|
|
for (i in fechas){ |
|
|
upd.samples[,i]<-lubridate::parse_date_time(upd.samples[,i], c("d/m/Y","d/m/y","Y-m-d")) %>% as.Date() |
|
|
upd.samples[,i]<-lubridate::parse_date_time(upd.samples[,i], c("d/m/Y","d/m/y","Y-m-d")) %>% as.Date() |
|
|
} |
|
|
} |
|
@ -549,14 +549,14 @@ server <- function(input, output) { |
|
|
|
|
|
|
|
|
## Entradas modificadas en CLINICOS |
|
|
## Entradas modificadas en CLINICOS |
|
|
upd.clinics<-values[["CLINICS"]] |
|
|
upd.clinics<-values[["CLINICS"]] |
|
|
umid.mod<-upd.clinics$OVID[upd.clinics$OVID %in% (sqlFetch(dta, "CLINICS") %>% pull(OVID))] |
|
|
|
|
|
rnames<-sqlFetch(dta, "CLINICS") %>% filter(OVID %in% umid.mod) %>% rownames |
|
|
|
|
|
|
|
|
umid.mod<-upd.clinics$OVID[upd.clinics$OVID %in% (sqlFetch(dta, "CLINICS", as.is=T) %>% pull(OVID))] |
|
|
|
|
|
rnames<-sqlFetch(dta, "CLINICS", as.is=T) %>% filter(OVID %in% umid.mod) %>% rownames |
|
|
clinics.mod<-upd.clinics %>% filter(OVID %in% umid.mod) %>% select(-NHC) |
|
|
clinics.mod<-upd.clinics %>% filter(OVID %in% umid.mod) %>% select(-NHC) |
|
|
rownames(clinics.mod)<-rnames |
|
|
rownames(clinics.mod)<-rnames |
|
|
|
|
|
|
|
|
### !! Atención, esto cambia la base de datos: |
|
|
### !! Atención, esto cambia la base de datos: |
|
|
print(clinics.mod) |
|
|
print(clinics.mod) |
|
|
fechas<-colnames(clinics.mod)[sqlFetch(dta, "CLINICS") %>% sapply(lubridate::is.POSIXct)] |
|
|
|
|
|
|
|
|
fechas<-colnames(clinics.mod)[sqlFetch(dta, "CLINICS", as.is=T) %>% sapply(lubridate::is.POSIXct)] |
|
|
for (i in fechas){ |
|
|
for (i in fechas){ |
|
|
clinics.mod[,i]<-lubridate::parse_date_time(clinics.mod[,i], c("d/m/Y","d/m/y","Y-m-d")) %>% as.Date() |
|
|
clinics.mod[,i]<-lubridate::parse_date_time(clinics.mod[,i], c("d/m/Y","d/m/y","Y-m-d")) %>% as.Date() |
|
|
} |
|
|
} |
|
@ -567,13 +567,13 @@ server <- function(input, output) { |
|
|
print("Tabla CLINICS modificada.") |
|
|
print("Tabla CLINICS modificada.") |
|
|
|
|
|
|
|
|
## Nuevas entradas en CLINICOS |
|
|
## Nuevas entradas en CLINICOS |
|
|
nsamples.clin<-sqlFetch(dta, "CLINICS") %>% nrow |
|
|
|
|
|
umid.new<-upd.clinics$OVID[!upd.clinics$OVID %in% (sqlFetch(dta, "CLINICS") %>% pull(OVID))] |
|
|
|
|
|
|
|
|
nsamples.clin<-sqlFetch(dta, "CLINICS", as.is=T) %>% nrow |
|
|
|
|
|
umid.new<-upd.clinics$OVID[!upd.clinics$OVID %in% (sqlFetch(dta, "CLINICS", as.is=T) %>% pull(OVID))] |
|
|
clinics.new<-upd.clinics %>% filter(OVID %in% umid.new) %>% select(-NHC) |
|
|
clinics.new<-upd.clinics %>% filter(OVID %in% umid.new) %>% select(-NHC) |
|
|
if (length(umid.new) > 0){rownames(clinics.new)<-(nsamples.clin+1):(nsamples.clin+nrow(clinics.new)) %>% as.character} |
|
|
if (length(umid.new) > 0){rownames(clinics.new)<-(nsamples.clin+1):(nsamples.clin+nrow(clinics.new)) %>% as.character} |
|
|
|
|
|
|
|
|
### !! Atención, esto cambia la base de datos: |
|
|
### !! Atención, esto cambia la base de datos: |
|
|
fechas<-colnames(clinics.new)[sqlFetch(dta, "CLINICS") %>% sapply(lubridate::is.POSIXct)] |
|
|
|
|
|
|
|
|
fechas<-colnames(clinics.new)[sqlFetch(dta, "CLINICS", as.is=T) %>% sapply(lubridate::is.POSIXct)] |
|
|
for (i in fechas){ |
|
|
for (i in fechas){ |
|
|
clinics.new[,i]<-lubridate::parse_date_time(clinics.new[,i], c("d/m/Y","d/m/y","Y-m-d")) %>% as.Date() |
|
|
clinics.new[,i]<-lubridate::parse_date_time(clinics.new[,i], c("d/m/Y","d/m/y","Y-m-d")) %>% as.Date() |
|
|
} |
|
|
} |
|
@ -601,8 +601,8 @@ server <- function(input, output) { |
|
|
|
|
|
|
|
|
## Entradas modificadas en CLINICOS |
|
|
## Entradas modificadas en CLINICOS |
|
|
upd.clinics<-values[["CLINICS"]] |
|
|
upd.clinics<-values[["CLINICS"]] |
|
|
PATID.mod<-upd.clinics$PATID[upd.clinics$PATID %in% (sqlFetch(dta, "CLINICOS") %>% pull(PATID))] |
|
|
|
|
|
rnames<-sqlFetch(dta, "CLINICOS") %>% filter(PATID %in% PATID.mod) %>% rownames |
|
|
|
|
|
|
|
|
PATID.mod<-upd.clinics$PATID[upd.clinics$PATID %in% (sqlFetch(dta, "CLINICOS", as.is=T) %>% pull(PATID))] |
|
|
|
|
|
rnames<-sqlFetch(dta, "CLINICOS", as.is=T) %>% filter(PATID %in% PATID.mod) %>% rownames |
|
|
clinics.mod<-upd.clinics %>% filter(PATID %in% PATID.mod) %>% select(-NHC) |
|
|
clinics.mod<-upd.clinics %>% filter(PATID %in% PATID.mod) %>% select(-NHC) |
|
|
rownames(clinics.mod)<-rnames |
|
|
rownames(clinics.mod)<-rnames |
|
|
|
|
|
|
|
@ -615,8 +615,8 @@ server <- function(input, output) { |
|
|
print("Tabla CLINICOS modificada.") |
|
|
print("Tabla CLINICOS modificada.") |
|
|
|
|
|
|
|
|
## Nuevas entradas en CLINICOS |
|
|
## Nuevas entradas en CLINICOS |
|
|
nsamples.clin<-sqlFetch(dta, "CLINICOS") %>% nrow |
|
|
|
|
|
PATID.new<-upd.clinics$PATID[!upd.clinics$PATID %in% (sqlFetch(dta, "CLINICOS") %>% pull(PATID))] |
|
|
|
|
|
|
|
|
nsamples.clin<-sqlFetch(dta, "CLINICOS", as.is=T) %>% nrow |
|
|
|
|
|
PATID.new<-upd.clinics$PATID[!upd.clinics$PATID %in% (sqlFetch(dta, "CLINICOS", as.is=T) %>% pull(PATID))] |
|
|
clinics.new<-upd.clinics %>% filter(PATID %in% PATID.new) %>% select(-NHC) |
|
|
clinics.new<-upd.clinics %>% filter(PATID %in% PATID.new) %>% select(-NHC) |
|
|
if (length(PATID.new) > 0){rownames(clinics.new)<-(nsamples.clin+1):(nsamples.clin+nrow(clinics.new)) %>% as.character} |
|
|
if (length(PATID.new) > 0){rownames(clinics.new)<-(nsamples.clin+1):(nsamples.clin+nrow(clinics.new)) %>% as.character} |
|
|
|
|
|
|
|
@ -633,7 +633,7 @@ server <- function(input, output) { |
|
|
## Nuevas entradas en CNAG |
|
|
## Nuevas entradas en CNAG |
|
|
if (nrow(values[["cnag"]]) > 0){ |
|
|
if (nrow(values[["cnag"]]) > 0){ |
|
|
cnag.sync<-values[["cnag"]] |
|
|
cnag.sync<-values[["cnag"]] |
|
|
fechas<-colnames(cnag.sync)[sqlFetch(dta, "CNAG") %>% sapply(lubridate::is.POSIXct)] |
|
|
|
|
|
|
|
|
fechas<-colnames(cnag.sync)[sqlFetch(dta, "CNAG", as.is=T) %>% sapply(lubridate::is.POSIXct)] |
|
|
varTypes<-rep("Date",length(fechas)) |
|
|
varTypes<-rep("Date",length(fechas)) |
|
|
names(varTypes)<-fechas |
|
|
names(varTypes)<-fechas |
|
|
print(fechas) |
|
|
print(fechas) |
|
@ -646,7 +646,7 @@ server <- function(input, output) { |
|
|
## Nuevas entradas en RNADNA |
|
|
## Nuevas entradas en RNADNA |
|
|
if (nrow(values[["rna"]]) > 0){ |
|
|
if (nrow(values[["rna"]]) > 0){ |
|
|
rna.sync<-values[["rna"]] |
|
|
rna.sync<-values[["rna"]] |
|
|
fechas<-colnames(rna.sync)[sqlFetch(dta, "RNADNA") %>% sapply(lubridate::is.POSIXct)] |
|
|
|
|
|
|
|
|
fechas<-colnames(rna.sync)[sqlFetch(dta, "RNADNA", as.is=T) %>% sapply(lubridate::is.POSIXct)] |
|
|
varTypes<-rep("Date",length(fechas)) |
|
|
varTypes<-rep("Date",length(fechas)) |
|
|
names(varTypes)<-fechas |
|
|
names(varTypes)<-fechas |
|
|
for (i in fechas){ |
|
|
for (i in fechas){ |
|
|