diff --git a/docs/.vitepress/api-pages.ts b/docs/.vitepress/api-pages.ts index fcea7f72b39..6abc411ae07 100644 --- a/docs/.vitepress/api-pages.ts +++ b/docs/.vitepress/api-pages.ts @@ -28,6 +28,7 @@ export const apiPages = [ { text: 'Internet', link: '/api/internet.html' }, { text: 'Location', link: '/api/location.html' }, { text: 'Lorem', link: '/api/lorem.html' }, + { text: 'Medical', link: '/api/medical.html' }, { text: 'Music', link: '/api/music.html' }, { text: 'Number', link: '/api/number.html' }, { text: 'Person', link: '/api/person.html' }, diff --git a/scripts/generate-locales.ts b/scripts/generate-locales.ts index d51d58b83e8..491d571deef 100644 --- a/scripts/generate-locales.ts +++ b/scripts/generate-locales.ts @@ -60,6 +60,7 @@ const definitionsTypes: DefinitionType = { internet: 'InternetDefinition', location: 'LocationDefinition', lorem: 'LoremDefinition', + medical: 'MedicalDefinition', metadata: 'MetadataDefinition', music: 'MusicDefinition', person: 'PersonDefinition', diff --git a/src/definitions/definitions.ts b/src/definitions/definitions.ts index d207ec123f3..ca1ace2421d 100644 --- a/src/definitions/definitions.ts +++ b/src/definitions/definitions.ts @@ -12,6 +12,7 @@ import type { HackerDefinition } from './hacker'; import type { InternetDefinition } from './internet'; import type { LocationDefinition } from './location'; import type { LoremDefinition } from './lorem'; +import type { MedicalDefinition } from './medical'; import type { MetadataDefinition } from './metadata'; import type { MusicDefinition } from './music'; import type { PersonDefinition } from './person'; @@ -47,6 +48,7 @@ export type LocaleDefinition = { internet?: InternetDefinition; location?: LocationDefinition; lorem?: LoremDefinition; + medical?: MedicalDefinition; music?: MusicDefinition; person?: PersonDefinition; phone_number?: PhoneNumberDefinition; diff --git a/src/definitions/index.ts b/src/definitions/index.ts index 68ac04011f1..e98ccde0b32 100644 --- a/src/definitions/index.ts +++ b/src/definitions/index.ts @@ -16,6 +16,7 @@ export type { HackerDefinition } from './hacker'; export type { InternetDefinition } from './internet'; export type { LocationDefinition } from './location'; export type { LoremDefinition } from './lorem'; +export type { MedicalDefinition } from './medical'; export type { MetadataDefinition } from './metadata'; export type { MusicDefinition } from './music'; export type { PersonDefinition, PersonEntryDefinition } from './person'; diff --git a/src/definitions/medical.ts b/src/definitions/medical.ts new file mode 100644 index 00000000000..b652d8eaff8 --- /dev/null +++ b/src/definitions/medical.ts @@ -0,0 +1,46 @@ +import type { LocaleEntry } from './definitions'; + +/** + * The possible definitions related to medical and healthcare data. + */ +export type MedicalDefinition = LocaleEntry<{ + /** + * Medical specialties, e.g. `'Cardiology'`. + */ + specialty: string[]; + + /** + * Hospital departments, e.g. `'Emergency Department'`. + */ + department: string[]; + + /** + * Plausible medical condition names (without diagnosis codes), e.g. `'Type 2 Diabetes'`. + */ + condition: string[]; + + /** + * Symptoms, e.g. `'Shortness of Breath'`. + */ + symptom: string[]; + + /** + * Medical procedures, e.g. `'Appendectomy'`. + */ + procedure: string[]; + + /** + * Common allergens, e.g. `'Penicillin'`. + */ + allergen: string[]; + + /** + * Blood types, e.g. `'O+'`. + */ + blood_type: string[]; + + /** + * Fictitious, brand-style drug names, e.g. `'Zolpraxen'`. + */ + drug_name: string[]; +}>; diff --git a/src/faker.ts b/src/faker.ts index 16a80384eee..5615a0db8a9 100644 --- a/src/faker.ts +++ b/src/faker.ts @@ -19,6 +19,7 @@ import { ImageModule } from './modules/image'; import { InternetModule } from './modules/internet'; import { LocationModule } from './modules/location'; import { LoremModule } from './modules/lorem'; +import { MedicalModule } from './modules/medical'; import { MusicModule } from './modules/music'; import { PersonModule } from './modules/person'; import { PhoneModule } from './modules/phone'; @@ -73,6 +74,7 @@ export class Faker extends SimpleFaker { readonly internet: InternetModule = new InternetModule(this); readonly location: LocationModule = new LocationModule(this); readonly lorem: LoremModule = new LoremModule(this); + readonly medical: MedicalModule = new MedicalModule(this); readonly music: MusicModule = new MusicModule(this); readonly person: PersonModule = new PersonModule(this); readonly phone: PhoneModule = new PhoneModule(this); diff --git a/src/index.ts b/src/index.ts index d75e522ce0a..2b85647ca58 100644 --- a/src/index.ts +++ b/src/index.ts @@ -75,6 +75,7 @@ export { IPv4Network } from './modules/internet'; export type { IPv4NetworkType, InternetModule } from './modules/internet'; export type { LocationModule, SimpleLocationModule } from './modules/location'; export type { LoremModule } from './modules/lorem'; +export type { MedicalModule } from './modules/medical'; export type { MusicModule } from './modules/music'; export type { NumberModule } from './modules/number'; export { Sex } from './modules/person'; diff --git a/src/locales/en/index.ts b/src/locales/en/index.ts index 994287a82ce..e32cc7b0ff3 100644 --- a/src/locales/en/index.ts +++ b/src/locales/en/index.ts @@ -19,6 +19,7 @@ import hacker from './hacker'; import internet from './internet'; import location from './location'; import lorem from './lorem'; +import medical from './medical'; import metadata from './metadata'; import music from './music'; import person from './person'; @@ -51,6 +52,7 @@ const en: LocaleDefinition = { internet, location, lorem, + medical, metadata, music, person, diff --git a/src/locales/en/medical/allergen.ts b/src/locales/en/medical/allergen.ts new file mode 100644 index 00000000000..7c392d28be9 --- /dev/null +++ b/src/locales/en/medical/allergen.ts @@ -0,0 +1,42 @@ +export default [ + 'Adhesive', + 'Anesthesia', + 'Aspirin', + 'Bee Sting', + 'Celery', + 'Cockroaches', + 'Codeine', + 'Contrast Dye', + 'Corn', + 'Dust Mites', + 'Eggs', + 'Fish', + 'Fragrance', + 'Fructose', + 'Gluten', + 'Grass', + 'Ibuprofen', + 'Insect Bites', + 'Lactose', + 'Latex', + 'Lupin', + 'MSG', + 'Milk', + 'Mold', + 'Morphine', + 'Mustard', + 'Nickel', + 'Peanuts', + 'Penicillin', + 'Pet Dander', + 'Pollen', + 'Ragweed', + 'Red Dye', + 'Sesame', + 'Shellfish', + 'Soy', + 'Sulfa Drugs', + 'Sulfites', + 'Tree Nuts', + 'Wheat', +]; diff --git a/src/locales/en/medical/blood_type.ts b/src/locales/en/medical/blood_type.ts new file mode 100644 index 00000000000..23f769b690c --- /dev/null +++ b/src/locales/en/medical/blood_type.ts @@ -0,0 +1 @@ +export default ['A+', 'A-', 'AB+', 'AB-', 'B+', 'B-', 'O+', 'O-']; diff --git a/src/locales/en/medical/condition.ts b/src/locales/en/medical/condition.ts new file mode 100644 index 00000000000..420c0e98315 --- /dev/null +++ b/src/locales/en/medical/condition.ts @@ -0,0 +1,160 @@ +export default [ + 'Acne Vulgaris', + 'Acute Bronchitis', + 'Acute Kidney Injury', + 'Acute Sinusitis', + 'Allergic Rhinitis', + "Alzheimer's Disease", + 'Anal Fissure', + 'Anemia', + 'Angina Pectoris', + 'Anxiety Disorder', + 'Aortic Aneurysm', + 'Appendicitis', + 'Asthma', + 'Atrial Fibrillation', + 'Attention Deficit Hyperactivity Disorder', + 'Autism Spectrum Disorder', + "Barrett's Esophagus", + 'Basal Cell Carcinoma', + 'Benign Prostatic Hyperplasia', + 'Bipolar Disorder', + 'Bladder Cancer', + 'Brain Tumor', + 'Breast Cancer', + 'Bronchiolitis', + 'COVID-19', + 'Cardiomyopathy', + 'Carpal Tunnel Syndrome', + 'Cataracts', + 'Celiac Disease', + 'Cellulitis', + 'Cholecystitis', + 'Chronic Kidney Disease', + 'Chronic Liver Disease', + 'Chronic Obstructive Pulmonary Disease', + 'Chronic Pain Syndrome', + 'Chronic Sinusitis', + 'Cirrhosis', + 'Colon Cancer', + 'Congenital Heart Disease', + 'Congestive Heart Failure', + 'Coronary Artery Disease', + "Crohn's Disease", + 'Croup', + 'Cystic Fibrosis', + 'Deep Vein Thrombosis', + 'Dengue Fever', + 'Depression', + 'Diabetic Retinopathy', + 'Diverticulitis', + 'Eczema', + 'Emphysema', + 'Endocarditis', + 'Endometrial Cancer', + 'Endometriosis', + 'Epilepsy', + 'Erectile Dysfunction', + 'Esophagitis', + 'Essential Hypertension', + 'Fecal Incontinence', + 'Fibromyalgia', + 'Gastritis', + 'Gastroesophageal Reflux Disease', + 'Gestational Diabetes', + 'Glaucoma', + 'Glomerulonephritis', + 'Gout', + 'HIV/AIDS', + 'Hearing Loss', + 'Hemophilia', + 'Hemorrhoids', + 'Hepatitis C', + 'Hiatal Hernia', + 'Hyperlipidemia', + 'Hypertensive Heart Disease', + 'Hyperthyroidism', + 'Hypothyroidism', + 'Infectious Mononucleosis', + 'Influenza', + 'Interstitial Cystitis', + 'Interstitial Lung Disease', + 'Iron Deficiency Anemia', + 'Irritable Bowel Syndrome', + 'Kidney Cancer', + 'Kidney Stones', + 'Laryngitis', + 'Leukemia', + 'Leukopenia', + 'Lung Cancer', + 'Lupus', + 'Lyme Disease', + 'Lymphoma', + 'Macular Degeneration', + 'Melanoma', + "Meniere's Disease", + 'Migraine', + 'Multiple Sclerosis', + 'Myeloma', + 'Myocardial Infarction', + 'Narcolepsy', + 'Nephrotic Syndrome', + 'Nonalcoholic Fatty Liver Disease', + 'Obesity', + 'Osteoarthritis', + 'Osteoporosis', + 'Otitis Externa', + 'Otitis Media', + 'Ovarian Cancer', + 'Overactive Bladder', + 'Pancreatic Cancer', + 'Pancreatitis', + "Parkinson's Disease", + 'Peptic Ulcer Disease', + 'Pericarditis', + 'Peripheral Artery Disease', + 'Peripheral Neuropathy', + 'Pernicious Anemia', + 'Pharyngitis', + 'Pleural Effusion', + 'Pneumonia', + 'Pneumothorax', + 'Polycystic Kidney Disease', + 'Polycystic Ovary Syndrome', + 'Post-Traumatic Stress Disorder', + 'Preeclampsia', + 'Prostate Cancer', + 'Psoriasis', + 'Pulmonary Embolism', + 'Pulmonary Hypertension', + 'Pyelonephritis', + 'Restless Leg Syndrome', + 'Rheumatoid Arthritis', + 'Rosacea', + 'Sarcoidosis', + 'Schizophrenia', + 'Scleroderma', + 'Seizure Disorder', + 'Sepsis', + 'Shingles', + 'Sickle Cell Disease', + "Sjögren's Syndrome", + 'Sleep Apnea', + 'Squamous Cell Carcinoma', + 'Stress Incontinence', + 'Stroke', + 'Substance Use Disorder', + 'Thrombocytopenia', + 'Thyroid Cancer', + 'Tonsillitis', + 'Tuberculosis', + 'Type 1 Diabetes', + 'Type 2 Diabetes', + 'Ulcerative Colitis', + 'Urge Incontinence', + 'Urinary Tract Infection', + 'Uterine Fibroids', + 'Valvular Heart Disease', + 'Viral Gastroenteritis', + 'Vitamin D Deficiency', +]; diff --git a/src/locales/en/medical/department.ts b/src/locales/en/medical/department.ts new file mode 100644 index 00000000000..93b8f618994 --- /dev/null +++ b/src/locales/en/medical/department.ts @@ -0,0 +1,32 @@ +export default [ + 'Burn Unit', + 'Cardiac Care Unit (CCU)', + 'Cardiology Unit', + 'Dialysis Unit', + 'Emergency Department', + 'Endoscopy Suite', + 'Infusion Center', + 'Inpatient Ward', + 'Intensive Care Unit (ICU)', + 'Labor and Delivery', + 'Laboratory', + 'Maternity Ward', + 'Medical Observation Unit', + 'Neonatal Intensive Care Unit (NICU)', + 'Neurology Unit', + 'Occupational Therapy', + 'Oncology', + 'Operating Room', + 'Outpatient Clinic', + 'Pediatrics', + 'Pharmacy', + 'Physical Therapy', + 'Post-Anesthesia Care Unit (PACU)', + 'Psychiatric Ward', + 'Radiology', + 'Rehabilitation Unit', + 'Respiratory Therapy', + 'Sleep Lab', + 'Surgery', + 'Wound Care Center', +]; diff --git a/src/locales/en/medical/drug_name.ts b/src/locales/en/medical/drug_name.ts new file mode 100644 index 00000000000..e2595dbf72c --- /dev/null +++ b/src/locales/en/medical/drug_name.ts @@ -0,0 +1,252 @@ +export default [ + 'Advaen', + 'Advavor', + 'Advavue', + 'Advazen', + 'Advazepral', + 'Aldadiol', + 'Aldatalor', + 'Andelcor', + 'Andelnavia', + 'Andelol', + 'Andelpradyn', + 'Andelsyyl', + 'Andeltor', + 'Andelzen', + 'Brixdara', + 'Brixgis', + 'Brixol', + 'Brixvor', + 'Caeldivex', + 'Caelduzen', + 'Caellor', + 'Caelmira', + 'Caelnix', + 'Caelpravue', + 'Caeltapral', + 'Caeltor', + 'Caelvue', + 'Cavibequel', + 'Cavidyn', + 'Cavipramira', + 'Cetracoyl', + 'Cetrapramira', + 'Cetraprasen', + 'Cetrasen', + 'Corvamira', + 'Corvaplex', + 'Corvavia', + 'Corvazetiva', + 'Elixcomox', + 'Elixdiplex', + 'Elixnopral', + 'Elixxen', + 'Elixzen', + 'Fendafen', + 'Fendamira', + 'Fendanix', + 'Fendaol', + 'Fendasoxen', + 'Gravabedon', + 'Gravadex', + 'Gravataol', + 'Gravavex', + 'Hylodon', + 'Hyloen', + 'Hylogis', + 'Hyloin', + 'Hylotor', + 'Hylozeen', + 'Hylozen', + 'Ixendara', + 'Ixendivor', + 'Ixendutiva', + 'Ixengis', + 'Ixenin', + 'Ixenmidex', + 'Ixenvafen', + 'Ixenvifen', + 'Ixenvor', + 'Juvidara', + 'Juviin', + 'Juvinool', + 'Kesacoyl', + 'Kesaex', + 'Kesagis', + 'Kesalomox', + 'Kesamox', + 'Kesasogis', + 'Kesativa', + 'Kesavadex', + 'Kesavane', + 'Kesavidyn', + 'Kesaviyl', + 'Klargoex', + 'Klarlor', + 'Klarmitor', + 'Klarmox', + 'Klartiva', + 'Klarvavane', + 'Klarxadon', + 'Lumedara', + 'Lumein', + 'Lumemox', + 'Lumevor', + 'Lumeyl', + 'Lyralopral', + 'Lyraplex', + 'Lyrasomox', + 'Lyravane', + 'Lyravex', + 'Lyrayl', + 'Mizamira', + 'Mizaquel', + 'Mizasen', + 'Mizatadex', + 'Mizator', + 'Mizavavia', + 'Morvaplex', + 'Morvavex', + 'Neuvobemox', + 'Neuvodyn', + 'Neuvonix', + 'Neuvovex', + 'Nexanovue', + 'Nexaplex', + 'Nexaric', + 'Nuvicor', + 'Nuvidex', + 'Nuvilocor', + 'Nuviridex', + 'Nuvitamira', + 'Nuvividyn', + 'Nuvizen', + 'Ombralydon', + 'Ombrapral', + 'Ombraric', + 'Ombravane', + 'Orbaex', + 'Orbamox', + 'Orbaplex', + 'Orbapral', + 'Orbatagis', + 'Oxadara', + 'Oxadien', + 'Oxaravor', + 'Oxasovue', + 'Oxavue', + 'Praxabecor', + 'Praxayl', + 'Pyraen', + 'Pyraloquel', + 'Pyramira', + 'Pyraplex', + 'Pyraramox', + 'Pyrasosen', + 'Pyravia', + 'Quendara', + 'Quennomox', + 'Quenpraex', + 'Quentor', + 'Quenvia', + 'Quenzen', + 'Quiladon', + 'Quiladumira', + 'Quilamisen', + 'Quilativa', + 'Ravidyn', + 'Raviric', + 'Ravivex', + 'Revalor', + 'Revalydon', + 'Revapral', + 'Rexacocor', + 'Rexadon', + 'Rexaen', + 'Rexanacor', + 'Rexaplex', + 'Rovendex', + 'Rovendidex', + 'Roventiva', + 'Rovenvia', + 'Rovenzecor', + 'Solitapral', + 'Solixen', + 'Solizedyn', + 'Solvadex', + 'Solvadon', + 'Solvanaol', + 'Solvaol', + 'Solvavane', + 'Solvavisen', + 'Sonadex', + 'Sonaen', + 'Sonaex', + 'Sonagoxen', + 'Sonaprafen', + 'Sonayl', + 'Tavodufen', + 'Tavopral', + 'Tavosonix', + 'Trovadex', + 'Trovamizen', + 'Trovariin', + 'Trovasyvia', + 'Uvelmox', + 'Uvelol', + 'Uvelsyvane', + 'Uvelvivex', + 'Uvelxen', + 'Uvelzen', + 'Valocor', + 'Valopral', + 'Valovia', + 'Valozevex', + 'Valozevia', + 'Vendadon', + 'Vendafen', + 'Vendavane', + 'Vendazen', + 'Vyraen', + 'Vyraex', + 'Vyragoplex', + 'Vyrapral', + 'Vyrasypral', + 'Vyrativa', + 'Wraxalydara', + 'Wraxanopral', + 'Wraxaquel', + 'Wraxavimox', + 'Wraxavue', + 'Xelydon', + 'Xelygis', + 'Xelyol', + 'Ynovanix', + 'Ynovapramira', + 'Ynovaquel', + 'Ynovasen', + 'Ynovasovex', + 'Ynovavane', + 'Zentacor', + 'Zentalygis', + 'Zentamira', + 'Zentanix', + 'Zentavor', + 'Zentavue', + 'Zevalomira', + 'Zevaritiva', + 'Zevasen', + 'Zevataquel', + 'Zevaxanix', + 'Zivadutiva', + 'Zivafen', + 'Zivalydara', + 'Zivalyvor', + 'Zivaol', + 'Zivavia', + 'Zolnodex', + 'Zolpraxen', + 'Zolraric', + 'Zolvia', + 'Zolyl', +]; diff --git a/src/locales/en/medical/index.ts b/src/locales/en/medical/index.ts new file mode 100644 index 00000000000..60700bb3626 --- /dev/null +++ b/src/locales/en/medical/index.ts @@ -0,0 +1,26 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +import type { MedicalDefinition } from '../../../definitions'; +import allergen from './allergen'; +import blood_type from './blood_type'; +import condition from './condition'; +import department from './department'; +import drug_name from './drug_name'; +import procedure from './procedure'; +import specialty from './specialty'; +import symptom from './symptom'; + +const medical: MedicalDefinition = { + allergen, + blood_type, + condition, + department, + drug_name, + procedure, + specialty, + symptom, +}; + +export default medical; diff --git a/src/locales/en/medical/procedure.ts b/src/locales/en/medical/procedure.ts new file mode 100644 index 00000000000..bc2736c8b2e --- /dev/null +++ b/src/locales/en/medical/procedure.ts @@ -0,0 +1,107 @@ +export default [ + 'Ablation', + 'Adenoidectomy', + 'Adrenalectomy', + 'Angioplasty', + 'Appendectomy', + 'Biopsy', + 'Blood Test', + 'Bone Marrow Biopsy', + 'Bone Marrow Transplant', + 'Botulinum Toxin Injection', + 'Bronchoscopy', + 'C-Section', + 'CAR T-Cell Therapy', + 'CT Scan', + 'Cardiac Catheterization', + 'Cataract Surgery', + 'Chemical Peel', + 'Chemotherapy', + 'Cholecystectomy', + 'Cochlear Implant', + 'Colectomy', + 'Colonoscopy', + 'Colostomy', + 'Corneal Transplant', + 'Coronary Artery Bypass Graft', + 'Cryotherapy', + 'Defibrillator Implantation', + 'Dermabrasion', + 'Dialysis', + 'Echocardiogram', + 'Electrocardiogram (ECG)', + 'Electrocautery', + 'Endoscopy', + 'Epidural Injection', + 'Excision', + 'Filler Injection', + 'Flap Surgery', + 'Gallbladder Removal', + 'Gastrectomy', + 'Glaucoma Surgery', + 'Heart Transplant', + 'Hemodialysis', + 'Hernia Repair', + 'Hip Replacement', + 'Hormone Therapy', + 'Hysterectomy', + 'IVIG Infusion', + 'Ileostomy', + 'Immunotherapy', + 'Incision and Drainage', + 'Joint Aspiration', + 'Joint Injection', + 'Kidney Biopsy', + 'Kidney Transplant', + 'Knee Replacement', + 'LASIK Surgery', + 'Laser Hair Removal', + 'Liver Biopsy', + 'Liver Resection', + 'Liver Transplant', + 'Lumbar Puncture', + 'Lumpectomy', + 'Lung Transplant', + 'Lymph Node Biopsy', + 'MRI Scan', + 'Mastectomy', + 'Microdermabrasion', + 'Mole Removal', + 'Nephrectomy', + 'Nerve Block', + 'Pacemaker Insertion', + 'Pancreas Transplant', + 'Pancreatectomy', + 'Paracentesis', + 'Parathyroidectomy', + 'Peritoneal Dialysis', + 'Physical Therapy Session', + 'Plasmapheresis', + 'Prostatectomy', + 'Radiation Therapy', + 'Retinal Detachment Repair', + 'Rhinoplasty', + 'Septoplasty', + 'Sinus Surgery', + 'Skin Biopsy', + 'Skin Graft', + 'Skin Tag Removal', + 'Splenectomy', + 'Stapedectomy', + 'Stapling', + 'Stem Cell Transplant', + 'Suturing', + 'Targeted Therapy', + 'Thoracentesis', + 'Thyroidectomy', + 'Tonsillectomy', + 'Trigger Point Injection', + 'Tympanoplasty', + 'Ultrasound', + 'Vaccination', + 'Vitrectomy', + 'Wart Removal', + 'Whipple Procedure', + 'Wound Debridement', + 'X-Ray', +]; diff --git a/src/locales/en/medical/specialty.ts b/src/locales/en/medical/specialty.ts new file mode 100644 index 00000000000..fc282e754cc --- /dev/null +++ b/src/locales/en/medical/specialty.ts @@ -0,0 +1,35 @@ +export default [ + 'Allergy and Immunology', + 'Anesthesiology', + 'Cardiology', + 'Critical Care', + 'Dermatology', + 'Emergency Medicine', + 'Endocrinology', + 'Family Medicine', + 'Gastroenterology', + 'General Surgery', + 'Gynecology', + 'Hematology', + 'Infectious Disease', + 'Internal Medicine', + 'Nephrology', + 'Neurology', + 'Neurosurgery', + 'Obstetrics', + 'Oncology', + 'Ophthalmology', + 'Orthopedics', + 'Otolaryngology', + 'Pain Medicine', + 'Pathology', + 'Pediatrics', + 'Plastic Surgery', + 'Psychiatry', + 'Pulmonology', + 'Radiology', + 'Rheumatology', + 'Urology', + 'Vascular Medicine', + 'Vascular Surgery', +]; diff --git a/src/locales/en/medical/symptom.ts b/src/locales/en/medical/symptom.ts new file mode 100644 index 00000000000..a4128c1dcbb --- /dev/null +++ b/src/locales/en/medical/symptom.ts @@ -0,0 +1,280 @@ +export default [ + 'Abdominal Bloating', + 'Abdominal Pain', + 'Abdominal Swelling', + 'Abnormal Vaginal Bleeding', + 'Acne', + 'Anxiety', + 'Asymmetrical Shape', + 'Avoidance Behaviors', + 'Back Pain', + 'Balance Issues', + 'Barking Cough', + 'Blackheads', + 'Bladder Pain', + 'Bladder Spasms', + 'Bleeding', + 'Bleeding Gums', + 'Bloating', + 'Blood in Stool', + 'Blood in Urine', + 'Bloody Diarrhea', + 'Blurred Vision', + 'Bone Loss', + 'Bone Pain', + 'Bradykinesia', + 'Breast Lump', + 'Bruising', + 'Burning Sensation', + 'Cataplexy', + 'Central Vision Loss', + 'Change in Bowel Habits', + 'Changing Mole', + 'Chest Discomfort', + 'Chest Pain', + 'Chronic Cough', + 'Cloudy Urine', + 'Cognitive Changes', + 'Cognitive Difficulties', + 'Cognitive Impairment', + 'Cold Extremities', + 'Cold Hands', + 'Color Changes', + 'Color Fading', + 'Color Variation', + 'Communication Difficulties', + 'Confusion', + 'Congestion', + 'Constipation', + 'Convulsions', + 'Cough', + 'Coughing Blood', + 'Cramping', + 'Cravings', + 'Crusted Surface', + 'Cyanosis', + 'Cysts', + 'Dark Areas', + 'Dark Spots', + 'Daytime Sleepiness', + 'Decreased Breath Sounds', + 'Decreased Urine Output', + 'Delusions', + 'Depression', + 'Diameter Increase', + 'Diarrhea', + 'Difficulty Breathing', + 'Difficulty Hearing', + 'Difficulty Speaking', + 'Difficulty Swallowing', + 'Discharge', + 'Discomfort', + 'Disorganization', + 'Disorganized Thinking', + 'Distorted Vision', + 'Dizziness', + 'Double Vision', + 'Dry Cough', + 'Dry Eyes', + 'Dry Mouth', + 'Dry Skin', + 'Dysmenorrhea', + 'Ear Fullness', + 'Ear Pain', + 'Easy Bruising', + 'Edema', + 'Excess Hair Growth', + 'Excessive Daytime Sleepiness', + 'Extreme Hunger', + 'Eye Irritation', + 'Eye Pain', + 'Facial Pain', + 'Facial Pressure', + 'Facial Redness', + 'Fading Colors', + 'Fatigue', + 'Fever', + 'Flank Pain', + 'Flashbacks', + 'Floaters', + 'Fluid Drainage', + 'Forgetfulness', + 'Fragmented Sleep', + 'Frequent Infections', + 'Frequent Urination', + 'Gas', + 'Gastrointestinal Issues', + 'Glare Sensitivity', + 'Growth with Central Depression', + 'Hair Loss', + 'Hallucinations', + 'Halos Around Lights', + 'Headache', + 'Hearing Loss', + 'Heart Murmurs', + 'Heartburn', + 'Heat Intolerance', + 'Heavy Menstrual Bleeding', + 'Heavy Periods', + 'Hemarthrosis', + 'Hematuria', + 'Hemoptysis', + 'High Blood Pressure', + 'Hoarseness', + 'Hyperactivity', + 'Hypertension', + 'Hypervigilance', + 'Hypoalbuminemia', + 'Hypotension', + 'Impulsivity', + 'Inability to Maintain Erection', + 'Inattention', + 'Incomplete Emptying', + 'Incontinence', + 'Increased Appetite', + 'Increased Thirst', + 'Infertility', + 'Insomnia', + 'Involuntary Bowel Movements', + 'Involuntary Leakage', + 'Irregular Borders', + 'Irregular Heartbeat', + 'Irregular Periods', + 'Irritability', + 'Itching', + 'Itchy Eyes', + 'Jaundice', + 'Joint Pain', + 'Kidney Problems', + 'Leakage', + 'Leg Pain', + 'Light Sensitivity', + 'Lightheadedness', + 'Limited Mobility', + 'Loss of Appetite', + 'Loss of Consciousness', + 'Loss of Control', + 'Loss of Smell', + 'Loss of Taste', + 'Low Blood Pressure', + 'Mania', + 'Memory Loss', + 'Mood Swings', + 'Morning Headaches', + 'Mouth Ulcers', + 'Muffled Sounds', + 'Muscle Aches', + 'Muscle Weakness', + 'Nasal Congestion', + 'Nausea', + 'Neck Lump', + 'Neck Pain', + 'Negative Symptoms', + 'Neglect of Responsibilities', + 'Night Sweats', + 'Nightmares', + 'Nipple Discharge', + 'Nocturia', + 'Nosebleeds', + 'Numbness', + 'Open Sore', + 'Pain', + 'Pain Crises', + 'Pain During Bowel Movements', + 'Painful Intercourse', + 'Painful Urination', + 'Pale Skin', + 'Palpitations', + 'Pearly Bump', + 'Pelvic Pain', + 'Persistent Cough', + 'Persistent Pain', + 'Petechiae', + 'Photosensitivity', + 'Pimples', + 'Poor Growth', + 'Poor Night Vision', + 'Postnasal Drip', + 'Postural Instability', + 'Premature Ejaculation', + 'Prolonged Bleeding', + 'Proteinuria', + 'Pulsatile Mass', + 'Rapid Heart Rate', + 'Rapid Heartbeat', + 'Rapid Pulse', + 'Rash', + "Raynaud's Phenomenon", + 'Rectal Bleeding', + 'Recurrent Infections', + 'Red Eyes', + 'Red Patch', + 'Redness', + 'Reduced Libido', + 'Reduced Mobility', + 'Regurgitation', + 'Repetitive Behaviors', + 'Respiratory Distress', + 'Restricted Interests', + 'Rigidity', + 'Rough Red Patch', + 'Runny Nose', + 'Salty Skin', + 'Scaling', + 'Scar-Like Area', + 'Scarring', + 'Seizures', + 'Sensory Sensitivities', + 'Severe Anxiety', + 'Severe Pain', + 'Shortness of Breath', + 'Skin Rash', + 'Skin Thickening', + 'Sleep Disturbance', + 'Sleep Paralysis', + 'Sneezing', + 'Snoring', + 'Social Impairment', + "Sore That Doesn't Heal", + 'Sore Throat', + 'Spasms', + 'Speech Changes', + 'Staring Spells', + 'Stress', + 'Stridor', + 'Sudden Urge to Urinate', + 'Sweating', + 'Swelling', + 'Swelling in Legs', + 'Swollen Lymph Nodes', + 'Swollen Salivary Glands', + 'Swollen Tonsils', + 'Syncope', + 'Thickened Skin', + 'Tingling', + 'Tinnitus', + 'Tophi', + 'Tremor', + 'Uncomfortable Sensations', + 'Uncontrolled Movements', + 'Unexplained Weight Loss', + 'Urge to Move Legs', + 'Urinary Frequency', + 'Urinary Urgency', + 'Urine Leakage with Coughing', + 'Vertigo', + 'Visible Blood Vessels', + 'Vision Changes', + 'Vision Loss', + 'Vision Problems', + 'Vomiting', + 'Warmth', + 'Weak Stream', + 'Weakness', + 'Weight Gain', + 'Weight Loss', + 'Wheezing', + 'Whiteheads', + 'Widespread Pain', + 'Withdrawal Symptoms', +]; diff --git a/src/modules/medical/index.ts b/src/modules/medical/index.ts new file mode 100644 index 00000000000..20a96c9a596 --- /dev/null +++ b/src/modules/medical/index.ts @@ -0,0 +1 @@ +export * from './module'; diff --git a/src/modules/medical/module.ts b/src/modules/medical/module.ts new file mode 100644 index 00000000000..376ad5726c2 --- /dev/null +++ b/src/modules/medical/module.ts @@ -0,0 +1,132 @@ +import { ModuleBase } from '../../internal/module-base'; + +/** + * Module to generate plausible medical and healthcare related entries. + * + * ### Overview + * + * Generate plausible, non-clinical healthcare data for tests, demos, and + * fixtures: specialties, hospital departments, conditions, symptoms, + * procedures, allergens, blood types, and fictitious drug names. + * + * All values are intentionally generic or invented. Real diagnosis codes (e.g. + * ICD-10), real medicine names, and correlated patient records are deliberately + * out of scope — this data must never be used for clinical purposes. + */ +export class MedicalModule extends ModuleBase { + /** + * Returns a random medical specialty. + * + * @example + * faker.medical.specialty() // 'Cardiology' + * + * @since 10.6.0 + */ + specialty(): string { + return this.faker.helpers.arrayElement( + this.faker.definitions.medical.specialty + ); + } + + /** + * Returns a random hospital department. + * + * @example + * faker.medical.department() // 'Emergency Department' + * + * @since 10.6.0 + */ + department(): string { + return this.faker.helpers.arrayElement( + this.faker.definitions.medical.department + ); + } + + /** + * Returns a random, plausible medical condition name (without any diagnosis code). + * + * @example + * faker.medical.condition() // 'Type 2 Diabetes' + * + * @since 10.6.0 + */ + condition(): string { + return this.faker.helpers.arrayElement( + this.faker.definitions.medical.condition + ); + } + + /** + * Returns a random symptom. + * + * @example + * faker.medical.symptom() // 'Shortness of Breath' + * + * @since 10.6.0 + */ + symptom(): string { + return this.faker.helpers.arrayElement( + this.faker.definitions.medical.symptom + ); + } + + /** + * Returns a random medical procedure. + * + * @example + * faker.medical.procedure() // 'Appendectomy' + * + * @since 10.6.0 + */ + procedure(): string { + return this.faker.helpers.arrayElement( + this.faker.definitions.medical.procedure + ); + } + + /** + * Returns a random allergen. + * + * @example + * faker.medical.allergen() // 'Penicillin' + * + * @since 10.6.0 + */ + allergen(): string { + return this.faker.helpers.arrayElement( + this.faker.definitions.medical.allergen + ); + } + + /** + * Returns a random blood type. + * + * @example + * faker.medical.bloodType() // 'O+' + * + * @since 10.6.0 + */ + bloodType(): string { + return this.faker.helpers.arrayElement( + this.faker.definitions.medical.blood_type + ); + } + + /** + * Returns a fictitious, brand-style drug name. + * + * All values are invented: they were generated from neutral morphemes and + * screened against real brand names, WHO INN generic names, and INN class + * stems (e.g. `-statin`, `-pril`), so they do not resolve to real medicines. + * + * @example + * faker.medical.drugName() // 'Zolpraxen' + * + * @since 10.6.0 + */ + drugName(): string { + return this.faker.helpers.arrayElement( + this.faker.definitions.medical.drug_name + ); + } +} diff --git a/test/modules/__snapshots__/medical.spec.ts.snap b/test/modules/__snapshots__/medical.spec.ts.snap new file mode 100644 index 00000000000..9c9f0a1f5f0 --- /dev/null +++ b/test/modules/__snapshots__/medical.spec.ts.snap @@ -0,0 +1,49 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`medical > 42 > allergen 1`] = `"Gluten"`; + +exports[`medical > 42 > bloodType 1`] = `"AB+"`; + +exports[`medical > 42 > condition 1`] = `"Fibromyalgia"`; + +exports[`medical > 42 > department 1`] = `"Maternity Ward"`; + +exports[`medical > 42 > drugName 1`] = `"Lumeyl"`; + +exports[`medical > 42 > procedure 1`] = `"Glaucoma Surgery"`; + +exports[`medical > 42 > specialty 1`] = `"Infectious Disease"`; + +exports[`medical > 42 > symptom 1`] = `"Gastrointestinal Issues"`; + +exports[`medical > 1211 > allergen 1`] = `"Sulfites"`; + +exports[`medical > 1211 > bloodType 1`] = `"O-"`; + +exports[`medical > 1211 > condition 1`] = `"Thyroid Cancer"`; + +exports[`medical > 1211 > department 1`] = `"Sleep Lab"`; + +exports[`medical > 1211 > drugName 1`] = `"Zentavor"`; + +exports[`medical > 1211 > procedure 1`] = `"Tympanoplasty"`; + +exports[`medical > 1211 > specialty 1`] = `"Urology"`; + +exports[`medical > 1211 > symptom 1`] = `"Unexplained Weight Loss"`; + +exports[`medical > 1337 > allergen 1`] = `"Eggs"`; + +exports[`medical > 1337 > bloodType 1`] = `"AB+"`; + +exports[`medical > 1337 > condition 1`] = `"Crohn's Disease"`; + +exports[`medical > 1337 > department 1`] = `"Inpatient Ward"`; + +exports[`medical > 1337 > drugName 1`] = `"Ixenvafen"`; + +exports[`medical > 1337 > procedure 1`] = `"Dermabrasion"`; + +exports[`medical > 1337 > specialty 1`] = `"Gastroenterology"`; + +exports[`medical > 1337 > symptom 1`] = `"Distorted Vision"`; diff --git a/test/modules/medical.spec.ts b/test/modules/medical.spec.ts new file mode 100644 index 00000000000..9b9360c5680 --- /dev/null +++ b/test/modules/medical.spec.ts @@ -0,0 +1,82 @@ +import { describe, expect, it } from 'vitest'; +import { faker } from '../../src'; +import { seededTests } from '../support/seeded-runs'; +import { times } from '../support/times'; + +const NON_SEEDED_BASED_RUN = 5; + +describe('medical', () => { + seededTests(faker, 'medical', (t) => { + t.itEach( + 'specialty', + 'department', + 'condition', + 'symptom', + 'procedure', + 'allergen', + 'bloodType', + 'drugName' + ); + }); + + describe.each(times(NON_SEEDED_BASED_RUN).map(() => faker.seed()))( + 'random seeded tests for seed %i', + () => { + describe('specialty()', () => { + it('should return a random value from the specialty array', () => { + const actual = faker.medical.specialty(); + expect(faker.definitions.medical.specialty).toContain(actual); + }); + }); + + describe('department()', () => { + it('should return a random value from the department array', () => { + const actual = faker.medical.department(); + expect(faker.definitions.medical.department).toContain(actual); + }); + }); + + describe('condition()', () => { + it('should return a random value from the condition array', () => { + const actual = faker.medical.condition(); + expect(faker.definitions.medical.condition).toContain(actual); + }); + }); + + describe('symptom()', () => { + it('should return a random value from the symptom array', () => { + const actual = faker.medical.symptom(); + expect(faker.definitions.medical.symptom).toContain(actual); + }); + }); + + describe('procedure()', () => { + it('should return a random value from the procedure array', () => { + const actual = faker.medical.procedure(); + expect(faker.definitions.medical.procedure).toContain(actual); + }); + }); + + describe('allergen()', () => { + it('should return a random value from the allergen array', () => { + const actual = faker.medical.allergen(); + expect(faker.definitions.medical.allergen).toContain(actual); + }); + }); + + describe('bloodType()', () => { + it('should return a random value from the blood type array', () => { + const actual = faker.medical.bloodType(); + expect(faker.definitions.medical.blood_type).toContain(actual); + }); + }); + + describe('drugName()', () => { + it('should return a random value from the drug name array', () => { + const actual = faker.medical.drugName(); + expect(faker.definitions.medical.drug_name).toContain(actual); + }); + }); + } + ); +}); diff --git a/test/scripts/apidocs/__snapshots__/verify-jsdoc-tags.spec.ts.snap b/test/scripts/apidocs/__snapshots__/verify-jsdoc-tags.spec.ts.snap index 079999de55c..715e4b6b422 100644 --- a/test/scripts/apidocs/__snapshots__/verify-jsdoc-tags.spec.ts.snap +++ b/test/scripts/apidocs/__snapshots__/verify-jsdoc-tags.spec.ts.snap @@ -323,6 +323,19 @@ exports[`check docs completeness > all modules and methods are present 1`] = ` "words", ], ], + [ + "medical", + [ + "allergen", + "bloodType", + "condition", + "department", + "drugName", + "procedure", + "specialty", + "symptom", + ], + ], [ "music", [