Giter VIP home page Giter VIP logo

gphs-annual-rap's Introduction

General Pharmaceutical Services

This code is published as part of the NHSBSA Official Statistics team's commitment to open code and transparency in how we produce our publications. The General Pharmaceutical Services (GPhS) reproducible analytical pipeline (RAP) is owned and maintained by the Official Statistics team.

Introduction

This RAP aims to bring together all code needed to run a pipeline in R to produce the GPhS publication. It includes accompanying documentation in line with RAP best practice.

This RAP is based on a internal NHSBSA package gphsR which contains the sql to build the table and the extract functions that organise it.

The RAP includes a functions folder containing several files with functions specific to this publication. The RAP will produce an HTML report and accompanying HTML background and methodology document. This RAP makes use of many R packages, including several produced internally at the NHSBSA. Therefore, some of these packages cannot be accessed by external users.

This RAP cannot be run in it's entirety by external users. However it should provide information on how the Official Statistics team extract the data from the NHSBSA data warehouse, analyse the data, and produce the outputs released on the NHSBSA website as part of this publication.

This RAP is a work in progress and may be replaced as part of updates and improvements for each new release of the GPhS publication. The functions in the functions folder and gphsR do not contain unit testing, although we will investigate adding this in future.

Getting started

You can clone the repository containing the RAP through GitHub using the following steps.

In RStudio, click on "New project", then click "Version Control" and select the "Git" option.

Click "Clone Git Repository" then enter the URL of the gphs-annual-rap GitHub repository (https://github.com/nhsbsa-data-analytics/gphs-annual-rap). You can click "Browse" to control where you want the cloned repository to be saved in your computer.

You will also need to create a PAT key.

You can view the source code for the GphS RAP on GitHub.

Running this RAP

Users outside of the Official Statistics team may not have the required access permissions to run all parts of this RAP. The following information is included to document how this pipeline is run by members of the Official Statistics team during production.

Once the repository has been cloned, open the pipeline.R file and run the script from start to finish. You will be prompted to enter your username and password to connect to the data warehouse. All other code in this script should require no other manual intervention.

The code should handle installing and loading any required packages and external data. It should then get data extracts from the fact table, perform data manipulations, then save this data into spreadsheet outputs. The pipeline will then render the statistical summary narrative and background document as HTML files for use in web publishing.

Functions guide

Functions used specifically for this RAP that aren't included in a package can be found in the functions folder. The RAP also makes use of functions from a range of packages. A list of packages used is included at the beginning of the pipeline.R file, and installed and loaded within the pipeline code. Some functions contained in the functions folder may be placed into the internal NHSBSA packages in future.

Functions in this file include those for formatting in the narrative and downloading chart data directly and one amendment to our standard chart function infoBox_border(), infoBox_no_border(), get_download_button(), and group_chart_hc_unround().

Contributing

Contributions are not currently being accepted for this RAP. If this changes, a contributing guide will be made available.

License

The gphs-annual-rap RAP, including associated documentation, is released under the MIT license. Details can be found in the LICENSE file.

gphs-annual-rap's People

Contributors

kgray1 avatar

Watchers

Pat Turner 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.