SIMPLIFIED Extract

Purpose:

The script produces an agreed extract in RDA format for patients who are part of the SIMPLIFIED project.

It requires that patients have been traced, or, in the case of Scottish patients that their details match a record held on the UKRR database.

The patient's records are searched for by NHS Number and extracted in RDA format if found.

To be extracted the patient will have to be a member of PV (for the UKRDC extract) or to have been loaded onto the UKRR Database (hench been receiving treatment ~12 months ago).

Code:

https://bitbucket.renalregistry.nhs.uk/projects/TNG/repos/simplified_extract/browse

Deployment:

The code has been deployed from BitBucket to rr-systems-live under a username simpliextract (details in KeyPass).

The SSH/Database connection settings are stored in a JSON file under /etc/simplified

The script connects directly to the UKRR SQL Server Database but uses an SSH Tunnel to access the UKRDC Database.

The script has been scheduled to run at 4:05am daily.

Input:

The script currently expects a file in "Tracing Output" format with a specific filename in /data/simplified/extract/input

The fields required are the Supplied NHS Number, Supplied DOB and Traced NHS Number (if found)

This file is created by https://bitbucket.renalregistry.nhs.uk/projects/UKRDC/repos/simplified-scripts/browse/tracer.py as part of the process of tracing the SIMPLIFIED patients. This runs as rrbatch on rr-systems-live.

Output:

The script creates files under /data/simplified/extract/ouput .

The filenames are in the format:

UKRR_REE01_1111111111.xml

UKRDC_REE01_1111111111.xml

Depending on where the data was extracted from. A patient may have one, both or neither of these files.

Transfer:

https://bitbucket.renalregistry.nhs.uk/projects/UKRDC/repos/simplified-scripts/browse/uploadsftp.py has been modified to also look in /data/simplified/extract/output and GPG any files that it finds. These are then uploaded to the SFTP server in the same way as the Traced data.