Browse Source

Remplacement du téléchargement par publication et archivage

master
Maxime Wack 7 years ago
parent
commit
c3f085976c
1 changed files with 22 additions and 15 deletions
  1. +22
    -15
      index.rmd

+ 22
- 15
index.rmd View File

@@ -70,7 +70,7 @@ inputPanel(
)
inputPanel(
fileInput("exhau_pims", "Fichier d'exhaustivité", accept = "text/csv"),
downloadButton("report", "Télécharger le rapport")
actionButton("publish", "Publier et archiver le rapport")
)

# Récupération des fichiers ePMSI ----
@@ -304,20 +304,27 @@ periode <- reactive({
```

```{r report}
output$report <- downloadHandler(filename = "bilan.html",
content = function(file)
{
rmarkdown::render("cloture.Rmd",
output_file = file,
params = list(annee = input$annee,
mois = input$mois,
rum = rum(),
rss = rss(),
exhau = exhau(),
exhau_pims = exhau_pims(),
Ovalide = tibble::data_frame(nom = names(Ovalide()), tab = Ovalide()),
OvalideP = tibble::data_frame(nom = names(OvalideP()), tab = OvalideP())))
})
observeEvent(input$publish,
{
req(input$annee, input$mois, exhau(), rum(), rss(), exhau_pims(), Ovalide(), OvalideP())


rmarkdown::render("cloture.Rmd",
output_file = "cloture.html",
params = list(annee = input$annee,
mois = input$mois,
rum = rum(),
rss = rss(),
exhau = exhau(),
exhau_pims = exhau_pims(),
Ovalide = tibble::data_frame(nom = names(Ovalide()), tab = Ovalide()),
OvalideP = tibble::data_frame(nom = names(OvalideP()), tab = OvalideP())))
file.copy("cloture.html", str_c("/var/www/html/cloture/archive/cloture", input$annee, "_", str_pad(input$mois, 2, "left", "0"), ".html"), overwrite = T)
file.copy("cloture.html", str_c("archive/cloture", input$annee, "_", str_pad(input$mois, 2, "left", "0"), ".html"), overwrite = T)
file.copy("cloture.html", "/var/www/html/cloture/", overwrite = T)

showModal(modalDialog(title = "Publication", p("Fichier archivé et publié, disponible", a("ici", href = "https://livenne.chu-nancy.fr/sitedim/index.php/clot/bilan")), easyClose = T))
})
```

## Rapport


Loading…
Cancel
Save