BML社製のMedicalStation
SQLserverからのデータ抽出(RODBC)
及び視覚化(ggplot2,leaflet)について
Rstudioの入力補完機能(コードスニペット)を利用した
電子カルテサポートシステム(CUI版)について
インタラクティブなWebアプリを作るパッケージです。
shinyは、画面構成を作る ui.Rとデータを処理する
server.Rという2つのプラグラムで構成されます。
ui.R
library(shiny)
shinyUI(fluidPage(
plotOutput("plot_iris") ## ここにUIスクリプト
))
server.R
shinyServer(function(input, output){
output$plot_iris <- renderPlot({ ## ここにサーバースクリプト
plot(iris)
})
})
出力画面
これで基本はほぼ網羅されてます。
大好きなplotly,leaflet,DiagrammeRの
render/Output functionが載っていない。
ui.R
shinyUI(fluidPage(
plotlyOutput("graph_plotly")
))
server.R
server <- shinyServer(function(input, output){
output$graph_plotly <- renderPlotly({
plot_ly(iris, x = Sepal.Length, type = "box")
})
})
出力画面
ui.R
shinyUI(fluidPage(
leafletOutput("map", height = 500)
))
server.R
server <- shinyServer(function(input, output){
output$map <- renderLeaflet({
map <- data.frame(address=c("Sapporo"),lat=43.0681678,lon=141.3509345)
m = leaflet(map) %>% addProviderTiles("CartoDB.Positron")
m %>%
addMarkers(data = map, lat = ~ lat, lng = ~ lon, popup = map$address)
})
})
出力画面
ui.R
shinyUI(fluidPage(
grVizOutput('diagram')
))
server.R
shinyServer(function(input, output){
output$diagram <- renderGrViz({
grViz("
digraph {
graph [overlap = true, fontsize = 10]
node [shape = box,fontname = Helvetica]
A; B
node [shape = circle,fixedsize = true,width = 0.9]
1; 2
A->1 B->2 1->2
}
")
})
})
出力画面
通常の診療画面
右が当院の電子カルテ
左の縦型ディスプレイがEHR support system