|
|
@@ -6,7 +6,13 @@ library(stringr) |
|
|
|
library(shiny) |
|
|
|
library(DT) |
|
|
|
|
|
|
|
options(shiny.maxRequestSize = 100*1024^2) |
|
|
|
options(shiny.maxRequestSize = 500*1024^2) |
|
|
|
|
|
|
|
if (!dir.exists("/var/www/html/shiny_files/actes")) |
|
|
|
dir.create("/var/www/html/shiny_files/actes") |
|
|
|
|
|
|
|
file.copy("actes_collact.wid", "/var/www/html/shiny_files/actes", overwrite = T) -> null |
|
|
|
file.copy("actes_pims.wid", "/var/www/html/shiny_files/actes", overwrite = T) -> null |
|
|
|
|
|
|
|
# CCAM ==== |
|
|
|
read_csv("CCAM.csv") %>% |
|
|
@@ -23,9 +29,9 @@ ui <- fluidPage( |
|
|
|
titlePanel("Actes manquants collact → pims"), |
|
|
|
sidebarLayout( |
|
|
|
sidebarPanel( |
|
|
|
a(href = "README.html", "Manuel d'utilisation"), |
|
|
|
a(href = "https://livenne.chu-nancy.fr/shiny_files/actes/actes_collact.wid", "Requête collact"), |
|
|
|
a(href = "https://livenne.chu-nancy.fr/shiny_files/actes/actes_pims.wid", "Requête webPIMS"), |
|
|
|
hr(), |
|
|
|
numericInput("annee", "Année", Sys.Date() %>% year), |
|
|
|
fileInput("collact", "Fichier collact", accept = "text/csv"), |
|
|
|
fileInput("webpims", "Fichier webpims", accept = "text/csv"), |
|
|
|
width = 3 |
|
|
@@ -43,23 +49,19 @@ server <- function(input, output) |
|
|
|
collact <- reactive({ |
|
|
|
req(input$collact) |
|
|
|
|
|
|
|
read_csv(input$collact$datapath, col_types = "cccc") %>% |
|
|
|
`names<-`(c("idhosp", "code", "date", "internum")) %>% |
|
|
|
#mutate(date = date %>% as.Date(format = "%d/%m/%Y") + years(2000)) %>% |
|
|
|
mutate(date = date %>% as.Date(format = "%d/%m/%Y")) %>% |
|
|
|
filter(date <= as.Date(str_c(input$annee, "-12-31"))) |
|
|
|
read_csv(input$collact$datapath) %>% |
|
|
|
setNames(c("nda", "entree", "sortie", "code", "date", "uf", "uf_lib")) %>% |
|
|
|
mutate(date = date %>% as.Date(format = "%Y/%m/%d %H:%M:%S")) -> collact |
|
|
|
}) |
|
|
|
|
|
|
|
# webpims ==== |
|
|
|
pims <- reactive({ |
|
|
|
req(input$webpims) |
|
|
|
|
|
|
|
read_csv(input$webpims$datapath, col_types = "ccc") %>% |
|
|
|
`names<-`(c("idhosp", "code", "date")) %>% |
|
|
|
#mutate(date = date %>% as.Date(format = "%Y/%m/%d"), |
|
|
|
mutate(date = date %>% as.Date(format = "%d/%m/%Y"), |
|
|
|
code = code %>% str_sub(1,7)) %>% |
|
|
|
filter(date <= as.Date(str_c(input$annee, "-12-31"))) |
|
|
|
read_csv(input$webpims$datapath) %>% |
|
|
|
setNames(c("nda", "code", "date")) %>% |
|
|
|
mutate(date = date %>% as.Date(format = "%Y/%m/%d %H:%M:%S"), |
|
|
|
code = code %>% str_sub(1,7)) -> pims |
|
|
|
}) |
|
|
|
|
|
|
|
# Output |
|
|
@@ -74,8 +76,7 @@ server <- function(input, output) |
|
|
|
|
|
|
|
# Collact - PIMS ==== |
|
|
|
collact() %>% |
|
|
|
filter(!((code %>% str_detect("^JVJF")) & (date < str_c(input$annee, "-01-01")))) %>% |
|
|
|
anti_join(pims()) %>% |
|
|
|
anti_join(pims(), by = c("nda", "code", "date")) %>% |
|
|
|
left_join(ccam, by = "code") -> collact_pims |
|
|
|
|
|
|
|
setProgress(.5, detail = "Agrégation") |
|
|
|