Learn R Programming

NHSRwaitinglist (version 0.1.2)

sim_patients: Generator of NHS patients

Description

Generates simulated NHS patients

Usage

sim_patients(n_rows = 10, start_date = NULL)

Value

A data.frame representing an empty waiting list with the following columns:

Referral

Date. Referral date; all values are NA.

Removal

Date. Removal date; all values are NA.

Withdrawal

Date. Patient withdrawal date; all values are NA

Priority

Numeric. Waiting list priority level, from 1 (most urgent) to 4 (least urgent).

Target_wait

Numeric. Target number of days the patient should wait at the assigned priority level (e.g., 28 days for priority 2)

Name

Character. Patient name in the format "Last, First".

Birth_date

Date. Date of birth.

NHS_number

Integer. Patient identifier, up to 100,000,000.

Specialty_code

Character. One-letter code representing the specialty of the procedure.

Specialty

Character. Full name of the specialty associated with the procedure.

OPCS

Character. OPCS-4 code of the selected procedure.

Procedure

Character. Name of the selected procedure.

Consultant

Character. Consultant name in the format "Last, First".

Arguments

n_rows

Number of rows/patients to generate

start_date

Start date (needed to generate patient ages)

Examples

Run this code
sim_patients()

Run the code above in your browser using DataLab