Giter Club home page Giter Club logo

public-health-scotland / waiting_times_clinical_prioritisation Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 617 KB

This repository contains the Reproducible Analytical Pipeline (RAP) to produce the quarterly statistics on clinical prioritisation, part of the Stage of Treatment (SoT) publication.

Home Page: https://scotland.shinyapps.io/phs-waiting-times-cp/

R 93.11% HTML 2.02% CSS 4.87%
nhs public-health scotland shiny waiting-time data healthcare shiny-app treatment

waiting_times_clinical_prioritisation's Introduction

Waiting Times Clinical Prioritisation

This repository contains the Reproducible Analytical Pipeline (RAP) to produce the quarterly statistics on clinical prioritisation, part of the Stage of Treatment (SoT) publication.

The repository also contains the necessary code to run and deploy the accompanying shiny app.

The publication, released on 06 September 2022, is a one-off retrospective analysis of data relating to the Scottish Government's clinical prioritisation Framework, and covers the period July 2021 to June 2022. The Framework became no longer applicable as of 22 July 2022.

Workflow

  1. Create a data folder with subfolder processed_data

  2. Transfer the necessary input files to the data folder. You can use the helper function in functions/admin_functions.R to do this. See "Input data files" below for the files you need.

  3. Run code/Main.R (takes ~ 5 minutes). This

    • Processes the data in data and saves it out in data/processed data

    • Creates plots and saves them out in plots (the code will create this folder if it doesn't already exist)

    • Transfers the processed data from data/processed data to shiny_app/data as .rds files so that the shiny app can run

  4. Launch shiny app by running shiny_app/app.R

Input data files

You will need the following data in your data folder - obtain from colleagues

  • Distribution of Waits 4 week bands.xlsx
  • Distribution of Waits larger time bands.xlsx
  • dq_summaries.csv
  • Performance excl. Lothian Dental Monthly.xlsx
  • Performance excl. Lothian Dental Quarterly.xlsx
  • Removal Reason excl. Lothian Dental.xlsx
  • Spec Exclusions.xlsx

shiny app

The code for the shiny app can be found in the shiny_app folder

Password protect the shiny app (PRA)

You can password protect the app for pre-release access.

  • Open shiny_app/admin/create_crententials.R (hidden file not pushed to Github - obtain this separately from collaborators)

  • Edit the script with the chosen username and password for pre-realease access

  credentials_df <- data.frame(
  user = c("username"), # insert username here
  password = c("password"), # insert password here
  stringsAsFactors = FALSE)
  • Save your changes and run the script. The script creates a folder called admin (if it doesn't already exist). Check that the credentials.rds file is saved to your admin folder.

  • Go to shiny_app/app.R, uncomment the secure_app() function in the ui. (make sure to uncomment both opening and closing brackets)

  • Run the app to check that the login page is active and test your credentials.

  • Note: the admin folder is ignored by git to prevent sharing credentials on Github.

Deploying the shiny app

  • Open shiny_app/AppDeployment.R (hidden file not committed to Github - obtain this separately) and edit the paths to point to your local shiny_app folder

  • Run the script to deploy the app

Developing the shiny app

App code layout

  • data contains all the data needed for the shiny app. It is populated using the app_data_preparation.R script

  • app.R is the main app file

  • AppDeployment.R is for deploying the app

  • setup.R contains the necessary packages and some settings. Loads all the data in shiny_app/data into a list called app_data. Initialises two lists of reactive values: plots, which will contain all the rendered plots, and numbers which will contain all the rendered numbers and tables.

  • www contains the css stylesheet and images

  • pages contains separate R scripts of app content, one for each page of the app

  • functions contains R scripts with the functions corresponding to each of the app pages. Additionally core_functions.R has some useful centralised functions, navigation_buttons.R has the links for the navigation buttons and modals.R defines information modals which pop up with information when you click on them

waiting_times_clinical_prioritisation's People

Contributors

cthomson8 avatar maiana-sanjuan avatar rosalynlp avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.