match.rb in mesh-medical-subject-headings-1.3.0 vs match.rb in mesh-medical-subject-headings-2.0.1

- old
+ new

@@ -2,15 +2,15 @@ syllabus = [ 'Medicine', 'Anaesthetics', 'Analgesia', 'Anesthesia', 'Conscious Sedation', 'Deep Sedation', 'Neuromuscular Blockade', 'Breast', 'Breast Cyst', 'Breast Neoplasms', 'Fibrocystic Breast Disease', 'Lactation Disorders', 'Mastitis', 'Cardiology', 'Cardiovascular Diseases', 'Acute Coronary Syndrome', 'Myocardial Infarction', 'Unstable Angina', 'Cardiac Arrhythmias', 'Atrial Fibrillation', 'Atrial Flutter', 'Bradycardia', 'Heart Block', 'Long QT Syndrome', 'Tachycardia', 'Ventricular Fibrillation', 'Ventricular Flutter', 'Angina Pectoris', 'Heart Failure', 'Diastolic Heart Failure', 'Systolic Heart Failure', 'Hypertension', 'Heart Valve Diseases', 'Aortic Valve Insufficiency', 'Aortic Valve Stenosis', 'Mitral Valve Insufficiency', 'Mitral Valve Stenosis', 'Pulmonary Valve Insufficiency', 'Pulmonary Valve Stenosis', 'Tricuspid Valve Insufficiency', 'Tricuspid Valve Stenosis', 'Endocarditis', 'Pericardial Disease', 'Pericardial Effusion', 'Pericarditis', 'Cardiac Tamponade', 'Disease of Heart Muscle', 'Alcoholic Cardiomyopathy', 'Dilated Cardiomyopathy', 'Hypertrophic Cardiomyopathy', 'Restrictive Cardiomyopathy', 'Myocardial Reperfusion Injury', 'Myocarditis', 'Cardiovascular Investigations', 'Angiocardiography', 'Echocardiography', 'Electrocardiography', 'Heart Catheterization', 'Dermatology', 'Skin eruptions', 'Acne Vulgaris', 'Eczema', 'Erythroderma', 'Lichenoid Eruptions', 'Photosensitivity Disorders', 'Pityriasis', 'Psoriasis', 'Infectious Skin Diseases', 'Bacterial Skin Diseases', 'Fungal Skin Diseases', 'Bacillary Angiomatosis', 'Cellulitis', 'Cervicofacial Actinomycosis', 'Cutaneous Syphilis', 'Cutaneous Tuberculosis', 'Ecthyma', 'Erysipelas', 'Erythema Chronicum Migrans', 'Erythrasma', 'Granuloma Inguinale', 'Hidradenitis Suppurativa', 'Mycetoma', 'Necrotizing Fasciitis', 'Staphylococcal Skin Infections', 'Parasitic Skin Diseases', 'Ectoparasitic Infestations', 'Larva Migrans', 'Leishmaniasis', 'Lice Infestations', 'Onchocerciasis', 'Scabies', 'Viral Skin Diseases', 'Erythema Infectiosum', 'Exanthema Subitum', 'Herpes Simplex', 'Molluscum Contagiosum', 'Warts', 'Specific skin structure disease', 'Hair Diseases', 'Folliculitis', 'Hirsutism', 'Hypertrichosis', 'Hypotrichosis', 'Nail Diseases', 'Nail-Patella Syndrome', 'Ingrown Nails', 'Onycholysis', 'Onychomycosis', 'Pachyonychia Congenita', 'Paronychia', 'Yellow Nail Syndrome', 'Pigmentation Disorders', 'Cafe-au-Lait Spots', 'Hyperpigmentation', 'Hypopigmentation', 'Sweat Gland Diseases', 'Hidradenitis', 'Hyperhidrosis', 'Hypohidrosis', 'Prickly Heat', 'Vascular Skin Diseases', 'Livedo Reticularis', 'Purpura', 'Raynaud Disease', 'Skin Ulcer', 'Buruli Ulcer', 'Leg Ulcer', 'Pressure Ulcer', 'Pyoderma Gangrenosum', 'Telangiectasis', 'Vasculitis', 'Inherited skin disease', 'Darier Disease', 'Ehlers-Danlos Syndrome', 'Ichthyosis Vulgaris', 'Neurofibromatoses', 'Palmoplantar Keratoderma', 'Pseudoxanthoma Elasticum', 'Tuberous Sclerosis', 'Xeroderma Pigmentosum', 'Skin Neoplasms', 'Benign skin tumours', 'Keloid', 'Lipoma', 'Pyogenic Granuloma', 'Seborrheic Keratosis', 'Premalignant and malignant skin disease', 'Actinic Keratosis', 'Bowen\'s Disease', 'Nevi and Melanomas', 'Keratoacanthoma', 'Mycosis Fungoides', 'Emergency Medicine', 'Acute Abdomen', 'Bradycardia', 'Dyspnea', 'Burns', 'Chest pain', 'Coma', 'Diabetic Ketoacidosis', 'Gastrointestinal Hemorrhage', 'Hyperglycemic Hyperosmolar Nonketotic Coma', 'Hyperkalemia', 'Hypoglycemia', 'Hypotension', 'Acute Liver Failure', 'Poisoning', 'Meningitis', 'Acute Kidney Failure', 'Seizures', 'Shock', 'Stroke', 'Tachycardia', 'Resuscitation', 'Spinal Cord Compression', 'Pre-Eclampsia', 'Endocrinology', 'Thyroid Diseases', 'Euthyroid Sick Syndromes', 'Goiter', 'Hyperthyroidism', 'Hypothyroidism', 'Thyroid Dysgenesis', 'Thyroid Neoplasms', 'Thyroiditis', 'Thyrotoxicosis', 'Parathyroid Diseases', 'Hyperparathyroidism', 'Hypoparathyroidism', 'Parathyroid Neoplasms', 'Adrenal Gland Diseases', 'Adrenal Cortex Neoplasms', 'Congenital Adrenal Hyperplasia', 'Addison Disease', 'Adrenoleukodystrophy', 'Hypoaldosteronism', 'Cushing Syndrome', 'Hyperaldosteronism', 'Pituitary Diseases', 'Diabetes Insipidus', 'Hyperpituitarism', 'Hypopituitarism', 'Inappropriate ADH Syndrome', 'Pituitary Apoplexy', 'Pituitary Neoplasms', 'Diabetes Mellitus', 'Gastroenterology', 'Biliary Tract Diseases', 'Cholelithiasis', 'Cholecystitis', 'Sclerosing Cholangitis', 'Biliary Liver Cirrhosis', 'Liver Diseases', 'Liver Failure', 'Liver Cirrhosis', 'Viral, Human Hepatitis', 'Hemochromatosis', 'alpha 1-Antitrypsin Deficiency', 'Hepatolenticular Degeneration', 'Alcoholic Liver Diseases', 'Liver Neoplasms', 'Focal Nodular Hyperplasia', 'Liver Cell Adenoma', 'Hemangioma', 'Hepatocellular Carcinoma', 'Pancreatic Neoplasms', 'Gastroesophageal Reflux', 'Gastroenteritis', 'Gastrointestinal Hemorrhage', 'Gastrointestinal Neoplasms', 'Ulcerative Colitis', 'Crohn Disease', 'Peptic Ulcer', 'Pancreatitis', 'General Practice', 'Analgesia', 'Breast Neoplasms', 'Hypertension', 'Heart Failure', 'Atrial Fibrillation', 'Skin eruptions', 'Infectious Skin Diseases', 'Skin Neoplasms', 'Diabetes Mellitus', 'Gastroesophageal Reflux', 'Gastroenteritis', 'Anaemia', 'Headache', 'Dementia', 'Failure to Thrive', 'Asthma', 'Chronic Obstructive Pulmonary Disease', 'Depression', 'Anxiety Disorders', 'Arthritis', 'Haematology', 'Anaemia', 'Leukaemia', 'Myeloid, Acute Leukaemia', 'Myeloid Leukemia, Chronic', 'Acute Lymphoblastic Leukemia', 'Chronic Lymphoblastic Leukemia', 'Myeloproliferative Disorders', 'Erythroblastic, Acute Leukaemia', 'Polycythemia Vera', 'Primary Myelofibrosis', 'Thrombocythemia', 'Blood Coagulation Disorders', 'Hemophilia A', 'Hemophilia B', 'Thrombocytopenic Purpura', 'Von Willebrand Diseases', 'Lymphoma', 'Hodgkin Disease', 'Non-Hodgkin Lymphoma', 'Paraproteinemias', 'Multiple Myeloma', 'Cryoglobulinemia', 'Waldenstrom Macroglobulinemia', 'Infectious Diseases', 'Virus Diseases', 'Viral, Human Hepatitis', 'Cytomegalovirus Infections', 'Poxviruses', 'Viral Hemorrhagic Fevers', 'HIV Infections', 'Bacterial diseases', 'Mycobacterium tuberculosis', 'Mycobacterium leprae', 'Diphtheria', 'Tetanus', 'Typhoid Fever', 'Cholera', 'Shigella', 'Parasicitc and protazoa infections', 'Malaria', 'Amoebiasis', 'Giardiasis', 'Toxoplasmosis', 'Cryptosporidiosis', 'Leishmaniasis', 'Trypanosomiasis', 'Lyme Disease', 'Filariasis', 'Schistosomiasis', 'Neurology', 'Trigeminal Neuralgia', 'Headache', 'Dizziness', 'Vertigo', 'Stroke', 'Parkinsonian Disorders', 'Multiple Sclerosis', 'Motor Neuron Disease', 'Epilepsy', 'Cranial Nerve Diseases', 'Meningitis', 'Nervous System Neoplasms', 'Dementia', 'Oncology and palliative care', 'Lung Neoplasms', 'Breast Neoplasms', 'Prostatic Neoplasms', 'Colorectal Neoplasms', 'Liver Neoplasms', 'Pancreatic Neoplasms', 'Palliative Care', 'Analgesia', 'Ophthalmology', 'Conjunctivitis', 'Retinal Hemorrhage', 'Vitreous Hemorrhage', 'Viral Conjunctivitis', 'Herpetic Keratitis', 'Eye Injuries', 'Cataract', 'Glaucoma', 'Ocular Motility Disorders', 'Orbital Diseases', 'Refractive Errors', 'Retinal Diseases', 'Paediatrics', 'Neonatology', 'Paediatric Infections', 'Measles', 'Rubella', 'Mumps', 'Chickenpox', 'Paediatric Diseases', 'Cystic Fibrosis', 'Asthma', 'Endocarditis', 'Rheumatic Fever', 'Coeliac Disease', 'Chromosome Disorders', 'Diabetes Mellitus', 'Meningococcal Meningitis', 'Febrile Seizures', 'Mental Disorders Diagnosed in Childhood', 'Failure to Thrive', 'Psychiatry', 'Depression', 'Anxiety Disorders', 'Bipolar Disorder', 'Schizophrenia', 'Psychotic Disorders', 'Deliberate Self-Harm', 'Eating Disorders', 'Substance-Related Disorders', 'Personality Disorders', 'Radiology', 'Angiography', 'Mammography', 'Abdominal Radiography', 'Interventional Radiography', 'Thoracic Radiography', 'X-Ray Tomography', 'Respiratory Medicine', 'Pneumonia', 'Bronchiectasis', 'Cystic Fibrosis', 'Fungal Lung Diseases', 'Lung Neoplasms', 'Asthma', 'Chronic Obstructive Pulmonary Disease', 'Respiratory Insufficiency', 'Pneumothorax', 'Pleural Effusion', 'Sarcoidosis', 'Extrinsic Allergic Alveolitis', 'Mesothelioma', 'Idiopathic Pulmonary Fibrosis', 'Obstructive Sleep Apnea', 'Pulmonary oedema', 'Rheumatology', 'Rheumatoid Arthritis', 'Osteoarthritis', 'Fibromyalgia', 'Gout', 'Osteoarthritis', 'Polymyalgia Rheumatica', 'Rheumatic Fever', 'Spondylarthropathies', 'Connective Tissue Diseases', 'Vasculitis', 'Renal Medicine', 'Acute Kidney Failure', 'Chronic Renal Insufficiency', 'Kidney Neoplasms', 'Glomerulonephritis', 'Anti-Glomerular Basement Membrane Disease', 'IGA Glomerulonephritis', 'Membranoproliferative Glomerulonephritis', 'Membranous Glomerulonephritis', 'Focal Segmental Glomerulosclerosis', 'Nephrotic Syndrome', 'Minimal Change Disease', 'Urinary Tract Infections', 'Nephrolithiasis', 'Cystic Kidney Diseases', 'Renal Osteodystrophy', 'Water-Electrolyte Imbalance', 'Specialties, Surgical', 'Ophthalmology', 'Conjunctivitis', 'Retinal Hemorrhage', 'Vitreous Hemorrhage', 'Viral Conjunctivitis', 'Herpetic Keratitis', 'Eye Injuries', 'Cataract', 'Glaucoma', 'Ocular Motility Disorders', 'Orbital Diseases', 'Refractive Errors', 'Retinal Diseases', 'Breast', 'Breast Cyst', 'Breast Neoplasms', 'Fibrocystic Breast Disease', 'Lactation Disorders', 'Mastitis', 'Orthopaedics and Trauma', 'Hip Dislocation', 'Hip Fractures', 'Radius Fractures', 'Ulna Fractures', 'Shoulder Dislocation', 'Shoulder Fractures', 'Spinal Injuries', 'Carpal Tunnel Syndrome', 'Cauda Equina', 'Osteomyelitis', 'Obstetrics', 'Eclampsia', 'Spontaneous Abortion', 'Gestational Diabetes', 'Obstetric Labour Complications', 'Abruptio Placentae', 'Breech Presentation', 'Cephalopelvic Disproportion', 'Dystocia', 'Premature Rupture Fetal Membranes', 'Premature Obstetric Labour', 'Placenta Previa', 'Postpartum Hemorrhage', 'Uterine Inversion', 'Uterine Rupture', 'Vasa Previa', 'Ectopic Pregnancy', 'Gynaecology', 'Hysterectomy', 'Menorrhagia', 'Polycystic Ovary Syndrome', 'Induced Abortion', 'Ectopic Pregnancy', 'Contraception', 'Ovarian Diseases', 'Endometrial Neoplasms', 'Ovarian Neoplasms', 'Female Genital Neoplasms', 'Fallopian Tube Neoplasms', 'Ovarian Neoplasms', 'Uterine Neoplasms', 'Vaginal Neoplasms', 'Vulvar Neoplasms', 'Ear nose and throat (ENT)', 'Cholesteatoma', 'Otitis Media', 'Deafness', 'Epistaxis', 'Nasal Polyps', 'Tonsillar Neoplasms', 'Hoarseness', 'Lumps in the neck', 'Maxillofacial', 'Jaw Fractures', 'Mandibular Injuries', 'Orbital Fractures', 'Zygomatic Fractures', 'Plastic surgery', 'Surgical Flaps', 'Burns', 'Hand Injuries', 'Suture Techniques', 'Breast Reconstruction', 'Urology', 'Urolithiasis', 'Prostatic Hyperplasia', 'Urethral Obstruction', 'Penile Diseases', 'Prostatic Neoplasms', 'Urinary Bladder Neoplasms', 'Testicular Neoplasms', 'Urinary Retention', 'Cardiothoracic surgery', 'Pulmonary Surgical Procedures', 'Cardiac Surgical Procedures', 'Vascular surgery', 'Varicose Veins', 'Arterial Occlusive Diseases', 'Peripheral Vascular Diseases', 'Embolism and Thrombosis', 'Compartment Syndromes', 'Aortic Diseases', 'Aneurysm', 'Carotid Endarterectomy', 'Paediatric Surgery', 'Gastroschisis', 'Hernia', 'Pyloric Stenosis', 'Esophageal Atresia', 'Biliary Atresia', 'Hirschsprung Disease', 'Intussusception', 'Intestinal Volvulus', 'Umbilical Hernia', 'Spermatic Cord Torsion', 'Cryptorchidism', 'Appendicitis', 'General surgery', 'Appendicitis', 'Hernia', 'Hemorrhoids', 'Peritonitis', 'Crohn Disease', 'Ulcerative Colitis', 'Colorectal Neoplasms', 'Esophageal Neoplasms', 'Diverticular disease', 'Cholelithiasis', 'Basic Sciences', 'Anatomy', 'Musculoskeletal System', 'Cardiovascular System', 'Respiratory System', 'Digestive System', 'Peripheral Nervous System', 'Central Nervous System', 'Physiology', 'Cardiovascular Physiology', 'Respiratory Physiology', 'Musculoskeletal Physiology', 'Digestive Physiology', 'Nervous System Physiology', 'Biochemistry', 'Histology', 'Pharmacology', 'Epidemiology', 'Statistics', 'Embryology', 'Sociology', 'Pathology', 'Immunology and Microbiology', 'Ethics and Law', 'Clinical Skills', 'Examination skills', 'Musculoskeletal Examination', 'Cardiovascular Examination', 'Respiratory Examination', 'Abdominal Examination', 'Neurological Examination', 'Cranial nerve examination', 'Motor system examination', 'Sensory system examination', 'Breast Examination', 'Thyroid Examination', 'Otoscopic Examination', 'Gynaecological Examination', 'Antenatal Examination', 'Opthalmoscopy', 'Practical procedures', 'Venipuncture', 'Cannulation', 'Arterial Blood Gas', 'Urinary Catheterization', 'Subcutaneous Injections', 'Intramuscular Injections', 'Lumbar Puncture', 'Nasogastric Tubes', 'Pleural Tap', 'Paracentesis', 'Chest Drain Insertion', 'Central Line', 'Spirometry' ] -MESH::Mesh.configure(filename: 'data/mesh_data_2014/d2014.bin.gz') +MESH::Heading.configure(filename: 'data/mesh_data_2014/d2014.bin.gz') syllabus.each do |si| - if mh = MESH::Mesh.find_by_original_heading(si) + if mh = MESH::Heading.find_by_original_heading(si) puts "#{si}\t1\t#{mh.inspect}\t#{mh.shallowest_position unless mh.nil?}\t#{mh.deepest_position unless mh.nil?}" - elsif matches = MESH::Mesh.match_in_text(si) + elsif matches = MESH::Heading.match_in_text(si) topical_matches = matches.map do |m| if m[:heading].descriptor_class == :topical_descriptor "#{m[:heading].inspect}, #{m[:heading].shallowest_position}, #{m[:heading].deepest_position}" end end