By Mandrake Technology Ltd | 2013
PARR-30 is a predictive model for identifying inpatients at high risk of re-admission to a NHS hospital in England within 30 days of discharge.
It has been developed by the Nuffield Trust and is described in the paper; Development of a predictive model to identify inpatients at risk of re-admission within 30 days of discharge (PARR-30).
PARR30 is a simple Android app to allow doctors to calculate a patient’s risk of re-admission within the next 30 days when they are being discharged.
It uses the PARR-30 predictive model developed by the Nuffield Trust.
Key features of the app are:
- The app has been designed to be quick and simple to use.
- No patient identifiable data is needed so there are no security of Information Governance issues to worry about.
- All model coefficients are held in text files, so can be easily changed if required.
- The Index of Multiple Deprivation (IMD) for a patient is derived from their postcode using the Department for Communities and Local Government’s Open Data Communities web site.
- Mappings from postcode to Lower Super Output Area (LSOA) and from LSOA to IMD are cached for faster subsequent lookup.
- Risk scores are displayed in an easily understood way.
- Risk workings out for the risk scores is available for the curious of mind.
The App in Action
Home screen data entry.
Risk prediction result.
App Source Code
The full source code for the app is available for download and reuse under the Apache License, Version 2.0.
Figure 4 shows the java classes within the parr30 package as displayed by the package explorer in eclipse.
Within an Android app each interface screen is represented by an Activity.
MainActivity is the main activity that is launched when the app is first loaded. It initialises the app by creating needed objects, loads model coefficients from the external text files and sets up the main data entry UI. The UI uses HospitalSpinAdapter, which is a custom android adapter class to load hospital names into a UI spinner control.
CoefficientLoader loads and validates the model coefficient values from the text files. It can throw a CoefficientException when reading or setting coefficients. It uses VariableCoefficient to hold the logistic regression coefficient for a model variable, HospitalCoefficient to hold the logistic regression coefficient for a specific hospital and IMDCoefficient to hold the logistic regression coefficient for a band of Index of Multiple Deprivation (IMD) values. Coefficient values are read from a text file using standard java io classes and then parsed using CSVReader, which can throw a CSVReaderException.
Once the user has entered the input data and pressed Calculate Risk Score the main work of the app begins.
The first task is to map the entered postcode to an Lower Super Output Area (LSOA) code and then map this LSOA code to an Index of Multiple Deprivation (IMD) value. Data sets for both mappings are publicly available, but the postcode to LSOA data set is too large (136MB compressed) to be practically downloaded and held on a mobile device. Therefore the mappings are dynamically looked up using the SPARQL end point provided by the Department for Communities and Local Government’s on their Open Data Communities web site.
Postcode maps a postcode to a LSOA code by calling SPARQL. It can throw a PostcodeException. LSOA maps a LSOA code to a IMD value by calling SPARQL. Both classes can throw a SPARQLException.
To make the mappings more efficient the app caches the results of previous mappings in a local cache using a SQLite database. The CacheData class and its associated CacheException class, provide a simple facade to the database. PostcodeCache gets and sets postcode to LSOA mappings in the database. LSOACache gets and sets LSOA to IMD mappings in the database.
The whole process of checking the cache, calling the mapping classes and finally deciding on which IMD model coefficient to use in the risk calculation based on the IMD value mapped from LSOA is done by IMD, which can throw a IMDException.
With all the input values assembled, Prediction actually calculates the PARR-30 risk score as well as recording the individual calculation steps it went through. It can throw a PredictionException.
ResultActivity displays the risk score calculation results. It uses RiskChart, which is a custom widget to draw the display of a risk score.
ShowWorkingsActivity displays the calculation workings.
AboutActivity is the activity to display information about the app.
PrefsActivity is the activity to handle the display and changing of the app preferences or settings. It uses AlertPreference, which is a custom android preference class to set alert trigger values.
ViewCoeffActivity is the activity to display the model coefficient values which have been loaded from the external text file.
Was this article useful?6