Skip to contents

R6 class storing health statistics for a list of health units.

R6 class storing health statistics for a list of health units.

Public fields

.data

A list of health units in health unit grp.

.id

A character ID of object.

Methods


Method new()

Create instance of health unit grp.

Usage

health_unitgrp$new(.data, .id)

Arguments

.data

(list)
A list of health units in health unit grp.

.id

(characer) A character ID of object.


Method validate()

Validate structure of health unit grp.

Usage

health_unitgrp$validate()


Method metadata()

Get combine metadata of health unit grp.

Usage

health_unitgrp$metadata()


Method data()

Get data of health unit grp.

Usage

health_unitgrp$data()


Method combine_data()

Get combined metadata and data in single data.frame.

Usage

health_unitgrp$combine_data()


Method ID()

Get ID of health unit grp.

Usage

health_unitgrp$ID()


Method IDs()

Get character vector of IDs for stored health units

Usage

health_unitgrp$IDs()


Method titles()

Get character vector of titles for stored health units

Usage

health_unitgrp$titles()


Method addresses()

Get character vector of addresses for stored health units

Usage

health_unitgrp$addresses()


Method health_boards()

Get character vector of health boards for stored health units

Usage

health_unitgrp$health_boards()


Method health_unit()

Get stored health unit.

Usage

health_unitgrp$health_unit(id)

Arguments

id

(character(1))
Character specifying ID of object to obtain from group.


Method subset()

Subset health unit group.

Usage

health_unitgrp$subset(id)

Arguments

id

(character())
Character specifying ID (or IDs) of object to obtain from group.


Method download_handler()

Get download handler function of health unit group.

Usage

health_unitgrp$download_handler()


Method summary_types()

Get character vector of summary types for grp unit

Usage

health_unitgrp$summary_types()


Method summary()

Summarise grp unit data.

Usage

health_unitgrp$summary(type, ...)

Arguments

type

(character(1))
Character specifying summary type. See summary_types for options.

...

Passed to method.

Examples

x <- example_gp_grp_unit()
x[["summary"]](type = "lookup")
x <- example_hospital_grp_unit()
x[["summary"]](type = "lookup")


Method summary_info()

Get summary info for grp unit.

Usage

health_unitgrp$summary_info(type, ...)

Arguments

type

(character(1))
Character specifying summary type. See summary_types for options.

...

Passed to summary info functions.

Examples

x <- example_gp_grp_unit()
x[["summary_info"]](type = "lookup")
x <- example_hospital_grp_unit()
x[["summary_info"]](type = "lookup")


Method datatable()

Create datatable of grp unit data

Usage

health_unitgrp$datatable(type, ns = NULL, ...)

Arguments

type

(character(1))
Character specifying summary type. See summary_types for options.

ns

Shiny Namespace. Default is NULL.

...

Passed to method.

Examples

x <- example_gp_grp_unit()
x[["datatable"]](type = "lookup")
x <- example_hospital_grp_unit()
x[["datatable"]](type = "lookup")


Method clone()

The objects of this class are cloneable with this method.

Usage

health_unitgrp$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples


## ------------------------------------------------
## Method `health_unitgrp$summary`
## ------------------------------------------------

x <- example_gp_grp_unit()
x[["summary"]](type = "lookup")
#>                     Title    ID
#> 1 Muirhead Medical Centre 10002
#> 2       The Blue Practice 10017
#>                                                                  Address
#> 1                  Muirhead Medical Centre, Liff Road, Muirhead, DD2 5NH
#> 2 The Blue Practice, Crieff Medical Centre, King Street, Crieff, PH7 3SA
#>           Telephone Health board
#> 1 01382   580   264    S08000030
#> 2 01764   652   283    S08000030
x <- example_hospital_grp_unit()
x[["summary"]](type = "lookup")
#>                         Title    ID                          Address
#> 1 Arran War Memorial Hospital A101H  Lamlash, Isle of Arran, KA278LF
#> 2              Ailsa Hospital A201H Dalmellington Road, Ayr, KA6 6AB
#>   Health board
#> 1    S08000015
#> 2    S08000015

## ------------------------------------------------
## Method `health_unitgrp$summary_info`
## ------------------------------------------------

x <- example_gp_grp_unit()
x[["summary_info"]](type = "lookup")
#> [1] "This lookup table presents data for all available GP practices\n      in the data set. This table can be searched, filtered and\n      the 'Plot' column allows the user to view statistics for a\n      selected GP practice."
x <- example_hospital_grp_unit()
x[["summary_info"]](type = "lookup")
#> [1] "This lookup table presents data for all available hospitals\n      in the data set. This table can be searched, filtered and\n      the 'Plot' column allows the user to view statistics for a\n      selected hospital."

## ------------------------------------------------
## Method `health_unitgrp$datatable`
## ------------------------------------------------

x <- example_gp_grp_unit()
x[["datatable"]](type = "lookup")
x <- example_hospital_grp_unit() x[["datatable"]](type = "lookup")