Browse Source

Generar tabla vacía cuando no haya CNAG y RNA.

main
Costa 2 years ago
parent
commit
109acff436
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      sqlFunctions.R

+ 2
- 2
sqlFunctions.R

@ -167,13 +167,13 @@ sqlWriteTemp<-function(conn=dta, nhcs=nhc.test, file="queryOV.xlsx", samples.mod
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{cnag.exp<-NULL}
}else{cnag.exp<-sqlFetch(dta, "CNAG") %>% slice(0)}
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(conn, "UMID") %>% filter(NHC %in% nhcs.rna) %>% pull(UMID) umid.rna<-sqlFetch(conn, "UMID") %>% 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), all=T) rna.exp<-merge(data.frame("UMID"=umid.rna, "CODIGO"=sample.rna), sqlFetch(dta, "RNADNA") %>% slice(0), all=T)
}else{rna.exp<-NULL}
}else{rna.exp<- sqlFetch(dta, "RNADNA") %>% slice(0)}
if (clinics.mod){ if (clinics.mod){
## 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(conn, "CLINICOS") upd.clinics<-sqlFetch(conn, "CLINICOS")

Loading…
Cancel
Save