file,coluymn,values
06_generate_nhse_eng_outpat.R,admincat,"""01 = NHS patient including overseas visitors charged under the National Health Service (Overseas Visitors Hospital Charging Regulations)""*, ""02 = Private patient one who uses accommodation or services authorised under the Nationa Health Service Act 2006"", ""03 = Amenity patient one who pays for the use of a single room or small ward in accordance with the National Health Services Act 2006"", ""04 = Category II patient one for whom work is undertaken by hospital medical or dental staff within category II as defined in paragraph 37 of the Terms and Conditions of Service of Hospital Medical and Dental Staff"", ""98 = Not applicable"", ""99 = Not known (to 2022-23) Administrative Category Code not known (V6.3 2022-23 onwards)"
06_generate_nhse_eng_outpat.R,attended,"""2 = Appointment cancelled by or on behalf of the patient"", ""3 = Did not attend - no advance warning given"", ""4 = Appointment cancelled or postponder by the Health Care Provider"", ""5 = Seen having attended on time or if late before the relevant care professional was ready to see the patient""*, ""6 = Arrived late after the relevant care professional was ready to see the patient but was seen"", ""7 = Did not attend - patient arrived late and could not be seen"", ""9 = Not known"""
06_generate_nhse_eng_outpat.R,attendkey,random numbers 11-19 digits long
06_generate_nhse_eng_outpat.R,firstatt,"""1 = First attendance face to face""*, ""2 = Follow-up attendance face to face""*, ""3 = First telephone or telemedicine consultation"", ""4 = Follow-up telephone or telemedicine consultation"", ""9 = Not known (prior to 2008/09)"", ""X = Not known (from 2008/09)"""
06_generate_nhse_eng_outpat.R,imd04_decile,"""Least deprived 10%"", ""More deprived 30-40%"", ""Most deprived ""40-50%"", ""LESS DEPRIVED 10-20%"", ""Less deprived 10-20%"""
06_generate_nhse_eng_outpat.R,mainspef,refer to mainspef_possible_values (960 is most common value ~ 15%)
06_generate_nhse_eng_outpat.R,outcome,"""1 = PATIENT discharged from the care of the CARE PROFESSIONAL without Personalised Out-Patient Follow Up (From 2022-23 onwards) or Discharged from consultant's care (last attendance) (to 202-23)"", ""2 = PATIENT given a Timed Out-Patient Follow Up Appointment while at the out-patient attendance without Personalised Out-Patient Follow Up (From 2022-23 onwards) or Another appointment given (Until 2022-23)"""
06_generate_nhse_eng_outpat.R,priority,"""1 = Routine""*, ""2 = Urgent"", ""3 = Two week wait"", ""9 = Not known"""
06_generate_nhse_eng_outpat.R,procode3_ofh,random numbers 6 digits long
06_generate_nhse_eng_outpat.R,protype,"""CARETRUST = Care trust"", ""CCG = Clinical Commission Group"",""FOUNDATION = NHS foundation trust""*, ""IND = Independent sector provider"", ""INDSITE = Independent sector provider site"", ""INDSITETC = Treatment centre at independent sector provider site"", ""OTHERPROV = Other provider organisation"", "" PCT = Primary care trust"", ""TRUST = NHS trust""*, ""TRUSTSITETC = Treatment centre at NHS trust site"""
06_generate_nhse_eng_outpat.R,refsourc,"""01 = Following an emergency admission (initiated by consultant responsible for the outpatient attendance)"", ""02 = Following a domiciliary visit (initiated by the consultant responsible for the outpatient attendance)"", ""03 = Referral from a general medical practitioner (Not initiated by the consultant responsible for the outpatient attendance)""*, "" 04 = Referral from an accident and emergency department (Not initiated by the consultant responsible for the outpatient attendance)"", "" 05 = Referral from a consultant other than in accident and emergency department (Not initiated by the consultant responsible for the outpatient attendance)""*, ""06 = Self Referral  (Not initiated by the consultant responsible for the outpatient attendance)"", ""07 = Referral from prosthetist  (Not initiated by the consultant responsible for the outpatient attendance)"", ""08 = Other source of Referral (Not initiated by the consultant responsible for the outpatient attendance)"", ""10 = Following an Accident and Emergency Attendance (Initiated by the consultant responsible for the outpatient attendance)"", ""11 = Other (Initiated by the consultant responsible for the outpatient attendance)"", "" 12 = Referral from GP with special interest (Not initiated by the consultant responsible for the outpatient attendance)"", ""13 = Referral from a specialist nurse (secondary care) (Not initiated by the consultant responsible for the outpatient attendance)"", ""14 = Referral from an allied health professional (Not initiated by the consultant responsible for the outpatient attendance)"", ""15 = Referral from an optometrist (Not initiated by the consultant responsible for the outpatient attendance)"", ""16 = Referral from a orthoptist (Not initiated by the consultant responsible for the outpatient attendance)"", ""17 = Referral from a national screening programme (Not initiated by the consultant responsible for the outpatient attendance)"", ""92 = General dental practitioner (Not initiated by the consultant responsible for the outpatient attendance)"""
06_generate_nhse_eng_outpat.R,rttperend,date between 2008-01-01 to 2035-12-31
06_generate_nhse_eng_outpat.R,rttperstart,date between 2008-01-01 to 2035-12-31
06_generate_nhse_eng_outpat.R,rttperstat,"""10 = First activity in a referral to treatment period (The first activity in a referral to treatment period where the first definitive treatment will be a subsequent activity)"", ""11 = First activity at the start of a new referral to treatment period (The first activity in a referral to treatment period where the first definitive treatment will be a subsequent activity)"", ""12 = First activity at start of a new referral to treatment period following a dsecision to refer directly to the consultant or NHS allied health professional service (referral to treatment measurement) for a separate condition (The first activity in a referral to treatment period where the first definitive treatment will be a subsequent activity)"", ""20 = Subsequent activity during a referral to treatment period - further activities anticipated (Subsequent activity during a referral to treatment period)"", ""21 - Subsequent activity by another health care provider following a transfer to another health care provider during a referral to treatment period anticipated (Subsequent activity during a referral to treatment period)"", ""30 = Start of first definitive treatment (Activity that ends the referral to treatment period)"", ""31 = Start of active monitoring initiated by the patient (Activity that ends the referal to treatment period)"", ""32 = Start of active monitoring initiated by the care professional (Activity that ends the referral to treatment period"", ""33 = Did not attend - the patient did not attend the first care activity after the referral1 (Activity that ends the referral to treatment period)"", "" 34 = Decision not to treat - decision not to treat made or no further contact required2 (Activity that ends the referral to treatment period)"", ""35 = Patient declined offered treatment (Activity that ends the referral to treatment period)"",""36 = Patient died before treatment (Activity that ends the referral to treatment period)"", ""90 = After treatment - first definitive treament occurred previously (e.g. admitted as an emergency from A&E or the activity is after the start of treatment) (Activity that is not part of a referral treatment period)"", ""91 = Care activity during active monitoring (Activity that is not part of a referral treatment period)"", ""92 - Not yet referred for treatment undergoing diagnostic tests by general practitioner before referral (Activity that is not part of a referral treatment period)"", ""98 = Not applicable - activity not applicable to referral to treatment periods (Activity that is not part of a referral treatment period)"", ""99 = Not yet known (Activity where the referral to treatment period status is not yet known)"""
06_generate_nhse_eng_outpat.R,susspellid,"""-1 = Unspellable episodes"", ""Null = Records that have exlcuded from pbR in SUS as the activity is outside the scope of pbR"" [Null is 0 people] [-1 is only 0.05% of total cohort]"
06_generate_nhse_eng_outpat.R,tretspef,"refer to tretspef_possible_values (most common value is ""110 = Trauma and Orthopaedix Service"""
07_generate_nhse_eng_inpat.R,acscflag,"""0 = Episode does not contain a diagnosis that is ambulatory sensitive care"", ""1 = Episode contains a diagnosis that is ambulatory care sensitive"""
07_generate_nhse_eng_inpat.R,admimeth,"""-999 = Suppressed"", ""11 = Waiting list. A Patient admitted electively from a waiting list having been given no date of admission at a time a decision was made to admit (Elective Admission when the decision to admit could be separated in time from the actual admission)"", ""12 = Booked. A Patient admitted having been given a date at the time the decision to admit was made determined mainly on the grounds of resource availability (Elective Admission when the decision to admit could be separated in time from the actual admission)"", ""13 = Planned. A Patient admitted having been given a date or approximate date at the time that the decision to admit was made. This is usually part of a planned sequence of clinical care determined mainly on social or clinical criteria (e.g. check cystoscopy). A planned admission is one where the date of admission is determined by the needs of the treatment rather than by the availability of resources. (Elective Admission when the decision to admit could be separated in time from the actual admission)"", ""21 = Emergency Care Department or acute or emergency dental service (Emergency Admission when admission is unpredictable and at short notice because of clinical need)"", ""22 = General Practitioner: after a request for immediate admission has been made direct to a Hospital Provider i.e not through a Bed bureau by a GP or deputy (Emergency Admission when admission is unpredictable and at short notice because of clinical need)"", ""23 = Bed bureau (Emergency Admission when admission is unpredictable and at short notice because of clinical need)"", ""24 = Conculstant Clinic of this or another Health Care Provider (Emergency Admission when admission is unpredictable and at short notice because of clinical need)"", ""28 = Other means examples are:- admited from the Accident and Emergency Department of another provider where they had not been admited- transfer of an admitted PATIENT from another Hospital Provider in an emergency- baby born at home as intended (retired on 2022-23) (Emergency Admission when admission is unpredictable and at short notice because of clinical need)"", ""2A = Emergency Care Department of another provider where the patient had not been admitted (available from 2013/14)  (Emergency Admission when admission is unpredictable and at short notice because of clinical need)"", ""2B = Transfer of an admitted patient from another Hospital Provider in an mergency (available from 2013/14)  (Emergency Admission when admission is unpredictable and at short notice because of clinical need)"",""2D = Other emergency admission (available from 2013/14)  (Emergency Admission when admission is unpredictable and at short notice because of clinical need)"", ""31 = Admitted ante-partum (Maternity Admission of a pregnant or recently pregnant woman to a maternity ward (including delivery facilities) exceptr when the intention is to terminate the pregnancy)"" [~15%], ""32 =Admitted post-partum (Maternity Admission of a pregnant or recently pregnant woman to a maternity was (including delivery facilities) except when the intention is to terminate the pregnancy)"", ""81 = Transfer of any admitted patient from other Hospital Provider other than in an emergency (Other Admission not specified above)"", ""82 = The birth of a baby in this Health Care Provider (Other Admission not specified above)"", ""89 = HSPH Admission Waiting List of a High Security Psychiatric Hospital (available between 1999 and 2006) (Other Admission not specified above)"", ""98 = Not applicable (available from 1996/97) (Other Admission not specified above)"", ""99 = Method of admission not known  (Other Admission not specified above)"""
07_generate_nhse_eng_inpat.R,admisorc,"""19 = The usual place of residence unless listed below for example a private dwelling whether owner occupied or owner by Local Authority housing association or other landlord. This includes wardened accommodation but not residential accommodation where health care is provided. It also included patients with no fixed abode.""*, ""51 = NHS other hospital provider: ward for general patients or the younger physically disabled or Emergency and Care dpeartment"", ""29 = Temporary place of residence when usually resident elsewhere for example hotels and residential educational establishments"", ""99 = Admission source Not known"", ""52 = NHS other hospital provider: ward for maternity patients or neonates"", ""87 = Independent Sector Healthcare Provider run hospital"", ""53 = NHS other hospital provider: ward for patients who are mentally ill or have learning disabilities"", ""-999 = Suppresed"", ""98 = Not applicable"", ""88 = Hospice"", ""55 = Care Home with Nursing"", ""56 = Care Home without Nursing"", ""79 = Babies born in or on the way to hospital"", ""65 = Local authority residential accommodation i.e. where care is provided (retired in 2022-23)"", ""85 = Non-NHS (other than local authority) run care home (retired in 2022-23)"", ""54 = NHS run care home (retired in 2022-23)"", ""66 = Local authority foster care but not in residential accommodation i.e. where care is provided"", ""89 =Non-NHS institution (1989-90 to 1995-96)"", ""69 = Local authority home or care (1989-90 to 1995-96)"", ""86 = Non-NHS (other than local authority) run nursing home"", ""30 = Repatriatrion from high security psychiatric hospital (1999-00 to 2006-07)"" [0 people]"
07_generate_nhse_eng_inpat.R,aekey,either Null or 12 digit random number
07_generate_nhse_eng_inpat.R,bedyear,"""Null = Not applicable (other maternity event / not know)"" [0 people have this]"
07_generate_nhse_eng_inpat.R,carersi,"""01 = Yes - Carer support is available"", ""02 = No - Carer support is not available"", ""99 = Not known""*"
07_generate_nhse_eng_inpat.R,classpat,"""1 = Ordinary admission""*, ""2 = Day case admission""*, ""3 = Regular day attender"", "" 4 = Regular night attender"", ""5 = Mothes and babies using only delivery facilities"",""8 = Not applicable (other maternity event)"", "" 9 = Not known"""
07_generate_nhse_eng_inpat.R,disdate,date between 1993-01-01 to 2026-12-31
07_generate_nhse_eng_inpat.R,disdest,"""19 = The usual place of residence including no fixed abode.""*, ""51 = NHS other hospital provider - ward for general PATIENTS or the younger physically disabled"", ""29 = Temporary place of residence when usually resident elsewhere for example hotels and residential educational establishments"", ""99 = Destination of Discharge Not known"", ""52 = NHS other hospital provider - ward for maternity PATIENTS or Neonates"", ""87 = Independent Sector Healthcare Provider run hospital - excluding medium secure unit"", ""53 = NHS other hospital provider - ward for PATIENTS who are mentally ill or have learning disabilities"", ""-999 = Suppresed"", ""98 = Not applicable - Hospital Provider Spell not finished at episode end"", ""88 = Hospice"", ""55 = Care Home with Nursing"", ""56 = Care Home without Nursing"", ""79 = Babies born in or on the way to hospital"", ""65 = Local authority residential accommodation i.e. where care is provided (retired in 2022-23)"", ""85 = Non-NHS (other than local authority) run care home (retired in 2022-23)"", ""54 = NHS run care home (retired in 2022-23)"", ""66 = Local authority foster care but not in residential accommodation i.e. where care is provided"", ""89 =Non-NHS institution (1989-90 to 1995-96)"", ""69 = Local authority home or care (1989-90 to 1995-96)"", ""86 = Non-NHS (other than local authority) run nursing home"", ""30 = Repatriatrion from high security psychiatric hospital (1999-00 to 2006-07)"", ""79 = PATIENT died or still birth"", ""37 = Penal estabilishment - court (from 1999-2000)"", ""84 = Independent Sector Healthcare Provider run hospital - medium secure unit"", ""89 = ORGANISATION responsible for forced repatriation"""
07_generate_nhse_eng_inpat.R,dismeth,"""1 = Patient discharged on clinical advice or with clinical consent""*, ""2 = Patient discharged him/herself or was discharged by a relative or advocate (retired 2022-23)"", ""3 = Patient discharged by a mental health review tribunal Home Secretary or Court"", ""4 = Patient died"", ""5 = Stillbirth"", ""6 = Patient discharged himself/herself (available from 2022-23)"", ""7 = Patient discharged by a relative or advocate (available from 2022-23)"", ""8 = Not applicable - Hospital Provider Spell not finished at episode end (i.e. not discharged) or current episode unfinished"", ""9 = Method of Discharge Not Known"""
07_generate_nhse_eng_inpat.R,disreadydate,"date between 2008-1-1 and 2034-12-31, but include 1 outlier date in 1800-01-01"
07_generate_nhse_eng_inpat.R,elecdate,"date between 1997-1-1 and 2029-12-31, but include 1 outlier date in 1900-01-01"
07_generate_nhse_eng_inpat.R,elecdur,number between 0 - 10k mean is 83 ( anything above 300 is outlier/rare skew)
07_generate_nhse_eng_inpat.R,epidur,"""Null = Not applicable (other maternity event / not know)"" [0 people have this]"
07_generate_nhse_eng_inpat.R,epikey,random numbers 11-19 digits long
07_generate_nhse_eng_inpat.R,epiorder,"numebrs 1 to 15 and only 5 individuals with etiher ""98 = Not applicable"" or ""99 = Not know: a validation error"""
07_generate_nhse_eng_inpat.R,epiend,date between 1997-1-1 and 2026-12-31
07_generate_nhse_eng_inpat.R,epitype,"""1 = General episode (anything that is not covered by the other codes)""*, ""2 = Delivery episode"", ""3 = Birth episode"", ""4 = Formally detained under the provisions of mental health legislation or long-term (over one year) psychiatric patients who should have additional information recorded on the psychiatric consensus (until 2016-17)"", ""5 = Other delivery event"", ""6 = Other birth event"""
07_generate_nhse_eng_inpat.R,firstreg,"""0 = First in a series"", ""9 = Not known: this episode is an attendance within a sequence of regular day/night admissions but the status of this epidsode within the attendance is not known: a valIdation error (valid between 2002-03 and 2007-08)"", ""8 = Not applicable: this episode is neither first not any subsequent attendance within a sequence of day/night admissions (valid between 2002-03 and 2007-08)"", ""1 = Subsequent to first in a series"", ""2 = Invalid"", ""3 = Invalid"""
07_generate_nhse_eng_inpat.R,imd04_decile,"""Least deprived 10%"", ""More deprived 30-40%"", ""Most deprived ""40-50%"", ""LESS DEPRIVED 10-20%"", ""Less deprived 10-20%"""
07_generate_nhse_eng_inpat.R,intmanig,"""1 = Patient to stay in hospital for at least one night"", ""2 = Patient not to stay in hospital overnight"", ""3 = Patient to have a planned series of admissions at least one overnight stay"", ""4 = Patient to have a planned series of admissions no overnight stay"", ""5 = Patient to be admitted regularly for a sequence of nights rest of the 24 hour period at home"", ""8 = Not applicable"", ""9 = Intended Management not known"""
07_generate_nhse_eng_inpat.R,mainspef,refer to mainspef_possible_values (960 is most common value ~ 15%)
07_generate_nhse_eng_inpat.R,posopdur,"""Null = Not applicable: no procedure or episode is unfinished"" [0 people have this]"
07_generate_nhse_eng_inpat.R,preopdur,"""Null = Not applicable: no operation or procedure unfinished"" [0 people have this]"
07_generate_nhse_eng_inpat.R,procode3_ofh,random numbers 6 digits long
07_generate_nhse_eng_inpat.R,protype,"""CARETRUST = Care trust"", ""CCG = Clinical Commission Group"",""FOUNDATION = NHS foundation trust""*, ""IND = Independent sector provider"", ""INDSITE = Independent sector provider site"", ""INDSITETC = Treatment centre at independent sector provider site"", ""OTHERPROV = Other provider organisation"", "" PCT = Primary care trust"", ""TRUST = NHS trust""*, ""TRUSTSITETC = Treatment centre at NHS trust site"""
07_generate_nhse_eng_inpat.R,rttperend,date between 2008-01-01 to 2035-12-31
07_generate_nhse_eng_inpat.R,rttperstart,date between 2008-01-01 to 2035-12-31
07_generate_nhse_eng_inpat.R,rttperstat,"""10 = First activity in a referral to treatment period (The first activity in a referral to treatment period where the first definitive treatment will be a subsequent activity)"", ""11 = First activity at the start of a new referral to treatment period (The first activity in a referral to treatment period where the first definitive treatment will be a subsequent activity)"", ""12 = First activity at start of a new referral to treatment period following a dsecision to refer directly to the consultant or NHS allied health professional service (referral to treatment measurement) for a separate condition (The first activity in a referral to treatment period where the first definitive treatment will be a subsequent activity)"", ""20 = Subsequent activity during a referral to treatment period - further activities anticipated (Subsequent activity during a referral to treatment period)"", ""21 - Subsequent activity by another health care provider following a transfer to another health care provider during a referral to treatment period anticipated (Subsequent activity during a referral to treatment period)"", ""30 = Start of first definitive treatment (Activity that ends the referral to treatment period)"", ""31 = Start of active monitoring initiated by the patient (Activity that ends the referal to treatment period)"", ""32 = Start of active monitoring initiated by the care professional (Activity that ends the referral to treatment period"", ""33 = Did not attend - the patient did not attend the first care activity after the referral1 (Activity that ends the referral to treatment period)"", "" 34 = Decision not to treat - decision not to treat made or no further contact required2 (Activity that ends the referral to treatment period)"", ""35 = Patient declined offered treatment (Activity that ends the referral to treatment period)"",""36 = Patient died before treatment (Activity that ends the referral to treatment period)"", ""90 = After treatment - first definitive treament occurred previously (e.g. admitted as an emergency from A&E or the activity is after the start of treatment) (Activity that is not part of a referral treatment period)"", ""91 = Care activity during active monitoring (Activity that is not part of a referral treatment period)"", ""92 - Not yet referred for treatment undergoing diagnostic tests by general practitioner before referral (Activity that is not part of a referral treatment period)"", ""98 = Not applicable - activity not applicable to referral to treatment periods (Activity that is not part of a referral treatment period)"", ""99 = Not yet known (Activity where the referral to treatment period status is not yet known)"""
07_generate_nhse_eng_inpat.R,spelbgin,"""1 = First episode of spell that started in a previous year"", ""2 = First episode of spell that started in current year"", ""0 = Not the first episode of spell"""
07_generate_nhse_eng_inpat.R,spelend,"""Y = Last episode of spell"", ""N = Not last episode of spell"""
07_generate_nhse_eng_inpat.R,susrecid,Null or random numbers of varying lengths from 13 to 19 digits
07_generate_nhse_eng_inpat.R,susspellid,same as susrecid
07_generate_nhse_eng_inpat.R,tretspef,"refer to tretspef_possible_values (most common value is ""110 = Trauma and Orthopaedix Service"""
09_generate_nhse_eng_ed.R,aearrivalmode,"""1 = Brought in by ambulance (including helicopter / Air Ambulance)"", ""2 = Other""*, ""9 = Not known"""
09_generate_nhse_eng_ed.R,aeattendcat,"""1 = First A&E attendance""*, ""2 =Follow-up A&E attendance - planned"", ""3 = Follow-up A&E attendance - unplanned"", ""9 = Not known"""
09_generate_nhse_eng_ed.R,aeattenddisp,"""01 = Admitted to hospital b ed / became a lodged patient of the same healthcare provider""*, ""02 = Discharged - follow-up treatment to be provided by general practitioner""*, ""03 = Discharged - did not require any follow-up treatment""*, ""04 = Referred to A&E clinic"", ""05 = Referred to fracture clinic"", ""06 = Referred to other outpatient clinic"", ""07 = Transferred to other healthcare provided"", ""10 = Died in department"", ""11 = Referred to other healthcare professional"", ""12 = Left department before being treated"", ""13 = Left department having refused treatment"", ""14 = Other"""
09_generate_nhse_eng_ed.R,aedepttype,"""01 = Emergency departments are a consultant led 24-hour service with full resuscitation facilities and designated accomodation for the receptionm of accident and emergency patients"", ""02 = Consultant-led mono speciality accident and emergency service (e.g. opthalmology dental) with designated accommodation for the reception of patients"", ""03 = Other type of A&E/minor injury activity with designated accommodation for the reception of accident and emergency patients. The department may be doctor led or nurse led and treats at least minor injuries and illnesses and can be routinely accessed without appointment. A service mainly or entirely appointment based (for example a GP practice or outpatient clinic) is excluded evenm though it may treat a number of patients with minor illness or injury. Excludes NHS walk-in centres"", ""04 = NHS walk-in centres"" , ""05 = Same Day Emergency Care (SDEC)"", ""99 = Not Known"""
09_generate_nhse_eng_ed.R,aerefsource,"""00 = General medical practicioner"", ""01 = Self referral"", ""02 = Local authority social services"", ""03 = Emergency services"", ""04 = Work"", ""05 = Educational establishment"", ""06 = Police"" , ""07 = Health care provider: same or other"", ""08 = Other"", ""92 = General dental practitioner"", ""93 = Community dental service"", ""99 = Not known"""
09_generate_nhse_eng_ed.R,arrivaldate,date between 2007-01-01 and 2020-09-01
09_generate_nhse_eng_ed.R,concltime,"""3000 = Invalid time submitted"" [0 people have this], ""4000 = Null time submitted"" [only 5% have this one]"
09_generate_nhse_eng_ed.R,deptime,"""3000 = Invalid time submitted"" [0 people have this], ""4000 = Null time submitted"" [only 2% have this one]"
09_generate_nhse_eng_ed.R,arrivaltime,"4 digit number detailing military time (can be set randomly to any time e.g ""1819"")"
09_generate_nhse_eng_ed.R,aekey,random 12 digit number
09_generate_nhse_eng_ed.R,epikey,random numbers 11-19 digits long
09_generate_nhse_eng_ed.R,imd04_decile,"""Least deprived 10%"", ""More deprived 30-40%"", ""Most deprived ""40-50%"", ""LESS DEPRIVED 10-20%"", ""Less deprived 10-20%"""
09_generate_nhse_eng_ed.R,invest2_01,"any one of these:01 = X-ray plain film, 02 = Electrocardiogram, 03 = Haematology, 04 = Cross match blood/group & save serum for later cross match,05 = Biochemistry, 06 = Urilysis, 07 = Bacteriology, 08 = Histology, 09 = Computerised tomography (retired 2006), 10 = Ultrasound, 11 = Magnetic resonance imaging, 12 = Computerised tomography (exc genito urinary contrast examition/tomography), 13 = Genito urinary contrast exami tion/tomography, 14 = Clotting studies,15 = Immunology,16 = Cardiac enzymes,17 = Arterial/capillary blood gas,18 = Toxicology,19 = Blood culture,20 = Serology,21 = Preg ncy test,22 = Dental investigation,23 = Refraction, orthoptic tests and computerised visual fields,24 = None,99 = Other. invest2_01 will have a vlaue for everyone, invest_02 will hae for 40%, then 03 for 20% then occasional outliers having diagnoses in the following invest2 columns up to _12. majority will have ""24 = None"""
09_generate_nhse_eng_ed.R,invest2_02,
09_generate_nhse_eng_ed.R,invest2_03,
09_generate_nhse_eng_ed.R,invest2_04,
09_generate_nhse_eng_ed.R,invest2_05,
09_generate_nhse_eng_ed.R,invest2_06,
09_generate_nhse_eng_ed.R,invest2_07,
09_generate_nhse_eng_ed.R,invest2_08,
09_generate_nhse_eng_ed.R,invest2_09,
09_generate_nhse_eng_ed.R,invest2_10,
09_generate_nhse_eng_ed.R,invest2_11,
09_generate_nhse_eng_ed.R,invest2_12,
09_generate_nhse_eng_ed.R,procode3_ofh,random numbers 6 digits long
09_generate_nhse_eng_ed.R,protype,"""CARETRUST = Care trust"", ""CCG = Clinical Commission Group"",""FOUNDATION = NHS foundation trust""*, ""IND = Independent sector provider"", ""INDSITE = Independent sector provider site"", ""INDSITETC = Treatment centre at independent sector provider site"", ""OTHERPROV = Other provider organisation"", "" PCT = Primary care trust"", ""TRUST = NHS trust""*, ""TRUSTSITETC = Treatment centre at NHS trust site"""
09_generate_nhse_eng_ed.R,susspellid,Null or random numbers of varying lengths from 13 to 19 digits
09_generate_nhse_eng_ed.R,treat_01,"gives one SNOMED ECDS code. Same logic as invest2, values in 01 (some will be Null though for this) then less and less values in follwing treat_02  _03 etc. columns"
09_generate_nhse_eng_ed.R,treat_02,
09_generate_nhse_eng_ed.R,treat_03,
09_generate_nhse_eng_ed.R,treat_04,
09_generate_nhse_eng_ed.R,treat_05,
09_generate_nhse_eng_ed.R,treat_06,
09_generate_nhse_eng_ed.R,treat_07,
09_generate_nhse_eng_ed.R,treat_08,
09_generate_nhse_eng_ed.R,treat_09,
09_generate_nhse_eng_ed.R,treat_10,
09_generate_nhse_eng_ed.R,treat_11,
09_generate_nhse_eng_ed.R,treat_12,
09_generate_nhse_eng_ed.R,trettime,"4 digit number detailing military time (can be set randomly to any time e.g ""1819"")"
10_generate_nhse_eng_primcare_meds.R,chargestatus,"""- = Unknown"", ""C = Chargeable at Current Rate"", ""E = Exempt""*, ""O = Chargeable at Previous Rate"", ""U = Unknown"""
10_generate_nhse_eng_primcare_meds.R,costcentresubtype,"""- = Does not apply"", ""01 = Walk-in-Centre"", ""02 = Out-of-hours service"", ""03 = Walk-in-Centre and Out-of-hours service"", ""04 = GP Practice""*, ""05 = Health & Justice"", ""06 = Private Controlled Drug practice"", ""07 = Other"", ""08 = Public health service"", ""09 = Community health service"", "" 10 = Hospital service"", ""11 = Optometry service"" , ""12 = Urgent & emergency care"", ""13 = Hospice"", ""14 = Care home/nursing home"", ""15 = PCN"""
10_generate_nhse_eng_primcare_meds.R,costcentretype,"""15 = GENERAL PRACTITIONER"", ""16 = DENTAL PRACTITIONER"", ""18 = HOSPITAL DOCTOR"", ""22 = SCOTTISH LEAKED DATA BATCHES"", ""23 = WELSH LEAKED DATA BATCHES"", ""33 =NURSE"", ""34 = COMMUNITY NURSE PRESCRIBING CONTRACT"", ""48 = ADDITIONAL PRESCRIBER"", ""5 = HOSPITAL"", ""51 = PRIVATE DOCTOR"", ""52 = PRIVATE NURSE"", ""53 = PRIVATE ADDITIONAL PRESCRIBER"", ""54 = PRIVATE GROUP"", ""7  = GP PRACTICE / COST CENTRE""*, ""8 = CONTRACTOR"", ""9 = DENTIST PRACTICE"""
10_generate_nhse_eng_primcare_meds.R,dispensedpharmacytype,"15 = GENERAL PRACTITIONER, ""16 = DENTAL PRACTITIONER"", ""18 = HOSPITAL DOCTOR"", ""22 = SCOTTISH LEAKED DATA BATCHES"", ""23 = WELSH LEAKED DATA BATCHES"", ""33 =NURSE"", ""34 = COMMUNITY NURSE PRESCRIBING CONTRACT"", ""48 = ADDITIONAL PRESCRIBER"", ""5 = HOSPITAL"", ""51 = PRIVATE DOCTOR"", ""52 = PRIVATE NURSE"", ""53 = PRIVATE ADDITIONAL PRESCRIBER"", ""54 = PRIVATE GROUP"", ""7  = GP PRACTICE / COST CENTRE"", ""8 = CONTRACTOR""*, ""9 = DENTIST PRACTICE"""
10_generate_nhse_eng_primcare_meds.R,costcentreodscode_ofh,6 digit random number that repeats per pid
10_generate_nhse_eng_primcare_meds.R,itemactualcost,"number between 0 to 1 million (mean is 800, outliers past 30000)"
10_generate_nhse_eng_primcare_meds.R,itemid,integer number 1 to 5
10_generate_nhse_eng_primcare_meds.R,itemnic,integer number 5 to 51846
10_generate_nhse_eng_primcare_meds.R,maternityexemptionflag,"""0 = no"", ""1 = yes"""
10_generate_nhse_eng_primcare_meds.R,outofhoursindicator,0 to 1 mean is 0
10_generate_nhse_eng_primcare_meds.R,paidflavourindicator,"""- = UNKNOWN""*,  ""0057 = Tutti frutti"", ""0070 = Peppermint"", ""0002 = Aniseed"", ""0040 = Orange"", ""0030 = Lemon"", ""0047 = Plain"", ""0031 = Lemon & lime"""
10_generate_nhse_eng_primcare_meds.R,paiddisallowedindicator,"""N = no""*, ""Y = yes"" [100% no]"
10_generate_nhse_eng_primcare_meds.R,paidformulation,"""0069 = Tablet""*, ""0282 = Oral tablet""*, ""0020 = Gastra-resistant capsule""*, ""0004 = Capsule"", ""0061 = Pressurised inhalation"", ""0042 = Modified-release tablet"", ""0204 = Oral capsule"""
10_generate_nhse_eng_primcare_meds.R,paidindicator,"""N = no"", ""Y = yes""* [100% yes]"
10_generate_nhse_eng_primcare_meds.R,paiddmdcode,"""1271511000001104 = Atorvastatin 20mg tablets 28 tablet (product)"", ""1068411000001105 = Omeprazole 20mg gastro resistant capsules 28 capsule (product)"" [fill with a few more examples in this format focusing on CVD drugs]"
10_generate_nhse_eng_primcare_meds.R,paidsuppliername,"""Generic Supplier"", ""Chiesi Ltf"", "" 3M Health Care Ltd"", ""A A H Pharmaceuticals Ltd"", ""Abbot Laboratories Ltd"", ""Essential Healthcare Ltd"", "
10_generate_nhse_eng_primcare_meds.R,prescribedbnfcode,"long bnf codes like ""0602010V0AABWBW"""
10_generate_nhse_eng_primcare_meds.R,prescribednfname,same as already made PaidBNFName column
10_generate_nhse_eng_primcare_meds.R,prescribedformulation,"""0069 = Tablet""*, ""0282 = Oral tablet""*, ""0020 = Gastra-resistant capsule""*, ""0004 = Capsule"", ""0061 = Pressurised inhalation"", ""0042 = Modified-release tablet"", ""0204 = Oral capsule"""
10_generate_nhse_eng_primcare_meds.R,prescribeddmdcode,"""1271511000001104 = Atorvastatin 20mg tablets 28 tablet (product)"", ""1068411000001105 = Omeprazole 20mg gastro resistant capsules 28 capsule (product)"" [fill with a few more examples in this format focusing on CVD drugs]"
10_generate_nhse_eng_primcare_meds.R,prescribedquantity,"number between 0 to 300k, mean is 80, "
10_generate_nhse_eng_primcare_meds.R,prescribedmedicinestrength,same as paiddrugstrength
10_generate_nhse_eng_primcare_meds.R,prescribedmedicinequantity,same as paidquantity
10_generate_nhse_eng_primcare_meds.R,prescribertype,"""15 = GENERAL PRACTITIONER""*, ""16 = DENTAL PRACTITIONER"", ""18 = HOSPITAL DOCTOR"", ""22 = SCOTTISH LEAKED DATA BATCHES"", ""23 = WELSH LEAKED DATA BATCHES"", ""33 =NURSE"", ""34 = COMMUNITY NURSE PRESCRIBING CONTRACT"", ""48 = ADDITIONAL PRESCRIBER"", ""5 = HOSPITAL"", ""51 = PRIVATE DOCTOR"", ""52 = PRIVATE NURSE"", ""53 = PRIVATE ADDITIONAL PRESCRIBER"", ""54 = PRIVATE GROUP"", ""7  = GP PRACTICE / COST CENTRE"", ""8 = CONTRACTOR"", ""9 = DENTIST PRACTICE"""
10_generate_nhse_eng_primcare_meds.R,privateprescriptionindicator,number between 0 to 1 mean is 0
10_generate_nhse_eng_primcare_meds.R,processedperiod,"number between 200k and 202k, mean is 202000"
10_generate_nhse_eng_primcare_meds.R,processingperioddate,any dat between 2018-01-01 and 2025-09-01