diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..abbb1e7e5285233c2bc36fb0be0f6298b481fca1
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,43 @@
+# History files
+.Rhistory
+.Rapp.history
+
+# Session Data files
+.RData
+cayenne/
+data/
+docs/
+test/
+
+# User-specific files
+.Ruserdata
+
+# Example code in package build process
+*-Ex.R
+
+# Output files from R CMD build
+/*.tar.gz
+
+# Output files from R CMD check
+/*.Rcheck/
+
+# RStudio files
+.Rproj.user/
+
+# produced vignettes
+vignettes/*.html
+vignettes/*.pdf
+
+# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3
+.httr-oauth
+
+# knitr and R markdown default cache directories
+*_cache/
+/cache/
+
+# Temporary files created by R markdown
+*.utf8.md
+*.knit.md
+
+# R Environment Variables
+.Renviron
diff --git a/README.md b/README.md
index cacfcf3e1e94395573436c00407aca006d5ab758..ecc975294fc8bc22d03942e67899f204c4c9be11 100644
--- a/README.md
+++ b/README.md
@@ -1,93 +1 @@
-# irdmalaria_painel
-
-
-
-## Getting started
-
-To make it easy for you to get started with GitLab, here's a list of recommended next steps.
-
-Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
-
-## Add your files
-
-- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
-- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
-
-```
-cd existing_repo
-git remote add origin https://forge.ird.fr/espace-dev/lmi-sentinela/irdmalaria_painel.git
-git branch -M main
-git push -uf origin main
-```
-
-## Integrate with your tools
-
-- [ ] [Set up project integrations](https://forge.ird.fr/espace-dev/lmi-sentinela/irdmalaria_painel/-/settings/integrations)
-
-## Collaborate with your team
-
-- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
-- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
-- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
-- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
-- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
-
-## Test and Deploy
-
-Use the built-in continuous integration in GitLab.
-
-- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
-- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
-- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
-- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
-- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
-
-***
-
-# Editing this README
-
-When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
-
-## Suggestions for a good README
-
-Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
-
-## Name
-Choose a self-explaining name for your project.
-
-## Description
-Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
-
-## Badges
-On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
-
-## Visuals
-Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
-
-## Installation
-Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
-
-## Usage
-Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
-
-## Support
-Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
-
-## Roadmap
-If you have ideas for releases in the future, it is a good idea to list them in the README.
-
-## Contributing
-State if you are open to contributions and what your requirements are for accepting them.
-
-For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
-
-You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
-
-## Authors and acknowledgment
-Show your appreciation to those who have contributed to the project.
-
-## License
-For open source projects, say how it is licensed.
-
-## Project status
-If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
+# irdmalaria_painel
\ No newline at end of file
diff --git a/functions/.DS_Store b/functions/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..186dd53aa42ea12865de52d49a3d24ad59c2f696
Binary files /dev/null and b/functions/.DS_Store differ
diff --git a/functions/addLegendCustom.R b/functions/addLegendCustom.R
new file mode 100644
index 0000000000000000000000000000000000000000..d9c898c231c1fb81ff26ba08f2c94c12281e3328
--- /dev/null
+++ b/functions/addLegendCustom.R
@@ -0,0 +1,6 @@
+addLegendCustom <- function(map, colors, labels, sizes, opacity = 0.5){
+  colorAdditions <- paste0(colors, "; width:", sizes, "px; height:", sizes, "px")
+  labelAdditions <- paste0("<div style='display: inline-block;height: ", sizes, "px;margin-top: 4px;line-height: ", sizes, "px;'>", labels, "</div>")
+  
+  return(addLegend(map, colors = colorAdditions, labels = labelAdditions, opacity = opacity))
+}
\ No newline at end of file
diff --git a/functions/area_har_ingest.R b/functions/area_har_ingest.R
new file mode 100644
index 0000000000000000000000000000000000000000..1effd258bff93856dffce93d5d7938f0366e12ab
--- /dev/null
+++ b/functions/area_har_ingest.R
@@ -0,0 +1,16 @@
+area_har_ingest <- function(json.dir, json.file){
+  
+  # Packages
+  require(dplyr)
+  require(jsonlite)
+  require(data.table)
+  
+  # Load JSON file
+  df <- fromJSON(txt = paste0(json.dir,json.file))$data
+  
+  # Convert df to data.table format
+  df <- data.table::as.data.table(df)
+  
+  # Return pre-processed data
+  return(df)
+}
\ No newline at end of file
diff --git a/functions/calendarHeat.R b/functions/calendarHeat.R
new file mode 100644
index 0000000000000000000000000000000000000000..f7deb893bc8bf207bed2b16b4b18229b05a1adc8
--- /dev/null
+++ b/functions/calendarHeat.R
@@ -0,0 +1,265 @@
+##############################################################################
+#                        Calendar Heatmap                                    #
+#                                by                                          #
+#                         Paul Bleicher                                      #
+# an R version of a graphic from:                                            #
+# http://stat-computing.org/dataexpo/2009/posters/wicklin-allison.pdf        #
+#  requires lattice, chron, grid packages                                    #
+############################################################################## 
+
+## calendarHeat: An R function to display time-series data as a calendar heatmap 
+## Copyright 2009 Humedica. All rights reserved.
+
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+
+## You can find a copy of the GNU General Public License, Version 2 at:
+## http://www.gnu.org/licenses/gpl-2.0.html
+
+calendarHeat <- function(dates, 
+                         values, 
+                         ncolors=99, 
+                         color="r2g", 
+                         varname="Values",
+                         date.form = "%Y-%m-%d", ...) {
+  require(lattice)
+  require(grid)
+  require(chron)
+  if (class(dates) == "character" | class(dates) == "factor" ) {
+    dates <- strptime(dates, date.form)
+  }
+  caldat <- data.frame(value = values, dates = dates)
+  min.date <- as.Date(paste(format(min(dates), "%Y"),
+                            "-1-1",sep = ""))
+  max.date <- as.Date(paste(format(max(dates), "%Y"),
+                            "-12-31", sep = ""))
+  dates.f <- data.frame(date.seq = seq(min.date, max.date, by="days"))
+  
+  # Merge moves data by one day, avoid
+  caldat <- data.frame(date.seq = seq(min.date, max.date, by="days"), value = NA)
+  dates <- as.Date(dates) 
+  caldat$value[match(dates, caldat$date.seq)] <- values
+  
+  caldat$dotw <- as.numeric(format(caldat$date.seq, "%w"))
+  caldat$woty <- as.numeric(format(caldat$date.seq, "%U")) + 1
+  caldat$yr <- as.factor(format(caldat$date.seq, "%Y"))
+  caldat$month <- as.numeric(format(caldat$date.seq, "%m"))
+  yrs <- as.character(unique(caldat$yr))
+  d.loc <- as.numeric()                        
+  for (m in min(yrs):max(yrs)) {
+    d.subset <- which(caldat$yr == m)  
+    sub.seq <- seq(1,length(d.subset))
+    d.loc <- c(d.loc, sub.seq)
+  }  
+  caldat <- cbind(caldat, seq=d.loc)
+  
+  #color styles
+  r2b <- c("#0571B0", "#92C5DE", "#F7F7F7", "#F4A582", "#CA0020") #red to blue                                                                               
+  r2g <- c("#D61818", "#FFAE63", "#FFFFBD", "#B5E384")   #red to green
+  w2b <- c("#045A8D", "#2B8CBE", "#74A9CF", "#BDC9E1", "#F1EEF6")   #white to blue
+  g2r <- c("#B5E384", "#FFFFBD", "#FFAE63", "#D61818") #green to red
+  
+  assign("col.sty", get(color))
+  calendar.pal <- colorRampPalette((col.sty), space = "Lab")
+  def.theme <- lattice.getOption("default.theme")
+  cal.theme <-
+    function() {  
+      theme <-
+        list(
+          strip.background = list(col = "transparent"),
+          strip.border = list(col = "transparent"),
+          axis.line = list(col="transparent"),
+          par.strip.text=list(cex=0.8))
+    }
+  lattice.options(default.theme = cal.theme)
+  yrs <- (unique(caldat$yr))
+  nyr <- length(yrs)
+  print(cal.plot <- levelplot(value~woty*dotw | yr, data=caldat,
+                              as.table=TRUE,
+                              aspect=.12,
+                              #layout = c(1, nyr%%7),
+                              layout = c(1, nyr),
+                              #between = list(x=0, y=c(1,1)),
+                              between = list(x=0, y=c(0.5, 0.5)),
+                              strip=TRUE,
+                              #main = paste("Calendar Heat Map of ", varname, sep = ""),
+                              scales = list(
+                                x = list(
+                                  at= c(seq(2.9, 52, by=4.42)),
+                                  labels = month.abb,
+                                  alternating = c(1, rep(0, (nyr-1))),
+                                  tck=0,
+                                  cex = 0.7),
+                                y=list(
+                                  at = c(0, 1, 2, 3, 4, 5, 6),
+                                  labels = c("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
+                                             "Friday", "Saturday"),
+                                  alternating = 1,
+                                  cex = 0.6,
+                                  tck=0)),
+                              xlim =c(0.4, 54.6),
+                              ylim=c(6.6,-0.6),
+                              cuts= ncolors - 1,
+                              col.regions = (calendar.pal(ncolors)),
+                              xlab="" ,
+                              ylab="",
+                              colorkey= list(col = calendar.pal(ncolors), width = 0.6, height = 0.5),
+                              subscripts=TRUE
+  ) )
+  panel.locs <- trellis.currentLayout()
+  for (row in 1:nrow(panel.locs)) {
+    for (column in 1:ncol(panel.locs))  {
+      if (panel.locs[row, column] > 0)
+      {
+        trellis.focus("panel", row = row, column = column,
+                      highlight = FALSE)
+        xyetc <- trellis.panelArgs()
+        subs <- caldat[xyetc$subscripts,]
+        dates.fsubs <- caldat[caldat$yr == unique(subs$yr),]
+        y.start <- dates.fsubs$dotw[1]
+        y.end   <- dates.fsubs$dotw[nrow(dates.fsubs)]
+        dates.len <- nrow(dates.fsubs)
+        adj.start <- dates.fsubs$woty[1]
+        
+        for (k in 0:6) {
+          if (k < y.start) {
+            x.start <- adj.start + 0.5
+          } else {
+            x.start <- adj.start - 0.5
+          }
+          if (k > y.end) {
+            x.finis <- dates.fsubs$woty[nrow(dates.fsubs)] - 0.5
+          } else {
+            x.finis <- dates.fsubs$woty[nrow(dates.fsubs)] + 0.5
+          }
+          grid.lines(x = c(x.start, x.finis), y = c(k -0.5, k - 0.5), 
+                     default.units = "native", gp=gpar(col = "grey", lwd = 1))
+        }
+        if (adj.start <  2) {
+          grid.lines(x = c( 0.5,  0.5), y = c(6.5, y.start-0.5), 
+                     default.units = "native", gp=gpar(col = "grey", lwd = 1))
+          grid.lines(x = c(1.5, 1.5), y = c(6.5, -0.5), default.units = "native",
+                     gp=gpar(col = "grey", lwd = 1))
+          grid.lines(x = c(x.finis, x.finis), 
+                     y = c(dates.fsubs$dotw[dates.len] -0.5, -0.5), default.units = "native",
+                     gp=gpar(col = "grey", lwd = 1))
+          if (dates.fsubs$dotw[dates.len] != 6) {
+            grid.lines(x = c(x.finis + 1, x.finis + 1), 
+                       y = c(dates.fsubs$dotw[dates.len] -0.5, -0.5), default.units = "native",
+                       gp=gpar(col = "grey", lwd = 1))
+          }
+          grid.lines(x = c(x.finis, x.finis), 
+                     y = c(dates.fsubs$dotw[dates.len] -0.5, -0.5), default.units = "native",
+                     gp=gpar(col = "grey", lwd = 1))
+        }
+        for (n in 1:51) {
+          grid.lines(x = c(n + 1.5, n + 1.5), 
+                     y = c(-0.5, 6.5), default.units = "native", gp=gpar(col = "grey", lwd = 1))
+        }
+        x.start <- adj.start - 0.5
+        
+        if (y.start > 0) {
+          grid.lines(x = c(x.start, x.start + 1),
+                     y = c(y.start - 0.5, y.start -  0.5), default.units = "native",
+                     gp=gpar(col = "black", lwd = 1.75))
+          grid.lines(x = c(x.start + 1, x.start + 1),
+                     y = c(y.start - 0.5 , -0.5), default.units = "native",
+                     gp=gpar(col = "black", lwd = 1.75))
+          grid.lines(x = c(x.start, x.start),
+                     y = c(y.start - 0.5, 6.5), default.units = "native",
+                     gp=gpar(col = "black", lwd = 1.75))
+          if (y.end < 6  ) {
+            grid.lines(x = c(x.start + 1, x.finis + 1),
+                       y = c(-0.5, -0.5), default.units = "native",
+                       gp=gpar(col = "black", lwd = 1.75))
+            grid.lines(x = c(x.start, x.finis),
+                       y = c(6.5, 6.5), default.units = "native",
+                       gp=gpar(col = "black", lwd = 1.75))
+          } else {
+            grid.lines(x = c(x.start + 1, x.finis),
+                       y = c(-0.5, -0.5), default.units = "native",
+                       gp=gpar(col = "black", lwd = 1.75))
+            grid.lines(x = c(x.start, x.finis),
+                       y = c(6.5, 6.5), default.units = "native",
+                       gp=gpar(col = "black", lwd = 1.75))
+          }
+        } else {
+          grid.lines(x = c(x.start, x.start),
+                     y = c( - 0.5, 6.5), default.units = "native",
+                     gp=gpar(col = "black", lwd = 1.75))
+        }
+        
+        if (y.start == 0 ) {
+          if (y.end < 6  ) {
+            grid.lines(x = c(x.start, x.finis + 1),
+                       y = c(-0.5, -0.5), default.units = "native",
+                       gp=gpar(col = "black", lwd = 1.75))
+            grid.lines(x = c(x.start, x.finis),
+                       y = c(6.5, 6.5), default.units = "native",
+                       gp=gpar(col = "black", lwd = 1.75))
+          } else {
+            grid.lines(x = c(x.start + 1, x.finis),
+                       y = c(-0.5, -0.5), default.units = "native",
+                       gp=gpar(col = "black", lwd = 1.75))
+            grid.lines(x = c(x.start, x.finis),
+                       y = c(6.5, 6.5), default.units = "native",
+                       gp=gpar(col = "black", lwd = 1.75))
+          }
+        }
+        for (j in 1:12)  {
+          last.month <- max(dates.fsubs$seq[dates.fsubs$month == j])
+          x.last.m <- dates.fsubs$woty[last.month] + 0.5
+          y.last.m <- dates.fsubs$dotw[last.month] + 0.5
+          grid.lines(x = c(x.last.m, x.last.m), y = c(-0.5, y.last.m),
+                     default.units = "native", gp=gpar(col = "black", lwd = 1.75))
+          if ((y.last.m) < 6) {
+            grid.lines(x = c(x.last.m, x.last.m - 1), y = c(y.last.m, y.last.m),
+                       default.units = "native", gp=gpar(col = "black", lwd = 1.75))
+            grid.lines(x = c(x.last.m - 1, x.last.m - 1), y = c(y.last.m, 6.5),
+                       default.units = "native", gp=gpar(col = "black", lwd = 1.75))
+          } else {
+            grid.lines(x = c(x.last.m, x.last.m), y = c(- 0.5, 6.5),
+                       default.units = "native", gp=gpar(col = "black", lwd = 1.75))
+          }
+        }
+      }
+    }
+    trellis.unfocus()
+  } 
+  lattice.options(default.theme = def.theme)
+}
+
+## Example of use: Plot financial data
+## This code is not run.
+if(FALSE) {
+  
+  #create faux data; skip this to use data from a file or stock data
+  #ndays <- 1500   #set number of days
+  #dates <- as.POSIXlt(seq(Sys.Date()- ndays, Sys.Date() - 1, by="days"))
+  #vals <- runif(ndays, -100, 100)
+  
+  #stock data:
+  stock <- "MSFT"
+  start.date <- "2006-01-12"
+  end.date <- Sys.Date()
+  quote <- paste("http://ichart.finance.yahoo.com/table.csv?s=",
+                 stock,
+                 "&a=", substr(start.date,6,7),
+                 "&b=", substr(start.date, 9, 10),
+                 "&c=", substr(start.date, 1,4), 
+                 "&d=", substr(end.date,6,7),
+                 "&e=", substr(end.date, 9, 10),
+                 "&f=", substr(end.date, 1,4),
+                 "&g=d&ignore=.csv", sep="")             
+  stock.data <- read.csv(quote, as.is=TRUE)
+  
+  # Plot as calendar heatmap
+  calendarHeat(stock.data$Date, stock.data$Adj.Close, varname="MSFT Adjusted Close")
+}
\ No newline at end of file
diff --git a/functions/consultation_har_filter.R b/functions/consultation_har_filter.R
new file mode 100644
index 0000000000000000000000000000000000000000..add879aed54f02985113a7188be3f28dde535c5c
--- /dev/null
+++ b/functions/consultation_har_filter.R
@@ -0,0 +1,63 @@
+consultation_har_filter <- function(df, source = "Any", new_attack, dateStart = "Any", dateEnd = "Any", diagn = "Any", minAge = NULL, maxAge = NULL, sex = "Any", active_diagn = "No"){
+  
+  # Packages
+  require(dplyr)
+  
+  # source
+  if(source != "Any"){
+    if(source == "FG"){
+      df <- df %>% filter(source == "FR-GF")
+    } else if(source == "BR"){
+      df <- df %>% filter(source == "BR")
+    }
+  }
+  
+  # new_attack
+  if(new_attack != "Any"){
+    if(new_attack == TRUE){
+      df <- df %>% filter(new_attack == TRUE)
+    } else if (new_attack == FALSE){
+      df <- df %>% filter(new_attack == FALSE)
+    }
+  } 
+  
+  # consultation_date
+  if(dateStart != "Any" & dateEnd != "Any"){
+    dateStart <- as.Date(dateStart)
+    dateEnd <- as.Date(dateEnd)
+    df <- df %>% filter(consultation_date >= dateStart & consultation_date <= dateEnd)
+  }
+  
+  # diagnosis_result
+  if(diagn != "Any"){
+    if(diagn == "falciparum"){
+      df <- df %>% filter(diagnosis_result == "falciparum")
+    } else if(diagn == "mixed infection with P. falciparum"){
+      df <- df %>% filter(diagnosis_result == "mixed infection with P. falciparum")
+    } else if(diagn == "non-falciparum"){
+      df <- df %>% filter(diagnosis_result == "non-falciparum")
+    } else if(diagn == "unspecified"){
+      df <- df %>% filter(diagnosis_result == "unspecified")
+    }
+  }
+  
+  # patient_age
+  if(!(is.null(minAge) & is.null(maxAge))){
+    df <- df %>% filter(patient_age >= minAge & patient_age <= maxAge)
+  }
+  
+  # patient_sex
+  if(sex != "Any"){
+    df <- df %>% filter(patient_sex == sex)
+  }
+  
+  # active_diagnosis
+  if(active_diagn == "No"){
+    df <- df %>% filter(active_diagnosis == FALSE)
+  } else if(active_diagn == "Yes") {
+    df <- df %>% filter(active_diagnosis == TRUE)
+  }
+  
+  # Return filtered df
+  return(df)
+}
\ No newline at end of file
diff --git a/functions/consultation_har_ingest.R b/functions/consultation_har_ingest.R
new file mode 100644
index 0000000000000000000000000000000000000000..e8488524b0b163b553507f600ae0b1e65275518a
--- /dev/null
+++ b/functions/consultation_har_ingest.R
@@ -0,0 +1,50 @@
+consultation_har_ingest <- function(json.dir, json.file){
+  
+  # Packages
+  require(dplyr)
+  require(jsonlite)
+  require(data.table)
+  
+  # Load JSON file
+  df <- fromJSON(txt = paste0(json.dir,json.file))$data
+  
+  # Convert df to data.table format
+  df <- data.table::as.data.table(df)
+  
+  # id_center
+  df$id_center[ df$id_center == ""] <- NA
+  
+  # residence_place
+  df$residence_place[ df$residence_place == ""] <- NA
+  
+  # infection_place
+  df$infection_place[ df$infection_place == ""] <- NA
+  
+  # id_consultation
+  df$id_consultation[ df$id_consultation == ""] <- NA
+  
+  # consultation_date
+  df$consultation_date <- as.Date(df$consultation_date, format = "%d/%m/%Y")
+  
+  # diagnosis_result
+  df$diagnosis_result <- as.factor(df$diagnosis_result) %>%
+    dplyr::recode(., "1" = "Negative", "2" = "Falciparum", "3" = "F + FG", "4" = "Vivax", "5" = "F + V",
+                  "6" = "V + FG", "7" = "FG", "8" = "Malariae", "9" = "F + M", "10" = "Ovale", "11" = "Non Falciparum")
+  
+  # patient_age
+  df$patient_age <- as.numeric(df$patient_age)
+  df$patient_age[ df$patient_age > 100] <- NA
+  
+  # patient_sex
+  df$patient_sex <- as.factor(df$patient_sex) %>%
+    dplyr::recode(., "0" =  "Desconhecido", "1" = "Male", "2" = "Female", "9" = "Desconhecido")
+  
+  # active_diagnosis
+  df$active_diagnosis <- as.logical(df$active_diagnosis)
+  
+  # new_attack
+  df$new_attack <- as.logical(df$new_attack)
+  
+  # Return pre-processed data
+  return(df)
+}
\ No newline at end of file
diff --git a/functions/consultation_json2csv.R b/functions/consultation_json2csv.R
new file mode 100644
index 0000000000000000000000000000000000000000..b1f3f0f4fa5f9dd66800bf03b9a0ca6db614e9a3
--- /dev/null
+++ b/functions/consultation_json2csv.R
@@ -0,0 +1,58 @@
+# write
+consultation_har_ingest2_write <- function(json.dir, json.file){
+  
+  # Packages
+  require(dplyr)
+  require(jsonlite)
+  require(data.table)
+  
+  # Load JSON file
+  df <- fromJSON(txt = paste0(json.dir,json.file))$data
+  
+  # Convert df to data.table format
+  df <- data.table::as.data.table(df)
+  
+  # id_center
+  df$id_center[ df$id_center == ""] <- NA
+  
+  # residence_place
+  df$residence_place[ df$residence_place == ""] <- NA
+  
+  # infection_place
+  df$infection_place[ df$infection_place == ""] <- NA
+  
+  # id_consultation
+  df$id_consultation[ df$id_consultation == ""] <- NA
+  
+  # consultation_date
+  df$consultation_date <- as.Date(df$consultation_date, format = "%d/%m/%Y")
+  
+  # diagnosis_result
+  df$diagnosis_result <- as.factor(df$diagnosis_result) %>%
+    dplyr::recode(., "1" = "Negative", "2" = "Falciparum", "3" = "F + FG", "4" = "Vivax", "5" = "F + V",
+                  "6" = "V + FG", "7" = "FG", "8" = "Malariae", "9" = "F + M", "10" = "Ovale", "11" = "Non Falciparum")
+  
+  # patient_age
+  df$patient_age <- as.numeric(df$patient_age)
+  df$patient_age[ df$patient_age > 100] <- NA
+  
+  # patient_sex
+  df$patient_sex <- as.factor(df$patient_sex) %>%
+    dplyr::recode(., "0" =  "Desconhecido", "1" = "Male", "2" = "Female", "9" = "Desconhecido")
+  
+  # active_diagnosis
+  df$active_diagnosis <- as.logical(df$active_diagnosis)
+  
+  # new_attack
+  df$new_attack <- as.logical(df$new_attack)
+  
+  tbl <- as_tibble(df)
+  readr::write_csv(tbl, "data/JSON_consultation_har.csv")
+  # Return pre-processed data
+  return(tbl)
+}
+
+consultation_har_ingest2_load <- function(csv_file) {
+  df <- readr::read_csv(csv_file)
+  return(df)
+}
\ No newline at end of file
diff --git a/functions/decompose.R b/functions/decompose.R
new file mode 100644
index 0000000000000000000000000000000000000000..77e1fef226cadf70ef5bc804048f0f3e71b51ec9
--- /dev/null
+++ b/functions/decompose.R
@@ -0,0 +1,13 @@
+decompose <- function(x){
+  date1 <- min(x)
+  date2 <- max(x)
+  inc <- as.data.frame(incidence(dates = x, interval = 1)) 
+  full <- data.frame(dates = seq(date1, date2, by = "day"))
+  inc <- dplyr::right_join(inc, full, by = "dates")
+  inc[is.na(inc)] <- 0
+  inc_ts <- ts(inc$counts, frequency = 365)
+  inc_dec <- stl(inc_ts, s.window="periodic")
+  df_dec <- as.data.frame(inc_dec$time.series)
+  df_dec <- cbind(df_dec, dates = inc$dates)
+  return(df_dec)
+}
\ No newline at end of file
diff --git a/functions/healthcenter_har_ingest.R b/functions/healthcenter_har_ingest.R
new file mode 100644
index 0000000000000000000000000000000000000000..37b43a48376a1100ce71c44bc48d4d535025e954
--- /dev/null
+++ b/functions/healthcenter_har_ingest.R
@@ -0,0 +1,16 @@
+healthcenter_har_ingest <- function(json.dir, json.file){
+  
+  # Packages
+  require(dplyr)
+  require(jsonlite)
+  require(data.table)
+  
+  # Load JSON file
+  df <- fromJSON(txt = paste0(json.dir,json.file))$data
+  
+  # Convert df to data.table format
+  df <- data.table::as.data.table(df)
+  
+  # Return pre-processed data
+  return(df)
+}
\ No newline at end of file
diff --git a/functions/last_update.R b/functions/last_update.R
new file mode 100644
index 0000000000000000000000000000000000000000..d9bbaa835a7f2fd49f5cba4bf51a8291159b1ff7
--- /dev/null
+++ b/functions/last_update.R
@@ -0,0 +1,15 @@
+# read last update for Brazil & French Guyana
+# from data\dates_recup_donnees_syst_surveillance.txt
+#library(readr)
+#library(stringr)
+#library(lubridate)
+
+last_update <- function(ftxt="data/dates_recup_donnees_syst_surveillance.txt") {
+  data_txt <- readLines(ftxt)
+  sapply(strsplit(data_txt, " "), function(X) {
+    #Y <- lubridate::ymd(X[2], quiet=T) %>% list()
+    Y <- tryCatch(list(as.Date(X[2])), error = function(e) "NA")
+    names(Y) <- X[1]
+    return(Y)
+  })
+}
diff --git a/functions/translate.R b/functions/translate.R
new file mode 100644
index 0000000000000000000000000000000000000000..5e42d0f80b8a7ed44fcb5eb3a8f9846950d310be
--- /dev/null
+++ b/functions/translate.R
@@ -0,0 +1,4 @@
+# Function to translate key 
+tr <- function(text){
+  sapply(text,function(s) translation[[s]][[input$language]], USE.NAMES=FALSE)
+}
\ No newline at end of file
diff --git a/functions/update_OSM_data.R b/functions/update_OSM_data.R
new file mode 100644
index 0000000000000000000000000000000000000000..6c6c56b961f3fb7db22d3a30a72096d9ca0ffd7d
--- /dev/null
+++ b/functions/update_OSM_data.R
@@ -0,0 +1,18 @@
+# Mise à jour données OSM
+
+library(osmdata)
+
+f_hosp <- "data/osm/hospital_guyamapa.osm"
+f_clin <- "data/osm/clinic_guyamapa.osm"
+
+# function : update OSM data 
+try({
+  bbox_guyam <- "(-1.24,-54.88,5.78,-49.34)"
+  q_hosp_guyam <- paste0(
+    "( nwr[amenity=hospital]", bbox_guyam, "; ); out center;")
+  q_clin_guyam <- paste0(
+    "( nwr[amenity=clinic]", bbox_guyam, "; ); out center;")
+  result_hosp <- osmdata_xml(q_hosp_guyam, filename=f_hosp)
+  result_clin <- osmdata_xml(q_clin_guyam, filename=f_clin)
+  print("OSM data updated !")
+})
\ No newline at end of file
diff --git a/google-analytics.js b/google-analytics.js
new file mode 100644
index 0000000000000000000000000000000000000000..891e8f0317519cbe69f09e0ac7b65b4f52256488
--- /dev/null
+++ b/google-analytics.js
@@ -0,0 +1,4 @@
+window.dataLayer = window.dataLayer || [];
+function gtag(){dataLayer.push(arguments);}
+gtag('js', new Date());
+gtag('config', 'UA-121861538-1');
\ No newline at end of file
diff --git a/irdmalaria_painel.Rproj b/irdmalaria_painel.Rproj
new file mode 100644
index 0000000000000000000000000000000000000000..8e3c2ebc99e2e337f7d69948b93529a437590b27
--- /dev/null
+++ b/irdmalaria_painel.Rproj
@@ -0,0 +1,13 @@
+Version: 1.0
+
+RestoreWorkspace: Default
+SaveWorkspace: Default
+AlwaysSaveHistory: Default
+
+EnableCodeIndexing: Yes
+UseSpacesForTab: Yes
+NumSpacesForTab: 2
+Encoding: UTF-8
+
+RnwWeave: Sweave
+LaTeX: pdfLaTeX
diff --git a/locale/.DS_Store b/locale/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..f3cbffd79cabcf8e1959e71dc7e97b00a534e7e7
Binary files /dev/null and b/locale/.DS_Store differ
diff --git a/locale/dictionary.csv b/locale/dictionary.csv
new file mode 100644
index 0000000000000000000000000000000000000000..61ec22d5786db4aa3e8dff7ba1e27cb75721769d
--- /dev/null
+++ b/locale/dictionary.csv
@@ -0,0 +1,98 @@
+key;en;fr;pt
+tab_harmonizedIndicators;Harmonized indicators;Indicateurs harmonisés;Indicadores harmonizados
+tab_harmonizedIndicators_loc;By location;Par emplacement;Por localização
+tab_brazilIndicators;Brazil indicators;Indicateurs Brésil;Indicadores Brasil
+tab_guianaIndicators;F. Guiana indicators;Indicateurs Guyane Française;Indicadores F. Guiana
+tab_ranking;Ranking;Classement;Ranking
+tab_trends;Trends;Tendance;Tendências
+tab_map;Maps;Cartes;Mapas
+tab_infoq;Information quality;Qualité de l'information;Qualidade da informação
+tab_download;Download;Download;Download
+both;Both;Les deux;Ambos
+yes;Yes;Oui;Sim
+no;No;Non;Não
+Any;Any;N'importe;Qualquer
+Falci_exclusive;Falciparum exclusive;Seulement falciparum;Apenas falciparum
+Falci_assoc;Falciparum and associations;Falciparum et associations;Falciparum e associações
+Non_falci;Non Falciparum;Non Falciparum;Não falciparum
+Negative;Negative;Négatif;Negativo
+numberOfObservations;Number of observations;Nombre d'observations;Número de observações
+filter;Filter;Filtre;Filtro
+new_attack;New case;Nouveau cas;Caso novo
+new_cases;New cases;Nouveaux cas;Casos novos
+old_cases;Notifications related to patients' follow-up, treatment failures and relaps;Notifications associées au suivi des patients, aux échecs de traitements et aux reviviscences;Notificações relacionadas ao seguimento dos pacientes, falhas de tratamento e recaídas
+plasmodium;Plasmodium species;Espèce de Plasmodium;Espécie de Plasmodium
+age;Age;Âge;Idade
+sex;Sex;Sexe;Sexo
+incidence;Incidence;Incidence;Incidência
+cases;Cases;Cas;Casos
+cases2;cases;cas;casos
+date;Date;Date;Data
+agg;Aggregation;Aggregation;Agregação
+daily;Daily;Quotidien;Diário
+weekly;Epi week;Epi semaine;Semana Epi
+30_days;Monthly;Mensuel;Mensal
+60_days;Bimonthly;Bimestriel;Bimestral
+90_days;Quarter;Trimestriel;Trimestral
+imported;Imported cases from FG found in BR;Cas importés de GF trouvé au Brésil;Casos importados da GF detectados no BR
+imported2;Imported;Importé;Importado
+anomalies;Detect anomalies;Détecter anomalies;Detectar anomalias
+male;Male;Masculin;Masculino
+female;Female;Féminin;Feminimo
+not_specified;Not specified;Non spécifié;Não especificado
+percentage;Percentage;Pourcentage;Percentual
+proportion;Proportion;Proportion;Proporção
+FG;French Guiana;Guyane Française;Guiana Francesa
+BR;Brazil;Brésil;Brasil
+symptons;Symptons;Symptômes;Sintomas
+occupation;Occupation;Occupation;Ocupação
+crosses;Crosses;croix;Cruzes
+imported_state;Imported cases by state;Cas importés par état;Casos importados por UF
+imported_country;Imported cases by country;Cas importés par pays;Casos importados por país
+country;Country;Pays;País
+positive_cases;positive;positif;positivos
+pregnant_cases;with pregnancy;avec grossesse;com gravidez
+imported_cases;imported;importés;importados
+positive_cases_leg;Positive cases;Cas positifs;Casos positivos
+pregnant_cases_leg;Pregnant cases;Cas avec grossesse;Casos com gravidez
+falciparum_assoc_leg;Falciparum and associated;Falciparum et associations;Falciparum e associados
+non_falciparum_leg;Non Falciparum;Non Falciparum;Não falciparum
+imported_cases_leg;Imported cases;Cas Importés;Casos importados
+lvc_leg;LVC;LVC;LVC
+asymptomatic_cases_leg;Asymptomatic cases;Cas asymptomatiques;Casos assintomáticos
+active_search_leg;Active search;Recherche active;Busca ativa
+passive_search_leg;Passive search;Recherche passive;Busca passiva
+uf_infection;UF of infection;État d'infection;UF de infecção
+density_plot;Density plot;Graphe de densité;Gráfico de densidade
+general;General;Général;Geral
+by_age;By age;Par âge;Por idade
+per_missing;% missing;% manquant;% faltando
+residence_area;Residence area;Zone résidentielle;Área de residência
+center;Health center;Centre de santé;Unidade de saúde
+location;Location;Location;Localização
+selection;Selection;Sélection;Seleção
+type;Type;Type;Tipo
+yearly;Yearly;Annuel;Anual
+dateRange;Year interval;Intervalle par année;Intervalo de anos
+missing_information;Missing information;Information manquante;Informação faltante
+infection_place;Probable infection place;Probable lieu d'infection;Lugar de provável infecção
+name;Name;Namme;Nome
+rank;Rank;Rang;Rank
+consultation_date;Consultation date;Date de consultation;Data da consulta
+diagnosis_result;Diagnosis result;Résultat du diagnostic;Resultado do diagnóstico
+period;Period;Période;Período
+last_week;Last week;La semaine dernière;Última semana
+last_month;Last month;Le mois dernier;Último mês
+last_three_months;Last three months;Trois derniers mois;Últimos três mêses
+last_semester;Last semester;Dernier semestre;Último semestre
+last_year;Last year;L'année dernière;Último ano
+last_five_years;Last five years;Cinq dernières années;Últimos cinco anos
+Other;Other;Autre;Outros
+Unspecified;Unspecified;Non spécifié;Não especificado
+mixed_falciparum;Mixed infection with P. falciparum;Infection mixte avec P. Falciparum;Infecção mista com P. Falciparum
+non_falciparum;Non P. Falciparum;Non P. Falciparum;Não P. Falciparum
+disclaimer_title;Transborder malaria cases;Cas de paludisme transfrontalier;Casos de malária transfronteiriços
+disclaimer_text;Notified or with place of residence or infection in the municipalities of Oiapoque (BR), Saint-Georges-de-l'Oyapock, Camopi or Ouanary (FR);Notifié ou ayant son lieu de résidence ou une infection dans les municipalités de Oiapoque (BR), Saint-Georges-de-l'Oyapock, Camopi ou Ouanary (FR);Notificados ou com local de residência ou de infecção no município de Oiapoque (BR), Saint-Georges-de-l'Oyapock, Camopi ou Ouanary (FR)
+missing_1;From;Sur;De
+missing_2;records;enregistrements;registros
+missing_3;were located on the map;se trouvaient sur la carte;foram localizados no mapa
\ No newline at end of file
diff --git a/locale/translation b/locale/translation
new file mode 100644
index 0000000000000000000000000000000000000000..1d5fda857d80d72fd2713660c43ff5e1141cefe8
Binary files /dev/null and b/locale/translation differ
diff --git a/locale/translation.bin b/locale/translation.bin
new file mode 100644
index 0000000000000000000000000000000000000000..491196c77ddfb5bb2448d3e84530f87cf6aef7e6
Binary files /dev/null and b/locale/translation.bin differ
diff --git a/locale/updateTranslation.R b/locale/updateTranslation.R
new file mode 100644
index 0000000000000000000000000000000000000000..60c7338b3164d1318962a587382128e91ba165e9
--- /dev/null
+++ b/locale/updateTranslation.R
@@ -0,0 +1,9 @@
+# update the processed translation file translation.bin
+# run this every time dictionary.csv is updated 
+# it reads the look-up table in dictionary.csv and turns it into a 2D list
+
+library(plyr)
+translationContent <- read.delim("locale/dictionary.csv", header = TRUE, sep = ";", as.is = TRUE)
+translation <- dlply(translationContent ,.(key), function(s) key = as.list(s))
+
+save(translation, file = "locale/translation.bin")
diff --git a/modules/brazil.R b/modules/brazil.R
new file mode 100644
index 0000000000000000000000000000000000000000..b930d4b1650415164e69eb474ace8f85c2ea1ae7
--- /dev/null
+++ b/modules/brazil.R
@@ -0,0 +1,263 @@
+### Brazil tab
+
+##################
+### Data objects
+##################
+
+# Positive incidence
+BR_sub <- reactive({
+  
+  date1 <- as.Date(paste0(input$BRdates[1],"-01-01"))
+  date2 <- as.Date(paste0(input$BRdates[2],"-12-31"))
+  
+  br_df %>%
+    sivep_filter_notif(plasm = "Any", minAge = 0, maxAge = 100) %>%
+    filter(DT_NOTIF >= date1 & DT_NOTIF <= date2)
+})
+
+# Tabulate
+BR_tab_pos_incidence <- reactive({
+  sub <- sivep_filter_notif(BR_sub(), type = "AP")
+  as.data.frame(incidence(sub$DT_NOTIF, interval = 30))
+})
+
+BR_tab_pregnant <- reactive({
+  sub <- sivep_filter_notif(BR_sub(), preg = "Pregnant")
+  as.data.frame(incidence(sub$DT_NOTIF, interval = 30))
+})
+
+BR_tab_falci <- reactive({
+  sub <- sivep_filter_notif(BR_sub(), plasm = "Falci_assoc")
+  as.data.frame(incidence(sub$DT_NOTIF, interval = 30))
+})
+
+BR_tab_non_falci <- reactive({
+  sub <- sivep_filter_notif(BR_sub(), plasm = "Non_falci")
+  as.data.frame(incidence(sub$DT_NOTIF, interval = 30))
+})
+
+BR_tab_imported_cases <- reactive({
+  sub <- subset(BR_sub(), PAIS_INF != "Brasil")
+  as.data.frame(incidence(sub$DT_NOTIF, interval = 30))
+})
+
+BR_tab_lvc <- reactive({
+  BR_sub() %>%
+    select(DT_NOTIF, ID_LVC) %>%
+    mutate(month = floor_date(DT_NOTIF, "month"), pos = if_else(ID_LVC == "Yes", "Yes", "No")) %>%
+    select(month, pos) %>%
+    group_by(month, pos) %>%
+    dplyr::summarise(count=n()) %>%
+    spread(pos, count) %>%
+    replace_na(list(Yes = 0, No = 0)) %>%
+    mutate(prop = Yes/(No+Yes)*100) %>%
+    select(month, prop)%>%
+    as.data.frame()
+})
+
+BR_tab_symptons <- reactive({
+  BR_sub() %>%
+    select(DT_NOTIF, SINTOMAS, RES_EXAM) %>%
+    mutate(month = floor_date(DT_NOTIF, "month"), pos = if_else(SINTOMAS == "Without symptons" & RES_EXAM != "Negative", "Yes", "No")) %>%
+    select(month, pos) %>%
+    group_by(month, pos) %>%
+    dplyr::summarise(count=n()) %>%
+    spread(pos, count) %>%
+    replace_na(list(Yes = 0, No = 0)) %>%
+    mutate(prop = Yes/(No+Yes)*100) %>%
+    select(month, prop)%>%
+    as.data.frame()
+})
+
+BR_tab_active_search <- reactive({
+  BR_sub() %>%
+    select(DT_NOTIF, TIPO_LAM) %>%
+    mutate(month = floor_date(DT_NOTIF, "month"), pos = if_else(TIPO_LAM == "Active search", "Yes", "No")) %>%
+    select(month, pos) %>%
+    group_by(month, pos) %>%
+    dplyr::summarise(count=n()) %>%
+    spread(pos, count) %>%
+    replace_na(list(Yes = 0, No = 0)) %>%
+    mutate(prop = Yes/(No+Yes)*100) %>%
+    select(month, prop)%>%
+    as.data.frame()
+})
+
+BR_tab_passive_search <- reactive({
+  BR_sub() %>%
+    select(DT_NOTIF, TIPO_LAM) %>%
+    mutate(month = floor_date(DT_NOTIF, "month"), pos = if_else(TIPO_LAM == "Passive search", "Yes", "No")) %>%
+    select(month, pos) %>%
+    group_by(month, pos) %>%
+    dplyr::summarise(count=n()) %>%
+    spread(pos, count) %>%
+    replace_na(list(Yes = 0, No = 0)) %>%
+    mutate(prop = Yes/(No+Yes)*100) %>%
+    select(month, prop)%>%
+    as.data.frame()
+})
+
+BR_tab_imported_cases_prop <- reactive({
+  BR_sub() %>%
+    select(DT_NOTIF, PAIS_INF) %>%
+    mutate(month = floor_date(DT_NOTIF, "month"), pos = if_else(PAIS_INF != "Brasil", "Yes", "No")) %>%
+    select(month, pos) %>%
+    group_by(month, pos) %>%
+    dplyr::summarise(count=n()) %>%
+    spread(pos, count) %>%
+    replace_na(list(Yes = 0, No = 0)) %>%
+    mutate(prop = Yes/(No+Yes)*100) %>%
+    select(month, prop)%>%
+    as.data.frame()
+})
+
+BR_tab_age <- reactive({
+  BR_sub() %>% 
+    select(ID_PACIE, ID_DIMEA) %>%
+    mutate(ID_PACIE_ADJ = ifelse((ID_DIMEA == "Days" | ID_DIMEA == "Months"), 0, ID_PACIE))
+})
+
+BR_tab_sex_prop <- reactive({
+  BR_sub() %>% 
+    select(SEXO) %>%
+    filter(SEXO == "Male" | SEXO == "Female") %>%
+    droplevels() %>%
+    count(SEXO)
+})
+
+BR_tab_symptons_prop <- reactive({
+  BR_sub() %>% 
+    select(SINTOMAS) %>%
+    count(SINTOMAS)
+})
+
+BR_tab_occupation_prop <- reactive({
+  BR_sub() %>% 
+    select(COD_OCUP) %>%
+    count(COD_OCUP)
+})
+
+BR_tab_crosses_prop <- reactive({
+  BR_sub() %>% 
+    select(QTD_CRUZ) %>%
+    count(QTD_CRUZ)
+})
+
+BR_tab_imported_uf <- reactive({
+  BR_sub() %>% 
+    select(UF_INFEC) %>%
+    filter(UF_INFEC != "Amapá") %>%
+    count(UF_INFEC)
+})
+
+BR_tab_imported_country <- reactive({
+  BR_sub() %>% 
+    select(PAIS_INF) %>%
+    filter(PAIS_INF != "Brasil") %>%
+    count(PAIS_INF)
+})
+
+##################
+### Plots
+##################
+
+# Count positive cases
+output$BR_count_incidence <- renderValueBox({
+  valueBox(
+    paste0(sum(BR_tab_pos_incidence()$counts), tr("cases2")), tr("positive_cases"), color = "purple"
+  )
+})
+
+# Count pregnant cases
+output$BR_count_pregnant <- renderValueBox({
+  valueBox(
+    paste0(sum(BR_tab_pregnant()$counts), tr("cases2")), tr("pregnant_cases"), color = "purple"
+  )
+})
+
+# Count imported cases
+output$BR_count_imported <- renderValueBox({
+  valueBox(
+    paste0(sum(BR_tab_imported_cases()$counts), tr("cases2")), tr("imported_cases"), color = "purple"
+  )
+})
+
+# Plot incidences
+output$BR_plot_incidence <- renderPlotly({
+  plot_ly(data = BR_tab_pos_incidence(), x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = tr("positive_cases_leg")) %>%
+    add_trace(data = BR_tab_pregnant(), x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = tr("pregnant_cases_leg")) %>%
+    add_trace(data = BR_tab_falci(), x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = tr("falciparum_assoc_leg")) %>%
+    add_trace(data = BR_tab_non_falci(), x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = tr("non_falciparum_leg")) %>%
+    add_trace(data = BR_tab_imported_cases(), x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = tr("imported_cases_leg")) %>%
+    layout(xaxis = list(title = tr("date")), yaxis = list(title = tr("cases")))
+})
+
+# Plot proportions
+output$BR_plot_proportions <- renderPlotly({
+  plot_ly(data = BR_tab_lvc(), x = ~month, y = ~prop, type = 'scatter', mode = 'lines', name = tr("lvc_leg")) %>%
+    add_trace(data = BR_tab_symptons(), x = ~month, y = ~prop, type = 'scatter', mode = 'lines', name = tr("asymptomatic_cases_leg")) %>%
+    add_trace(data = BR_tab_active_search(), x = ~month, y = ~prop, type = 'scatter', mode = 'lines', name = tr("active_search_leg")) %>%
+    add_trace(data = BR_tab_passive_search(), x = ~month, y = ~prop, type = 'scatter', mode = 'lines', name = tr("passive_search_leg")) %>%
+    add_trace(data = BR_tab_imported_cases_prop(), x = ~month, y = ~prop, type = 'scatter', mode = 'lines', name = tr("imported_cases_leg")) %>%
+    layout(xaxis = list(title = tr("date")), yaxis = list(title = tr("percentage")))
+})
+
+# Plot age (histogram)
+output$BR_plot_age <- renderPlotly({
+  plot_ly(data = BR_tab_age(), x = ~ID_PACIE_ADJ, type = "histogram") %>%
+    layout(xaxis = list(title = tr("age"), domain = c(0,100)), yaxis = list(title = tr("cases")))
+})
+
+# Plot sex
+output$BR_plot_sex <- renderPlotly({
+  plot_ly(data = BR_tab_sex_prop(), labels = ~SEXO, values = ~n) %>%
+    add_pie(hole = 0.6) %>%
+    config(displayModeBar = FALSE) %>%
+    layout(xaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE),
+           yaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE))
+})
+
+# Plot symptons
+output$BR_plot_symptons <- renderPlotly({
+  plot_ly(data = BR_tab_symptons_prop(), labels = ~SINTOMAS, values = ~n) %>%
+    add_pie(hole = 0.6) %>%
+    config(displayModeBar = FALSE) %>%
+    layout(xaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE),
+           yaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE))
+})
+
+# Plot occupation
+output$BR_plot_occupation <- renderPlotly({
+  plot_ly(data = BR_tab_occupation_prop(), labels = ~COD_OCUP, values = ~n) %>%
+    add_pie(hole = 0.6) %>%
+    config(displayModeBar = FALSE) %>%
+    layout(xaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE),
+           yaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE))
+})
+
+# Plot crosses
+output$BR_plot_crosses <- renderPlotly({
+  plot_ly(data = BR_tab_crosses_prop(), labels = ~QTD_CRUZ, values = ~n, sort = FALSE) %>%
+    add_pie(hole = 0.6) %>%
+    config(displayModeBar = FALSE) %>%
+    layout(xaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE),
+           yaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE))
+})
+
+# Plot imported cases by state
+output$BR_plot_imported_uf <- renderPlotly({
+  plot_ly(data = BR_tab_imported_uf(), labels = ~UF_INFEC, values = ~n) %>%
+    add_pie(hole = 0.6) %>%
+    config(displayModeBar = FALSE) %>%
+    layout(xaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE),
+           yaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE))
+})
+
+# Plot imported cases by country
+output$BR_plot_imported_country <- renderPlotly({
+  plot_ly(data = BR_tab_imported_country(), labels = ~PAIS_INF, values = ~n) %>%
+    add_pie(hole = 0.6) %>%
+    config(displayModeBar = FALSE) %>%
+    layout(xaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE),
+           yaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE))
+})
\ No newline at end of file
diff --git a/modules/brazil_age.R b/modules/brazil_age.R
new file mode 100644
index 0000000000000000000000000000000000000000..265a96a7a37a66570db3cc8b0b66456c78ffc8ec
--- /dev/null
+++ b/modules/brazil_age.R
@@ -0,0 +1,77 @@
+### Tab Brazil age
+
+# Positive incidence
+BRage_sub <- reactive({
+  
+  date1 <- as.Date(paste0(input$BRAgeDates[1],"-01-01"))
+  date2 <- as.Date(paste0(input$BRAgeDates[2],"-12-31"))
+  
+  br_df %>%
+    sivep_filter_notif(plasm = "Any", minAge = 0, maxAge = 100) %>%
+    filter(DT_NOTIF >= date1 & DT_NOTIF <= date2)
+})
+
+# QTD_CRUZ, COD_OCUP
+
+output$BRAge_plot <- renderPlot({
+  if(input$BRAgeVar == "Crosses"){
+    BRage_sub() %>% 
+      select(ID_PACIE, ID_DIMEA, QTD_CRUZ) %>%
+      mutate(ID_PACIE_ADJ = ifelse((ID_DIMEA == "Days" | ID_DIMEA == "Months"), 0, ID_PACIE)) %>%
+      ggplot(aes(x = ID_PACIE_ADJ, y = QTD_CRUZ)) + 
+        geom_joy() +
+        scale_x_continuous(limits = c(0, 100)) +
+        labs(x = tr("age"), y = tr("crosses"))
+  } else if (input$BRAgeVar == "Occupation"){
+    BRage_sub() %>% 
+      select(ID_PACIE, ID_DIMEA, COD_OCUP) %>%
+      mutate(ID_PACIE_ADJ = ifelse((ID_DIMEA == "Days" | ID_DIMEA == "Months"), 0, ID_PACIE)) %>%
+      ggplot(aes(x = ID_PACIE_ADJ, y = COD_OCUP)) + 
+      geom_joy() +
+      labs(x = tr("age"), y = tr("occupation"))
+  } else if (input$BRAgeVar == "Sex"){
+    BRage_sub() %>% 
+      select(ID_PACIE, ID_DIMEA, SEXO) %>%
+      filter(SEXO == "Male" | SEXO == "Female") %>%
+      mutate(ID_PACIE_ADJ = ifelse((ID_DIMEA == "Days" | ID_DIMEA == "Months"), 0, ID_PACIE)) %>%
+      ggplot(aes(x = ID_PACIE_ADJ, y = SEXO)) + 
+      geom_joy() +
+      labs(x = tr("age"), y = tr("sex"))
+  } else if (input$BRAgeVar == "Symptons"){
+    BRage_sub() %>% 
+      select(ID_PACIE, ID_DIMEA, SINTOMAS) %>%
+      mutate(ID_PACIE_ADJ = ifelse((ID_DIMEA == "Days" | ID_DIMEA == "Months"), 0, ID_PACIE)) %>%
+      ggplot(aes(x = ID_PACIE_ADJ, y = SINTOMAS)) + 
+      geom_joy() +
+      labs(x = tr("age"), y = tr("symptons"))
+  } else if (input$BRAgeVar == "UF"){
+    BRage_sub() %>% 
+      select(ID_PACIE, ID_DIMEA, UF_INFEC) %>%
+      mutate(ID_PACIE_ADJ = ifelse((ID_DIMEA == "Days" | ID_DIMEA == "Months"), 0, ID_PACIE)) %>%
+      ggplot(aes(x = ID_PACIE_ADJ, y = UF_INFEC)) + 
+      geom_joy() +
+      labs(x = tr("age"), y = tr("symptons"))
+  } else if (input$BRAgeVar == "Country"){
+    BRage_sub() %>% 
+      select(ID_PACIE, ID_DIMEA, PAIS_INF) %>%
+      mutate(ID_PACIE_ADJ = ifelse((ID_DIMEA == "Days" | ID_DIMEA == "Months"), 0, ID_PACIE)) %>%
+      ggplot(aes(x = ID_PACIE_ADJ, y = PAIS_INF)) + 
+      geom_joy() +
+      labs(x = tr("age"), y = tr("country"))
+  } else if (input$BRAgeVar == "Plasmodium"){
+    BRage_sub() %>% 
+      select(ID_PACIE, ID_DIMEA, RES_EXAM) %>%
+      mutate(ID_PACIE_ADJ = ifelse((ID_DIMEA == "Days" | ID_DIMEA == "Months"), 0, ID_PACIE)) %>%
+      ggplot(aes(x = ID_PACIE_ADJ, y = RES_EXAM)) + 
+      geom_joy() +
+      labs(x = tr("age"), y = tr("plasmodium"))
+  }
+  
+  
+  
+  
+})  
+
+
+
+
diff --git a/modules/download.R b/modules/download.R
new file mode 100644
index 0000000000000000000000000000000000000000..8f8fea2c65f80ed37b544080114a955bebb35eb0
--- /dev/null
+++ b/modules/download.R
@@ -0,0 +1,107 @@
+### Ranking tab
+
+##################
+### Data objects
+##################
+
+
+DOWN_residencial_area_fg <- JSON_area_har %>%
+  filter(source == "FR-GF") %>%
+  select(id, name) %>%
+  arrange(name)
+DOWN_residencial_area_list_fg <- as.list(DOWN_residencial_area_fg$id)
+names(DOWN_residencial_area_list_fg) <- DOWN_residencial_area_fg$name
+
+DOWN_residencial_area_br <- JSON_area_har %>%
+  filter(source == "BR") %>%
+  select(id, name) %>%
+  arrange(name)
+DOWN_residencial_area_list_br <- as.list(DOWN_residencial_area_br$id)
+names(DOWN_residencial_area_list_br) <- DOWN_residencial_area_br$name
+
+DOWN_health_center_fg <- JSON_healthcenter_har %>%
+  filter(source == "FR-GF") %>%
+  select(id_center, name) %>%
+  arrange(name)
+DOWN_health_center_list_fg <- as.list(DOWN_health_center_fg$id_center)
+names(DOWN_health_center_list_fg) <- DOWN_health_center_fg$name
+
+DOWN_health_center_br <- JSON_healthcenter_har %>%
+  filter(source == "BR") %>%
+  select(id_center, name) %>%
+  arrange(name)
+DOWN_health_center_list_br <- as.list(DOWN_health_center_br$id_center)
+names(DOWN_health_center_list_br) <- DOWN_health_center_br$name
+
+
+output$DOWNlocation_fg <- renderUI({
+  switch(input$DOWNtype,
+         "residence_area" = selectInput("DOWNselection_fg", tr("FG"), DOWN_residencial_area_list_fg, multiple = TRUE),
+         "center" = selectInput("DOWNselection_fg", tr("FG"), DOWN_health_center_list_fg, multiple = TRUE),
+         "infection_place" = selectInput("DOWNselection_fg", tr("FG"), DOWN_residencial_area_list_fg, multiple = TRUE)
+  )
+})
+
+output$DOWNlocation_br <- renderUI({
+  switch(input$DOWNtype,
+         "residence_area" = selectInput("DOWNselection_br", tr("BR"), DOWN_residencial_area_list_br, multiple = TRUE),
+         "center" = selectInput("DOWNselection_br", tr("BR"), DOWN_health_center_list_br, multiple = TRUE),
+         "infection_place" = selectInput("DOWNselection_br", tr("BR"), DOWN_residencial_area_list_br, multiple = TRUE)
+  )
+})
+
+
+
+
+
+DOWN_tab <- reactive({
+  
+  date1 <- as.Date(paste0(input$DOWNdates[1],"-01-01"))
+  date2 <- as.Date(paste0(input$DOWNdates[2],"-12-31"))
+  
+  df <- consultation_har_filter(JSON_cons_har,
+                          new_attack = input$DOWNnew_attack,
+                          diagn = input$DOWNdiagn,
+                          sex = input$DOWNsex,
+                          minAge = input$DOWNage[1], maxAge = input$DOWNage[2]
+  ) %>%
+    filter(consultation_date >= date1 & consultation_date <= date2)
+  
+  if(input$DOWNtype == "center"){
+    df <- df %>% filter(id_center %in% c(input$DOWNselection_fg, input$DOWNselection_br))
+  } else if(input$DOWNtype == "residence_area"){
+    df <- df %>% filter(residence_place %in% c(input$DOWNselection_fg, input$DOWNselection_br))
+  } else if(input$DOWNtype == "infection_place"){
+    df <- df %>% filter(infection_place %in% c(input$DOWNselection_fg, input$DOWNselection_br))
+  }
+  
+  df <- df %>% select(
+    source,
+    id_center,
+    residence_place,
+    infection_place,
+    consultation_date,
+    patient_sex,
+    patient_age,
+    new_attack,
+    diagnosis_result
+  )
+  
+  return(df)
+  
+})
+
+##################
+### Table
+##################
+
+output$DOWN_table <- renderDataTable(
+    DOWN_tab(),
+    server = FALSE,
+    rownames= FALSE, 
+    extensions = 'Buttons', 
+    options = list(
+      dom = 'Bfrtip',
+      buttons = c('copy', 'csv', 'excel', 'pdf', 'print')
+    )
+)
\ No newline at end of file
diff --git a/modules/harmonized.R b/modules/harmonized.R
new file mode 100644
index 0000000000000000000000000000000000000000..b9b7da8724abf36301672451b970e893b7b39666
--- /dev/null
+++ b/modules/harmonized.R
@@ -0,0 +1,192 @@
+### Harmonized tab
+
+date1 <- reactive({
+  as.Date(paste0(input$dates[1],"-01-01"))
+})
+
+date2 <- reactive({
+  date2 <- as.Date(paste0(input$dates[2],"-12-31"))
+})
+
+# Filter
+HAR_sub <- reactive({
+  
+  date1 <- as.Date(paste0(input$dates[1],"-01-01"))
+  date2 <- as.Date(paste0(input$dates[2],"-12-31"))
+  
+  consultation_har_filter(JSON_cons_har,
+                          new_attack = input$new_attack,
+                          diagn = input$diagn,
+                          sex = input$sex,
+                          minAge = input$age[1], maxAge = input$age[2]
+  ) %>%
+    filter(consultation_date >= date1 & consultation_date <= date2)
+  
+})
+
+
+# Split by country
+HAR_br <- reactive({
+  HAR_sub() %>% filter(source == "BR")
+})
+HAR_fg <- reactive({
+  HAR_sub() %>% filter(source == "FR-GF")
+})
+
+# Tabulate by date of notification
+HAR_br_tab <- reactive({
+  agg <- as.numeric(input$agg)
+  date1 <- as.Date(paste0(input$dates[1],"-01-01"))
+  date2 <- as.Date(paste0(input$dates[2],"-12-31"))
+  
+  if(agg == 1){
+    HAR_br() %>% group_by(dates = floor_date(consultation_date, "day")) %>%
+      summarize(counts=n()) %>%
+      complete(dates = seq.Date(date1, date2, by = "day"), fill = list(counts = 0))
+  } else if(agg == 6){
+    as.data.frame(incidence(HAR_br()$consultation_date, interval = 7, iso_week = TRUE)) %>%
+      select(dates, counts)
+  } else if(agg == 30){
+    HAR_br() %>% group_by(dates = floor_date(consultation_date, "month")) %>%
+      summarize(counts=n()) %>%
+      complete(dates = seq.Date(date1, date2, by = "month"), fill = list(counts = 0))
+  } else if(agg == 90){
+    HAR_br() %>% group_by(dates = floor_date(consultation_date, "quarter")) %>%
+      summarize(counts=n()) %>%
+      complete(dates = seq.Date(date1, date2, by = "quarter"), fill = list(counts = 0))
+  } else if(agg == 366){
+    HAR_br() %>% group_by(dates = floor_date(consultation_date, "year")) %>%
+      summarize(counts=n()) %>%
+      complete(dates = seq.Date(date1, date2, by = "year"), fill = list(counts = 0))
+  }
+})
+
+HAR_fg_tab <- reactive({
+  agg <- as.numeric(input$agg)
+  date1 <- as.Date(paste0(input$dates[1],"-01-01"))
+  date2 <- as.Date(paste0(input$dates[2],"-12-31"))
+  
+  if(agg == 1){
+    HAR_fg() %>% group_by(dates = floor_date(consultation_date, "day")) %>%
+      summarize(counts=n()) %>%
+      complete(dates = seq.Date(date1, date2, by = "day"), fill = list(counts = 0))
+  } else if(agg == 6){
+    as.data.frame(incidence(HAR_fg()$consultation_date, interval = 7, iso_week = TRUE)) %>%
+      select(dates, counts)
+  } else if(agg == 30){
+    HAR_fg() %>% group_by(dates = floor_date(consultation_date, "month")) %>%
+      summarize(counts=n()) %>%
+      complete(dates = seq.Date(date1, date2, by = "month"), fill = list(counts = 0))
+  } else if(agg == 90){
+    HAR_fg() %>% group_by(dates = floor_date(consultation_date, "quarter")) %>%
+      summarize(counts=n()) %>%
+      complete(dates = seq.Date(date1, date2, by = "quarter"), fill = list(counts = NA))
+  } else if(agg == 366){
+    HAR_fg() %>% group_by(dates = floor_date(consultation_date, "year")) %>%
+      summarize(counts=n()) %>%
+      complete(dates = seq.Date(date1, date2, by = "year"), fill = list(counts = 0))
+  }
+})
+
+
+
+##################
+### Plots and counts
+##################
+
+# Count FG
+output$HAR_count_fg <- renderValueBox({
+  valueBox(
+    paste(nrow(HAR_fg()), tr("cases2")), tr("FG"), color = "purple"
+  )
+})
+
+# Count BR
+output$HAR_count_br <- renderValueBox({
+  valueBox(
+    paste(nrow(HAR_br()), tr("cases2")), tr("BR"), color = "purple"
+  )
+})
+
+# Plot incidence
+output$HAR_plot_incidence <- renderPlotly({
+  plot_ly() %>%
+    add_trace(data = HAR_br_tab(), x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', 
+              name = paste0(tr("BR"), ", ", tr("date_of_retrieval"), " SIVEP-Malária: ", text_recup_donnees_BR)) %>%
+    add_trace(data = HAR_fg_tab(), x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', 
+              name = paste0(tr("FG"), ", ", tr("date_of_retrieval"), " CHC/CDPS : ", text_recup_donnees_GF)) %>%
+    layout(xaxis = list(title = tr("date")), yaxis = list(title = tr("cases"))) %>%
+    layout(legend = list(x = 0, y = 1.2))
+    # layout(annotations = list(
+    #   align="left", bgcolor="gray85", font=list(color="limegreen"),
+    #   x=0.5, y=0.7, xref="paper", yref="paper", xanchor = 'left', showarrow=F, 
+    #   text=text_recup_donnees))
+})
+
+# Plot age
+output$HAR_plot_age <- renderPlotly({
+  
+  HAR_br <- HAR_br() %>% mutate(patient_age = round(patient_age, 0))
+  HAR_fg <- HAR_fg() %>% mutate(patient_age = round(patient_age, 0))
+  
+  plot_ly() %>%
+    add_trace(data = HAR_br, x = ~patient_age, type = "histogram", name = tr("BR")) %>%
+    add_trace(data = HAR_fg, x = ~patient_age, type = "histogram", name = tr("FG")) %>%
+    layout(xaxis = list(title = tr("age"), domain = c(0,100)), yaxis = list(title = tr("cases"))) %>%
+    layout(legend = list(x = 0.8, y = 0.9))
+})
+
+# Plot sex
+output$HAR_plot_sex <- renderPlotly({
+  # Country list
+  HAR_loc <- c("FG","BR")
+  
+  # Subset cases with specific sex definition (Brazilian data have some unknown codes)
+  HAR_br_sex_sub <- subset(HAR_br(), patient_sex == "Male" | patient_sex == "Female")
+  HAR_fg_sex_sub <- subset(HAR_fg(), patient_sex == "Male" | patient_sex == "Female")
+  
+  # Proportion tables
+  HAR_br_sex_tab <- prop.table(table(HAR_br_sex_sub$patient_sex))*100
+  HAR_fg_sex_tab <- prop.table(table(HAR_fg_sex_sub$patient_sex))*100
+  HAR_male <- c(HAR_fg_sex_tab["Male"],HAR_br_sex_tab["Male"])
+  HAR_female <- c(HAR_fg_sex_tab["Female"],HAR_br_sex_tab["Female"])
+  HAR_data <- data.frame(HAR_loc, HAR_male, HAR_female)
+  
+  # Plot
+  plot_ly(HAR_data, x = ~HAR_loc, y = ~HAR_male, type = "bar", name = tr("male")) %>%
+    add_trace(y = ~HAR_female, name = tr("female")) %>%
+    layout(xaxis = list(title = ""), yaxis = list(title = tr("percentage")), barmode = 'stack')
+})
+
+# Plot plasmodium
+output$HAR_plot_plasm <- renderPlotly({
+  # Country list
+  HAR_loc <- c("FG","BR")
+  
+  HAR_br_any <- nrow(consultation_har_filter(HAR_br(), diagn = "Any", new_attack = input$new_attack))
+  HAR_fg_any <- nrow(consultation_har_filter(HAR_fg(), diagn = "Any", new_attack = input$new_attack))
+  
+  HAR_br_falci <- nrow(consultation_har_filter(HAR_br(), diagn = "falciparum", new_attack = input$new_attack))/HAR_br_any*100
+  HAR_br_mixed <- nrow(consultation_har_filter(HAR_br(), diagn = "mixed infection with P. falciparum", new_attack = input$new_attack))/HAR_br_any*100
+  HAR_br_other <- nrow(consultation_har_filter(HAR_br(), diagn = "non-falciparum", new_attack = input$new_attack))/HAR_br_any*100
+  HAR_br_unspe <- nrow(consultation_har_filter(HAR_br(), diagn = "unspecified", new_attack = input$new_attack))/HAR_br_any*100
+  HAR_fg_falci <- nrow(consultation_har_filter(HAR_fg(), diagn = "falciparum", new_attack = input$new_attack))/HAR_fg_any*100
+  HAR_fg_mixed <- nrow(consultation_har_filter(HAR_fg(), diagn = "mixed infection with P. falciparum", new_attack = input$new_attack))/HAR_fg_any*100
+  HAR_fg_other <- nrow(consultation_har_filter(HAR_fg(), diagn = "non-falciparum", new_attack = input$new_attack))/HAR_fg_any*100
+  HAR_fg_unspe <- nrow(consultation_har_filter(HAR_fg(), diagn = "unspecified", new_attack = input$new_attack))/HAR_fg_any*100
+   
+  # Proportion tables
+  HAR_falci <- c(HAR_fg_falci, HAR_br_falci)
+  HAR_mixed <- c(HAR_fg_mixed, HAR_br_mixed)
+  HAR_other <- c(HAR_fg_other, HAR_br_other)
+  HAR_unspe <- c(HAR_fg_unspe, HAR_br_unspe)
+  HAR_data <- data.frame(HAR_loc, HAR_falci, HAR_other)
+  
+  # Plot
+  plot_ly(HAR_data, x = ~HAR_loc, y = ~HAR_falci, type = "bar", name = "Falci assoc") %>%
+    add_trace(y = ~HAR_mixed, name = "Mixed") %>%
+    add_trace(y = ~HAR_other, name = "Non falci") %>%
+    add_trace(y = ~HAR_unspe, name = "Unspecified") %>%
+    layout(xaxis = list(title = ""), yaxis = list(title = tr("percentage")), barmode = 'stack')
+  
+})
diff --git a/modules/harmonized_loc.R b/modules/harmonized_loc.R
new file mode 100644
index 0000000000000000000000000000000000000000..6d7f7fa30debea6f2748f86bf49c7157aab842ed
--- /dev/null
+++ b/modules/harmonized_loc.R
@@ -0,0 +1,535 @@
+### Harmonized tab
+
+##################
+### Data objects
+##################
+
+date1 <- reactive({
+  as.Date(paste0(input$HARLOCdates[1],"-01-01"))
+})
+
+date2 <- reactive({
+  as.Date(paste0(input$HARLOCdates[2],"-12-31"))
+})
+
+HARLOC_residencial_area_fg <- JSON_area_har %>%
+  filter(source == "FR-GF") %>%
+  select(id, name) %>%
+  arrange(name)
+#HARLOC_residencial_area_list_fg <- HARLOC_residencial_area_fg
+HARLOC_residencial_area_list_fg <- with(HARLOC_residencial_area_fg, split(id, name))
+
+HARLOC_residencial_area_br <- JSON_area_har %>%
+  filter(source == "BR") %>%
+  select(id, name) %>%
+  arrange(name)
+#HARLOC_residencial_area_list_br <- HARLOC_residencial_area_br
+HARLOC_residencial_area_list_br <- with(HARLOC_residencial_area_br, split(id, name))
+
+# HARLOC_health_center_fg <- JSON_healthcenter_har %>%
+#   filter(source == "FR-GF") %>%
+#   select(id_center, name) %>%
+#   arrange(name)
+# HARLOC_health_center_list_fg <- as.list(HARLOC_health_center_fg$id_center)
+# names(HARLOC_health_center_list_fg) <- HARLOC_health_center_fg$name
+
+HARLOC_health_center_fg <- JSON_healthcenter_har %>%
+  filter(source == "FR-GF") %>%
+  select(id_center, name) %>%
+  arrange(name)
+#HARLOC_health_center_list_fg <- HARLOC_health_center_fg
+HARLOC_health_center_list_fg <- with(HARLOC_health_center_fg, split(id_center, name))
+
+HARLOC_health_center_br <- JSON_healthcenter_har %>%
+  filter(source == "BR") %>%
+  select(id_center, name) %>%
+  arrange(name)
+#HARLOC_health_center_list_br <- HARLOC_health_center_br
+HARLOC_health_center_list_br <- with(HARLOC_health_center_br, split(id_center, name))
+
+
+
+output$HARLOClocation_fg <- renderUI({
+  switch(input$HARLOCtype,
+    "residence_area" = selectInput("HARLOCselection_fg", tr("FG"), HARLOC_residencial_area_list_fg, multiple = TRUE, selected = c("ESGOS_CENT")),
+    "center" = selectInput("HARLOCselection_fg", tr("FG"), HARLOC_health_center_list_fg, multiple = TRUE, selected = c("CAM","STG")),
+    "infection_place" = selectInput("HARLOCselection_fg", tr("FG"), HARLOC_residencial_area_list_fg, multiple = TRUE, selected = c("ESGOS_CENT"))
+  )
+})
+
+output$HARLOClocation_br <- renderUI({
+  switch(input$HARLOCtype,
+    "residence_area" = selectInput("HARLOCselection_br", tr("BR"), HARLOC_residencial_area_list_br, multiple = TRUE, selected = c("126")),
+    "center" = selectInput("HARLOCselection_br", tr("BR"), HARLOC_health_center_list_br, multiple = TRUE, selected = c("16/160050")),
+    "infection_place" = selectInput("HARLOCselection_br", tr("BR"), HARLOC_residencial_area_list_br, multiple = TRUE, selected = c("126"))
+  )
+})
+
+
+# Filter
+HARLOC_sub_fg <- reactive({
+
+  df <- consultation_har_filter(JSON_cons_har,
+                          source = "FG",
+                          new_attack = input$HARLOCnew_attack,
+                          diagn = input$HARLOCdiagn,
+                          sex = input$HARLOCsex,
+                          minAge = input$HARLOCage[1], maxAge = input$HARLOCage[2]
+  ) %>%
+    filter(consultation_date >= date1() & consultation_date <= date2()) 
+  
+
+  
+  if(input$HARLOCtype == "center"){
+    df <- df %>% filter(id_center %in% input$HARLOCselection_fg)
+  } else if(input$HARLOCtype == "residence_area"){
+    df <- df %>% filter(residence_place %in% input$HARLOCselection_fg)
+  } else if(input$HARLOCtype == "infection_place"){
+    df <- df %>% filter(infection_place %in% input$HARLOCselection_fg)
+  }
+  
+  return(df)
+    
+})
+
+HARLOC_sub_br <- reactive({
+  
+  df <- consultation_har_filter(JSON_cons_har,
+                          source = "BR",
+                          new_attack = input$HARLOCnew_attack,
+                          diagn = input$HARLOCdiagn,
+                          sex = input$HARLOCsex,
+                          minAge = input$HARLOCage[1], maxAge = input$HARLOCage[2]
+  ) %>%
+    filter(consultation_date >= date1() & consultation_date <= date2())
+    
+  if(input$HARLOCtype == "center"){
+    df <- df %>% filter(id_center %in% input$HARLOCselection_br)
+  } else if(input$HARLOCtype == "residence_area"){
+    df <- df %>% filter(residence_place %in% input$HARLOCselection_br)
+  } else if(input$HARLOCtype == "infection_place"){
+    df <- df %>% filter(infection_place %in% input$HARLOCselection_br)
+  }
+  
+  return(df)
+
+})
+
+# Filter (info quality)
+HARLOC_sub_infqual_fg <- reactive({
+  
+  df <- consultation_har_filter(JSON_cons_har,
+                                source = "FG",
+                                new_attack = input$HARLOCnew_attack,
+                                diagn = input$HARLOCdiagn,
+                                sex = input$HARLOCsex,
+                                minAge = input$HARLOCage[1], maxAge = input$HARLOCage[2]
+  ) %>%
+    filter(consultation_date >= date1() & consultation_date <= date2()) %>%
+    is.na() %>%
+    colMeans() * 100
+  
+  df <- replace(df, is.nan(df), 100)
+  
+  return(df)
+})
+
+HARLOC_sub_infqual_br <- reactive({
+  
+  df <- consultation_har_filter(JSON_cons_har,
+                                source = "BR",
+                                new_attack = input$HARLOCnew_attack,
+                                diagn = input$HARLOCdiagn,
+                                sex = input$HARLOCsex,
+                                minAge = input$HARLOCage[1], maxAge = input$HARLOCage[2]
+  ) %>%
+    filter(consultation_date >= date1() & consultation_date <= date2()) %>%
+    is.na() %>%
+    colMeans() * 100
+  
+  df <- replace(df, is.nan(df), 100)
+
+  return(df)
+})
+
+
+# Tabulate by date (day of the week)
+HARLOC_fg_tab_day_week <- reactive({
+  if(nrow(HARLOC_sub_fg()) > 0){
+    as.data.frame(incidence(HARLOC_sub_fg()$consultation_date, interval = 1))
+  }
+})
+HARLOC_br_tab_day_week <- reactive({
+  if(nrow(HARLOC_sub_br()) > 0){
+    as.data.frame(incidence(HARLOC_sub_br()$consultation_date, interval = 1))
+  }
+})
+
+
+##################
+### Plots
+##################
+
+# Plot incidence
+output$HARLOC_plot_incidence <- renderPlotly({
+  
+  # Variables
+  HARLOCtype <- input$HARLOCtype
+  HARLOCagg <- as.numeric(input$HARLOCagg)
+  
+  # Main plot configuration
+  plot_incidence <- plot_ly() %>% 
+    layout(xaxis = list(title = tr("date")), yaxis = list(title = tr("cases"))) %>%
+    layout(legend = list(x = 0, y = -.25, orientation = 'h'), showlegend=TRUE)
+  
+  if(HARLOCtype == "center"){
+    if(HARLOCagg == 1){
+      # FG
+      for(loc in unique(HARLOC_sub_fg()$id_center)){
+        df <- HARLOC_sub_fg() %>% filter(id_center == loc)
+        tab <- df %>% 
+          group_by(dates = floor_date(consultation_date, "day")) %>%
+          summarize(counts=n()) %>%
+          complete(dates = seq.Date(date1(), date2(), by = "day"), fill = list(counts = 0))
+        loc_name <- HARLOC_health_center_fg[which(HARLOC_health_center_fg$id_center == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+      # BR
+      for(loc in unique(HARLOC_sub_br()$id_center)){
+        df <- HARLOC_sub_br() %>% filter(id_center == loc)
+        tab <- df %>% 
+          group_by(dates = floor_date(consultation_date, "day")) %>%
+          summarize(counts=n()) %>%
+          complete(dates = seq.Date(date1(), date2(), by = "day"), fill = list(counts = 0))
+        loc_name <- HARLOC_health_center_br[which(HARLOC_health_center_br$id_center == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+    } else if(HARLOCagg == 6){
+      # FG
+      for(loc in unique(HARLOC_sub_fg()$id_center)){
+        df <- HARLOC_sub_fg() %>% filter(id_center == loc)
+        tab <- as.data.frame(incidence(df$consultation_date, interval = 7, iso_week = TRUE))
+        loc_name <- HARLOC_health_center_fg[which(HARLOC_health_center_fg$id_center == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+      # BR
+      for(loc in unique(HARLOC_sub_br()$id_center)){
+        df <- HARLOC_sub_br() %>% filter(id_center == loc)
+        tab <- as.data.frame(incidence(df$consultation_date, interval = 7, iso_week = TRUE))
+        loc_name <- HARLOC_health_center_br[which(HARLOC_health_center_br$id_center == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+    } else if(HARLOCagg == 30){
+      # FG
+      for(loc in unique(HARLOC_sub_fg()$id_center)){
+        df <- HARLOC_sub_fg() %>% filter(id_center == loc)
+        tab <- df %>% 
+          group_by(dates = floor_date(consultation_date, "month")) %>%
+          summarize(counts=n()) %>%
+          complete(dates = seq.Date(date1(), date2(), by = "month"), fill = list(counts = 0))
+        loc_name <- HARLOC_health_center_fg[which(HARLOC_health_center_fg$id_center == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+      # BR
+      for(loc in unique(HARLOC_sub_br()$id_center)){
+        df <- HARLOC_sub_br() %>% filter(id_center == loc)
+        tab <- df %>% 
+          group_by(dates = floor_date(consultation_date, "month")) %>%
+          summarize(counts=n()) %>%
+          complete(dates = seq.Date(date1(), date2(), by = "month"), fill = list(counts = 0))
+        loc_name <- HARLOC_health_center_br[which(HARLOC_health_center_br$id_center == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+    } else if(HARLOCagg == 90){
+      # FG
+      for(loc in unique(HARLOC_sub_fg()$id_center)){
+        df <- HARLOC_sub_fg() %>% filter(id_center == loc)
+        tab <- df %>% 
+          group_by(dates = floor_date(consultation_date, "quarter")) %>%
+          summarize(counts=n()) %>%
+          complete(dates = seq.Date(date1(), date2(), by = "quarter"), fill = list(counts = 0))
+        loc_name <- HARLOC_health_center_fg[which(HARLOC_health_center_fg$id_center == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+      # BR
+      for(loc in unique(HARLOC_sub_br()$id_center)){
+        df <- HARLOC_sub_br() %>% filter(id_center == loc)
+        tab <- df %>% 
+          group_by(dates = floor_date(consultation_date, "quarter")) %>%
+          summarize(counts=n()) %>%
+          complete(dates = seq.Date(date1(), date2(), by = "quarter"), fill = list(counts = 0))
+        loc_name <- HARLOC_health_center_br[which(HARLOC_health_center_br$id_center == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+    } else if(HARLOCagg == 366){
+      # FG
+      for(loc in unique(HARLOC_sub_fg()$id_center)){
+        df <- HARLOC_sub_fg() %>% filter(id_center == loc)
+        tab <- df %>% 
+          group_by(dates = floor_date(consultation_date, "year")) %>%
+          summarize(counts=n()) %>%
+          complete(dates = seq.Date(date1(), date2(), by = "year"), fill = list(counts = 0))
+        loc_name <- HARLOC_health_center_fg[which(HARLOC_health_center_fg$id_center == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+      # BR
+      for(loc in unique(HARLOC_sub_br()$id_center)){
+        df <- HARLOC_sub_br() %>% filter(id_center == loc)
+        tab <- df %>% 
+          group_by(dates = floor_date(consultation_date, "year")) %>%
+          summarize(counts=n()) %>%
+          complete(dates = seq.Date(date1(), date2(), by = "year"), fill = list(counts = 0))
+        loc_name <- HARLOC_health_center_br[which(HARLOC_health_center_br$id_center == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+    }
+  } else if(HARLOCtype == "residence_area"){
+    if(HARLOCagg == 1){
+      # FG
+      for(loc in unique(HARLOC_sub_fg()$residence_place)){
+        df <- HARLOC_sub_fg() %>% filter(residence_place == loc)
+        tab <- df %>% 
+          group_by(dates = floor_date(consultation_date, "day")) %>%
+          summarize(counts=n()) %>%
+          complete(dates = seq.Date(date1(), date2(), by = "day"), fill = list(counts = 0))
+        loc_name <- HARLOC_residencial_area_fg[which(HARLOC_residencial_area_fg$id == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+      # BR
+      for(loc in unique(HARLOC_sub_br()$residence_place)){
+        df <- HARLOC_sub_br() %>% filter(residence_place == loc)
+        tab <- df %>% 
+          group_by(dates = floor_date(consultation_date, "day")) %>%
+          summarize(counts=n()) %>%
+          complete(dates = seq.Date(date1(), date2(), by = "day"), fill = list(counts = 0))
+        loc_name <- HARLOC_residencial_area_br[which(HARLOC_residencial_area_br$id == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+    } else if(HARLOCagg == 6){
+      # FG
+      for(loc in unique(HARLOC_sub_fg()$residence_place)){
+        df <- HARLOC_sub_fg() %>% filter(residence_place == loc)
+        tab <- as.data.frame(incidence(df$consultation_date, interval = 7, iso_week = TRUE))
+        loc_name <- HARLOC_residencial_area_fg[which(HARLOC_residencial_area_fg$id == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+      # BR
+      for(loc in unique(HARLOC_sub_br()$residence_place)){
+        df <- HARLOC_sub_br() %>% filter(residence_place == loc)
+        tab <- as.data.frame(incidence(df$consultation_date, interval = 7, iso_week = TRUE))
+        loc_name <- HARLOC_residencial_area_br[which(HARLOC_residencial_area_br$id == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+    } else if(HARLOCagg == 30){
+      # FG
+      for(loc in unique(HARLOC_sub_fg()$residence_place)){
+        df <- HARLOC_sub_fg() %>% filter(residence_place == loc)
+        tab <- df %>% 
+          group_by(dates = floor_date(consultation_date, "month")) %>%
+          summarize(counts=n()) %>%
+          complete(dates = seq.Date(date1(), date2(), by = "month"), fill = list(counts = 0))
+        loc_name <- HARLOC_residencial_area_fg[which(HARLOC_residencial_area_fg$id == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+      # BR
+      for(loc in unique(HARLOC_sub_br()$residence_place)){
+        df <- HARLOC_sub_br() %>% filter(residence_place == loc)
+        tab <- df %>% 
+          group_by(dates = floor_date(consultation_date, "month")) %>%
+          summarize(counts=n()) %>%
+          complete(dates = seq.Date(date1(), date2(), by = "month"), fill = list(counts = 0))
+        loc_name <- HARLOC_residencial_area_br[which(HARLOC_residencial_area_br$id == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+    } else if(HARLOCagg == 90){
+      # FG
+      for(loc in unique(HARLOC_sub_fg()$residence_place)){
+        df <- HARLOC_sub_fg() %>% filter(residence_place == loc)
+        tab <- df %>% 
+          group_by(dates = floor_date(consultation_date, "quarter")) %>%
+          summarize(counts=n()) %>%
+          complete(dates = seq.Date(date1(), date2(), by = "quarter"), fill = list(counts = 0))
+        loc_name <- HARLOC_residencial_area_fg[which(HARLOC_residencial_area_fg$id == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+      # BR
+      for(loc in unique(HARLOC_sub_br()$residence_place)){
+        df <- HARLOC_sub_br() %>% filter(residence_place == loc)
+        tab <- df %>% 
+          group_by(dates = floor_date(consultation_date, "quarter")) %>%
+          summarize(counts=n()) %>%
+          complete(dates = seq.Date(date1(), date2(), by = "quarter"), fill = list(counts = 0))
+        loc_name <- HARLOC_residencial_area_br[which(HARLOC_residencial_area_br$id == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+    } else if(HARLOCagg == 366){
+      # FG
+      for(loc in unique(HARLOC_sub_fg()$residence_place)){
+        df <- HARLOC_sub_fg() %>% filter(residence_place == loc)
+        tab <- df %>% 
+          group_by(dates = floor_date(consultation_date, "year")) %>%
+          summarize(counts=n()) %>%
+          complete(dates = seq.Date(date1(), date2(), by = "year"), fill = list(counts = 0))
+        loc_name <- HARLOC_residencial_area_fg[which(HARLOC_residencial_area_fg$id == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+      # BR
+      for(loc in unique(HARLOC_sub_br()$residence_place)){
+        df <- HARLOC_sub_br() %>% filter(residence_place == loc)
+        tab <- df %>% 
+          group_by(dates = floor_date(consultation_date, "year")) %>%
+          summarize(counts=n()) %>%
+          complete(dates = seq.Date(date1(), date2(), by = "year"), fill = list(counts = 0))
+        loc_name <- HARLOC_residencial_area_br[which(HARLOC_residencial_area_br$id == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+    }
+  } else if(input$HARLOCtype == "infection_place"){
+    if(HARLOCagg == 1){
+      # FG
+      for(loc in unique(HARLOC_sub_fg()$infection_place)){
+        df <- HARLOC_sub_fg() %>% filter(infection_place == loc)
+        tab <- df %>% 
+          group_by(dates = floor_date(consultation_date, "day")) %>%
+          summarize(counts=n()) %>%
+          complete(dates = seq.Date(date1(), date2(), by = "day"), fill = list(counts = 0))
+        loc_name <- HARLOC_residencial_area_fg[which(HARLOC_residencial_area_fg$id == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+      # BR
+      for(loc in unique(HARLOC_sub_br()$infection_place)){
+        df <- HARLOC_sub_br() %>% filter(infection_place == loc)
+        tab <- df %>% 
+          group_by(dates = floor_date(consultation_date, "day")) %>%
+          summarize(counts=n()) %>%
+          complete(dates = seq.Date(date1(), date2(), by = "day"), fill = list(counts = 0))
+        loc_name <- HARLOC_residencial_area_br[which(HARLOC_residencial_area_br$id == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+    } else if(HARLOCagg == 6){
+      # FG
+      for(loc in unique(HARLOC_sub_fg()$infection_place)){
+        df <- HARLOC_sub_fg() %>% filter(infection_place == loc)
+        tab <- as.data.frame(incidence(df$consultation_date, interval = 7, iso_week = TRUE))
+        loc_name <- HARLOC_residencial_area_fg[which(HARLOC_residencial_area_fg$id == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+      # BR
+      for(loc in unique(HARLOC_sub_br()$infection_place)){
+        df <- HARLOC_sub_br() %>% filter(infection_place == loc)
+        tab <- as.data.frame(incidence(df$consultation_date, interval = 7, iso_week = TRUE))
+        loc_name <- HARLOC_residencial_area_br[which(HARLOC_residencial_area_br$id == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+    } else if(HARLOCagg == 30){
+      # FG
+      for(loc in unique(HARLOC_sub_fg()$infection_place)){
+        df <- HARLOC_sub_fg() %>% filter(infection_place == loc)
+        tab <- df %>% 
+          group_by(dates = floor_date(consultation_date, "month")) %>%
+          summarize(counts=n()) %>%
+          complete(dates = seq.Date(date1(), date2(), by = "month"), fill = list(counts = 0))
+        loc_name <- HARLOC_residencial_area_fg[which(HARLOC_residencial_area_fg$id == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+      # BR
+      for(loc in unique(HARLOC_sub_br()$infection_place)){
+        df <- HARLOC_sub_br() %>% filter(infection_place == loc)
+        tab <- df %>% 
+          group_by(dates = floor_date(consultation_date, "month")) %>%
+          summarize(counts=n()) %>%
+          complete(dates = seq.Date(date1(), date2(), by = "month"), fill = list(counts = 0))
+        loc_name <- HARLOC_residencial_area_br[which(HARLOC_residencial_area_br$id == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+    } else if(HARLOCagg == 90){
+      # FG
+      for(loc in unique(HARLOC_sub_fg()$infection_place)){
+        df <- HARLOC_sub_fg() %>% filter(infection_place == loc)
+        tab <- df %>% 
+          group_by(dates = floor_date(consultation_date, "quarter")) %>%
+          summarize(counts=n()) %>%
+          complete(dates = seq.Date(date1(), date2(), by = "quarter"), fill = list(counts = 0))
+        loc_name <- HARLOC_residencial_area_fg[which(HARLOC_residencial_area_fg$id == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+      # BR
+      for(loc in unique(HARLOC_sub_br()$infection_place)){
+        df <- HARLOC_sub_br() %>% filter(infection_place == loc)
+        tab <- df %>% 
+          group_by(dates = floor_date(consultation_date, "quarter")) %>%
+          summarize(counts=n()) %>%
+          complete(dates = seq.Date(date1(), date2(), by = "quarter"), fill = list(counts = 0))
+        loc_name <- HARLOC_residencial_area_br[which(HARLOC_residencial_area_br$id == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+    } else if(HARLOCagg == 366){
+      # FG
+      for(loc in unique(HARLOC_sub_fg()$infection_place)){
+        df <- HARLOC_sub_fg() %>% filter(infection_place == loc)
+        tab <- df %>% 
+          group_by(dates = floor_date(consultation_date, "year")) %>%
+          summarize(counts=n()) %>%
+          complete(dates = seq.Date(date1(), date2(), by = "year"), fill = list(counts = 0))
+        loc_name <- HARLOC_residencial_area_fg[which(HARLOC_residencial_area_fg$id == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+      # BR
+      for(loc in unique(HARLOC_sub_br()$infection_place)){
+        df <- HARLOC_sub_br() %>% filter(infection_place == loc)
+        tab <- df %>% 
+          group_by(dates = floor_date(consultation_date, "year")) %>%
+          summarize(counts=n()) %>%
+          complete(dates = seq.Date(date1(), date2(), by = "year"), fill = list(counts = 0))
+        loc_name <- HARLOC_residencial_area_br[which(HARLOC_residencial_area_br$id == loc), "name"]
+        plot_incidence <- add_trace(plot_incidence, data = tab, x = ~dates, y = ~counts, type = 'scatter', mode = 'lines', name = loc_name)
+      }
+    }
+  }
+  
+  # Plot
+  plot_incidence
+})
+
+
+
+# Information completness
+output$HARLOC_information_completness <- renderUI({
+  tabBox(
+    width = 12,
+    height = "180px",
+    title = tr("missing_information"),
+    tabPanel(
+      title = tr("infection_place"), 
+      valueBox(paste0(round(HARLOC_sub_infqual_fg()["infection_place"],2),"%"), tr("FG"), color = "purple", width = 6),
+      valueBox(paste0(round(HARLOC_sub_infqual_br()["infection_place"],2),"%"), tr("BR"), color = "purple", width = 6)
+    ),
+    tabPanel(
+      title = tr("residence_area"), 
+      valueBox(paste0(round(HARLOC_sub_infqual_fg()["residence_place"],2),"%"), tr("FG"), color = "purple", width = 6),
+      valueBox(paste0(round(HARLOC_sub_infqual_br()["residence_place"],2),"%"), tr("BR"), color = "purple", width = 6)
+    ),
+    tabPanel(
+      title = tr("center"), 
+      valueBox(paste0(round(HARLOC_sub_infqual_fg()["id_center"],2),"%"), tr("FG"), color = "purple", width = 6),
+      valueBox(paste0(round(HARLOC_sub_infqual_br()["id_center"],2),"%"), tr("BR"), color = "purple", width = 6)
+    )
+  )
+})
+
+# Day of the week plot
+output$HARLOC_plot_day_week_br <- renderPlot({
+  if(length(HARLOC_br_tab_day_week() > 0)){
+    calendarHeat(dates = HARLOC_br_tab_day_week()$dates, values = HARLOC_br_tab_day_week()$counts, color="g2r")
+  } else {
+    plot.new()
+  }
+})
+output$HARLOC_plot_day_week_fg <- renderPlot({
+  if(length(HARLOC_fg_tab_day_week() > 0)){
+    calendarHeat(dates = HARLOC_fg_tab_day_week()$dates, values = HARLOC_fg_tab_day_week()$counts, color="g2r")
+  } else {
+    plot.new()
+  }
+})
+
diff --git a/modules/infoq.R b/modules/infoq.R
new file mode 100644
index 0000000000000000000000000000000000000000..7d2ba05d1da4e38778d239893270a289a0f3115b
--- /dev/null
+++ b/modules/infoq.R
@@ -0,0 +1,312 @@
+### Information quality tab
+
+##################
+### Data objects
+##################
+
+INFOQ_plot_tab <- reactive({
+  
+  date1 <- as.Date(paste0(input$INFOQdates[1],"-01-01"))
+  date2 <- as.Date(paste0(input$INFOQdates[2],"-12-31"))
+  
+  consultation_har_filter(JSON_cons_har,
+                          source = input$INFOQcountry,
+                          new_attack = input$INFOQnew_attack,
+                          diagn = input$INFOQdiagn,
+                          sex = input$INFOQsex
+  ) %>%
+    filter(consultation_date >= date1 & consultation_date <= date2) %>%
+    mutate(year = lubridate::year(consultation_date)) %>%
+    select(residence_place,
+           infection_place,
+           id_center, 
+           patient_age,
+           patient_sex,
+           diagnosis_result,
+           new_attack,
+           active_diagnosis,
+           source,
+           year
+    ) %>%
+    group_by(source, year) %>%
+    dplyr::summarise(
+      count = n(), 
+      residence_place = mean(is.na(residence_place))*100,
+      infection_place = mean(is.na(infection_place))*100,
+      center = mean(is.na(id_center))*100,
+      patient_age = mean(is.na(patient_age))*100,
+      sex = mean(is.na(patient_sex))*100,
+      diagnosis_result = mean(is.na(diagnosis_result))*100,
+      new_attack = mean(is.na(new_attack))*100,
+      active_diagnosis = mean(is.na(active_diagnosis))*100
+    )
+})
+
+INFOQ_plot_tab_fg <- reactive({
+  INFOQ_plot_tab() %>% filter(source == "FR-GF")
+})
+INFOQ_plot_tab_br <- reactive({
+  INFOQ_plot_tab() %>% filter(source == "BR")
+})
+
+INFOQ_tab <- reactive({
+  
+  date1 <- as.Date(paste0(input$INFOQdates[1],"-01-01"))
+  date2 <- as.Date(paste0(input$INFOQdates[2],"-12-31"))
+  
+  if(input$INFOQtype == "residence_area"){
+    consultation_har_filter(JSON_cons_har,
+                            source = input$INFOQcountry,
+                            new_attack = input$INFOQnew_attack,
+                            diagn = input$INFOQdiagn,
+                            sex = input$INFOQsex
+    ) %>%
+      filter(consultation_date >= date1 & consultation_date <= date2) %>%
+      select(residence_place,
+             infection_place,
+             id_center, 
+             patient_age,
+             patient_sex,
+             diagnosis_result,
+             new_attack,
+             active_diagnosis
+      ) %>%
+      group_by(residence_place) %>%
+      dplyr::summarise(
+        count = n(), 
+        infection_place = percent(mean(is.na(infection_place)), format = "d"),
+        center = percent(mean(is.na(id_center)), format = "d"),
+        patient_age = percent(mean(is.na(patient_age)), format = "d"),
+        sex = percent(mean(is.na(patient_sex)), format = "d"),
+        diagnosis_result = percent(mean(is.na(diagnosis_result)), format = "d"),
+        new_attack = percent(mean(is.na(new_attack)), format = "d"),
+        active_diagnosis = percent(mean(is.na(active_diagnosis)), format = "d")
+      ) %>%
+      inner_join(JSON_area_har, by = c("residence_place" = "id"))
+  } else if(input$INFOQtype == "center"){
+    consultation_har_filter(JSON_cons_har,
+                            source = input$INFOQcountry,
+                            new_attack = input$INFOQnew_attack,
+                            diagn = input$INFOQdiagn,
+                            sex = input$INFOQsex
+    ) %>%
+      filter(consultation_date >= date1 & consultation_date <= date2) %>%
+      select(id_center, 
+             residence_place, 
+             infection_place, 
+             patient_age,
+             patient_sex,
+             diagnosis_result,
+             new_attack,
+             active_diagnosis
+      ) %>%
+      group_by(id_center) %>%
+      dplyr::summarise(
+        count = n(), 
+        residence_place = percent(mean(is.na(residence_place)), format = "d"),
+        infection_place = percent(mean(is.na(infection_place)), format = "d"),
+        patient_age = percent(mean(is.na(patient_age)), format = "d"),
+        sex = percent(mean(is.na(patient_sex)), format = "d"),
+        diagnosis_result = percent(mean(is.na(diagnosis_result)), format = "d"),
+        new_attack = percent(mean(is.na(new_attack)), format = "d"),
+        active_diagnosis = percent(mean(is.na(active_diagnosis)), format = "d")
+      ) %>%
+      inner_join(JSON_healthcenter_har, by = c("id_center" = "id_center"))
+  } else if(input$INFOQtype == "infection_place"){
+    consultation_har_filter(JSON_cons_har,
+                            source = input$INFOQcountry,
+                            new_attack = input$INFOQnew_attack,
+                            diagn = input$INFOQdiagn,
+                            sex = input$INFOQsex
+    ) %>%
+      filter(consultation_date >= date1 & consultation_date <= date2) %>%
+      select(infection_place,
+             residence_place, 
+             id_center, 
+             patient_age,
+             patient_sex,
+             diagnosis_result,
+             new_attack,
+             active_diagnosis
+      ) %>%
+      group_by(infection_place) %>%
+      dplyr::summarise(
+        count = n(), 
+        residence_place = percent(mean(is.na(residence_place)), format = "d"),
+        center = percent(mean(is.na(id_center)), format = "d"),
+        patient_age = percent(mean(is.na(patient_age)), format = "d"),
+        sex = percent(mean(is.na(patient_sex)), format = "d"),
+        diagnosis_result = percent(mean(is.na(diagnosis_result)), format = "d"),
+        new_attack = percent(mean(is.na(new_attack)), format = "d"),
+        active_diagnosis = percent(mean(is.na(active_diagnosis)), format = "d")
+      ) %>%
+      inner_join(JSON_area_har, by = c("infection_place" = "id"))
+  }
+  
+  
+})
+
+##################
+### Plot
+##################
+
+output$INFOQ_plot_sex <- renderPlotly({
+  p <- plot_ly(data = INFOQ_plot_tab_fg(), x = ~year, y = ~sex, type = 'scatter', mode = 'lines', name = tr("FG")) %>%
+    add_trace(data = INFOQ_plot_tab_br(), x = ~year, y = ~sex, type = 'scatter', mode = 'lines', name = tr("BR")) %>%
+    layout(xaxis = list(title = tr("year")), yaxis = list(title = "%", range = c(0,100)))
+  p
+})
+output$INFOQ_plot_residence_area <- renderPlotly({
+  p <- plot_ly(data = INFOQ_plot_tab_fg(), x = ~year, y = ~residence_place, type = 'scatter', mode = 'lines', name = tr("FG")) %>%
+    add_trace(data = INFOQ_plot_tab_br(), x = ~year, y = ~residence_place, type = 'scatter', mode = 'lines', name = tr("BR")) %>%
+    layout(xaxis = list(title = tr("year")), yaxis = list(title = "%", range = c(0,100))) 
+  p
+})
+output$INFOQ_plot_infection_place <- renderPlotly({
+  p <- plot_ly(data = INFOQ_plot_tab_fg(), x = ~year, y = ~infection_place, type = 'scatter', mode = 'lines', name = tr("FG")) %>%
+    add_trace(data = INFOQ_plot_tab_br(), x = ~year, y = ~infection_place, type = 'scatter', mode = 'lines', name = tr("BR")) %>%
+    layout(xaxis = list(title = tr("year")), yaxis = list(title = "%", range = c(0,100)))
+  p
+})
+output$INFOQ_plot_center <- renderPlotly({
+  p <- plot_ly(data = INFOQ_plot_tab_fg(), x = ~year, y = ~center, type = 'scatter', mode = 'lines', name = tr("FG")) %>%
+    add_trace(data = INFOQ_plot_tab_br(), x = ~year, y = ~center, type = 'scatter', mode = 'lines', name = tr("BR")) %>%
+    layout(xaxis = list(title = tr("year")), yaxis = list(title = "%", range = c(0,100)))
+  p
+})
+
+##################
+### Table
+##################
+
+output$INFOQ_ftable <- renderDataTable({
+  if(input$INFOQtype == "residence_area"){
+    INFOQ_tab() %>%
+      plyr::arrange(-count) %>% 
+      select(
+        name, 
+        count, 
+        source, 
+        center, 
+        infection_place, 
+        patient_age, 
+        sex, 
+        diagnosis_result,
+        new_attack,
+        active_diagnosis
+      ) %>%
+      mutate(source = ifelse(source == "BR", tr("BR"), tr("FG"))) %>%
+      formattable(., list(
+        center = color_tile("transparent", "orange"),
+        infection_place = color_tile("transparent", "orange"),
+        patient_age = color_tile("transparent", "orange"),
+        sex = color_tile("transparent", "orange"),
+        diagnosis_result = color_tile("transparent", "orange"),
+        new_attack = color_tile("transparent", "orange"),
+        active_diagnosis = color_tile("transparent", "orange")
+      )) %>%
+      as.datatable(., colnames = c(
+        tr("name"),
+        tr("cases"), 
+        tr("country"),
+        tr("center"),
+        tr("infection_place"),
+        tr("age"),
+        tr("sex"),
+        tr("diagnosis_result"),
+        tr("new_attack"),
+        tr("active_search_leg")
+      ), 
+      extensions = 'Buttons', options = list(
+        dom = 'Bfrtip',
+        buttons = c('copy', 'csv', 'excel', 'pdf', 'print')
+      )
+    )
+  } else if(input$INFOQtype == "center"){
+    INFOQ_tab() %>%
+      plyr::arrange(-count) %>% 
+      select(
+        name, 
+        count, 
+        source, 
+        residence_place, 
+        infection_place, 
+        patient_age, 
+        sex, 
+        diagnosis_result,
+        new_attack,
+        active_diagnosis
+      ) %>%
+      mutate(source = ifelse(source == "BR", tr("BR"), tr("FG"))) %>%
+      formattable(., list(
+        residence_place = color_tile("transparent", "orange"),
+        infection_place = color_tile("transparent", "orange"),
+        patient_age = color_tile("transparent", "orange"),
+        sex = color_tile("transparent", "orange"),
+        diagnosis_result = color_tile("transparent", "orange"),
+        new_attack = color_tile("transparent", "orange"),
+        active_diagnosis = color_tile("transparent", "orange")
+      )) %>%
+      as.datatable(., colnames = c(
+        tr("name"),
+        tr("cases"), 
+        tr("country"),
+        tr("residence_area"),
+        tr("infection_place"),
+        tr("age"),
+        tr("sex"),
+        tr("diagnosis_result"),
+        tr("new_attack"),
+        tr("active_search_leg")
+      ), 
+      extensions = 'Buttons', options = list(
+        dom = 'Bfrtip',
+        buttons = c('copy', 'csv', 'excel', 'pdf', 'print')
+      )
+    )
+  } else if(input$INFOQtype == "infection_place"){
+    INFOQ_tab() %>%
+      plyr::arrange(-count) %>% 
+      select(
+        name, 
+        count, 
+        source, 
+        residence_place, 
+        center, 
+        patient_age, 
+        sex, 
+        diagnosis_result,
+        new_attack,
+        active_diagnosis
+      ) %>%
+      mutate(source = ifelse(source == "BR", tr("BR"), tr("FG"))) %>%
+      formattable(., list(
+        residence_place = color_tile("transparent", "orange"),
+        center = color_tile("transparent", "orange"),
+        patient_age = color_tile("transparent", "orange"),
+        sex = color_tile("transparent", "orange"),
+        diagnosis_result = color_tile("transparent", "orange"),
+        new_attack = color_tile("transparent", "orange"),
+        active_diagnosis = color_tile("transparent", "orange")
+      )) %>%
+      as.datatable(., colnames = c(
+        tr("name"),
+        tr("cases"), 
+        tr("country"),
+        tr("residence_area"),
+        tr("center"),
+        tr("age"),
+        tr("sex"),
+        tr("diagnosis_result"),
+        tr("new_attack"),
+        tr("active_search_leg")
+      ),
+      extensions = 'Buttons', options = list(
+        dom = 'Bfrtip',
+        buttons = c('copy', 'csv', 'excel', 'pdf', 'print')
+      )
+    )
+  }
+},
+server = FALSE
+)
\ No newline at end of file
diff --git a/modules/map.R b/modules/map.R
new file mode 100644
index 0000000000000000000000000000000000000000..6bb075b4691972da6332d312c41761b15d156bab
--- /dev/null
+++ b/modules/map.R
@@ -0,0 +1,256 @@
+### Map tab
+
+avg.formula = 
+  "function (cluster) {
+var markers = cluster.getAllChildMarkers();
+var sum = 0;
+var count = 0;
+var avg = 0;
+var mFormat = ' marker-cluster-';
+for (var i = 0; i < markers.length; i++) {
+if(markers[i].options.weight != undefined){
+sum += markers[i].options.weight;
+count += 1;
+}
+}
+//avg = Math.round(sum/count);
+avg = sum;
+if(avg<500) {mFormat+='small'} else if (avg>10000){mFormat+='large'}else{mFormat+='medium'};
+return L.divIcon({ html: '<div><span>' + avg + '</span></div>', className: 'marker-cluster'+mFormat, iconSize: L.point(40, 40) });
+}"
+
+### limites Guyane - Oiapoque
+f_lim_guyam <- "data/shp/guy-oiapoque_final.shp"
+lim_guyam <- sf::st_read(f_lim_guyam, quiet = TRUE) %>% 
+  st_transform(crs=4326)
+
+### OSM data 2022
+
+f_hosp <- "data/osm/hospital_guyamapa.osm"
+f_clin <- "data/osm/clinic_guyamapa.osm"
+
+query_update <- FALSE
+if (query_update) {
+  bbox_guyam <- "(-1.24,-54.88,5.78,-49.34)"
+  q_hosp_guyam <- paste0(
+    "( nwr[amenity=hospital]", bbox_guyam, "; ); out center;")
+  q_clin_guyam <- paste0(
+    "( nwr[amenity=clinic]", bbox_guyam, "; ); out center;")
+  result_hosp <- osmdata_xml(q_hosp_guyam, filename=f_hosp)
+  result_clin <- osmdata_xml(q_clin_guyam, filename=f_clin)
+} 
+
+# read osm points
+hospital <- sf::st_read(f_hosp, layer = 'points', quiet = TRUE)
+clinica <- sf::st_read(f_clin, layer = 'points', quiet = TRUE)
+hospital_icon <- makeIcon(
+  iconUrl = 'data/svg/circle-h-solid.svg', iconWidth = 20, iconHeight = 20)
+clinica_icon <- makeIcon(
+  iconUrl='data/svg/house-medical-solid.svg', iconWidth = 20, iconHeight = 20)
+
+### data wms cayenne 2022
+url_wms <- paste0(
+  "https://cartogy.cayenne.ird.fr/index.php/lizmap/service/",
+  "?repository=risquepalu&project=progysat_carto_risque_lizmap&SERVICE=WMS"
+)
+
+### data GBIF
+url_anopheles_darlingi <- paste0(
+  "https://api.gbif.org/v2/map/occurrence/density/{z}/{x}/{y}@1x.png?",
+  "style=classic.poly&bin=hex&hexPerTile=17&taxonKey=1650149&srs=EPSG:3857")
+
+url_anopheles_marajoara <- paste0(
+  "https://api.gbif.org/v2/map/occurrence/density/{z}/{x}/{y}@1x.png?",
+  "style=classic.poly&bin=hex&hexPerTile=17&taxonKey=1650776&srs=EPSG:3857")
+
+
+output$MAPmissing <- renderText("")
+
+df_map <- reactive({
+  
+  map_dates <- req(input$MAPdates)
+  map_type <- req(input$MAPtype)
+  map_diagn <- req(input$MAPdiagn)
+  
+  # print("**df_map**")
+  # print(map_dates)
+  # print(map_type)
+  
+  date1 <- as.Date(paste0(map_dates[1],"-01-01"))
+  date2 <- as.Date(paste0(map_dates[2],"-12-31"))
+  
+  if(map_type == "residence_area"){
+    df <-  consultation_har_filter(
+      JSON_cons_har, new_attack="Any",
+      diagn = map_diagn
+    ) %>% 
+      filter(consultation_date >= date1 & consultation_date <= date2) %>%
+      select(residence_place, source) %>%
+      inner_join(coords, by = c("residence_place" = "id")) %>%
+      mutate(id = residence_place)
+    
+    missing_total <- JSON_cons_har %>%
+      filter(consultation_date >= date1 & consultation_date <= date2) %>%
+      nrow()
+    
+    # missing_per <- round((sum(df$count)/missing_total)*100, 2)
+    # missing_n <- sum(df$count)
+  } else if(map_type == "infection_place"){
+    df <-  consultation_har_filter(
+      JSON_cons_har, new_attack="Any",
+      diagn = map_diagn
+    ) %>% 
+      filter(consultation_date >= date1 & consultation_date <= date2) %>%
+      select(infection_place, source) %>%
+      inner_join(coords, by = c("infection_place" = "id")) %>%
+      mutate(id = infection_place)
+    
+    missing_total <- JSON_cons_har %>%
+      filter(consultation_date >= date1 & consultation_date <= date2) %>%
+      nrow()
+  }
+  
+  return(df)
+})
+
+output$map <- renderLeaflet({
+  
+  # reinit map on language change !
+  lang <- req(input$language)
+  print(lang)
+  
+  dados_mapa <- isolate(df_map())
+  pal <- colorFactor(c("red","blue"), dados_mapa$source)
+  
+  leaflet() %>%
+    addTiles(options = providerTileOptions(maxZoom = 12), group = "OSM Tiles") %>%
+    setView(lng = -51.548, lat = 3.938, zoom = 9) %>%
+    addMapPane("pane_lim", zIndex = 395) %>%
+    addMapPane("pane_an_darlingi", zIndex = 400) %>%
+    addMapPane("pane_clinic", zIndex = 410) %>%
+    addMapPane("pane_hospital", zIndex = 415) %>%
+    addMapPane("pane_cases", zIndex = 420) %>%
+    addPolygons(
+      data = lim_guyam, 
+      color = "#444444", 
+      weight = 1, 
+      smoothFactor = 0.5,
+      opacity = 1.0, 
+      fillOpacity = 0.05,
+      options = pathOptions(pane = "pane_lim")
+    ) %>%
+    addTiles(
+      urlTemplate = url_anopheles_darlingi,
+      attribution = "GBIF",
+      layerId = "GBIF_Anopheles_Darlingi",
+      group = "GBIF_An_Darlingi",
+      options = tileOptions(pane = "pane_an_darlingi")
+    ) %>%
+    addMarkers(
+      data = clinica, group = "Clinics", icon = clinica_icon,
+      popup = ~name, 
+      options = markerOptions(opacity=0.8, pane = "pane_clinic")) %>%
+    addMarkers(
+      data = hospital, group = "Hospitals", icon = hospital_icon,
+      popup = ~name, 
+      options = markerOptions(pane = "pane_hospital")) %>%
+    clearGroup("Dados") %>%
+    addCircleMarkers(
+      data = dados_mapa,
+      lat = ~y_coordinate,
+      lng = ~x_coordinate,
+      color = ~pal(source),
+      stroke = FALSE, fillOpacity = 0.5,
+      clusterOptions = markerClusterOptions(spiderfyOnMaxZoom = FALSE),
+      options = pathOptions(pane = "pane_cases"),
+      group = "Dados") %>%
+    hideGroup(
+      c("Clinics", "Hospitals", "GBIF_An_Darlingi"))
+  
+})
+
+# Interactive populate
+observe({
+  print("MAP observeEvent")
+  df <- df_map()
+  print(nrow(df))
+  # Map
+  pal <- colorFactor(c("red","blue"), df$source)
+  leafletProxy("map", data = df) %>%
+    clearGroup("Dados") %>%
+    # clearShapes() %>%
+    # clearMarkers() %>%
+    # clearMarkerClusters() %>%
+    addCircleMarkers(
+      data = df,
+      lat = ~y_coordinate,
+      lng = ~x_coordinate,
+      color = ~pal(source),
+      stroke = FALSE, fillOpacity = 0.5,
+      clusterOptions = markerClusterOptions(spiderfyOnMaxZoom = FALSE),
+      group = "Dados"
+    )
+  
+})
+
+observe({
+  val <- input$MAPosm
+  mapobj <- leafletProxy("map")
+  if ("Hospitals" %in% val) {
+    mapobj %>% showGroup("Hospitals")
+  } else {
+    mapobj %>% hideGroup("Hospitals")
+  }
+  if ("Clinics" %in% val) {
+    mapobj %>% showGroup("Clinics")
+  } else {
+    mapobj %>% hideGroup("Clinics")
+  }
+})
+
+observe({
+  val <- input$MAPgbif
+  if ("Anopheles darlingi" %in% val) {
+    leafletProxy("map") %>% showGroup("GBIF_An_Darlingi")
+  } else {
+    leafletProxy("map") %>% hideGroup("GBIF_An_Darlingi")
+  }
+})
+
+# Interactive WMS Layers
+observeEvent(input$MAPrasters, {
+  layer_wms <- req(input$MAPrasters)
+  print(paste("MAPrasters", ":", layer_wms))
+  proxy_map <- leafletProxy("map", data = df)
+  if (layer_wms=="NO_SEL") {
+    proxy_map %>% clearGroup("WMS_Raster")
+  } else {
+    proxy_map %>% 
+      clearGroup("WMS_Raster") %>%
+      addWMSTiles(
+        url_wms,
+        layers = layer_wms,
+        options = WMSTileOptions(
+          format = "image/png", opacity=0.8, transparent = TRUE),
+        attribution = "UMR Espace-Dev",
+        group = "WMS_Raster"
+      )
+  }
+})
+
+output$MAPlegend <- renderUI({
+  layer_wms <- req(input$MAPrasters)
+  if (layer_wms=="NO_SEL") {
+    html_output <- ""
+  } else {
+    html_output <- img(src=paste0(
+      "https://cartogy.cayenne.ird.fr/index.php/lizmap/service/?",
+      "repository=risquepalu&project=progysat_carto_risque_lizmap&",
+      "SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&",
+      "LAYER=", layer_wms, "&",
+      "FORMAT=image/png&STYLE=padrão&SLD_VERSION=1.1.0&",
+      "ITEMFONTSIZE=9&SYMBOLSPACE=1&ICONLABELSPACE=2&DPI=96&LAYERSPACE=0&",
+      "LAYERFONTBOLD=FALSE&LAYERTITLE=FALSE"))
+  }
+  html_output
+})
diff --git a/modules/mapBKP.R b/modules/mapBKP.R
new file mode 100644
index 0000000000000000000000000000000000000000..db30b455c0b80044bcb40dd4ad387db9a2485276
--- /dev/null
+++ b/modules/mapBKP.R
@@ -0,0 +1,121 @@
+### Coords information changes
+# coords <- coords %>%
+#   select(name, id_sivep, id_cdps, X, Y) %>%
+#   mutate(id_sivep = as.character(id_sivep)) %>%
+#   mutate(id_cdps = as.character(id_cdps)) %>%
+#   mutate(id_sivep = str_replace_all(id_sivep, "[\r\n]" , "")) %>%
+#   mutate(id_cdps = str_replace_all(id_cdps, "[\r\n]" , "")) %>%
+#   mutate(X = as.numeric(as.character(X)), Y = as.numeric(as.character(Y))) %>%
+#   mutate(name = as.character(name)) %>%
+#   mutate(id = if_else(is.na(id_sivep), id_cdps, id_sivep)) %>%
+#   mutate(y_coordinate = Y, x_coordinate = X) %>%
+#   select(id, name, x_coordinate, y_coordinate)
+
+
+
+### Map tab
+
+output$map <- renderLeaflet({
+  # First load populate
+  date1 <- as.Date("2007-01-01")
+  date2 <- as.Date(today())
+  df <- JSON_cons_har %>%
+    filter(consultation_date >= date1 & consultation_date <= date2) %>%
+    select(residence_place, source) %>%
+    group_by(residence_place, source) %>%
+    dplyr::summarise(count=n()) %>%
+    inner_join(coords, by = c("residence_place" = "id")) %>%
+    mutate(id = residence_place)
+  
+  pal <- colorFactor(c("red","blue"), df$source)
+  
+  leaflet() %>%
+    addTiles(options = providerTileOptions(maxZoom = 10)) %>%
+    setView(lng = -51.548, lat = 3.938, zoom = 9) %>%
+    addCircleMarkers(
+      layerId = ~id,
+      data = df[which(df$source == "FR-GF"),],
+      lat = ~y_coordinate,
+      lng = ~x_coordinate,
+      radius = ~log(count+1)*1.5,
+      color = ~pal(source),
+      stroke = FALSE, fillOpacity = 0.5,
+      label = ~paste0(as.character(name), " (", source, ")", ": ", count)
+    ) %>% 
+    addCircleMarkers(
+      layerId = ~id,
+      data = df[which(df$source == "BR"),],
+      lat = ~y_coordinate,
+      lng = ~x_coordinate,
+      radius = ~log(count+1)*1.5,
+      color = ~pal(source),
+      stroke = FALSE, fillOpacity = 0.5,
+      label = ~paste0(as.character(name), " (", source, ")", ": ", count)
+    ) %>%
+    addLegend("bottomleft", pal = pal, values = df$source, layerId = "mapLegend") 
+})
+
+output$MAPmissing <- renderText("")
+
+# Interactive populate
+observe({
+  # Input requirements
+  req(input$MAPdates)
+  req(input$MAPtype)
+  
+  date1 <- as.Date(paste0(input$MAPdates[1],"-01-01"))
+  date2 <- as.Date(paste0(input$MAPdates[2],"-12-31"))
+  map_type <- input$MAPtype
+
+
+  if(map_type == "residence_area"){
+    df <- JSON_cons_har %>%
+      filter(consultation_date >= date1 & consultation_date <= date2) %>%
+      select(residence_place, source) %>%
+      group_by(residence_place, source) %>%
+      dplyr::summarise(count=n()) %>%
+      inner_join(coords, by = c("residence_place" = "id")) %>%
+      mutate(id = residence_place)
+    
+    missing_total <- JSON_cons_har %>%
+      filter(consultation_date >= date1 & consultation_date <= date2) %>%
+      nrow()
+    
+    missing_per <- round((sum(df$count)/missing_total)*100, 2)
+    missing_n <- sum(df$count)
+  } else if(map_type == "infection_place"){
+    df <- JSON_cons_har %>%
+      filter(consultation_date >= date1 & consultation_date <= date2) %>%
+      select(infection_place, source) %>%
+      group_by(infection_place, source) %>%
+      dplyr::summarise(count=n()) %>%
+      inner_join(coords, by = c("infection_place" = "id")) %>%
+      mutate(id = infection_place)
+    
+    missing_total <- JSON_cons_har %>%
+      filter(consultation_date >= date1 & consultation_date <= date2) %>%
+      nrow()
+    
+    missing_per <- round((sum(df$count)/missing_total)*100, 2)
+    missing_n <- sum(df$count)
+  }
+
+  # Map
+  pal <- colorFactor(c("red","blue"), df$source)
+  leafletProxy("map") %>%
+    clearMarkers() %>%
+    addCircleMarkers(
+      layerId = ~id,
+      data = df,
+      lat = ~y_coordinate,
+      lng = ~x_coordinate,
+      radius = ~log(count+1)*1.5,
+      color = ~pal(df$source),
+      stroke = FALSE, fillOpacity = 0.5,
+      label = ~paste0(as.character(name), " (", source, ")", ": ", count)
+    ) %>% addLegend("bottomleft", pal = pal, values = df$source, layerId = "mapLegend")
+
+  #output$MAPmissing <- renderText(paste0("De ", missing_total, "registros, foram localizados no mapa ", missing_n, " (", missing_per, "%)."))
+  output$MAPmissing <- renderText(paste0(tr("missing_1"), " ", missing_total," ", tr("missing_2"), ", ", missing_n, " (", missing_per, "%) ", tr("missing_3"), "."))
+  
+  })
\ No newline at end of file
diff --git a/modules/ranking.R b/modules/ranking.R
new file mode 100644
index 0000000000000000000000000000000000000000..2983193e9e7a126acff4e9b2000d60e590e3cca4
--- /dev/null
+++ b/modules/ranking.R
@@ -0,0 +1,67 @@
+### Ranking tab
+
+##################
+### Data objects
+##################
+
+
+
+RANK_tab <- reactive({
+  
+  date1 <- as.Date(paste0(input$RANKdates[1],"-01-01"))
+  date2 <- as.Date(paste0(input$RANKdates[2],"-12-31"))
+  
+  if(input$RANKtype == "residence_area"){
+    consultation_har_filter(JSON_cons_har,
+                            new_attack = input$RANKnew_attack,
+                            diagn = input$RANKdiagn,
+                            sex = input$RANKsex,
+                            minAge = input$RANKage[1], maxAge = input$RANKage[2]
+    ) %>%
+      filter(consultation_date >= date1 & consultation_date <= date2) %>%
+      select(residence_place) %>%
+      group_by(residence_place) %>%
+      dplyr::summarise(count=n()) %>%
+      inner_join(JSON_area_har, by = c("residence_place" = "id"))
+  } else if(input$RANKtype == "center"){
+    consultation_har_filter(JSON_cons_har,
+                            new_attack = input$RANKnew_attack,
+                            diagn = input$RANKdiagn,
+                            sex = input$RANKsex,
+                            minAge = input$RANKage[1], maxAge = input$RANKage[2]
+    ) %>%
+      filter(consultation_date >= date1 & consultation_date <= date2) %>%
+      select(id_center) %>%
+      group_by(id_center) %>%
+      dplyr::summarise(count=n()) %>%
+      inner_join(JSON_healthcenter_har, by = c("id_center" = "id_center"))
+  } else if(input$RANKtype == "infection_place"){
+    consultation_har_filter(JSON_cons_har,
+                            new_attack = input$RANKnew_attack,
+                            diagn = input$RANKdiagn,
+                            sex = input$RANKsex,
+                            minAge = input$RANKage[1], maxAge = input$RANKage[2]
+    ) %>%
+      filter(consultation_date >= date1 & consultation_date <= date2) %>%
+      select(infection_place) %>%
+      group_by(infection_place) %>%
+      dplyr::summarise(count=n()) %>%
+      inner_join(JSON_area_har, by = c("infection_place" = "id"))
+  }
+  
+  
+})
+
+##################
+### Table
+##################
+
+output$RANK_table <- renderDataTable({
+  RANK_tab() %>%
+    select(name, count, source) %>%
+    plyr::arrange(-count) %>% 
+    mutate(rank = row_number(-count)) %>%
+    select(rank, name, count, source) %>%
+    mutate(source = ifelse(source == "BR", tr("BR"), tr("FG"))) %>%
+    plyr::rename(c("name" = tr("name"), "count" = tr("cases"), "source" = tr("country"), "rank" = tr("rank")))
+}, rownames= FALSE)
\ No newline at end of file
diff --git a/modules/server_ui.R b/modules/server_ui.R
new file mode 100644
index 0000000000000000000000000000000000000000..d75d4411529ad8ac4a039743e0dceeb31e6e62fb
--- /dev/null
+++ b/modules/server_ui.R
@@ -0,0 +1,329 @@
+# Dynamic server UI
+
+# Menu itens
+output$sidebarMenu <- renderMenu({
+  sidebarMenu(id="tabs",
+              menuItem(tr("tab_harmonizedIndicators"), tabName = "tab_harmonizedIndicators", icon = icon("bar-chart")),
+              menuItem(tr("tab_harmonizedIndicators_loc"), tabName = "tab_harmonizedIndicators_loc", icon = icon("map-marker")),
+              menuItem(tr("tab_ranking"), tabName = "tab_ranking", icon = icon("reorder")),
+              menuItem(tr("tab_map"), tabName = "tab_map", icon = icon("map"))
+              
+              #menuItem(tr("tab_trends"), tabName = "tab_trends", icon = icon("line-chart")),
+              #menuItem(tr("tab_infoq"), tabName = "tab_infoq", icon = icon("check-square-o")),
+              #menuItem(tr("tab_download"), tabName = "tab_download", icon = icon("download"))
+  )
+})
+
+# Select first tab
+isolate({updateTabItems(session, "tabs", "tab_harmonizedIndicators")})
+
+# Translated selection options 
+ops_new_attack <- reactive({
+  ops <- c(TRUE,FALSE,"Any")
+  names(ops) <- c(tr("new_cases"),tr("old_cases"),tr("Any"))
+  ops
+})
+ops_diagn <- reactive({
+  ops <- c("Any","falciparum","mixed infection with P. falciparum","non-falciparum","unspecified")
+  names(ops) <- c(tr("Any"),"Plasmodium falciparum",tr("mixed_falciparum"),tr("non_falciparum"),tr("Unspecified"))
+  ops
+})
+ops_sex <- reactive({
+  ops <- c("Any","Male","Female")
+  names(ops) <-  c(tr("Any"),tr("male"),tr("female"))
+  ops
+})
+ops_agg <- reactive({
+  ops <- c(30,90,366)
+  names(ops) <-  c(tr("30_days"),tr("90_days"),tr("yearly"))
+  ops
+})
+ops_location <- reactive({
+  ops <- c("center","residence_area","infection_place")
+  names(ops) <-  c(tr("center"), tr("residence_area"), tr("infection_place"))
+  ops
+})
+ops_location2 <- reactive({
+  ops <- c("residence_area","infection_place")
+  names(ops) <-  c(tr("residence_area"), tr("infection_place"))
+  ops
+})
+ops_raster <- reactive({
+  # noms des couches WMS
+  ops <- c(
+    "NO_SEL",
+    "INTERACTION AVEC FORÊT/INTERAÇÃO COM  FLORESTA (NLHI)",
+    "PROBABILITÉ PRÉSENCE VECTEUR/PROBABILIDADE PRESENÇA VETOR",
+    "EMPREINTE HUMAINE/PEGADA HUMANA",
+    "RISQUE D'EXPOSITION POP./RISCO DE EXPOSIÇÃO POP."
+  )
+  names(ops) <- c(
+    "Pas de sélection",
+    "Interaction avec forêt",
+    "Probabilité Présence Vecteur",
+    "Empreinte Humaine",
+    "Risque d'exposition pop."
+  )
+  ops
+})
+ops_country <- reactive({
+  ops <- c("Any","FG","BR")
+  names(ops) <- c(tr("Any"),tr("FG"),tr("BR"))
+  ops
+})
+ops_period <- reactive({
+  ops <- c("last_week","last_month","last_three_months","last_semester","last_year","last_five_years")
+  names(ops) <- c(tr("last_week"),tr("last_month"),tr("last_three_months"),tr("last_semester"),tr("last_year"),tr("last_five_years"))
+  ops
+})
+
+
+# Tab Items
+output$tabItems <- renderUI({
+  tabItems(
+    # Harmonized indicators
+    tabItem(tabName = "tab_harmonizedIndicators",
+            fluidRow(
+              # Filter
+              box(
+                status = "warning", 
+                solidHeader = TRUE,
+                collapsible = TRUE,
+                width = 12,
+                title = tr("disclaimer_title"),
+                tr("disclaimer_text")
+              ),
+              box(
+                title = tr("filter"),
+                width = 4,
+                sliderInput('dates', tr("dateRange"), sep = "", step = 1, min = 2003, max = 2024, value = c(2007,2024)),
+                selectInput('new_attack', tr("cases"), ops_new_attack(), selected = TRUE),
+                selectInput('diagn', tr("plasmodium"), ops_diagn()),
+                sliderInput('age', tr("age"), min = 0, max = 100, value = c(0,100)),
+                selectInput('sex', tr("sex"), ops_sex()),
+                selectInput('agg', tr("agg"), ops_agg(), selected = 30)
+              ),
+              # Counts
+              valueBoxOutput("HAR_count_fg"),
+              valueBoxOutput("HAR_count_br"),
+              # Main plot
+              box(
+                title = tr("incidence"),
+                width = 8,
+                plotlyOutput("HAR_plot_incidence")
+              ),
+              # Age plots
+              box(
+                title = tr("age"),
+                width = 12,
+                plotlyOutput("HAR_plot_age")
+              ),
+              # Bar plots
+              box(
+                title = tr("sex"),
+                width = 6,
+                plotlyOutput("HAR_plot_sex")
+              ),
+              box(
+                title = tr("plasmodium"),
+                width = 6,
+                plotlyOutput("HAR_plot_plasm")
+              )
+            )
+            
+    ),
+    # Harmonized indicators location
+    tabItem(tabName = "tab_harmonizedIndicators_loc",
+            fluidRow(
+              # Filter
+              box(
+                title = tr("filter"),
+                width = 4,
+                selectInput('HARLOCtype', tr("type"), ops_location()),
+                uiOutput('HARLOClocation_fg'),
+                uiOutput('HARLOClocation_br'),
+                sliderInput('HARLOCdates', tr("dateRange"), sep = "", step = 1, min = 2003, max = 2024, value = c(2010,2024)),
+                selectInput('HARLOCnew_attack', tr("new_attack"), ops_new_attack(), selected = TRUE),
+                selectInput('HARLOCdiagn', tr("plasmodium"), ops_diagn()),
+                sliderInput('HARLOCage', tr("age"), min = 0, max = 100, value = c(0,100)),
+                selectInput('HARLOCsex', tr("sex"), ops_sex()),
+                selectInput('HARLOCagg', tr("agg"), ops_agg(), selected = 30)
+              ),
+              box(
+                title = tr("incidence"),
+                width = 8,
+                plotlyOutput("HARLOC_plot_incidence")
+              ),
+              box(
+                width = 8,
+                uiOutput("HARLOC_information_completness")
+              )
+            ),
+            fluidRow(
+              # Day of the week plot
+              box(
+                title = tr("FG"),
+                width = 6,
+                plotOutput("HARLOC_plot_day_week_fg", height = "600px")
+              ),
+              box(
+                title = tr("BR"),
+                width = 6,
+                plotOutput("HARLOC_plot_day_week_br", height = "600px")
+              )
+            )
+            
+    ),
+    # Maps
+    tabItem(tabName = "tab_map",
+            fluidRow(
+              tags$head(
+                tags$link(rel = "stylesheet", type = "text/css", href = "styles.css")
+              ),
+              leafletOutput("map"),
+              absolutePanel(id = "controls",
+                            class = "panel panel-default",
+                            fixed = TRUE,
+                            width = 330, height = "auto",
+                            top = 100, left = "auto", right = 10, bottom = "auto",
+                            draggable = TRUE,
+                            selectInput('MAPtype', tr("type"), ops_location2(), selected = "residence_area"),
+                            sliderInput('MAPdates', tr("dateRange"), sep = "", step = 1, min = 2003, max = 2024, value = c(2007,2024), animate = TRUE),
+                            selectInput('MAPdiagn', tr("plasmodium"), ops_diagn()),
+                            checkboxGroupInput('MAPosm', "OSM layers", c("Hospitals", "Clinics"), inline=TRUE),
+                            # checkboxGroupInput('MAPgbif', "GBIF layers", c("Anopheles darlingi", "Anopheles marajoara"), inline=TRUE),
+                            checkboxGroupInput('MAPgbif', "GBIF layers", c("Anopheles darlingi"), inline=TRUE),
+                            selectInput('MAPrasters', "Raster models", ops_raster(), selected = "NO_SEL"),
+                            uiOutput('MAPlegend'),
+                            textOutput('MAPmissing')
+              )
+            )
+    ),
+    # Ranking
+    tabItem(tabName = "tab_ranking",
+            fluidRow(
+              # Filter
+              box(
+                title = tr("filter"),
+                width = 4,
+                selectInput('RANKtype', tr("type"), ops_location()),
+                sliderInput('RANKdates', tr("dateRange"), sep = "", step = 1, min = 2003, max = 2024, value = c(2010,2024)),
+                selectInput('RANKnew_attack', tr("new_attack"), ops_new_attack(), selected = TRUE),
+                selectInput('RANKdiagn', tr("plasmodium"), ops_diagn()),
+                sliderInput('RANKage', tr("age"), min = 0, max = 100, value = c(0,100)),
+                selectInput('RANKsex', tr("sex"), ops_sex())
+              ),
+              box(
+                width = 8,
+                dataTableOutput('RANK_table')
+              )
+            )
+    ),
+    # Download
+    tabItem(tabName = "tab_download",
+            fluidRow(
+              # Filter
+              box(
+                title = tr("filter"),
+                width = 4,
+                selectInput('DOWNtype', tr("type"), ops_location()),
+                sliderInput('DOWNdates', tr("dateRange"), sep = "", step = 1, min = 2003, max = 2024, value = c(2010,2024)),
+                selectInput('DOWNnew_attack', tr("new_attack"), ops_new_attack(), selected = TRUE),
+                selectInput('DOWNdiagn', tr("plasmodium"), ops_diagn()),
+                sliderInput('DOWNage', tr("age"), min = 0, max = 100, value = c(0,100)),
+                selectInput('DOWNsex', tr("sex"), ops_sex())
+              ),
+              box(
+                title = tr("FG"),
+                width = 4,
+                uiOutput('DOWNlocation_fg')
+              ),
+              box(
+                title = tr("BR"),
+                width = 4,
+                uiOutput('DOWNlocation_br')
+              )
+            ),
+            fluidRow(
+              box(
+                width = 12,
+                dataTableOutput('DOWN_table')
+              )
+            )
+    ),
+    # Trends
+    # tabItem(tabName = "tab_trends",
+    #         fluidRow(
+    #           # Filter
+    #           box(
+    #             title = tr("filter"),
+    #             width = 4,
+    #             selectInput('TRENDStype', tr("type"), ops_location(), selected = "residence_area"),
+    #             selectInput('TRENDSnew_attack', tr("new_attack"), ops_new_attack(), selected = TRUE),
+    #             selectInput('TRENDSdiagn', tr("plasmodium"), ops_diagn()),
+    #             sliderInput('TRENDSage', tr("age"), min = 0, max = 100, value = c(0,100)),
+    #             selectInput('TRENDSsex', tr("sex"), ops_sex())
+    #           ),
+    #           box(
+    #             width = 8,
+    #             dataTableOutput('TRENDS_table')
+    #           )
+    #         )
+    # ),
+    # Information quality
+    tabItem(tabName = "tab_infoq",
+            fluidRow(
+              # Filter
+              box(
+                title = tr("filter"),
+                width = 4,
+                selectInput("INFOQcountry", tr("country"), ops_country()),
+                selectInput('INFOQtype', tr("type"), ops_location()),
+                uiOutput('INFOQlocation_fg'),
+                uiOutput('INFOQlocation_br'),
+                sliderInput('INFOQdates', tr("dateRange"), sep = "", step = 1, min = 2003, max = 2024, value = c(2010,2024)),
+                selectInput('INFOQnew_attack', tr("new_attack"), ops_new_attack(), selected = "Any"),
+                selectInput('INFOQdiagn', tr("plasmodium"), ops_diagn(), selected = "Any"),
+                selectInput('INFOQsex', tr("sex"), ops_sex())
+              ),
+              box(
+                title = "Misssing information",
+                width = 8,
+                tabBox(
+                  width = 12,
+                  tabPanel(
+                    title = tr("sex"),
+                    plotlyOutput("INFOQ_plot_sex")
+                  ),
+                  tabPanel(
+                    title = tr("residence_area"),
+                    plotlyOutput("INFOQ_plot_residence_area")
+                  ),
+                  tabPanel(
+                    title = tr("infection_place"),
+                    plotlyOutput("INFOQ_plot_infection_place")
+                  ),
+                  tabPanel(
+                    title = tr("center"),
+                    plotlyOutput("INFOQ_plot_center")
+                  )
+                )
+              )
+            ),
+            fluidRow(
+              box(
+                width = 12,
+                dataTableOutput('INFOQ_ftable')
+              )
+            )
+    )
+  )
+})
+
+
+
+# Handle translation change
+observeEvent(input$language, {
+  currentTab <- input$tabs # Get current tab
+  updateTabItems(session, "tabs", currentTab) # Set current tab after getting translation
+})
diff --git a/modules/trends.R b/modules/trends.R
new file mode 100644
index 0000000000000000000000000000000000000000..6cc3a4f992083803211cb8d02effbb45adf0846f
--- /dev/null
+++ b/modules/trends.R
@@ -0,0 +1,62 @@
+### Ranking tab
+
+##################
+### Data objects
+##################
+
+
+
+TRENDS_tab <- reactive({
+  
+  date1 <- min(JSON_cons_har$consultation_date)
+  date2 <- max(JSON_cons_har$consultation_date)
+  
+  if(input$TRENDStype == "residence_area"){
+    consultation_har_filter(JSON_cons_har,
+                            new_attack = input$TRENDSnew_attack,
+                            diagn = input$TRENDSdiagn,
+                            sex = input$TRENDSsex,
+                            minAge = input$TRENDSage[1], maxAge = input$TRENDSage[2]
+    ) %>%
+      select(id_residence_place, consultation_date) %>%
+      group_by(id_residence_place)
+  } else if(input$TRENDStype == "center"){
+    consultation_har_filter(JSON_cons_har,
+                            new_attack = input$TRENDSnew_attack,
+                            diagn = input$TRENDSdiagn,
+                            sex = input$TRENDSsex,
+                            minAge = input$TRENDSage[1], maxAge = input$TRENDSage[2]
+    ) %>%
+      filter(consultation_date >= date1 & consultation_date <= date2) %>%
+      select(id_center, consultation_date) %>%
+      group_by(id_center) %>%
+      dplyr::summarise(count = n(), trend = decompose(x = consultation_date, date1 = date1, date2 = date2)) %>%
+      inner_join(healthcenter_list, by = c("id_center" = "id_center"))
+  } else if(input$TRENDStype == "infection_place"){
+    consultation_har_filter(JSON_cons_har,
+                            new_attack = input$TRENDSnew_attack,
+                            diagn = input$TRENDSdiagn,
+                            sex = input$TRENDSsex,
+                            minAge = input$TRENDSage[1], maxAge = input$TRENDSage[2]
+    ) %>%
+      filter(consultation_date >= date1 & consultation_date <= date2) %>%
+      select(id_infection_place, consultation_date) %>%
+      group_by(id_infection_place) %>%
+      dplyr::summarise(count = n(), trend = decompose(x = consultation_date, date1 = date1, date2 = date2)) %>%
+      inner_join(residencial_area_list, by = c("id_infection_place" = "id"))
+  }
+  
+  
+})
+
+##################
+### Table
+##################
+
+output$TRENDS_table <- renderDataTable({
+  TRENDS_tab() %>%
+    select(name, count, source, trend) %>%
+    plyr::arrange(-count) %>% 
+    mutate(source = ifelse(source == "BR", tr("BR"), tr("FG"))) %>%
+    plyr::rename(c("name" = tr("name"), "count" = tr("cases"), "source" = tr("country")))
+}, rownames= FALSE)
\ No newline at end of file
diff --git a/notes_time_series.R b/notes_time_series.R
new file mode 100644
index 0000000000000000000000000000000000000000..5ad807802fac56fff4abe5bdd08834a6cf2b7f6b
--- /dev/null
+++ b/notes_time_series.R
@@ -0,0 +1,78 @@
+consultation_date <- JSON_cons_har$consultation_date
+
+inc <- as.data.frame(incidence(dates = consultation_date, interval = 1)) 
+
+inc_ts <- ts(inc$counts, frequency = 7)
+
+plot(inc_ts)
+
+inc_dec <- stl(inc_ts, s.window="periodic")
+
+plot(inc_dec)
+
+trend <- as.data.frame(inc_dec$time.series)$trend
+trend[length(trend)] - trend[1]
+
+
+data <- JSON_cons_har %>%
+  filter(id_center == "11/160050") %>%
+  filter(consultation_date >= as.Date("2015-01-01") & consultation_date <= as.Date("2015-01-31"))
+
+
+####
+
+date1 <- min(JSON_cons_har$consultation_date)
+date2 <- max(JSON_cons_har$consultation_date)
+
+df <- consultation_har_filter(
+  JSON_cons_har,
+  new_attack = TRUE,
+  diagn = "Positive",
+  sex = "Any",
+  minAge = 0,
+  maxAge = 100
+) %>%
+  #filter(id_center == "200/160050") %>%
+  select(id_center, consultation_date)
+
+seasonal <- data.frame(unit = as.character())
+for(g in df$id_center){
+  sub <- subset(df, id_center == g)
+  dec <- decompose(sub$consultation_date)
+  df2 <- data.frame(dec$dates, dec$seasonal)
+}
+
+####
+
+teste <- consultation_har_filter(
+  JSON_cons_har,
+  new_attack = TRUE,
+  diagn = "Positive",
+  sex = "Any",
+  minAge = 0,
+  maxAge = 100
+) %>%
+  #filter(source == "B") %>%
+  filter(id_center == "200/160050") %>%
+  select(consultation_date) 
+
+
+date1 <- min(teste$consultation_date)
+date2 <- max(teste$consultation_date)
+inc <- as.data.frame(incidence(dates = teste$consultation_date, interval = 1)) 
+full <- data.frame(dates = seq(date1, date2, by = "day"))
+inc <- dplyr::right_join(inc, full, by = "dates")
+inc[is.na(inc)] <- 0
+inc_ts <- ts(inc$counts, frequency = 365)
+inc_dec <- stl(inc_ts, s.window="periodic")
+df_dec <- data.frame(dates = inc$dates, inc_dec$time.series)
+
+# Seasonality
+q <- quantile(df_dec$seasonal, c(.90))
+sub <- subset(df_dec, seasonal >= q)
+table(lubridate::month(sub_high$dates))
+
+
+
+plot(inc_ts)
+plot(inc_dec)
diff --git a/residential_area.csv b/residential_area.csv
new file mode 100644
index 0000000000000000000000000000000000000000..618c85cb5b343dd8603c63cba99522d0959b186b
--- /dev/null
+++ b/residential_area.csv
@@ -0,0 +1,383 @@
+Var1;Freq
+1;545
+10;29
+100;4
+102;1
+103;325
+105;383
+106;4
+107;5
+108;9
+109;79
+1099;1
+11;721
+110;441
+111;107
+112;10
+113;625
+114;4
+115;2
+116;10
+1160;1
+117;3
+118;18
+119;6
+12;107
+120;4
+121;175
+122;13
+1227;1
+123;4
+1237;4
+1238;2
+1239;3
+124;641
+125;6716
+126;10445
+127;5853
+128;1935
+129;3114
+13;24
+130;5849
+131;15
+132;2897
+1323;1
+1326;7
+133;6
+134;11
+135;125
+136;1160
+14;112
+140;5
+141;9
+142;4
+143;15
+144;1
+145;44
+146;62
+147;3
+148;3
+149;102
+15;105
+151;7
+152;13
+153;125
+154;2
+155;2
+156;26
+157;38
+158;6
+159;557
+16;79
+160;52
+161;1
+163;2
+164;3
+165;17
+166;18
+167;6
+168;1
+169;2
+17;40
+170;2
+171;1
+172;6
+173;10
+174;15
+175;3
+176;10
+177;1
+178;4
+179;2
+18;1
+182;1
+185;11
+186;15
+187;14
+188;2
+189;3
+19;55
+190;4
+191;8
+192;6
+193;15
+194;5
+198;3
+2;189
+20;840
+200;1
+201;1
+202;1
+203;1
+204;6
+205;1
+206;2
+207;2
+21;1702
+211;1
+212;6
+216;1
+217;2
+219;1
+22;24
+221;2
+222;6
+224;1
+227;3
+228;1
+23;30
+230;5
+233;1
+234;2
+235;1
+238;3
+24;57
+240;1
+242;1
+243;1
+244;3
+245;1
+247;13
+248;24
+249;2
+25;11
+250;1
+251;13
+254;1
+256;1
+257;4
+259;1
+26;12
+261;1
+263;7
+264;1
+265;1
+266;1
+267;5
+268;1
+27;5
+274;3
+277;1
+28;76
+29;379
+291;1
+293;4
+297;1
+3;172
+30;28
+300;1
+303;2
+306;1
+31;6
+315;1
+32;66
+33;104
+330;1
+331;1
+333;2
+334;1
+336;1
+338;1
+34;1
+343;2
+349;1
+35;4
+350;1
+354;5
+355;1
+36;239
+362;1
+363;1
+37;5
+370;1
+375;2
+378;1
+38;120
+382;1
+388;1
+39;240
+397;1
+4;590
+40;202
+400;2
+41;59
+42;82
+420;1
+421;1
+424;1
+425;1
+428;1
+43;87
+430;1
+433;2
+44;279
+449;2
+45;4
+451;1
+46;17
+463;1
+47;103
+479;24
+48;3
+480;18
+482;44
+483;26
+484;9
+485;3
+486;1
+49;11
+492;44
+493;4
+494;87
+495;13
+496;4
+498;2
+5;362
+50;410
+51;22
+510;11
+511;16
+512;3
+513;62
+514;1
+52;4
+521;42
+522;1
+528;1
+529;1
+53;23
+530;1
+531;1
+54;1051
+55;22
+551;1
+56;5
+563;2
+566;2
+567;1
+569;2
+57;47
+570;3
+577;5
+58;3
+584;1
+589;1
+590;19
+592;4
+594;4
+6;129
+60;1181
+61;162
+617;1
+62;141
+621;28
+624;1
+625;1
+628;1
+63;100
+632;4
+64;35
+66;167
+67;6
+68;42
+69;48
+7;147
+70;9
+702;2
+704;2
+708;1
+71;33
+72;3
+73;467
+74;20
+740;1
+75;46
+754;9
+755;9
+757;2
+76;5
+77;101
+78;76
+79;3
+8;94
+80;5
+81;11
+83;5
+84;88
+845;6
+85;6
+86;3
+87;2898
+88;3193
+885;3
+89;1489
+9;48
+90;16
+909;1
+91;726
+914;2
+916;1
+918;2
+92;290
+93;22
+94;453
+95;97
+96;3
+97;131
+98;86
+99;16
+ECAMC_CENT;5
+ECAMC_COLE;234
+ECAMC_ECOL;116
+ECAMC_GEND;78
+ECAMC_MAIR;54
+ECAMT_ALAM;15
+ECAMT_KALA;36
+ECAMT_LIPO;13
+ECAMT_PINA;26
+ECAMT_ROGE;84
+ECAMT_YAWA;24
+ECAMT_ZIDO;140
+ECAMX_BRAZ;187
+ECAMX_CACO;6
+ECAMX_CAJO;27
+ECAMX_CANA;101
+ECAMX_CHAN;40
+ECAMX_CITR;41
+ECAMX_CIVE;166
+ECAMX_DIAM;51
+ECAMX_KUMA;54
+ECAMX_LEGI;4
+ECAMX_MARI;196
+ECAMX_MONB;156
+ECAMX_MOUL;177
+ECAMX_PATA;23
+ECAMX_PAUL;52
+ECAMX_PIST;2
+ECAMX_POUV;36
+ECAMX_RENE;84
+ECAMX_ROSE;43
+ECAMX_ROUG;65
+ECAMX_SIKI;24
+ECAMX_SOIT;209
+ECAMX_SOLE;5
+ESGOS_ADIM;310
+ESGOS_BAMB;138
+ESGOS_CENT;142
+ESGOS_ESP1;105
+ESGOS_ESP2;204
+ESGOS_ESP3;534
+ESGOS_GEND;50
+ESGOS_MAIR;45
+ESGOS_MARI;223
+ESGOS_ONOZ;325
+ESGOS_PIST;130
+ESGOS_RESI;88
+ESGOU_POST;51
+ESGOX_BLON;192
+ESGOX_GABA;128
+ESGOX_OIAP;48
+ESGOX_PALE;305
+ESGOX_SAUT;2
+ESGOX_TAMP;9
+ESGOX_VICT;63
diff --git a/server.R b/server.R
new file mode 100644
index 0000000000000000000000000000000000000000..0c7eeabe68df2642b254d1895896f95ca33db7a6
--- /dev/null
+++ b/server.R
@@ -0,0 +1,172 @@
+# Packages
+library(jsonlite)
+library(shiny)
+library(shinydashboard)
+library(incidence)
+library(plotly)
+library(tidyr)
+library(reshape2)
+library(lubridate)
+library(chron)
+library(dplyr)
+library(formattable)
+library(DT)
+library(leaflet)
+library(readr)
+library(stringr)
+library(rgdal)
+library(sf)
+library(osmdata)
+
+t <- Sys.time()
+
+# Load translated strings, parsed as a double list
+load("locale/translation.bin") 
+
+str_glue("Load translations done : {Sys.time() - t} sec.") %>% print()
+
+# Load ingest functions
+source("functions/consultation_har_ingest.R")
+source("functions/area_har_ingest.R")
+source("functions/healthcenter_har_ingest.R")
+
+# Load filter functions
+source("functions/consultation_har_filter.R")
+
+# Load other functions
+source("functions/calendarHeat.R")
+source("functions/addLegendCustom.R")
+#source("functions/decompose.R")
+
+# Find Last Download Date
+source("functions/last_update.R")
+
+str_glue("Load functions done : {Sys.time() - t} sec.") %>% print()
+
+# Load JSON files
+JSON_cons_har <- consultation_har_ingest("data/", "consultation_harmonized.json")
+# JSON_healthcenter_har <- read_csv(
+#   file = "data/JSON_healthcenter_har.csv", col_types="-cnccn")
+JSON_healthcenter_har <- read.csv(file = "data/JSON_healthcenter_har.csv", header=TRUE)
+
+
+# Load shapefile and "create" JSON_area_har
+# unique_loc.shp <- readOGR("data/shp", "unique_Spatial_referential_2019_07_01", encoding = "UTF-8")
+# unique_loc <- unique_loc.shp@data %>%
+#   select(country, name, id_sivep, id_cdps, geocoded) %>%
+#   cbind(coordinates(unique_loc.shp))
+
+unique_loc.shp <- st_read(
+  dsn="data/shp", layer = "unique_Spatial_referential_2019_07_01",
+  options = "ENCODING=UTF-8")
+coords_loc <- st_coordinates(unique_loc.shp)
+unique_loc <- unique_loc.shp %>%
+  select(country, name, id_sivep, id_cdps, geocoded) %>%
+  mutate(coords.x1 = coords_loc[,1], coords.x2 = coords_loc[,2]) %>%
+  st_drop_geometry()
+unique_loc_br <- unique_loc %>% 
+  filter(country == "BR") %>%
+  filter(!is.na(id_sivep))
+unique_loc_gf <- unique_loc %>% 
+  filter(country == "GF") %>%
+  filter(!is.na(id_cdps))
+unique_loc_both <- unique_loc_br %>%
+  filter(!is.na(id_sivep) & !is.na(id_cdps)) %>%
+  mutate(id_sivep = id_cdps) %>%
+  mutate(country = "GF") %>%
+  mutate(coords.x1 = coords.x1 + 0.001) %>%
+  mutate(coords.x2 = coords.x2 + 0.001) %>%
+  mutate(name = paste(name, "(FR-GF)"))
+unique_loc_br <- unique_loc_br %>%
+  mutate(name = as.character(name)) %>%
+  mutate(name = ifelse(!is.na(id_sivep) & !is.na(id_cdps), paste(name, "(BR)"), name))
+unique_loc <- rbind(unique_loc_br, unique_loc_gf) %>% 
+  rbind(unique_loc_both) %>%
+  select(-id_cdps) %>%
+  rename(source = country) %>%
+  rename(x_coordinate = coords.x1) %>%
+  rename(y_coordinate = coords.x2) %>%
+  rename(id = id_sivep) %>%
+  mutate(source = ifelse(source == "GF", "FR-GF", "BR"))
+JSON_area_har <- unique_loc
+rm(unique_loc, unique_loc_br, unique_loc_gf, unique_loc_both, unique_loc.shp)
+
+#coords <- read.csv2("data/map.csv")
+coords <- JSON_area_har %>%
+  filter(geocoded == TRUE) %>%
+  select(id, name, x_coordinate, y_coordinate)
+#filter(x_coordinate <= -51)
+
+str_glue("Process SHP + JSON done : {Sys.time() - t} sec.") %>% print()
+
+dates_recup_donnees <- last_update("data/dates_recup_donnees_syst_surveillance.txt")
+# text_recup_donnees <- paste0(
+#   "Date of last data retrieval", 
+#   "\nfrom SIVEP-Malária (BR) : ", dates_recup_donnees[["date_recup_donnees_SIVEP"]], 
+#   "\nfrom CDPS database (FR-GF) : ", dates_recup_donnees[["date_recup_donnees_CDPS"]])
+text_recup_donnees_BR <-dates_recup_donnees[["date_recup_donnees_SIVEP"]]
+text_recup_donnees_GF <-dates_recup_donnees[["date_recup_donnees_CDPS"]]
+
+
+# Initate server side modules
+shinyServer(function(input, output, session) {
+  
+  # Function to translate key 
+  source("functions/translate.R", local = TRUE)
+  
+  # Tab harmonized
+  source("modules/harmonized.R", local = TRUE)
+  
+  # Tab harmonized localities
+  source("modules/harmonized_loc.R", local = TRUE)
+  
+  # Tab trends (not ready)
+  # source("modules/trends.R", local = TRUE)
+  
+  # Tab download
+  source("modules/download.R", local = TRUE)
+  
+  # Tab ranking
+  source("modules/ranking.R", local = TRUE)
+  
+  # Tab information quality
+  source("modules/infoq.R", local = TRUE)
+  
+  # Tab Brazil
+  # ToDo
+  
+  # Tab French Guiana
+  # ToDo
+  
+  # Tab map
+  source("modules/map.R", local = TRUE)
+  
+  # Dynamic server UI
+  source("modules/server_ui.R", local = TRUE)
+  
+  # Modal
+  showModal(modalDialog(
+    #title = "Term of use",
+    size = "l",
+    tags$h3("Informações Gerais e Condições de Utilização"),
+    tags$p("Você está acessando informações epidemiológicas coletadas de maneira passiva pelos Centros de Prevenção e Cuidado Não Localizados (CDPS, Centro Hospitalar Andrée Rosemon em Caiena) da Guiana Francesa e de centros de notificação no Brasil, de pacientes com malária que foram consultados, residem ou relataram um local suspeito de infeção em um dos seguintes municípios: Saint-Georges-de-l'Oyapock, Ouanary, Camopi (Guiana Francesa), ou Oiapoque (Brasil)."),
+    tags$p("Esta informação é apresentada de forma anonimizada e agregada, resultado de um processamento automático autorizado pelo Commission Nationale Informatique et Liberté (CNIL) (Deliberação No. 2019-025 do dia 28 de fevereiro de 2019, pedido de autorização No. 2135363)"),
+    tags$b("O uso da informação disponível através deste sistema não deve, sob qualquer circunstância, ser usado para fins comerciais."),
+    tags$p("Qualquer publicação de dados e/ou resultados obtidos através do uso deste sistema deve mencionar explicitamente o endereço na Internet do sistema e a data de último acesso ao sistema."),
+    tags$h3("Informations Générales et Conditions d'Utilisation"),
+    tags$p("Vous êtes sur le point d’accéder à des informations épidémiologiques recueillies de manière passive dans les Centres Délocalisés de Prévention et de Soin (CDPS, Centre Hospitalier Andrée Rosemon de Cayenne) de Guyane française ainsi que dans les centres de notification du Brésil, auprès de patients atteints de paludisme et ayant consulté, résidant, ou ayant déclaré un lieu présumé d'infection dans l’une des communes suivantes : Saint-Georges-de-l’Oyapock, Ouanary, Camopi (Guyane française), ou Oiapoque (Brésil)."),
+    tags$p("Ces informations sont présentées anonymisées et agrégées, et résultent d’un traitement automatisé autorisé par la Commission Nationale Informatique et Liberté (CNIL) (Délibération N°2019-025 du 28 février 2019, demande d'autorisation N°2135363)."),
+    tags$b("L’utilisation des informations disponibles via ce système ne doit en aucun cas être à but commercial."),
+    tags$p("Toute publication de données et/ou de résultats obtenus via l’utilisation de ce système devra mentionner explicitement l'adresse internet du système et la date du dernier accès au système."),
+    tags$h3("General Information and Terms and conditions of use"),
+    tags$p("You are about to access epidemiological information collected in a passive mode from Delocalized Prevention and Care Centres (CDPS, Andrée Rosemon Hospital Centre in Cayenne) of French Guiana and notification centres in Brazil, from patients with malaria who have consulted, reside in, or have reported a suspected place of infection in one of the following municipalities: Saint-Georges-de-l'Oyapock, Ouanary, Camopi (French Guiana), or Oiapoque (Brazil)."),
+    tags$p("These information are presented anonymized and aggregated, and result from an automated processing authorized by the Commission Nationale Informatique et Liberté (CNIL) (Deliberation no. 2019-025 of 28 February 2019, request for authorisation No. 2135363)."),
+    tags$b("The use of the information available through this system must under no circumstances be for commercial purposes."),
+    tags$p("Any publication of data and/or results obtained through the use of this system must explicitly mention the Internet address of the system and the date of last access to the system."),
+    easyClose = FALSE,
+    footer = tagList(
+      modalButton("Eu li e aceito as condições de utilização | J’ai lu et j’accepte les conditions d’utilisation |\n I have read and accept the terms of use")
+    )
+    
+  ))
+})
diff --git a/ui.R b/ui.R
new file mode 100644
index 0000000000000000000000000000000000000000..6754658e05dcca19c12b1a4c418aa63b0c6aaf19
--- /dev/null
+++ b/ui.R
@@ -0,0 +1,47 @@
+# Packages
+library(shinydashboard)
+
+shinyUI(dashboardPage(
+  # Skin color
+  skin = "purple",
+  
+  # APP Title
+  dashboardHeader(
+    title = "Malaria Lite 1.2"
+    # tags$li(class = "dropdown",
+    #         tags$a(href="http://ird.fr", target="_blank", 
+    #                tags$img(height = "20px", alt="IRD Logo", src="logo_ird.png")
+    #         )
+    # ),
+    # tags$li(class = "dropdown",
+    #         tags$a(href="http://fiocruz.br", target="_blank", 
+    #                tags$img(height = "20px", alt="Fiocruz Logo", src="logo_fiocruz.png")
+    #         )
+    # )
+  ),
+  
+  # Sidebar
+  dashboardSidebar(
+    # Render translated menu from server.R
+    uiOutput("sidebarMenu"),
+    
+    # Translation selector
+    radioButtons(inputId = "language", label = "Language",
+                 choices = c("English" = "en", "Français" = "fr", "Português" = "pt"),
+                 selected = "en"),
+    
+    # Logos
+    img(class = "logo", src='logos2.png')
+  ),
+  
+  # Body
+  dashboardBody(
+    # Google Analytics
+    tags$head(includeScript("https://www.googletagmanager.com/gtag/js?id=UA-121861538-1")),
+    tags$head(includeScript("google-analytics.js")),
+    
+    # Render translated tab items from server.R
+    uiOutput("tabItems")
+  )
+  
+))
diff --git a/www/.DS_Store b/www/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..4761ef77be21bf21f6cc9d336be92a61c582e187
Binary files /dev/null and b/www/.DS_Store differ
diff --git a/www/CHAR-CDPS.jpg b/www/CHAR-CDPS.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..9d4bbadc014315822b22fb4842477013ba703d55
Binary files /dev/null and b/www/CHAR-CDPS.jpg differ
diff --git a/www/ESPACE-DEV.jpg b/www/ESPACE-DEV.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..fd178718955464904d4b55947bb3b9478ae06bb8
Binary files /dev/null and b/www/ESPACE-DEV.jpg differ
diff --git a/www/FIOCRUZ.jpg b/www/FIOCRUZ.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..338ab748fb1e4dce1db05ae9a2dfa355be522739
Binary files /dev/null and b/www/FIOCRUZ.jpg differ
diff --git a/www/GATES_FONDATION.png b/www/GATES_FONDATION.png
new file mode 100644
index 0000000000000000000000000000000000000000..a6586acb7ce27906f2def4b9cdc5a26b52e2d8a3
Binary files /dev/null and b/www/GATES_FONDATION.png differ
diff --git a/www/ICICT.png b/www/ICICT.png
new file mode 100644
index 0000000000000000000000000000000000000000..946414524e88317ac5f71c8935a6599bc413a1a8
Binary files /dev/null and b/www/ICICT.png differ
diff --git a/www/IRD.png b/www/IRD.png
new file mode 100644
index 0000000000000000000000000000000000000000..1e8ef8bea07f32144d8f4d66446edfdb64f334c5
Binary files /dev/null and b/www/IRD.png differ
diff --git a/www/LogoLMISentinela.png b/www/LogoLMISentinela.png
new file mode 100644
index 0000000000000000000000000000000000000000..f5eff641efe89039be19e9724db489a740d06564
Binary files /dev/null and b/www/LogoLMISentinela.png differ
diff --git a/www/logo_fiocruz.png b/www/logo_fiocruz.png
new file mode 100644
index 0000000000000000000000000000000000000000..e5321df3e9f84899d3ecfea660e2907d9d2096fa
Binary files /dev/null and b/www/logo_fiocruz.png differ
diff --git a/www/logo_ird.png b/www/logo_ird.png
new file mode 100644
index 0000000000000000000000000000000000000000..89ef085a9eaf0bc5f285e19dcfaa56ea6549e582
Binary files /dev/null and b/www/logo_ird.png differ
diff --git a/www/logos.png b/www/logos.png
new file mode 100644
index 0000000000000000000000000000000000000000..f0842ae0f933b7aa59d6ec00cc03607ccea2bd4c
Binary files /dev/null and b/www/logos.png differ
diff --git a/www/logos2.png b/www/logos2.png
new file mode 100644
index 0000000000000000000000000000000000000000..3ab797b1abaa11b671fa63cc39f356e764632795
Binary files /dev/null and b/www/logos2.png differ
diff --git a/www/styles.css b/www/styles.css
new file mode 100644
index 0000000000000000000000000000000000000000..b28f0c66fff851efdc6a112d7d1040e90b429cf7
--- /dev/null
+++ b/www/styles.css
@@ -0,0 +1,31 @@
+.logo {
+  display: block;
+  margin-left: auto;
+  margin-right: auto;
+  width: 100%;
+}
+
+#map {
+  margin-top: -15px;
+  height: calc(100vh - 65px) !important;
+}
+
+#controls {
+  /* Appearance */
+  background-color: white;
+  padding: 20px 20px 20px 20px;
+  cursor: move;
+  /* Fade out while not hovering */
+  opacity: 0.65;
+  transition: opacity 500ms 1s;
+}
+#controls:hover {
+  /* Fade in while hovering */
+  opacity: 0.95;
+  transition-delay: 0;
+}
+
+/* If not using map tiles, show a white background */
+.leaflet-container {
+  background-color: white !important;
+}
\ No newline at end of file