-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapp.R
executable file
·4723 lines (3482 loc) · 244 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
# source global settings
source("global.R")
# TITLE ----
# appears top left
dashboardtitle <- tags$a(href = "https://www.publichealthscotland.scot/",
target="_blank",
tags$imag(src = "phs-logo.png",
alt = "Public Health Scotland logo",
width = 120)
)
# HEADER BAR ----
# forces dashboard name to top right
header <- dashboardHeader(
title = dashboardtitle,
#titleWidth = 290,
tags$li(class = "dropdown",
# comment out version as appropriate - and secure if PRA or TEST!
#tags$p("SPBAND v 1.6") # this is the LIVE dashboard
#tags$p("SPBAND_test v 1.6") # this is the TEST dashboard
tags$p("SPBAND_PRA v 1.6") # this is the PRA dashboard
)
)
# MENU ----
topicmenu <- sidebarMenu(
id = "topics",
menuItem("Home",
tabName = "home",
icon = icon("info-circle", verify_fa = FALSE) %>% rem_aria_label()
),
menuItem("Multi indicator overview",
tabName = "multi_indicator_overview",
icon = icon("tachometer-alt", verify_fa = FALSE) %>% rem_aria_label()
),
menuItem("Pregnancy",
icon = icon("person-pregnant", verify_fa = FALSE) %>% rem_aria_label(),
menuSubItem("Number of pregnancies booked",
tabName = "pregnancies_booked",
icon = shiny::icon("angle-double-right") %>% rem_aria_label()
),
menuSubItem("Number of terminations",
tabName = "terminations",
icon = shiny::icon("angle-double-right") %>% rem_aria_label()
),
menuSubItem("Gestation at booking",
tabName = "gestation_at_booking",
icon = shiny::icon("angle-double-right") %>% rem_aria_label()
),
menuSubItem("Gestation at termination",
tabName = "gestation_at_termination",
icon = shiny::icon("angle-double-right") %>% rem_aria_label()
)
) %>% rem_menu_aria_label(),
menuItem("Births and babies",
icon = icon("baby", verify_fa = FALSE) %>% rem_aria_label(),
menuSubItem("Location of extremely pre-term births",
tabName = "location_of_ex_pre_term",
icon = shiny::icon("angle-double-right") %>% rem_aria_label()
),
menuSubItem("Induction of labour",
tabName = "inductions",
icon = shiny::icon("angle-double-right") %>% rem_aria_label()
),
menuSubItem("Type of birth",
tabName = "type_of_birth",
icon = shiny::icon("angle-double-right") %>% rem_aria_label()
),
menuSubItem("Third- and fourth-degree perineal tears",
tabName = "perineal_tears",
icon = shiny::icon("angle-double-right") %>% rem_aria_label()
),
menuSubItem("Gestation at birth: pre- and post-term births",
tabName = "gestation_at_birth",
icon = shiny::icon("angle-double-right") %>% rem_aria_label()
),
menuSubItem("Stillbirths and infant deaths",
tabName = "stillbirths",
icon = shiny::icon("angle-double-right") %>% rem_aria_label()
),
menuSubItem("Apgar scores",
tabName = "apgar_scores",
icon = shiny::icon("angle-double-right") %>% rem_aria_label()
)
) %>% rem_menu_aria_label(),
# menuItem("Neonatal",
# icon = icon("hand-holding-medical", verify_fa = FALSE) %>% rem_aria_label(),
# menuSubItem("Median corrected gestational age at discharge from neonatal care",
# tabName = "median_cga_30_32",
# icon = shiny::icon("angle-double-right") %>% rem_aria_label()
# ),
# menuSubItem("Admissions to a neonatal unit by level of care",
# tabName = "gestation_by_BAPM_LOC",
# icon = shiny::icon("angle-double-right") %>% rem_aria_label()
# )
# ) %>% rem_menu_aria_label(),
menuItem("Infant feeding",
tabName = "infant_feeding",
icon = icon("person-breastfeeding", verify_fa = FALSE) %>% rem_aria_label()
) %>% rem_menu_aria_label()
)
# HOW TO USE THIS DASHBOARD ----
instructions <-
tabPanel(title = "How to use this dashboard",
value = "instructions",
fluidRow(
br(),
br(),
p("Click +/- to open and close the sections below",
style = "text-align: right;"),
box(title = p(strong("Navigation and filtering")),
status = "primary",
width = 12,
collapsible = TRUE,
collapsed = FALSE,
column(10,
p("This dashboard has been developed with simplicity in mind. The ", strong("left-hand navigation menu"), " lists all the content available and will expand and collapse when a sub-menu with an arrow to the right is selected."
),
p("The left-hand menu can also be hidden (or revealed) by clicking on this toggle button", img(src = "toggle.png", alt = ""), " at the top of the screen. This can be useful if you are viewing charts on a small computer screen."
),
p("Data for individual measures are available in the ", strong("Pregnancy"), " and ", strong("Births and babies"), " sub-menus."
),
p("Each measure has an ", strong("About this measure"), " tab which is visible when the measure is selected."
)
),
column(2,
img(src = "nav_menu.png", alt = "The left-hand navigation menu.", width = "70%", height = "70%"
),
br(),
br()
),
column(10,
p("The ", strong("selection filters"), " are under the navigation menu. Filter values are persistent, which means that the same selections will be in place regardless of the measure chosen."
),
p("Most measures are available by Health Board of Residence (based on home postcode) and by Health Board of Treatment (based on location of care). Individual Boards can be selected unless a measure is only available for Scotland."
),
p("Where applicable, time periods can be selected (by calendar year – Jan-Dec, and by financial year – Apr-Mar). Time periods are only relevant to the ", strong("Multi indicator overview"), " and will not be visible when viewing other content."
)
),
column(2,
img(src = "filter.png", alt = "The selection filters.", width = "70%", height = "70%"
)
)
) # box "Navigation and filtering"
%>% rem_button_aria_label(),
box(title = p(strong("There are three ways to view data")),
status = "primary",
width = 12,
collapsible = TRUE,
collapsed = TRUE,
column(12,
tags$ol(
tags$li(class = "bullet-points", "Multi indicator overview"),
tags$li(class = "bullet-points", "Board comparison"),
tags$li(class = "bullet-points", "Individual Board")
)
),
column(12,
p("The ", strong("Multi indicator overview"), " shows a selection of the Core measures. All NHS Boards can be compared at once in the ", strong("Board comparison"), " tab. When a Board is selected in the filter panel its values appear as green dots; Scotland values are shown as black dots; the remaining Boards values are shown as light grey dots. The selected Board values can be compared against Scotland in the table shown on the ", strong("Individual Board"), " tab."
),
p("Individual measures are available in the ", strong("Pregnancy"), " and ", strong("Births and babies"), "sub-menus. Most measures will have ", strong("Board comparison"), " and ", strong("Individual Board"), " tabs. Those that are only available for Scotland will have a ", strong("Scotland"), " tab instead."
),
p("Where applicable, ", strong("Board comparison"), " tabs show simple time series charts for all NHS Boards in a grouped layout. These are usually shown on the same scale to allow easy comparison over the same time periods. Where necessary, Island Boards (NHS Orkney, NHS Shetland and NHS Western Isles) may have a different y-axis to allow the mainland Boards charts to be easier to read. Note there are no individual charts available for the Island Boards for the ‘Gestation at termination’ measure as small numbers are disclosive. If an Island Board is selected in the filter panel the values relating to this measure will be aggregated values for NHS Orkney, NHS Shetland and NHS Western Isles combined. The charts default to show data by NHS Board of Residence but the filter is available to switch to NHS Board of Treatment."
),
p(strong("Individual Board"), " tabs show a more detailed time series chart (‘Number of pregnancies booked’, ‘Number of terminations’) or run chart (all other measures excluding the ‘Location of extremely pre-term births’ and ‘Stillbirths and infant deaths’). The charts default to show data for Scotland but the filters are available to change the content. Some measures also have a ‘context’ chart below the run charts. These show time series of counts of the data, for example, singleton live births at any gestation by type of birth and all live births."
)
)
) # box "There are three ways to view data"
%>% rem_button_aria_label(),
box(title = p(strong("Notes on particular measures")),
status = "primary",
width = 12,
collapsible = TRUE,
collapsed = TRUE,
column(12,
p("The ", strong("Location of extremely pre-term births"), " measure has a ", strong("Scotland"), " tab which shows a control chart. Control charts use a series of rules to help identify unusual behaviour in data and indicate patterns that merit further investigation. Read more about the rules used in the charts by clicking the tab ", strong("How do we identify patterns in the data?"), " There are no filters applicable to this chart."
),
p("The ", strong("Stillbirths and infant deaths"), " measure also has a ", strong("Scotland"), " tab. This shows simple time series of the relevant rates for stillbirths, neonatal deaths, extended perinatal deaths, post-natal deaths, and infant deaths. Please see the related ", strong("About this measure"), " for more information about these terms. There are no filters applicable to this chart."
)
)
) # box "Notes on particular measures"
%>% rem_button_aria_label(),
box(title = p(strong("Copying charts and downloading data")),
status = "primary",
width = 12,
collapsible = TRUE,
collapsed = TRUE,
column(12,
p("To make a ", strong("copy"), " of any content it is recommended that a snipping tool is used as this will ensure all titles and footnotes can be included in the snapshot. For Windows, use the Windows logo key + Shift + S; for Apple Mac use Command + Shift + 5."
),
p("All charts, including the ", strong("Multi indicator overview"), " have their associated data available to ", strong("download"), " by clicking this button", img(src = "download_button.png", alt = ""
),
"Data are now available in an accessible Excel file format which contains metadata for the relevant variables. The same data are available from either download button within an measure."
)
)
) # box "Copying charts and downloading data"
%>% rem_button_aria_label(),
box(title = p(strong("Tell us what you think")),
status = "primary",
width = 12,
collapsible = FALSE,
collapsed = FALSE,
column(12,
p("The version of the dashboard available today is still in development and is subject to changes and refinements in the future. Contact ", tags$a(href = "mailto:[email protected]", tags$u("[email protected]")), "for more information or to provide feedback."
)
)
) # box "Tell us what you think"
#%>% rem_button_aria_label()
) # fluidRow
) # tabPanel("How to use this dashboard")
# HOW DO WE IDENTIFY PATTERNS IN THE DATA? ----
patterns <-
tabPanel(title = "How do we identify patterns in the data?",
value = "patterns",
fluidRow(
br(),
box(solidHeader = TRUE,
width = 12,
p(strong("Run charts"), "have been used to show time series data for many of the measures in this dashboard. Run charts use a series of rules to help identify important change in the data. These are the ones we used for these charts:"
),
tags$ul(
tags$li(class = "bullet-points",
strong("Shifts:"), " Six or more consecutive data points above or below the centreline. Points on the centreline neither break nor contribute to a shift (marked as a yellow line on charts)."
),
tags$li(class = "bullet-points",
strong("Trends:"), " Five or more consecutive data points which are increasing or decreasing. An observation that is the same as the preceding value does not count towards a trend (marked as green highlights on charts)."
),
tags$li(class = "bullet-points",
strong("Too many or too few runs:"), " A run is a sequence of one or more consecutive observations on the same side of the centreline. Any observations falling directly on the centreline can be ignored. If there are too many or too few runs (i.e. the median is crossed too many or too few times) that is a sign of something more than random chance."
),
tags$li(class = "bullet-points",
strong("Astronomical data point:"), " A data point which is distinctly different from the rest. Different people looking at the same graph would be expected to recognise the same data point as astronomical (or not)."
)
),
br(),
p("The", strong("Location of extremely pre-term births"), "charts are ", strong("control charts."), "These charts have additional ‘control limits’ to indicate how much random variation we would expect to see by chance. They also use slightly different rules for", strong("shifts"), "and", strong("trends."), "The five rules we use are:"
),
tags$ul(
tags$li(class = "bullet-points",
strong("Outliers:"), " Data points outside the limits marked by the control limits."
),
tags$li(class = "bullet-points",
strong("Shifts:"), " Eight or more consecutive data points above or below the centreline.",
),
tags$li(class = "bullet-points",
strong("Trends:"), " Six or more consecutive data points which are increasing or decreasing."
),
tags$li(class = "bullet-points",
strong("Outer one–third:"), " Two out of three consecutive data points which sit between the control and warning limits."
),
tags$li(class = "bullet-points",
strong("Inner one-third:"), " 15 or more consecutive data points that lie close to the centreline."
)
),
p("The type of chart used depends on the type of data involved (which statistical distribution we think it follows). For the ", strong("Location of extremely pre-term births"), " measure P charts are presented."
),
br(),
p("Further information on these methods of presenting data can be found in this ",
tags$a(
href = "https://webarchive.nrscotland.gov.uk/20231129152542mp_/https://www.isdscotland.org/Health-Topics/Quality-Indicators/Statistical-Process-Control/_docs/Statistical-Process-Control-Tutorial-Guide-180713.pdf",
tags$u("guide to statistical process control charts (PDF)."),
class = "externallink",
target = "_blank"
)
)
) # box
) # fluidRow
) # tabPanel("How do we identify patterns in the data?")
# BACKGROUND ----
background <-
tabPanel(title = "Background",
value = "background",
fluidRow(
br(),
box(solidHeader = TRUE,
width = 12,
br(),
p("The data displays on this ", strong("Scottish Pregnancy, Births and Neonatal Data (SPBAND) Dashboard"), " have been developed in response to commitment 67 in ",
tags$a(
href = "https://www.gov.scot/publications/best-start-five-year-forward-plan-maternity-neonatal-care-scotland/",
tags$u("The Best Start: five year plan for maternity and neonatal care"),
class = "externallink",
target = "_blank"
),
" that: ‘national level maternity and neonatal dashboards should be developed to facilitate benchmarking and reduce variations in care’."
),
p("During 2019 the ",
tags$a(
href = "https://www.perinatalnetwork.scot/data/",
tags$u("MatNeo Data Hub"),
class = "externallink",
target = "_blank"
),
" compiled an initial list of CORE maternity measures by exploring what measures are used in a variety of local and national dashboards."
),
p("Given the extensive work done in England through a Delphi process to derive 14 monthly Clinical Quality Improvement Metrics or ", strong("CQIMS,"), " the concepts included in the CQIMs measures were used as a starting point for further engagement on establishing core measures of pregnancy, births, and neonatal care quality relevant to multiple audiences (policy makers, planners, clinical staff, the public) and suitable for a publicly accessible dashboard."
),
p("A longer list of potential measures was discussed in November 2019 with a short life working group. This working group contained representation from Heads of Midwifery, Clinical Directors of Obstetrics, the Scottish Perinatal Network, and the Best Start Implementation Programme. Through a voting exercise, we selected a set of measures to concentrate on initially. These CORE measures are listed in the ",
tags$a(
href = "https://docs.google.com/spreadsheets/d/1iAcRF8gc1-k7341JygofiSUmsvmKJ_OxUPyE07XVTPU/edit#gid=747368373",
tags$u("Topics Index"),
class = "externallink",
target = "_blank"
),
" produced by the MatNeo Data Hub."
),
p("During 2020, in response to concerns about the Wider Impacts of COVID-19, many of these CORE measures were made available on a dashboard showing ",
tags$a(
href = "https://scotland.shinyapps.io/phs-covid-wider-impact/",
tags$u("COVID-19 wider impacts on the health care system."),
class = "externallink",
target = "_blank"
)
),
p("The ‘Pregnancy’ and ‘Births and babies’ sections of the Wider Impacts dashboard were updated for the last time in September 2023, so this post-COVID ", strong("Pregnancy, Births and Neonatal Data"), " dashboard for Scotland is now the primary source of PHS Maternity and Neonatal data visualisations. It offers alternative data views, including small multiple time series charts, to allow comparison (for a particular measure) across Health Board areas, and a multi indicator overview to display multiple measures simultaneously for all Health Board areas."
)
) # box
) # fluidRow
) # tabPanel("Background")
# VERSION ----
version <-
tabPanel(title = "Version",
value = "version",
uiOutput("version_panel")
) # tabPanel("Version")
# SIDEBAR ----
sidebar <- dashboardSidebar(#width = 280,
useShinyjs(),
accessible_menu(topicmenu),
uiOutput("organisationControl"), # Board of Residence/Treatment
uiOutput("hbnameControl"), # Board name
uiOutput("dateControl"), # FY/CY
hidden(
textInput(inputId = "topics",
label = "",
value = "home") # forces input$topics to initialise as "home" to make filters appear correctly
)
#uiOutput("subgroupControl") # Age group/SIMD/Ethnicity - not currently used
#textOutput("mytext") # for testing
)
# HOME ----
home <- tabItem(
tabName = "home",
fluidRow(
h1("Welcome to the Scottish Pregnancy, Births and Neonatal Data dashboard",
class = "smaller--h1"
),
hr(),
tabBox(title = "Home",
# The id lets us use input$tabset00 on the server to find the current tab
id = "tabset00",
width = 12,
instructions,
patterns,
background,
version
) # tabBox
) # fluidRow
) # tabItem ("home")
# MULTI INDICATOR OVERVIEW ----
multi_indicator_overview <- tabItem(
tabName = "multi_indicator_overview",
fluidRow(
tabBox(title = "Multiple indicator overview",
# The id lets us use input$tabset01 on the server to find the current tab
id = "tabset01",
width = 12,
# "bullet" chart tab
tabPanel(title = "Board comparison",
fluidRow(
column(12,
textOutput("multi_indicator_chart_title"
),
br()
),
column(10,
p("Compare Boards by measure: hover your mouse over the dots to see individual Board values"
)
),
column(1,
downloadButton("multi_indicator_download_data1", "Download data",
icon = shiny::icon("download") %>% rem_aria_label()
)
),
column(12,
loading(plotlyOutput("multi_indicator_chart",
height = "40em"
)
),
br()
),
column(12,
p("* Values shown for the Island Boards (NHS Orkney, NHS Shetland and NHS Western Isles) for ‘Average gestation at termination’ are based on the data for those three Boards combined.",
class = "notes-style"
)
),
column(12,
p("^ Shortened label for clarity. Full label is: % of women giving birth vaginally to a singleton live or stillborn baby with a cephalic presentation at 37-42 weeks gestation who had a third- or fourth-degree perineal tear.",
class = "notes-style"
)
),
column(12,
p(paste0("Data last refreshed on ", pretty_refresh_date, "."),
class = "notes-style"
)
),
column(12,
p("Source: Public Health Scotland - Antenatal Booking Collection, Termination of Pregnancy Submissions Scotland (ToPSS), SMR02.",
class = "notes-style"
),
p("Further information is available from the annual",
tags$a(
href = "https://www.publichealthscotland.scot/publications/antenatal-booking-in-scotland/",
tags$u("Antenatal booking in Scotland,"),
class = "externallink",
target = "_blank"
),
" ",
tags$a(
href = "https://publichealthscotland.scot/publications/termination-of-pregnancy-statistics/",
tags$u("Termination of pregnancy statistics"),
class = "externallink",
target = "_blank"
),
"and ",
tags$a(
href = "https://publichealthscotland.scot/publications/births-in-scotland/",
tags$u("Births in Scotland"),
class = "externallink",
target = "_blank"
),
" reports.",
class = "notes-style"
)
)
) # fluidRow
), # tabPanel("Board comparison")
# table tab
tabPanel(title = "Individual Board",
fluidRow(
column(12,
textOutput("multi_indicator_table_title"
),
br()
),
column(1, offset = 10,
downloadButton("multi_indicator_download_data2", "Download data",
icon = shiny::icon("download") %>% rem_aria_label()
)
)
), # fluidRow
br(),
fluidRow(
column(11,
loading(DTOutput("mytable"
)
),
br()
),
column(12,
p("* Values shown for the Island Boards (NHS Orkney, NHS Shetland and NHS Western Isles) for ‘Average gestation at termination’ are based on the data for those three Boards combined.",
class = "notes-style"
)
),
column(12,
p("^ Shortened label for clarity. Full label is: % of women giving birth vaginally to a singleton live or stillborn baby with a cephalic presentation at between 37-42 weeks gestation who had a third- or fourth-degree perineal tear.",
class = "notes-style"
)
),
column(12,
p(paste0("Data last refreshed on ", pretty_refresh_date, "."),
class = "notes-style"
)
),
column(12,
p("Source: Public Health Scotland - Antenatal Booking Collection, Termination of Pregnancy Submissions Scotland (ToPSS), SMR02.",
class = "notes-style"
),
p("Further information is available from the annual",
tags$a(
href = "https://www.publichealthscotland.scot/publications/antenatal-booking-in-scotland/",
tags$u("Antenatal booking in Scotland,"),
class = "externallink",
target = "_blank"
),
" ",
tags$a(
href = "https://publichealthscotland.scot/publications/termination-of-pregnancy-statistics/",
tags$u("Termination of pregnancy statistics"),
class = "externallink",
target = "_blank"
),
"and ",
tags$a(
href = "https://publichealthscotland.scot/publications/births-in-scotland/",
tags$u("Births in Scotland"),
class = "externallink",
target = "_blank"
),
" reports.",
class = "notes-style"
)
)
) # fluidRow
) # tabPanel ("Individual Board")
) # tabBox ("Multi indicator overview")
) # fluidRow
) # tabItem ("multi_indicator_overview")
# NUMBER OF PREGNANCIES BOOKED ----
pregnancies_booked <- tabItem(
tabName = "pregnancies_booked",
fluidRow(
tabBox(title = "Number of pregnancies booked",
# The id lets us use input$tabset10 on the server to find the current tab
id = "tabset10",
width = 12,
# Time series
tabPanel(title = "Individual Board", #value = "bookings_board",
fluidRow(
column(12,
textOutput("bookings_runcharts_title"
),
br()
),
column(10,
p("Number of pregnancies booked for antenatal care"
)
),
column(1,
downloadButton("bookings_download_data", "Download data",
icon = shiny::icon("download") %>% rem_aria_label()
)
),
column(12,
loading(plotlyOutput("bookings_runcharts", # time series not runchart
height = "30em"
)
),
br()
),
column(12,
p(paste0("Data last refreshed on ", pretty_refresh_date, "."),
class = "notes-style"
)
),
column(12,
p("Source: Public Health Scotland - Antenatal Booking Collection.",
class = "notes-style"
),
p("Further information is available from the annual ",
tags$a(
href = "https://www.publichealthscotland.scot/publications/antenatal-booking-in-scotland/",
tags$u("Antenatal booking in Scotland"),
class = "externallink",
target = "_blank"
),
" publication.",
class = "notes-style"),
hr()
),
column(12,
p("The black dots connected by a line in the chart above show the number of pregnancies booked for antenatal care, for each month from Apr 2019 onwards."
),
p("To provide a basis for identifying patterns in the data, a blue line shows the average (median) number of pregnancies booked for antenatal care each month over the period Apr 2019 to Feb 2020 inclusive (the period before the COVID-19 pandemic in Scotland). The blue line is dashed where the average is projected outside that time range."
),
p("Numbers of pregnancies booked for antenatal care by gestation bands (under 10 weeks, between 10 and 12 weeks, and 13 weeks and over) are available in the download file."
)
) # column
) # fluidRow
), # tabPanel("bookings_board")
# Data source and definitions etc.
tabPanel(title = "About this measure", #value = "bookings_datasource",
fluidRow(
column(12,
p("Number of pregnancies booked for antenatal care",
class = "about-this-measure-title"
),
br()
),
box(title = "Why measure this?",
status = "primary",
width = 5,
p("The ",
tags$a(
href = "https://www.nhsinform.scot/ready-steady-baby/pregnancy/your-antenatal-care/your-booking-appointment-booking-visit",
tags$u("‘booking’ appointment (external website)"),
class = "externallink",
target = "_blank"
),
" is the first main appointment a woman has with her local maternity service once she knows she is pregnant. At the booking appointment, women are assessed by a midwife who can then tailor the subsequent care they receive during their pregnancy to their particular preferences and needs. Women are encouraged to book before they are 13 weeks pregnant, and ideally before they are 10 weeks pregnant."
),
p("Counting the numbers of pregnancies booked for antenatal care is useful in estimating the number of women who will require maternity care and also the numbers of those who should be offered antenatal screening and vaccinations."
),
p("Further information based on Antenatal Booking Collection (ABC) data is available from the annual ",
tags$a(
href = "https://www.publichealthscotland.scot/publications/antenatal-booking-in-scotland/",
tags$u("Antenatal booking in Scotland"),
class = "externallink",
target = "_blank"
),
" publication."
)
), # box
box(width = 1,
solidHeader = TRUE
),
box(title = "Data source and definitions",
status = "primary",
width = 5,
p("Data source: Antenatal Booking Collection."
),
p("The antenatal booking data presented are based on the ", strong("Antenatal Booking Collection"), "initially established as a rapid response to COVID-19. Data are collected from the clinical information system - BadgerNet Maternity (most NHS boards) or TrakCare Maternity (NHS Lothian) - used by the midwives who ‘book’ a pregnant woman for maternity care. The booking appointment is the first planned and structured contact a midwife has with a pregnant woman, to assess her history and needs so that local maternity services can provide further care such as an early pregnancy scan and antenatal screening tests. The booking appointment can also give women further information about how they can keep themselves and their baby healthy during pregnancy, and to help them plan labour and birth."
),
p("Historic data from April 2019 were also collected as a ‘catch-up’ extract in order to identify all women who were currently pregnant during the COVID-19 period. This was either from the same source or, in NHS Ayrshire & Arran, NHS Tayside and NHS Highland, from the systems in use before the introduction of BadgerNet Maternity."
),
p("Pregnancies of cis women (non-transgender women), trans men, and gender non-binary people are included in the data shown. However, as national health records do not currently provide reliable data on individuals’ gender identity, data on the number of trans or non-binary people cannot be provided."
),
p("Data are shown for up to and including the most recent month for which records are considered near complete. Data for the most recent month should be viewed as provisional. Data for the whole time period shown will be refreshed every time the dashboard page is updated, and data for the most recent months are likely to change slightly as additional or updated records are added."
)
) # box
) # fluidRow
) # tabPanel("bookings_datasource")
) # tabBox ("Number of pregnancies booked")
) # fluidRow
) # tabItem("pregnancies_booked")
# NUMBER OF TERMINATIONS ----
terminations <- tabItem(
tabName = "terminations",
fluidRow(
tabBox(title = "Number of terminations",
# The id lets us use input$tabset11 on the server to find the current tab
id = "tabset11",
width = 12,
# Time series
tabPanel(title = "Individual Board", #value = "terminations_board",
fluidRow(
column(12,
textOutput("terminations_runcharts_title"
),
br()
),
column(10,
p("Number of terminations"
)
),
column(1,
downloadButton("terminations_download_data", "Download data",
icon = shiny::icon("download") %>% rem_aria_label()
)
),
column(12,
loading(plotlyOutput("terminations_runcharts", # time series not runchart
height = "30em"
)
),
br()
),
column(12,
p(paste0("Data last refreshed on ", pretty_refresh_date, "."),
class = "notes-style"
)
),
column(12,
p("Source: Public Health Scotland - Termination of Pregnancy Submissions Scotland (ToPSS).",
class = "notes-style"
),
p("Further information is available from the annual ",
tags$a(
href = "https://publichealthscotland.scot/publications/termination-of-pregnancy-statistics/",
tags$u("Termination of pregnancy statistics"),
class = "externallink",
target = "_blank"
),
" publication.",
class = "notes-style"),
hr()
),
column(12,
p("The black dots connected by a line in the chart above show the number of terminations of pregnancy, for each month, from Jan 2017 onwards."
),
p("To provide a basis for identifying patterns in the data, a blue line shows the average (median) number of terminations of pregnancy each month over the period Jan 2017 to Feb 2020 inclusive (the period before the COVID-19 pandemic in Scotland). The blue line is dashed where the average is projected outside that time range."
)
)
) # fluidRow
), # tabPanel("terminations_board")
# Data source and definitions etc.
tabPanel(title = "About this measure", #value = "terminations_datasource",
fluidRow(
column(12,
p("Number of terminations",
class = "about-this-measure-title"
),
br()
),
box(title = "Why measure this?",
status = "primary",
width = 5,
p("Monitoring the number of terminations of pregnancy is useful for service planners to understand changes in demand and need for termination services."
),
p("Further information is available from the PHS annual report ",
tags$a(
href = "https://publichealthscotland.scot/publications/termination-of-pregnancy-statistics/",
tags$u("Termination of pregnancy statistics"),
class = "externallink",
target = "_blank"
),
"where other data tables and charts are available."
)
), # box
box(width = 1,
solidHeader = TRUE
),
box(title = "Data source and definitions",
status = "primary",
width = 5,
p("Data source: Termination of Pregnancy Submissions Scotland (ToPSS)."
),
p("The Abortion (Scotland) Regulations 1991 set out the arrangements under which a doctor who has terminated a pregnancy must give notice of the termination to the Chief Medical Officer (CMO), as required by the Abortion Act 1967. For any terminations taking place from 1 May 2022 onwards, the 1991 Regulations were replaced by the Abortion (Scotland) Amendment Regulations 2021. The 2021 Regulations include: the removal of the prescribed notification form (commonly known as the ‘yellow form’); changing the deadline for giving notice of a termination from ‘within 7 days’ of the termination to ‘before the fifteenth day of the calendar month immediately following the calendar month in which the practitioner terminated the pregnancy’; and a simpler notification to be sent to the CMO."
),
p("Data regarding each termination should also be provided directly to PHS for the collation of termination statistics. In addition to an aggregate notification to the CMO, local service providers record details about the termination on the PHS web-based Termination of Pregnancy Submissions Scotland (ToPSS) system. These details should be saved on the system within 30 days of a termination taking place."
),
p("Pregnancies of cis women (non-transgender women), trans men, and gender non-binary people are included in the data shown. However, as national health records do not currently provide reliable data on individuals’ gender identity, data on the number of trans or non-binary people cannot be provided."
),
p("Data are shown for up to and including the most recent month for which records are considered near complete. Data for the most recent month should be viewed as provisional. Data for the whole time period shown will be refreshed every time the dashboard page is updated, and data for the most recent months are likely to change slightly as additional or updated records are added."
)
) # box
) # fluidRow
) # tabPanel("terminations_datasource")
) # tabBox ("Number of terminations")
) #fluidRow