Skip to content

Commit

Permalink
nedstrippet versjon for debugging på server
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinthon committed Nov 14, 2024
1 parent a183cfb commit 274762c
Show file tree
Hide file tree
Showing 4 changed files with 306 additions and 298 deletions.
354 changes: 177 additions & 177 deletions R/appServer.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,188 +33,188 @@ appServer <- function(input, output, session) {

rapbase::appLogger(session = session, msg = 'Starter NORGAST')

shiny::observeEvent(
shiny::req(user$role()), {
print(user$role())
if (user$role() != 'SC') {
shiny::hideTab("norgast_app_id", target = "Sykehusvisning")
shiny::hideTab("norgast_app_id", target = "Utsending")
# shiny::hideTab("norgast_app_id", target = "Datakvalitet")
shiny::hideTab("norgast_app_id", target = "Eksport")
shiny::hideTab("norgast_app_id", target = "Traktplott")
shiny::hideTab("norgast_app_id", target = "Indikatorer")
shiny::hideTab("norgast_app_id", target = "Verktøy")
} else {
shiny::showTab("norgast_app_id", target = "Sykehusvisning")
shiny::showTab("norgast_app_id", target = "Utsending")
# shiny::showTab("norgast_app_id", target = "Datakvalitet")
shiny::showTab("norgast_app_id", target = "Eksport")
shiny::showTab("norgast_app_id", target = "Traktplott")
shiny::showTab("norgast_app_id", target = "Indikatorer")
shiny::showTab("norgast_app_id", target = "Verktøy")
}
})
# shiny::observeEvent(
# shiny::req(user$role()), {
# print(user$role())
# if (user$role() != 'SC') {
# shiny::hideTab("norgast_app_id", target = "Sykehusvisning")
# shiny::hideTab("norgast_app_id", target = "Utsending")
# # shiny::hideTab("norgast_app_id", target = "Datakvalitet")
# shiny::hideTab("norgast_app_id", target = "Eksport")
# shiny::hideTab("norgast_app_id", target = "Traktplott")
# shiny::hideTab("norgast_app_id", target = "Indikatorer")
# shiny::hideTab("norgast_app_id", target = "Verktøy")
# } else {
# shiny::showTab("norgast_app_id", target = "Sykehusvisning")
# shiny::showTab("norgast_app_id", target = "Utsending")
# # shiny::showTab("norgast_app_id", target = "Datakvalitet")
# shiny::showTab("norgast_app_id", target = "Eksport")
# shiny::showTab("norgast_app_id", target = "Traktplott")
# shiny::showTab("norgast_app_id", target = "Indikatorer")
# shiny::showTab("norgast_app_id", target = "Verktøy")
# }
# })

shiny::callModule(norgast::startside, "startside", usrRole=user$role())

##############################################################################
################ Fordelingsfigurer ###########################################

shiny::callModule(norgast::fordelingsfig, "fordelingsfig_id", reshID = user$org(),
RegData = RegData, userRole = user$role(),
hvd_session = session, BrValg = BrValg)

##############################################################################
################ Sykehusvisning ##############################################

shiny::callModule(norgast::sykehusvisning, "sykehusvisning_id", reshID = user$org(),
RegData = RegData, hvd_session = session, BrValg = BrValg)

##############################################################################
################ Traktplot ###################################################

shiny::callModule(norgast::traktplot, "traktplot_id", reshID = user$org(),
RegData = RegData, hvd_session = session, BrValg = BrValg)


##############################################################################
################ Tidsvisning #################################################

shiny::callModule(norgast::tidsvisning, "tidsvisning_id", reshID = user$org(),
RegData = RegData, userRole = user$role(),
hvd_session = session, BrValg = BrValg)

##############################################################################
################ Sammenlign utvalg ###########################################

shiny::callModule(norgast::saml_andeler, "saml_andeler_id", reshID = user$org(),
RegData = RegData, userRole = user$role(),
hvd_session = session, BrValg = BrValg)


##############################################################################
################ Indikatorfigurer ############################################

shiny::callModule(norgast::indikatorfig, "indikator_id", reshID = user$org(),
RegData = RegData, userRole = user$role(),
hvd_session = session, BrValg = BrValg)

##############################################################################
################ Overlevelseskurver ##########################################

shiny::callModule(norgast::overlevelse, "overlevelse_id", reshID = user$org(),
RegData = RegData, userRole = user$role(),
hvd_session = session, BrValg = BrValg)

##############################################################################
################ Samledokumenter #############################################

shiny::callModule(norgast::samledok, "samledok_id", reshID = user$org(),
RegData = RegData, userRole = user$role(),
hvd_session = session, BrValg = BrValg)

##############################################################################
################ Datadump ##################################################

shiny::callModule(norgast::datadump, "datadump_id", reshID = user$org(),
RegData = RegData, userRole = user$role(), brukerinfo=brukerinfo,
hvd_session = session, BrValg = BrValg)

##############################################################################
################ Adm. tabeller ###############################################

shiny::callModule(norgast::admtab, "admtab_id", reshID = user$org(),
RegData = RegData, userRole = user$role(),
hvd_session = session, skjemaoversikt=skjemaoversikt,
BrValg = BrValg)

##############################################################################
################ Datakvalitet ################################################

shiny::callModule(norgast::datakval_server, "datakval_id",
reshID = user$org(), userRole = user$role(),
RegData = RegData, skjemaoversikt = skjemaoversikt,
hvd_session = session)

##############################################################################
################ Subscription, Dispatchment and Stats ########################

## Objects currently shared among subscription and dispathcment
orgs <- as.list(BrValg$sykehus)
# reports <- list(
# Kvartalsrapport = list(
# synopsis = "NORGAST: Kvartalsrapport",
# fun = "abonnement_kvartal_norgast",
# paramNames = c("baseName", "reshID"),
# paramValues = c("NorgastKvartalsrapport_abonnement", user$org())
# )
# )

## Subscription
shiny::observe(

rapbase::autoReportServer(
id = "norgastSubscription",
registryName = "norgast",
type = "subscription",
reports = list(
Kvartalsrapport = list(
synopsis = "NORGAST: Kvartalsrapport",
fun = "abonnement_kvartal_norgast",
paramNames = c("baseName", "reshID"),
paramValues = c("NorgastKvartalsrapport_abonnement", user$org())
)
),
orgs = orgs,
freq = "quarter"
)
)

## Dispatchment
org <- rapbase::autoReportOrgServer("norgastDispatch", orgs)

paramNames <- shiny::reactive(c("reshID"))
paramValues <- shiny::reactive(c(org$value()))

observe(
rapbase::autoReportServer(
id = "norgastDispatch",
registryName = "norgast",
type = "dispatchment",
org = org$value,
paramNames = paramNames,
paramValues = paramValues,
reports = list(
Kvartalsrapport = list(
synopsis = "NORGAST: Kvartalsrapport",
fun = "abonnement_kvartal_norgast",
paramNames = c("baseName", "reshID"),
paramValues = c("NorgastKvartalsrapport_abonnement", user$org())
)
),
orgs = orgs,
eligible = (user$org() == "SC"),
freq = "quarter"
)
)

# ## Stats
# observe(
# rapbase::statsServer("norgastStats", registryName = "norgast",
# eligible = (user$org() == "SC"))
# )
# rapbase::statsGuideServer("norgastStatsGuide", registryName = "norgast")


##############################################################################
# Eksport ###################################################################
# brukerkontroller
rapbase::exportUCServer("norgastExport", "norgast")

## veileding
rapbase::exportGuideServer("norgastExportGuide", "norgast")

##############################################################################
#
# shiny::callModule(norgast::fordelingsfig, "fordelingsfig_id", reshID = user$org(),
# RegData = RegData, userRole = user$role(),
# hvd_session = session, BrValg = BrValg)
#
# ##############################################################################
# ################ Sykehusvisning ##############################################
#
# shiny::callModule(norgast::sykehusvisning, "sykehusvisning_id", reshID = user$org(),
# RegData = RegData, hvd_session = session, BrValg = BrValg)
#
# ##############################################################################
# ################ Traktplot ###################################################
#
# shiny::callModule(norgast::traktplot, "traktplot_id", reshID = user$org(),
# RegData = RegData, hvd_session = session, BrValg = BrValg)
#
#
# ##############################################################################
# ################ Tidsvisning #################################################
#
# shiny::callModule(norgast::tidsvisning, "tidsvisning_id", reshID = user$org(),
# RegData = RegData, userRole = user$role(),
# hvd_session = session, BrValg = BrValg)
#
# ##############################################################################
# ################ Sammenlign utvalg ###########################################
#
# shiny::callModule(norgast::saml_andeler, "saml_andeler_id", reshID = user$org(),
# RegData = RegData, userRole = user$role(),
# hvd_session = session, BrValg = BrValg)
#
#
# ##############################################################################
# ################ Indikatorfigurer ############################################
#
# shiny::callModule(norgast::indikatorfig, "indikator_id", reshID = user$org(),
# RegData = RegData, userRole = user$role(),
# hvd_session = session, BrValg = BrValg)
#
# ##############################################################################
# ################ Overlevelseskurver ##########################################
#
# shiny::callModule(norgast::overlevelse, "overlevelse_id", reshID = user$org(),
# RegData = RegData, userRole = user$role(),
# hvd_session = session, BrValg = BrValg)
#
# ##############################################################################
# ################ Samledokumenter #############################################
#
# shiny::callModule(norgast::samledok, "samledok_id", reshID = user$org(),
# RegData = RegData, userRole = user$role(),
# hvd_session = session, BrValg = BrValg)
#
# ##############################################################################
# ################ Datadump ##################################################
#
# shiny::callModule(norgast::datadump, "datadump_id", reshID = user$org(),
# RegData = RegData, userRole = user$role(), brukerinfo=brukerinfo,
# hvd_session = session, BrValg = BrValg)
#
# ##############################################################################
# ################ Adm. tabeller ###############################################
#
# shiny::callModule(norgast::admtab, "admtab_id", reshID = user$org(),
# RegData = RegData, userRole = user$role(),
# hvd_session = session, skjemaoversikt=skjemaoversikt,
# BrValg = BrValg)
#
# ##############################################################################
# ################ Datakvalitet ################################################
#
# shiny::callModule(norgast::datakval_server, "datakval_id",
# reshID = user$org(), userRole = user$role(),
# RegData = RegData, skjemaoversikt = skjemaoversikt,
# hvd_session = session)
#
# ##############################################################################
# ################ Subscription, Dispatchment and Stats ########################
#
# ## Objects currently shared among subscription and dispathcment
# orgs <- as.list(BrValg$sykehus)
# # reports <- list(
# # Kvartalsrapport = list(
# # synopsis = "NORGAST: Kvartalsrapport",
# # fun = "abonnement_kvartal_norgast",
# # paramNames = c("baseName", "reshID"),
# # paramValues = c("NorgastKvartalsrapport_abonnement", user$org())
# # )
# # )
#
# ## Subscription
# shiny::observe(
#
# rapbase::autoReportServer(
# id = "norgastSubscription",
# registryName = "norgast",
# type = "subscription",
# reports = list(
# Kvartalsrapport = list(
# synopsis = "NORGAST: Kvartalsrapport",
# fun = "abonnement_kvartal_norgast",
# paramNames = c("baseName", "reshID"),
# paramValues = c("NorgastKvartalsrapport_abonnement", user$org())
# )
# ),
# orgs = orgs,
# freq = "quarter"
# )
# )
#
# ## Dispatchment
# org <- rapbase::autoReportOrgServer("norgastDispatch", orgs)
#
# paramNames <- shiny::reactive(c("reshID"))
# paramValues <- shiny::reactive(c(org$value()))
#
# observe(
# rapbase::autoReportServer(
# id = "norgastDispatch",
# registryName = "norgast",
# type = "dispatchment",
# org = org$value,
# paramNames = paramNames,
# paramValues = paramValues,
# reports = list(
# Kvartalsrapport = list(
# synopsis = "NORGAST: Kvartalsrapport",
# fun = "abonnement_kvartal_norgast",
# paramNames = c("baseName", "reshID"),
# paramValues = c("NorgastKvartalsrapport_abonnement", user$org())
# )
# ),
# orgs = orgs,
# eligible = (user$org() == "SC"),
# freq = "quarter"
# )
# )
#
# # ## Stats
# # observe(
# # rapbase::statsServer("norgastStats", registryName = "norgast",
# # eligible = (user$org() == "SC"))
# # )
# # rapbase::statsGuideServer("norgastStatsGuide", registryName = "norgast")
#
#
# ##############################################################################
# # Eksport ###################################################################
# # brukerkontroller
# rapbase::exportUCServer("norgastExport", "norgast")
#
# ## veileding
# rapbase::exportGuideServer("norgastExportGuide", "norgast")
#
# ##############################################################################



Expand Down
Loading

0 comments on commit 274762c

Please sign in to comment.