Browse Source

radar2 init

main
parent
commit
ffa35d02fd
  1. 6
      .gitignore
  2. 74
      global.R
  3. 134
      grouping microorganisms.csv
  4. 1078
      server.R
  5. 43
      specialties.csv
  6. 84
      ui.R
  7. BIN
      www/radar.png
  8. 14
      www/radar.svg
  9. 289
      www/radar_style.css

6
.gitignore

@ -0,0 +1,6 @@
.Rproj.user
.Rhistory
.RData
.Ruserdata
*.Rproj
.DS_Store

74
global.R

@ -0,0 +1,74 @@
# WELCOME TO RadaR
#RadaR is licensed under the GNU General Public License (GPL) v2.0 (https://github.com/ceefluz/radar/blob/master/LICENSE)
# LIST OF REQUIRED PACKAGES -----------------------------------------------
library(shiny)
library(shinydashboard)
library(shinydashboardPlus)
library(dashboardthemes)
library(shinyWidgets)
library(shinycssloaders)
library(shinyjs)
library(DT)
library(tidyverse)
library(ggtext)
library(AMR)
library(cleaner)
library(scales)
library(ggiraph)
specialties <- read_csv("specialties.csv")
specialties <- specialties %>%
mutate(specialty_shiny = if_else(specialty != "Outpatients", paste0(specialty, " (", str_replace_all(specialism, ";", ", "), ")"), "Outpatients"),
department = if_else(is.na(department), "NO DEPARTMENT GIVEN", department))
specialties <- separate_rows(specialties, specialism, sep = ";")
specialties <- separate_rows(specialties, department, sep = ";")
pathogens <- read_csv("grouping microorganisms.csv")
radar_data <- readRDS("bk_2019.rds")
radar_data <- radar_data %>%
left_join(specialties) %>%
mutate(specialty = if_else(is.na(specialty), "NO SPECIALTY GIVEN", specialty),
specialty_shiny = if_else(is.na(specialty_shiny), "NO SPECIALTY GIVEN", specialty_shiny),
name = mo_name(mo),
FLC = OXAC) %>%
left_join(pathogens)
lab_ab <- c("CFCC", "CFCL", "CFOC", "CFSC", "CFTC", "COCL", "GEHI", "QUDA")
radar_data <- radar_data %>%
select_at(vars(!contains(lab_ab))) %>%
rename_if(is.rsi, function(x) ifelse(is.na(suppressWarnings(as.ab(x))),
x,
suppressWarnings(as.ab(x)))) %>%
mutate(group_all = 1) # dummy variable to disable grouping
radar_data <- radar_data %>%
mutate(CRO = if_else(is.na(CRO) & !is.na(CTX), CTX, CRO))
radar_data_first <- radar_data %>%
filter_first_isolate(col_patient_id = "patientid", episode_days = 365) %>%
mutate(mo = as.mo(mo, Becker = TRUE))
intrinsic_info <- intrinsic_resistant %>%
mutate(mo = as.mo(microorganism),
intrinsic_r = TRUE)
download_box <- function(exportname, plot) {
downloadHandler(
filename = function() {
paste(exportname, Sys.Date(), ".png", sep = "")
},
content = function(file) {
ggsave(file, plot = plot, device = "png", width = 8)
}
)
}

134
grouping microorganisms.csv

@ -0,0 +1,134 @@
name,pathogen_group
Coagulase-negative Staphylococcus (CoNS),2
Escherichia coli,1
Staphylococcus aureus,1
Enterococcus faecium,1
Klebsiella pneumoniae,1
Enterococcus faecalis,1
Pseudomonas aeruginosa,1
Streptococcus pneumoniae,1
Streptococcus mitis,1
Enterobacter cloacae,1
Micrococcus luteus,2
Milleri Group Streptococcus (MGS),1
Klebsiella oxytoca,1
Bacteroides fragilis,1
Serratia marcescens,1
Klebsiella variicola,1
Streptococcus agalactiae,1
Streptococcus dysgalactiae,1
Proteus mirabilis,1
Candida glabrata,1
Cutibacterium acnes,2
Candida albicans,1
Streptococcus salivarius,2
Bacillus,3
Haemophilus influenzae,1
Streptococcus parasanguinis,1
Aerococcus urinae,1
Enterococcus casseliflavus,1
Streptococcus pyogenes,1
Citrobacter freundii,1
Listeria monocytogenes,1
Parvimonas micra,1
Rothia mucilaginosa,2
Bacillus cereus,3
Bacteroides thetaiotaomicron,1
Corynebacterium jeikeium,3
Citrobacter koseri,1
Gemella morbillorum,1
(unknown Gram-positives),3
Salmonella,1
Salmonella enterica,1
Veillonella,1
Fusobacterium nucleatum,1
Hafnia alvei,1
Rothia dentocariosa,2
Schaalia odontolytica,2
Stenotrophomonas maltophilia,1
Streptococcus lutetiensis,1
Acinetobacter,1
Acinetobacter lwoffii,1
Aeromonas,1
Alistipes onderdonkii,1
Actinomyces oris,1
Anaerococcus octavius,1
Bacillus licheniformis,3
Bacteroides ovatus,1
Bacteroides vulgatus,1
Brevibacterium,3
Corynebacterium,3
Eggerthella lenta,1
Enterococcus avium,1
Granulicatella adiacens,1
Klebsiella aerogenes,1
Lactobacillus gasseri,1
Lactobacillus rhamnosus,1
Morganella morganii,1
Abiotrophia defectiva,1
Achromatium,3
Actinobaculum,2
Aeromonas hydrophila,1
Alloscardovia omnicolens,2
Aliivibrio finisterrensis,2
Actinomyces dentalis,2
Anaerococcus,1
Anaerococcus vaginalis,1
Bacillus pumilus,3
Bacteroides uniformis,1
Bifidobacterium longum,2
Butyrivibrio,2
Cellulosimicrobium cellulans,2
Campylobacter ureolyticus,1
Capnocytophaga sputigena,1
Corynebacterium afermentans,3
Corynebacterium amycolatum,3
Corynebacterium aurimucosum,3
Corynebacterium mucifaciens,3
Corynebacterium minutissimum,3
Corynebacterium tuberculostearicum,3
Corynebacterium urealyticum,3
Cutibacterium avidum,2
Eubacterium limosum,3
Eikenella corrodens,1
Enterobacillus,2
(unknown Gram-negatives),2
Helcococcus kunzii,1
Kocuria,1
Kocuria rhizophila,1
Lachnoanaerobaculum orale,3
Lactobacillus fermentum,2
Lactobacillus plantarum,2
Lactobacillus paracasei,2
Lancefieldella parvula,2
Micrococcus,2
Moraxella atlantae,1
Moraxella catarrhalis,1
Moraxella osloensis,1
Neisseria,2
Neisseria subflava,2
Odoribacter splanchnicus,1
Pantoea agglomerans,2
Pediococcus pentosaceus,1
Paenibacillus,1
Paenibacillus illinoisensis,1
Parabacteroides distasonis,1
Providencia rettgeri,1
Prevotella melaninogenica,1
Pseudomonas putida,1
Rhodococcus hoagii,1
Schaalia meyeri,1
Schaalia turicensis,1
Solobacterium moorei,2
Staphylococcus,2
Streptococcus equinus,1
Streptococcus gallolyticus,1
Streptococcus salivarius thermophilus,2
Veillonella atypica,1
Weissella,1
Candida dubliniensis,1
Candida nivariensis,1
Candida parapsilosis,1
Issatchenkia orientalis,1
Kluyveromyces marxianus,2
Meyerozyma guilliermondii,1

1078
server.R
File diff suppressed because it is too large
View File

43
specialties.csv

@ -0,0 +1,43 @@
specialty ,specialism,department
Abdominal surgery ,CHAB,A3VA;K4VA
Cardiology,CARD,B1VA;B2VA;C1CC
Cardiothoracic surgery ,CTCH,C2VA
Children cardiology,KCAR,M2VA
Children surgery ,CHKC,M1VA
Children gastroenterology,KMDL,M1VA
Children general/immunology/nephrology,KALG;KIRI;KMET;KNEF,M4VA;L1KV
Children special,KALG;KIRI;KMET;KNEF,L1SC
Children ICU,KICK,KICK
Children onco/hematology,KOHE,M2VA
Children Lung,KLOA,M4VA
Children neurology ,NEKI,M4VA
Dermatology,D4VA,DERM
Dialyses,,DIAL
Ear-nose-throat ,KNOH,A1VA
Opthalmology ,OOGH,A1VA
Gastroenterology and hepatology general,MDLZ,C3VA
Gastroenterology and hepatology transplantation,MDLT,C3VA
Gynaecology,OGGY;OGGO,L4VA
Hematology,IHEM;IHTR,E2VA;B4VA;D1VA
Hepatobiliary surgery,CHHP,C4VA
Infectious diseases ,IINF,E1VA
Intensive care,ICVO,ICV2;ICV3;ICV4
Internal medicine general,IALG;IEND,E3VA;E4VA
Internal medicine oncology,IONC,D2VA
Lung diseases,LONG,D2VA;E4VA
Neonatology,KICN,KICN
Nephrology general,INEF,D4VA
Nephrology transplant,INTR,D4VA
Neurology,NEAL,K2VA
Neurosurgery,NCHI,K1VA;NEUC
Obstetrics,OGVK,K3VA;L3VA
Oncologic surgery,CHON,A3VA;K4VA
Orthopedic surgery,ORTH,A2VA
Plastic surgery,PLCH,A2VA
Psychiatry,PSYC,
Rheumatology,REUM,D3VA
Trauma surgery,CHTR,J2VA
Urology,UROL,L4VA
Vascular surgery,CHVA,C4VA
Other ,CRLR;CRRE;IACZ;MKKA,
Outpatients,BUCK;CAR;CCC;CCCB;CHVA;CTSC;DBL1;DER;DIAB;DIAL;ECHO;ENDO;EPBA;HCK;IEND;IHEM;INEF;INT;IONC;KALG;KCAR;KDWE;KIND;KMDL;KMET;KNO;KOHE;LON;MDL;MKA;MRI;NEU;NEUC;ODOK;OGVK;ONC1;ORTH;PET;PRIK;PSS2;REKI;RTH;RTPR;THOR;TRPL;UCO;URO;VAAT;ZAAR,

84
ui.R

@ -0,0 +1,84 @@
ui <- dashboardPagePlus(
title = "RadaR",
skin = "black", collapse_sidebar = TRUE, sidebar_background = "light",
# HEADER ------------------------------------------------------------------
dashboardHeader(
title = span(img(src = "radar.png", height = 30), strong("RadaR 2.0")),
titleWidth = 500,
tags$li(
a(
strong("About RadaR"),
height = 40,
href = "https://www.jmir.org/2019/6/e12843/",
title = "",
target = "_blank"
),
class = "dropdown",
)
),
# SIDEBAR -----------------------------------------------------------------
dashboardSidebar(disable = TRUE,
sidebarMenu(id = "sidebar_id",
menuItem(icon = icon("check-square"),
materialSwitch(
inputId = "allInput",
label = "All specialties selected",
value = TRUE,
status = "danger")),
menuItem(icon = icon("user-nurse"),
checkboxGroupInput(inputId = "specialtyInput",
label = "Select specialties",
choices = sort(unique(radar_data$specialty_shiny)))),
menuItem(icon = icon("hospital"),
checkboxGroupInput(inputId = "departmentInput",
label = "Select departments" ,
choices = sort(unique(radar_data$department))))
)
),
# BODY --------------------------------------------------------------------
dashboardBody(
# fluidRow(
# column = 12,
# infoBoxOutput(outputId = "no_tests", width = 4),
# infoBoxOutput(outputId = "no_pos", width = 4),
# infoBoxOutput(outputId = "top_mo", width = 4)
# ),
# br(),
fluidRow(
tags$style(
".nav-tabs {background-color: white;}
.nav-tabs-custom .nav-tabs li.active:hover a, .nav-tabs-custom .nav-tabs li.active a {background-color: transparent; border-color: transparent;}
.nav-tabs-custom .nav-tabs li.active {border-top-color: black;}"),
div(
id = "resistance",
column(
width = 6,
uiOutput("box2")
),
column(
width = 6,
uiOutput("box1")
),
column(
width = 6,
uiOutput("box3")
),
column(
width = 6,
uiOutput("box4")
)
)
)
)
)

BIN
www/radar.png

After

Width: 50  |  Height: 50  |  Size: 1.2 KiB

14
www/radar.svg

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
<style type="text/css">
.st0{fill:none;}
.st1{fill:#231F20;}
</style>
<path class="st0" d="M0,0h24v24H0V0z"/>
<path class="st1" d="M19.1,4.9l-1.4,1.4C19.1,7.8,20,9.8,20,12c0,4.4-3.6,8-8,8s-8-3.6-8-8c0-4.1,3.1-7.4,7-7.9v2C8.2,6.6,6,9,6,12
c0,3.3,2.7,6,6,6s6-2.7,6-6c0-1.7-0.7-3.2-1.8-4.2l-1.4,1.4C15.6,9.9,16,10.9,16,12c0,2.2-1.8,4-4,4s-4-1.8-4-4c0-1.9,1.3-3.4,3-3.9
v2.1c-0.6,0.4-1,1-1,1.7c0,1.1,0.9,2,2,2s2-0.9,2-2c0-0.7-0.4-1.4-1-1.7V2h-1C6.5,2,2,6.5,2,12s4.5,10,10,10s10-4.5,10-10
C22,9.2,20.9,6.7,19.1,4.9z"/>
</svg>

289
www/radar_style.css

@ -0,0 +1,289 @@
.btn-success {
font-size: 18px;
font-family: inherit;
padding: 5px 12px;
height: 55px;
min-width: 21.85%;
margin: 0px 10px 14px 20px;
text-align: left;
color: white;
background: #727477;
text-indent: 4px;
vertical-align: middle;
border-radius: 0px;
border-color: transparent;
box-shadow: 0 2px 5px 0 rgba(0,0,0,0.18), 0 1px 5px 0 rgba(0,0,0,0.15);
text-transform: uppercase;
-webkit-transition: all 0.25s cubic-bezier(0.02, 0.01, 0.47, 1);
transition: all 0.25s cubic-bezier(0.02, 0.01, 0.47, 1);
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.btn-success:hover {
background-color:#d1351b;
font-size: 18px;
font-family: inherit;
padding: 5px 12px;
height: 55px;
min-width: 21.85%;
margin: 0px 10px 14px 20px;
text-align: left;
color: white;
text-indent: 4px;
vertical-align: middle;
border-radius: 0px;
border-color: transparent;
box-shadow: 0 5px 11px 0 rgba(0,0,0,0.18), 0 4px 15px 0 rgba(0,0,0,0.15);
-webkit-transition: box-shadow 0.4s ease-out;
transition: box-shadow 0.4s ease-out;
}
.btn-warning, .btn-warning:hover {
font-size: 18px;
font-family: inherit;
padding: 5px 12px;
height: 55px;
min-width: 21.85%;
margin: 0px 10px 14px 20px;
text-align: left;
color: white;
background: #d1351b;
text-indent: 4px;
vertical-align: middle;
border-radius: 0px;
border-color: transparent;
box-shadow: 0 2px 5px 0 rgba(0,0,0,0.18), 0 1px 5px 0 rgba(0,0,0,0.15);
text-transform: uppercase;
-webkit-transition: all 0.25s cubic-bezier(0.02, 0.01, 0.47, 1);
transition: all 0.25s cubic-bezier(0.02, 0.01, 0.47, 1);
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.fa {
margin-right: 10px;
}
.fa.fa-gear.opt {
margin-right: 0px;
}
.fa.fa-search-plus.opt {
margin-right: 0px
}
#intro {
margin-bottom: 0;
align-items: center;
display: block;
margin: 0 auto;
background: #d1351b;
color: white;
min-width: 25%;
border-color: white
}
#sidebar_button {
height: 55px;
}
section.sidebar .shiny-bound-input.action-button, section.sidebar .shiny-bound-input.action-link {
margin: auto;
display: block;
}
.btn-danger {
background-color: #d1351b;
border-color: #d1351b;
height: 55px;
width: 300px;
border-radius: 0;
position: relative;
font-size: 18px;
}
.btn-primary {
background-color: darkgrey;
border-color: darkgrey;
color: white;
height: 55px;
width: 300px;
border-radius: 0;
position: relative;
font-size: 18px;
}
.btn-primary:hover {
background-color: #d1351b;
border-color: #d1351b;
color: white;
border-color: #d1351b;
}
.fa.fa-user, .fa.fa-thumbs-o-up, .fa.fa-flask.flask-box, .fa.fa-spinner.spinner-box {
color: white;
font-size: 20;
margin-right: 10px;
font-size: 30px;
vertical-align: middle;
}
.skin-black .treeview-menu > li > a {
color: white;
white-space: pre-line;
}
.skin-black .treeview-menu > li:hover > a {
color: white;
white-space: pre-line;
background-color:#606164;;
}
.info-box {
min-height:55px;
float:center;
box-shadow:5px 5px 5px lightgrey;
border-bottom: 0px;
}
}
.info-box-icon.bg-black {
height:55px;
}
.bg-black {
background-color: #727477 !important;
height: 55px;
line-height:55px;
}
.text-success {
color: #d1351b;
font-size: large;
}
.skin-black .main-header .navbar {
background-color:#d1351b
}
.skin-black .main-header .navbar .nav > li > a {
color:#fff
}
.skin-black .main-header .navbar .nav > li > a:hover {
background:#ffffff;
color:#d1351b
}
.skin-black .main-header .navbar .sidebar-toggle {
color:#ffffff
}
.skin-black .main-header .navbar .sidebar-toggle:hover {
color:#d1351b;
background:#fff
}
.skin-black .main-header .navbar .navbar-custom-menu .navbar-nav > li > a, .skin-black .main-header .navbar .navbar-right > li > a {
border-left:1px solid #d1351b;
border-right-width:0
}
.main-header .logo {
font-family:"Helvetica Neue", sans-serif ;
font-weight:bold;
letter-spacing:-1px;
font-size:30px;
color:#ffffff;
}
.modal-dialog{
max-width:1000px;
border-radius: 5px;
border: 2px solid white;
}
.modal-body{
max-height:700px;
align-content:center;
border: 2px solid white;
border-radius: 5px;
}
.modal-sm {
max-width:1200px;
align-content:center;
border-radius: 5px;
border: 2px solid white;
}
.sidebar {
height:90vh;
overflow-y:auto
}
.skin-black .main-header > .logo {
background-color:#d1351b;
color:#ffffff;
border-bottom:0 solid transparent;
border-right:1px solid #d1351b;
}
.skin-black .main-header > .logo:hover {
background-color:#d1351b
}
.nav-tabs-custom > .nav-tabs > li.active {
border-top-color:#616365
}
.nav-tabs-custom {
box-shadow:5px 5px 5px lightgrey
}
.skin-black .left-side, .skin-black .main-sidebar, .skin-black .wrapper {
background-color:#727477;
}
.skin-black .sidebar-menu > li.active > a, .skin-black .sidebar-menu > li:hover > a {
color:#fff;
background:#606164;
border-left-color:#d1351b;
}
.skin-black .sidebar-menu > li > .treeview-menu {
margin:0 1px;
background:#8a8c8f;
box-shadow:inset 0px 0px 7px #000000;
padding-bottom:2px
}
.skin-black .sidebar a {
color:#ffffff
}
.navbar-nav > .messages-menu > .dropdown-menu, .navbar-nav > .notifications-menu > .dropdown-menu, .navbar-nav > .tasks-menu > .dropdown-menu {
width: 400px;
padding: 0;
margin: 10px;
top: 100%;
background-color: #fefefee6;
box-shadow: 10px 10px 10px darkgrey;
}
.navbar-nav > .messages-menu > .dropdown-menu > li.header, .navbar-nav > .notifications-menu > .dropdown-menu > li.header, .navbar-nav > .tasks-menu > .dropdown-menu > li.header {
border-top-left-radius: 0px;
border-top-right-radius: 0px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
background-color: #d1351b;
padding: 7px 10px;
border-bottom: 1px solid #d1351be6;
color: #ffffff;
font-size: 14px;
}
.navbar-nav > .messages-menu > .dropdown-menu > li .menu, .navbar-nav > .notifications-menu > .dropdown-menu > li .menu, .navbar-nav > .tasks-menu > .dropdown-menu > li .menu {
max-height: 1200px;
margin: 0;
padding: 0;
list-style: none;
overflow-x: hidden;
}
.navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a {
color: #000000;
overflow: hidden;
white-space: normal;
}
#coxreg {
overflow-y: auto;
max-height: 200px;
background-color: lightgrey;
box-shadow: inset 0px -5px 5px darkgrey
}
#coxreg_aic {
background-color: lightgrey
}
#logreg {
overflow-y: auto;
max-height: 200px;
background-color: lightgrey;
box-shadow: inset 0px -5px 5px darkgrey
}
#logreg_aic {
background-color: lightgrey
}
.shiny-output-error {
visibility: hidden;
}
.shiny-output-error:before {
visibility: hidden;
}
Loading…
Cancel
Save