-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.R
1356 lines (1233 loc) · 55.8 KB
/
app.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#
# GA Autism Services
# Created by Freyja Brandel-Tanis (freyjabt.me) for Dr. Jennifer Singh and funded through DILAC.
library(shiny)
library(leaflet)
library(readr)
library(lubridate)
library(shinyWidgets)
library(shinydashboard)
library(shinythemes)
library(shades)
library(sf)
library(tigris)
options(tigris_use_cache = TRUE)
library(stringr)
library(ggmap)
library(readxl)
library(RMySQL)
library(tidyr)
library(dplyr)
library(DT)
##
# Connect to database
# # Freyja Local
# source("db_connection1.R")
# dbname <- "dilac_project"
# Server
source("db_connection.R")
dbname <- "mapdb"
# Function to load data from database
loadData <- function(databaseName, tableName) {
# Connect to the database
db <- dbConnect(MySQL(), dbname = databaseName, host = options()$mysql$host,
port = options()$mysql$port, user = options()$mysql$user,
password = options()$mysql$password)
# Construct the fetching query
query <- sprintf("SELECT * FROM %s", tableName)
# Submit the fetch query and disconnect
on.exit(dbDisconnect(db))
return(dbGetQuery(db, query))
}
# Load data from database
p2p_prov <- loadData(dbname,"p2p_providers")%>% # p2p provider data
drop_na(lat,lon)%>%
filter(
row_names != 399,
!provider_id %in% c(25, 387, 315) # these providers geocoded to Michigan, so I'm manually removing them
)%>%
select(-row_names)
p2p_pd <- loadData(dbname,"p2p_provider_details")%>% # p2p details specific to the providers, like hours of operation
mutate(
provider_id = as.numeric(provider_id)
)%>%
select(-row_names)%>%
filter(pfx!="disability")
p2p_sd <- loadData(dbname,"p2p_service_details")%>% # p2p which services are offered by each provider
select(-row_names)
# CDC SVI 2018
svi_ga_tracts <- st_read("svi/SVI2018_GEORGIA_tract.shp")%>%
st_transform(crs = 3518)%>%
st_simplify(500, preserveTopology = TRUE)%>%
st_transform(4326)
# st_transform('+proj=longlat +datum=WGS84')
svi_ga_county <- st_read("svi/SVI2018_GEORGIA_county.shp")%>%
st_transform('+proj=longlat +datum=WGS84')
# svi_ga_county_tidy <- svi_ga_county%>%
# select(LOCATION, FIPS, starts_with("EPL_"), starts_with("SPL_"))%>%
# filter(
# across(where(is.numeric),
# ~.!=(-999)
# )
# )%>%
# pivot_longer(
# cols = c(starts_with("EPL_"), starts_with("SPL_")),
# names_to = "variable",
# values_to = "value"
# )
# Read in the transit stops. To add more stops or update existing ones, see "transit/transit_write.R"
stops_all <- st_read("transit/stops.shp")
# Create a vector of providers within 1/4 mi of a transit stop.
# # This intersection is done here instead of before adding data to the database so that it is more dynamic when more transit providers are added.
p2p_prov_transit <- p2p_prov%>%
st_as_sf(coords = c("lon","lat"))%>%
st_set_crs(4326)%>%
st_intersection(stops_all)%>%
st_drop_geometry()%>%
select(provider_id)%>%
distinct()%>%
pull
# Edit the p2p_pd file to account for providers we've shown to be transit accessible but were not marked that way.
p2p_pd <- p2p_pd%>%
mutate(
values = ifelse(pfx == "transit_access" & provider_id %in% p2p_prov_transit, 1, values)
)
purple_ramp <- scales::colour_ramp(c('#D8BFD8','#7851A9'))
bins = c(0,1,5,10,50,100,Inf)
# Bringing in the county data for GA from Census TIGER
ga_counties <- counties(state = "GA")
# basemap for both maps
plot_map <- ga_counties # Use ga counties to make the basemap
basemap = leaflet(plot_map)%>%
addTiles(options = providerTileOptions(minZoom = 7))%>% # Limits the users ability to zoom out too far.
setView(lat = 32.84069, lng = -83.6324, zoom = 7) # Centers the map on GA. Technically on Macon, GA, which seemed close enough to center.
# Variable declaration for Provider details
age_var <- list(
"Under 3 Years"="Under 3 Years",
"3-5 Years"="3-5 Years",
"6-11 Years"="6-11 Years",
"12-18 Years"="12-18 Years",
"19-21 Years"="19-21 Years",
"Over 21 Years"="21+ Years"
)
hours_var <- list(
"Daytime Hours",
"By Appointment Only",
"Weekend Hours",
"Evening Hours",
"Afternoons Only",
"24 Hours On Call",
"Mornings Only"
)
pay_var <- list(
"Medicaid"="medicaid",
"PeachCare"="peachcare",
"Tri-Care" = "tricare",
"Private Insurance"="private_insurance",
"Financial Assistance"="assistance"
)
# Variable declaration for services, etc
adap_var <- list("Accomodations / Modifications" = "accomodations_modifications",
"Adaptive Equipment" = "adaptive_equipment",
"Assistive Technology" = "assistive_technology",
"Augmentative Communication" = "augmentative_communication",
"Service Animals" = "service_animals")
adult_var <- list("Day Services" = "day_services",
"Supported Employment" = "supported_employment",
"Supported Independent Living" = "supported_independent_living",
"Job Training" = "job_training",
"Residential Facility" = "residential_facility",
"Personal Care Assitance" = "personal_care_assistance")
advoc_var <- list("Education" = "advocate_education",
"Heathcare" = "advocate_healthcare",
"Disability" = "advocate_disability",
"Education Resources " = "resources_advocate_education",
"IDEA Resources" = "resources_idea",
"Mediation" = "mediation",
"ADA Resources" = "resources_ada",
"Attorney: Wills / Trusts" = "attorney_wills_trusts",
"Attorney" = "attorney")
care_var <- list("Day Camp" = "camp_day", "After School Caregivers" = "caregivers_after_school", "Overnight Camp" = "camp_overnight", "Respite Care" = "respite_care", "Finacial Assistance" = "financial_assistance", "Caregivers (Adult)" = "caregivers_adult", "Caregivers (Child)" = "caregivers_child", "Community Caregiving" = "community_caregiving", "Adult Camp" = "camp_adults")
child_var <- list("High-Risk Infant Assessment" = "high_risk_infant_assessment",
"Preschool (Specialized)" = "preschool_specialized",
"BCW Offices" = "bcw_offices",
"Preschool (Private)" = "preschool_private",
"Childcare Programs" = "child_care",
"Preschool (Public)" = "preschool_public")
health_var <- list("Psychologists (Child)" = "psychologists_child",
"Children's Medical Services" = "cms",
"Developmental Pediatricians" = "dev_pediatricians",
"Diet / Nutrition" = "diet_nutrition",
"Mental Health" = "mental_health",
"Medicaid Waiver" = "medicaid_waiver",
"Georgia Pediatric Program (GAPP)" = "gapp_providers",
"Home Healthcare" = "home_healthcare",
"Nursing" = "nursing_services",
"Public Health" = "public_health",
"Psychiatrist" = "psychiatrist",
"Rehabilitation Centers" = "rehabilitation_centers")
eval_var <- list("Evaluation Developmental Pediatricians" = "eval_dev_pediatricians",
"Developmental Evaluation and Assessment" = "developmental_eval_assessment")
mental_var <- list("Psychologist" = "psychologist",
"Behavior Specialist" = "behavior_specialist",
"Child Abuse Counseling" = "child_abuse",
"Sexual Abuse Support / Counseling" = "sexual_abuse",
"Mental Health Support" = "mental_health",
"Bullying Support / Prevention" = "bullying",
"Psychiatrist" = "psychiatrist",
"Sucide Support / Prevention" = "suicide_support")
pfam_var <- list("Adpotion" = "adoption",
"Crisis Intervention" = "crisis",
"Family Support" = "family_support",
"Foster Care" = "foster_care",
"Parent Training / Education" = "parent_education",
"Residential Children" = "residential_childrens",
"Social Work" = "social_work",
"Support (Bereavement)" = "support_bereavement",
"Support (Parent)" = "support_parent",
"Support (Peer)" = "support_peer",
"Personal Care" = "personal_care",
"Support (Sibling)" = "support_sibling",
"Case Management" = "case_management",
"Play Groups" = "play_groups",
"Support Groups" = "support_group")
plan_var <- list("Person-Centered Planning" = "person_centered_planning",
"Financial Planning" = "financial_planning",
"Trust / Will Prep" = "trust_will_prep",
"Guardianship" = "guardianship")
therp_var <- list("Counseling" = "counseling",
"Applied Behavior Therapy" = "aba",
"Feeding Therapy" = "feeding_therapy",
"Occupational Therapy" = "occupational_therapy",
"Social Skills Training" = "social_skills_training",
"Speech and Language Therapy" = "speech_language",
"Sensory Integration" = "sensory_integration",
"Special Instruction" = "special_instruction",
"Alternative Therapies" = "alternative_therapies",
"Music Therapy" = "music_therapy",
"Physical Therapy" = "physical_therapy",
"Art Therapy" = "art_therapy",
"Play Therapy" = "play_therapy",
"Aquatic Therapy" = "aquatic_therapy",
"Floor Therapy" = "floor_therapy",
"Hippo Therapy" = "hippotherapy",
"Vision Therapy" = "vision_therapy",
"Massage Therapy" = "massage_therapy",
"Sign Language Training" = "sign_language",
"Pet Therapy" = "pet_therapy"
)
edu_var <- list("Financial Assistance" = "financial_assistance",
"Day School (Private)" = "day_private",
"Tutoring" = "tutoring",
"Transition Services" = "transition_services",
"Home Schooling" = "home_schooling",
"Residential School (Private)" = "residential_private",
"Charter School (Public)" = "charter_public",
"Education Consultant" = "education_consultants",
"Inclusive Services" = "inclusive_services",
"Post-Secondary Education" = "post_secondary_ed",
"Special Education Oversight" = "special_ed_oversight"
)
svi_descs <- tibble(
desc = str_to_title(c("Persons below poverty",
"Unemployed civilians",
"Per capita income",
"Persons 25+ with no high school diploma",
"Persons aged 65 and older",
"Persons aged 17 and younger",
"Civilian with a disability",
"Single parent households with children under 18",
"Minority",
"Persons who speak English 'less than well'",
"Multi-family housing (10+)",
"Mobile homes",
"Crowded households",
"Households with no vehicle available",
"Persons in group quarters",
"Series for Socioeconomic theme",
"Series for Household Composition theme",
"Series for Minority Status/Language theme",
"Series for Housing Type/Transportation theme",
"Overall Series")),
var = svi_ga_county%>%st_drop_geometry()%>%select(starts_with("EP_"), starts_with("SPL_"), -EP_UNINSUR)%>%names
)%>%
pivot_wider(names_from = desc, values_from = var)%>%
as.list
svi_descs_tib <- svi_descs%>%
as_tibble()%>%
pivot_longer(
cols=everything(),
names_to = "Desc",
values_to = "Abbr"
)%>%
mutate(
Unit = if_else(
Abbr == "EP_PCI",
"(USD)",
if_else(
Abbr %in% c("SPL_THEME1","SPL_THEME2","SPL_THEME3","SPL_THEME4","SPL_THEMES"),
"",
"(%)"
)
)
)
# Define UI
ui <- dashboardPage(
# tags$style(HTML("body {font-family: 'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;}")),
# tags$style(type = "text/css", "html, body {width:100%;height:100%}",
# ".leaflet .legend i{
# border-radius: 50%;
# width: 10px;
# height: 10px;
# margin-top: 4px;
# }
# "),
# Create Dashboard Header
dashboardHeader(title = "Autism Services in Georgia", titleWidth = 280,
tags$li(a(onclick = "openTab('home')", # Link to take you to the homepage
href = '../',
icon("home"),
title = "Home",
style = "cursor: pointer;"),
class = "dropdown"#,
# tags$script(HTML("
# var openTab = function(tabName){
# $('a', $('.sidebar')).each(function() {
# if(this.getAttribute('data-value') == tabName) {
# this.click()
# };
# });
# }"))
),
tags$li(a(onclick = "openTab('home')", # Link to take you to the Service Cliff Visualization
href = '../adultcliff',
# href = 'https://autism-cliff-viz.herokuapp.com/',
icon("chart-pie"),
title = "Service Cliff Visualization",
style = "cursor: pointer;"),
class = "dropdown"
)
),
# Create Dashboard Sidebar
dashboardSidebar(
tags$style("body {font-family: 'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;}"),
width = 280,
sidebarMenu(
id = 'sidebar',
style = "position: relative; overflow: visible; font-family: 'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;",
#style = "position: relative; overflow: visible; overflow-y:scroll",
#style = 'height: 90vh; overflow-y: auto;',
## 1st tab show the Main dashboard -----------
menuItem( "Provider Search", tabName = 'search_tab', icon = icon('search')),#,
#badgeLabel = maxYear_lb, badgeColor = "green" ),
div( id = 'sidebar_cr',
conditionalPanel("input.sidebar === 'search_tab'",
tags$style(
"#sidebar_cr {
overflow: auto;
max-height: 70vh;
}"
),
tags$style("h4 {
margin: 0 0 -5px 10px;
}"),
# Attempt to make a search function for counties and service providers
# selectizeInput("select_country",
# "Select or search for one or multiple markets",
# choices = list_country,
# selected = NULL, width = "200px",
# multiple = T), #,
# #actionButton('btn_country','Submit')
#
# ## action button to build report
# actionButton('btn_build_country_report',
# paste0('Build Report'),
# icon = icon('wrench')),
#
# ## reset side bar selectoin
# actionButton('btn_reset_cr',
# 'Reset',
# icon = icon('refresh') ),
h4("Provider Details"),
# selectizeInput(
# inputId = "name_search", # Search for providers by name. Currently not functional.
# label = "Search by name",
# choices = p2p_prov$name%>%unique,
# multiple = TRUE
# ),
# actionButton("search_go", label = "Search"),
div(style="display:inline-block;width:32%;text-align: center;",actionButton("selectall1", label = "Select All")),
div(style="display:inline-block;width:32%;text-align: center;",actionButton("selectnone1", label = "Select None")),
pickerInput("age_range","Age",choices=age_var,selected=unlist(age_var),
multiple = TRUE,
options = list(`actions-box` = TRUE)),
pickerInput("hours","Operating Hours",choices=hours_var,selected=unlist(hours_var),
multiple = TRUE,
options = list(`actions-box` = TRUE)),
pickerInput("pay_type","Payment Options",choices=pay_var,selected=unlist(pay_var),
multiple = TRUE,
options = list(`actions-box` = TRUE)),
pickerInput(
inputId = "trwh",
label = "Accessibility Requirements",
choices = c("Transit" = "transit_access",
"Wheelchair" = "wheelchair_access"
),
selected = NULL,
multiple = TRUE,
options = list(`actions-box` = TRUE)
),
h4("Services"),
div(style="display:inline-block;width:32%;text-align: center;",actionButton("selectall", label = "Select All")),
div(style="display:inline-block;width:32%;text-align: center;",actionButton("selectnone", label = "Select None")),
pickerInput(
inputId = "adap",
label = "Adaptations / Accessibiity",
choices = adap_var,
selected = NULL,
multiple = TRUE,
options = list(`actions-box` = TRUE)
),
pickerInput(
inputId = "adult",
label = "Adult-Specific",
choices = adult_var,
selected = NULL,
multiple = TRUE,
options = list(`actions-box` = TRUE)
),
pickerInput(
inputId = "advoc",
label = "Advocacy",
choices = advoc_var,
selected = NULL,
multiple = TRUE,
options = list(`actions-box` = TRUE)
),
pickerInput(
inputId = "care",
label = "Camps / Caregivers",
choices = care_var,
selected = NULL,
multiple = TRUE,
options = list(`actions-box` = TRUE)
),
pickerInput(
inputId = "child",
label = "Early Childhood-Specific",
choices = child_var,
selected = NULL,
multiple = TRUE,
options = list(`actions-box` = TRUE)
),
pickerInput(
inputId = "edu",
label = "Education",
choices = edu_var,
selected = NULL,
multiple = TRUE,
options = list(`actions-box` = TRUE)
),
pickerInput(
inputId = "health",
label = "Healthcare",
choices = health_var,
selected = NULL,
multiple = TRUE,
options = list(`actions-box` = TRUE)
),
pickerInput(
inputId = "eval",
label = "Evaluation / Diagnosis",
choices = eval_var,
selected = NULL,
multiple = TRUE,
options = list(`actions-box` = TRUE)
),
pickerInput(
inputId = "mental",
label = "Mental Health / Behavior",
choices = mental_var,
selected = NULL,
multiple = TRUE,
options = list(`actions-box` = TRUE)
),
pickerInput(
inputId = "pfam",
label = "Parent / Family Support",
choices = pfam_var,
selected = NULL,
multiple = TRUE,
options = list(`actions-box` = TRUE)
),
pickerInput(
inputId = "plan",
label = "Planning for the Future",
choices = plan_var,
selected = NULL,
multiple = TRUE,
options = list(`actions-box` = TRUE)
),
pickerInput(
inputId = "therp",
label = "Therapies and Interventions",
choices = therp_var,
selected = NULL,
multiple = TRUE,
options = list(`actions-box` = TRUE)
)
)),
menuItem("Provider List", tabName = 'prov_list', icon = icon('table')),# icon = icon('globe') ),
div( id = 'sidebar_cn',
tags$style(
"#sidebar_cn {
overflow: auto;
max-height: 100vh
}"
),
conditionalPanel("input.sidebar === 'prov_list'",
downloadButton("report","Generate CSV", class = 'butt'),
tags$head(tags$style(".butt{background-color:#3c8dbc;} .butt{margin-left: 25px;}"))
)
),
menuItem("Demographic Visualization", tabName = 'demo_vis', icon = icon('house-user')),# icon = icon('globe') ),
div( id = 'sidebar_cn',
conditionalPanel("input.sidebar === 'demo_vis'",
h4("CDC SVI Visualization Settings"),
radioButtons(
inputId = "geolevel",
label = "Geographic Level",
choices = c(
"County" = "county",
"Census Tract" = "tract"
),
selected = "county"
),
pickerInput(
inputId = "sviChoice",
label = "SVI Variable",
choices = svi_descs, #svi_ga_county%>%st_drop_geometry()%>%select(starts_with("EP_"), starts_with("SPL_"))%>%names,
selected = "SPL_THEMES",
multiple = FALSE
),
radioButtons(
inputId = "showProv",
label = "Show Selected Providers?",
choices = c("Yes" = 0.7,"No" = 0),
selected = 0
),
em(style = "margin-left:10px;",
"Select variables on the 'Provider Search' tab"))
),
menuItem("About", tabName = "about",icon = icon('info-circle')),
div( id = 'sidebar_cn',
conditionalPanel("input.sidebar === 'about'"
)
),
menuItem("Feedback", tabName = 'feedback', icon = icon('comments')),
div( #id = 'sidebar_cn',
conditionalPanel("input.sidebar==='feedback'",
uiOutput("feedback"))
)
)
# tags$style(
# "#sidebarItemExpanded {
# overflow: auto;
# max-height: 80vh;
# }"
# ),
# ,
#
),
dashboardBody(
tabItems(
tabItem(
tabName = 'search_tab',
tags$style(type = "text/css", "#mymap {height: calc(100vh - 80px) !important;}"),
leafletOutput("mymap")
),
tabItem(
tabName = "prov_list",
DTOutput(
"printed_table", height = "calc(100vh - 100px)"
)
#)
),
tabItem(
tabName = "demo_vis",
tags$style(type = "text/css", "#demogvis {height: calc(100vh - 80px) !important;}"),
leafletOutput("demogvis")
),
tabItem(
tabName = "about",
div( id = "longtext",
tags$style(
"#longtext {
overflow = auto;
max-width: 750px;
}"
),
h2("About the Project"),
p(
"This map was conceived and designed to help people in Georgia navigate and coordinate autism services. Additionally, it provides an educational tool for those learning about the relationship between structural inequalties and location of autism services across the state of Georgia."
),
p(
"We are unable to vet each service type or service provider in the database, so their presence in this resource is not an endorsement of their efficacy, ethics, or existence. If you have feedback regarding a specific service or provider, please tell us through the feedback link in the sidebar. We will use this information to continue updating the app."
),
h3("Using the Program"),
p("The Autism Services Map is composed of three sections that all interact with each other: the provider search, the provider list, and the demographic information."),
h4("Provider Search", style = 'margin-left: 0px;'),
p(
"The Provider Search tab lets you select the characteristics of providers that are valuable to you as well as the specific services you need.",br(),"Your selection will carry through to the other sections, and you can return here to make a new selection."
),
strong("Transit Access"),
p("This map considers service providers within 1/4 mile of a bus or rail stop to be transit accessible. Counties throughout Georgia provide transit services on request through paratransit, which is not considered here because there are no fixed stops or routes. Currently, the map accounts for the following transit providers:"),
p("Metropolitan Atlanta Rapid Transit Authority (MARTA)",br(),"Chatham Area Transit (CAT)",br(),"Gwinnett County Transit (GCT)",br(),"CobbLinc",br(),"XPRESS", style = 'margin-left: 40px;' ),
h4("Provider List", style = 'margin-left: 0px;'),
p("The Provider List shows providers matching your search in table form, which can be searched, sorted, and filtered. Clicking \"Generate CSV\" in the sidebar will download a .csv file with all the providers matching your search, even if you use the filters on the table."),
h4("Demographic Information", style = 'margin-left: 0px;'),
p("The Demographic Information tab displays CDC/ATSDR Social Vulnerability Index data at the county and census tract level. You can also overlay the selected provider search data points."),
strong("Available Variables"),
# strong("Variable Definitions"),# I didn't have time to add the definitions
p("Persons below poverty",br(),
"Unemployed civilians",br(),
"Per capita income",br(),
"Persons 25+ with no high school diploma",br(),
"Persons aged 65 and older",br(),
"Persons aged 17 and younger",br(),
"Civilian with a disability",br(),
"Single parent households with children under 18",br(),
"Minority",br(),
"Persons who speak English 'less than well'",br(),
"Multi-family housing (10+)",br(),
"Mobile homes",br(),
"Crowded households",br(),
"Households with no vehicle available",br(),
"Persons in group quarters",br(),
"Series for Socioeconomic theme",br(),
"Series for Household Composition theme",br(),
"Series for Minority Status/Language theme",br(),
"Series for Housing Type/Transportation theme",br(),
"Overall Series", style = 'margin-left: 40px;'),
h3("Credits"),
p(
"Professor: Dr. Jennifer Singh"
),
p("
Programming: Freyja Brandel-Tanis"
),
p("Data Gathering: Freyja Brandel-Tanis, Shristi, Elise Zheng, Dr. Jennifer Singh
"
),
p("Grant funding provided through the ",a("Digital Integrative Liberal Arts Center",href='https://dilac.iac.gatech.edu/', target="_blank", rel="noopener noreferrer")," at the Georgia Tech Ivan Allen College of Liberal Arts"
),
p(
"This program was made using Shiny in R v4.0.5, along with RStudio and MySQL, and is hosted using Shiny Server. ",a("The code and full list of packages are available on github.", href='https://github.com/freyja-bt/autism-service-map', target="_blank", rel="noopener noreferrer")
),
h3("Sources"),
p("Citation tags included in parentheses for service data providers."),
p(a("Parent to Parent of Georgia", href='https://www.p2pga.org/', target="_blank", rel="noopener noreferrer")," (p2p)",
br(),
a("Autism Speaks*", href='https://www.autismspeaks.org/', target="_blank", rel="noopener noreferrer")," (as)",
br(),
a("Autism Society of America*", href='https://source.autism-society.org/autismsource', target="_blank", rel="noopener noreferrer")," (asa)",
br(),
a("Georgia Department of Public Health*", href='https://sendss.state.ga.us/sendss/!mch.coord_search', target="_blank", rel="noopener noreferrer")," (dph)"),
p(a("CDC/ATSDR Social Vulnerability Index (SVI) Data", href='https://www.atsdr.cdc.gov/placeandhealth/svi/data_documentation_download.html', target="_blank", rel="noopener noreferrer")),
p("Transit stop data from ",a("OpenMobilityData", href = 'https://transitfeeds.com/', target="_blank", rel="noopener noreferrer"), " in General Transit Feed Specification (GTFS) format."),
p(em("* Starred providers are not currently integrated into the live version of the app.")),
p(em("The use of an organization's data is not an endorsement of their practices, vision, mission, or their ability to vet providers. The inclusion of a provider is not an endorsement of their efficacy, ethics, or existence."))
)
)
)
)
)
server <- function(input, output, session) {
jsc <- '
$(document).ready(function () {
$(".sidebar-menu").children("li").on("click", function() {
$("#mult, #single").toggle();
});
});
'
observe({
if(input$selectall == 0) return(NULL)
else if (input$selectall > 0)
{
updatePickerInput(session,"adult","Adult-Specific",choices=adult_var,selected=unlist(adult_var),
options = list(`actions-box` = TRUE))
updatePickerInput(session,"advoc","Advocacy",choices=advoc_var,selected=unlist(advoc_var),
options = list(`actions-box` = TRUE))
updatePickerInput(session,"adap","Adaptations / Accessibility",choices=adap_var,selected=unlist(adap_var),
options = list(`actions-box` = TRUE))
updatePickerInput(session,"care","Camps / Caregiving",choices=care_var,selected=unlist(care_var),
options = list(`actions-box` = TRUE))
updatePickerInput(session,"child","Early Childhood-Specific",choices=child_var,selected=unlist(child_var),
options = list(`actions-box` = TRUE))
updatePickerInput(session,"edu","Education",choices=edu_var,selected=unlist(edu_var),
options = list(`actions-box` = TRUE))
updatePickerInput(session,"health","Healthcare",choices=health_var,selected=unlist(health_var),
options = list(`actions-box` = TRUE))
updatePickerInput(session,"eval","Evaluation / Diagnosis",choices=eval_var,selected=unlist(eval_var),
options = list(`actions-box` = TRUE))
updatePickerInput(session,"mental","Mental Health / Behavior",choices=mental_var,selected=unlist(mental_var),
options = list(`actions-box` = TRUE))
updatePickerInput(session,"pfam","Parent / Family Support",choices=pfam_var,selected=unlist(pfam_var),
options = list(`actions-box` = TRUE))
updatePickerInput(session,"plan","Planning for the Future",choices=plan_var,selected=unlist(plan_var),
options = list(`actions-box` = TRUE))
updatePickerInput(session,"therp","Therapies and Interventions",choices=therp_var,selected=unlist(therp_var),
options = list(`actions-box` = TRUE))
}
})
observe({
if(input$selectnone == 0) return(NULL)
else if (input$selectnone > 0)
{
updatePickerInput(session,"adult","Adult-Specific",choices=adult_var,selected=NULL,
options = list(`actions-box` = TRUE))
updatePickerInput(session,"advoc","Advocacy",choices=advoc_var,selected=NULL,
options = list(`actions-box` = TRUE))
updatePickerInput(session,"adap","Adaptations / Accessibility",choices=adap_var,selected=NULL,
options = list(`actions-box` = TRUE))
updatePickerInput(session,"care","Camps / Caregiving",choices=care_var,selected=NULL,
options = list(`actions-box` = TRUE))
updatePickerInput(session,"child","Early Childhood-Specific",choices=child_var,selected=NULL,
options = list(`actions-box` = TRUE))
updatePickerInput(session,"edu","Education",choices=edu_var,selected=NULL,
options = list(`actions-box` = TRUE))
updatePickerInput(session,"health","Healthcare",choices=health_var,selected=NULL,
options = list(`actions-box` = TRUE))
updatePickerInput(session,"eval","Evaluation / Diagnosis",choices=eval_var,selected=NULL,
options = list(`actions-box` = TRUE))
updatePickerInput(session,"mental","Mental Health / Behavior",choices=mental_var,selected=NULL,
options = list(`actions-box` = TRUE))
updatePickerInput(session,"pfam","Parent / Family Support",choices=pfam_var,selected=NULL,
options = list(`actions-box` = TRUE))
updatePickerInput(session,"plan","Planning for the Future",choices=plan_var,selected=NULL,
options = list(`actions-box` = TRUE))
updatePickerInput(session,"therp","Therapies and Interventions",choices=therp_var,selected=NULL,
options = list(`actions-box` = TRUE))
}
})
observe({
if(input$selectall1 == 0) return(NULL)
else if (input$selectall1 > 0)
{
updatePickerInput(session,"age_range","Age",choices=age_var,selected=unlist(age_var),
options = list(`actions-box` = TRUE))
updatePickerInput(session,"hours","Operating Hours",choices=hours_var,selected=unlist(hours_var),
options = list(`actions-box` = TRUE))
updatePickerInput(session,"pay_type","Payment Options",choices=pay_var,selected=unlist(pay_var),
options = list(`actions-box` = TRUE))
}
})
observe({
if(input$selectnone1 == 0) return(NULL)
else if (input$selectnone1 > 0)
{
updatePickerInput(session,"age_range","Age",choices=age_var,
options = list(`actions-box` = TRUE))
updatePickerInput(session,"hours","Operating Hours",choices=hours_var,
options = list(`actions-box` = TRUE))
updatePickerInput(session,"pay_type","Payment Options",choices=pay_var,
options = list(`actions-box` = TRUE))
}
})
# observe({
# updateSelectizeInput()
# })
#
observe({
cat(input$trwh)
})
# Creation of Reactive Dataframe for map and provider list
reactive_db <- reactive({
p_list_s <- p2p_sd%>%
# select(-row_names)%>%
filter(
service %in% c(as.character(input$therp), as.character(input$plan), as.character(input$pfam), as.character(input$mental), as.character(input$eval), as.character(input$health), as.character(input$edu), as.character(input$child), as.character(input$care), as.character(input$advoc), as.character(input$adult), as.character(input$adap)),
offered==1
)%>%
pull(1)
p_list_pay <- p2p_sd%>%
# select(-row_names)%>%
filter(
category == "a_payment",
service %in% as.character(input$pay_type),
offered==1
)%>%
pull(1)
# p_list_therp <- p2p_sd%>%
# select(-row_names)%>%
# filter(
# service %in% as.character(input$therp),
# offered==1
# )%>%
# pull(1)
p_list_age <- p2p_pd%>%
# select(-row_names)%>%
filter(
pfx == "age",
values %in% as.character(input$age_range)
#"21+ Years Old"#
)%>%
pull(1)
p_list_hour <- p2p_pd%>%
# select(-row_names)%>%
filter(
pfx == "hour",
values %in% as.character(input$hours)
)%>%
pull(1)
# p_list_wheel <- p2p_pd%>%
# # select(-row_names)%>%
# filter(
# pfx == "wheelchair_access",
# values == 1
# )%>%
# pull(1)
# p_list_transit <- p2p_pd%>%
# # select(-row_names)%>%
# filter(
# pfx == "transit_access",
# values == 1
# )%>%
# pull(1)
# p2p_pd2 <- p2p_pd%>%
# mutate(
# values = ifelse(pfx == "transit_access" & provider_id %in% p2p_prov_transit, 1, values)
# )%>%
# filter(
# pfx == "transit_access",
# provider_id %in% p2p_prov_transit
# )
if(is.null(c(input$trwh))==TRUE){
p_list_trwh <- p2p_prov$provider_id%>%unique
}else if (length(input$trwh)==1){
p_list_trwh <- p2p_pd%>%
# select(-row_names)%>%
filter(
pfx %in% as.character(input$trwh),
values == 1
)%>%
pull(1)
}else{
p_list_trwh <- intersect(
p2p_pd%>%
# select(-row_names)%>%
filter(
pfx %in% as.character(input$trwh)[1],
values == 1
)%>%
pull(1),
p2p_pd%>%
# select(-row_names)%>%
filter(
pfx %in% as.character(input$trwh)[2],
values == 1
)%>%
pull(1)
)
}
# p_list_prov <- p2p_pd%>%
# select(-row_names)%>%
# filter(
# pfx == "age",
# values %in% as.character(input$age_range)#"21+ Years Old"#
# )%>%
# pull(1)
p2p_prov%>%
# select(-row_names)%>%
filter(
provider_id %in% p_list_pay,
provider_id %in% p_list_age,
provider_id %in% p_list_s,
provider_id %in% p_list_trwh,
provider_id %in% p_list_hour
# provider_id %in% p_list_therp,
# provider_id %in% p_list_prov
)%>%
# select(
# -lat, -lon
# )%>%
left_join(
.,
p2p_pd, by = "provider_id"
)%>%
pivot_wider(
# id_cols = provider_id,
names_from = "pfx",
values_from = "values",
values_fn = function(x)paste(unlist(x), collapse = "; "),
values_fill = NA_character_
)
# attempt for search function
# if (is.null(input$name_search)) {
# p2p_prov%>%
# # select(-row_names)%>%
# filter(
# provider_id %in% p_list_pay,
# provider_id %in% p_list_age,
# provider_id %in% p_list_s,
# provider_id %in% p_list_trwh,
# provider_id %in% p_list_hour
#
# # provider_id %in% p_list_therp,
# # provider_id %in% p_list_prov
# )
# }else{
# p2p_prov%>%
# # select(-row_names)%>%
# filter(
# provider_id %in% p_list_pay,
# provider_id %in% p_list_age,
# provider_id %in% p_list_s,
# provider_id %in% p_list_trwh,
# provider_id %in% p_list_hour#,
# # name %in% as.character(input$name_search)
# # provider_id %in% p_list_therp,
# # provider_id %in% p_list_prov
# )
# }
#
# p2p_prov%>%
# select(-row_names)%>%
# right_join(.,p2p_sd%>%
# select(-row_names)%>%
# filter(
# category == "a_payment",
# service %in% "medicaid",#as.character(input$pay_type), #
# offered==1
# ),by = "provider_id")%>%
# inner_join(.,p2p_pd%>%
# select(-row_names)%>%
# filter(
# pfx == "age",
# values %in% "21+ Years"#as.character(input$age_range) #
# ),by = "provider_id")
# mutate(
# medicaid1 = if_else(medicaid==1,TRUE,FALSE)
# )%>%
# filter(
# medicaid1 == input$medicaid
# )%>%
# filter(
# over_21 %in% input$over21
# )