View source: R/validate_data.R
| validate_inpatient_episodes | R Documentation |
This function performs a series of checks for mandatory and optional requirements on episodes of care records. The data definitions closely follow those of the English NHS Admitted Patient Care Commissioning Datasets.
validate_inpatient_episodes(patients, episodes, wards = NULL)
patients |
data frame containing one row per patient |
episodes |
data frame containing one row per episode of care |
wards |
(optional) data frame containing one row per ward stay.
Default is |
A logical value indicating success
patient_ida patient identifier with no missing value
forenamethe patient's forename
surnamethe patient's surname
date_of_birtha Date for the birth date
date_of_deatha missing value or a Date of death
sexthe following values are valid:
"male"
"female"
"other"
"unknown"
Must not be missing.
ethnic_category_UKreserved for UK users for Ramses to compute
the empirical glomerular filtration rate (eGFR). The following codes are valid:
White
"A" British
"B" Irish
"C" Any other White background
Mixed
"D" White and Black Caribbean
"E" White and Black African
"F" White and Asian
"G" Any other mixed background
Asian or Asian British
"H" Indian
"J" Pakistani
"K" Bangladeshi
"L" Any other Asian background
Black or Black British
"M" Caribbean
"N" African
"P" Any other Black background
Other Ethnic Groups
"R" Chinese
"S" Any other ethnic group
Not stated
"Z" Not stated
patient_ida patient identifier with no missing value
encounter_ida hospital encounter (admission or spell) identifier with no missing value
admission_methoda non-missing character code:
"1" elective admission
"2" emergency admission
"3" transfer/other admission
Note: "1" and "2" corresponds to the first character
of the
NHS admission method value set;
"3" corresponds to the remaining values starting with
3 or 8.
admission_datea POSIXct timestamp for
the hospital admission. Must not be missing.
discharge_datea POSIXct timestamp for
the hospital discharge. Must not be missing.
episode_numbera strictly positive integer indicating the number of the episode within an admission. Must not be missing.
last_episode_in_encountera character indicating whether the patient is discharged at the end of the episode:
"1" the episode is the last episode in the encounter
"2" the episode is not the last episode in the encounter
Must not be missing.
episode_starta POSIXct timestamp for
the hospital start. Must not be missing.
episode_enda POSIXct timestamp for
the hospital end Must not be missing.
consultant_codea code uniquely identifying the medical professional responsible for the episode of care. Must not be missing.
main_specialty_codea code identifying the main specialty of the medical professional responsible for the episode of care. Must not be missing.
patient_ida patient identifier with no missing value
encounter_ida hospital encounter identifier with no missing value
ward_codecharacter vector of ward codes
ward_display_namecharacter vector of expanded ward designations
ward_descriptionfull text description of service/unit/specialty
ward_starta POSIXct timestamp for
the arrival time on the ward
ward_enda POSIXct timestamp for
the ward departure time
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.