-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathREADME.Rmd
More file actions
70 lines (45 loc) · 3.56 KB
/
Copy pathREADME.Rmd
File metadata and controls
70 lines (45 loc) · 3.56 KB
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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# NHP Outputs
<!-- badges: start -->
[](https://www.repostatus.org/#active)
[](https://github.com/The-Strategy-Unit/nhp_outputs/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
## About
An app to explore the results of scenarios run through the New Hospital Programme (NHP) demand model. Provides interactive charts and tables, as well as downloads.
The app is [deployed to Posit Connect](https://connect.strategyunitwm.nhs.uk/nhp/outputs/). You must have an account and sufficient permissions to view it.
You can find more information on [the NHP model project information site](https://connect.strategyunitwm.nhs.uk/nhp/project_information/), including [a diagram](https://connect.strategyunitwm.nhs.uk/nhp/project_information/project_plan_and_summary/components-overview.html) of how the components of the modelling process fit together.
## For developers
The app is built and maintained by members of the Strategy Unit's Data Science team.
### Structure
The app is built primarily with [Shiny](https://shiny.posit.co/) and [the {golem} package](https://thinkr-open.github.io/golem/). Server and UI modules can be found in `R/`. Configuration files, report templates and supporting data and text are in `inst/`.
### Run locally
Packages used in the app are listed in `DESCRIPTION`, and can be
installed with `pak::local_install_deps(dependencies = TRUE)`.
Add an `.Renviron` file to the project root that contains the required environment variables. You can get these from a member of the Data Science team.
The outputs app is on the `main` branch, but the selection app (where users choose a scenario) is in the `results_selection_app` branch. Use Git’s `worktree` function to add that branch to its own folder in your development branch:
```
git fetch origin results_selection_app
git worktree add results_selection_app results_selection_app
```
To run the app from RStudio, start up the selection app by opening the `dev/watch.R` script, go to the ‘Background Jobs’ tab of the console pane and click the ‘Start Background Job’ button. Hit 'Start' in the ‘Run Script as Background Job’ dialog box. When ready, the app will tell you to visit `http://127.0.0.1:9080/` in your browser. Note that your selections in the app remain local to you.
If you need to remove the selection-app folder at any point, you can do that with:
```
git worktree remove results_selection_app
```
### Data collection
The app displays scenario-specific results to users. The user creates scenarios in the app generated by the [the nhp_inputs repo](https://github.com/The-Strategy-Unit/nhp_inputs), the inputs are then processed by the model found in [the nhp_model repo](https://github.com/The-Strategy-Unit/nhp_data) and the subsequent results files are stored in Azure storage and read into the outputs app.
### Deployment
Deployment is controlled by GitHub Actions, where:
* pushes to the `main` branch redeploy the app to /nhp/dev/outputs/ for purposes of quality assurance
* tagged releases trigger a new deployment to /nhp/vX-Y/outputs/, where 'vX-Y' is the current version (note the hyphen)