From d43c2c95cdf48976c21f6b737f5efb432c69705b Mon Sep 17 00:00:00 2001 From: Edward Lu Date: Wed, 19 Apr 2023 05:01:22 -0400 Subject: [PATCH] Add all tox reports data to data distributions page --- .../src/schema-typing/12-tox_reports.sql | 584 ++++++++++++++++++ 1 file changed, 584 insertions(+) diff --git a/data-processor/src/schema-typing/12-tox_reports.sql b/data-processor/src/schema-typing/12-tox_reports.sql index 801bdb6a..41257fe1 100644 --- a/data-processor/src/schema-typing/12-tox_reports.sql +++ b/data-processor/src/schema-typing/12-tox_reports.sql @@ -1,4 +1,7 @@ DROP TABLE IF EXISTS tox_reports; +DROP TABLE IF EXISTS tox_reports1; +DROP TABLE IF EXISTS tox_reports2; +DROP TABLE IF EXISTS tox_reports3; CREATE TABLE tox_reports ( "ACCT_NUM" CHARACTER(5) CHECK(length(acct_num) = 5), @@ -68,4 +71,585 @@ INSERT INTO tox_reports END FROM tox_reports_raw; +CREATE TABLE tox_reports1 AS SELECT + "ACCT_NUM", + "REQ_FC_NUM", + "_NAME_", + "Norfentanyl", + "Meprobamate", + "______No_Testing_Performed", + "BARBITURATES", + "SYNTHETIC_CANNABINOIDS", + "Caffeine", + "MUSCLE_RELAXANTS", + "GASTROINTESTINALS", + "VOLATILES", + "Hydroxyzine", + "Oxycodone", + "Methanol", + "ANTIDIABETICS", + "Cotinine", + "ANTIFUNGALS", + "NOVEL_PSYCHOACTIVES", + "Alprazolam", + "Phencyclidine__PCP_", + "Morphine", + "O_Desmethyltramadol", + "Acetaminophen", + "HALLUCINOGENS", + "Acetone", + "CANNABINOIDS", + "MISCELLANEOUS", + "SEDATIVE_HYPNOTICS", + "ANESTHETICS", + "ANTIHISTAMINES", + "Isopropanol", + "ANTIPSYCHOTICS", + "DESIGNER_OPIOIDS", + "Nicotine", + "AMPHETAMINES", + "ANTICONVULSANTS", + "ANTICHOLINERGICS", + "ANTIDEPRESSANTS", + "Amphetamine", + "BENZODIAZEPINES", + "OPIOID_ANALGESICS", + "STIMULANTS", + "Hydrocodone", + "Ethanol", + "Diphenhydramine", + "Methamphetamine", + "Hydromorphone", + "Oxazepam", + "a_OH_Alprazolam", + "ANALGESICS", + "Oxymorphone", + "UROLOGICALS", + "MDMA", + "_7_Aminoclonazepam", + "_6_Monoacetylmorphine", + "CARDIOVASCULARS", + "EDDP", + "Fentanyl", + "Methadone", + "Benzoylecgonine", + "Codeine", + "Norbuprenorphine", + "Nordiazepam", + "Gabapentin", + "Lorazepam", + "Buprenorphine", + "Tramadol", + "Temazepam", + "THC_COOH", + "Delta_9_THC", + "__SUBMITTING_COUNTY_", + "__CORONER_", + "Carboxyhemoglobin", + "Cancelled_Order_Code_", + "Cancellation_Reason_", + "__Date_of_Birth_", + "Sertraline", + "Paroxetine", + "Amlodipine", + "Desmethylsertraline", + "Diazepam", + "Dextromethorphan", + "Levetiracetam", + "Acetylfentanyl", + "_4_ANPP", + "Naloxone", + "Olanzapine", + "Flubromazolam", + "Midazolam", + "Salicylic_Acid", + "Metoprolol", + "Ibuprofen", + "Pseudoephedrine", + "Pregabalin", + "Fluorofentanyl", + "Acrylfentanyl", + "NOVEL_EMERGING_SUBSTANCES", + "Naproxen", + "__Volatile_Testing_Not_Perfo", + "Trazodone", + "Quinidine_Quinine", + "Xylazine", + "Propranolol", + "Aripiprazole", + "Citalopram", + "Flurazepam", + "Warfarin", + "meta_Chlorophenylpiperazine", + "Promethazine", + "Norfluoxetine", + "NITAZENE_ANALOG_PANEL", + "Protonitazene", + "Bupropion", + "Metonitazene", + "Buspirone__BuSpar__", + "Cyclobenzaprine", + "Lamotrigine", + "Fluoxetine", + "Dihydrocodeine", + "Phenylpropanolamine", + "Ephedrine", + "Metoclopramide", + "Theophylline", + "Donepezil", + "Creatinine", + "Potassium", + "Glucose", + "Sodium", + "Chloride", + "Urea_Nitrogen", + "Carfentanil", + "Mephedrone", + "Butyrylfentanyl", + "Flualprazolam", + "Eutylone", + "_25B_NBOMe", + "_25C_NBOMe", + "Dimethylone", + "Methcathinone", + "cis_3_Methylfentanyl", + "Etizolam", + "_5_MeO_DALT", + "Ethylone", + "Clonazolam", + "_2C_I", + "_2C_E", + "Methylone", + "_6_Beta_Naltrexol", + "Adinazolam", + "Ocfentanil", + "Butylone", + "Tetrahydrofuranfentanyl", + "MDMB_4en_PINACA_Metabolite", + "_5F_MDMB_PICA_Metabolite", + "_2C_B", + "Methoxetamine", + "MDPV", + "Cyclopropylfentanyl", + "Dibutylone", + "_25I_NBOMe", + "TFMPP", + "N_ethylpentylone", + "Methoxyacetylfentanyl", + "Alpha_PVP", + "_4F_MDMB_BICA_Metabolite", + "U47700", + "Naltrexone", + "Betahydroxythiofentanyl", + "Parafluorobutyrylfentanyl", + "Methedrone", + "Furanylfentanyl", + "Pentylone", + "Quetiapine", + "Amiodarone", + "Lidocaine", + "Promazine", + "Trihexyphenidyl", + "Desmethylclomipramine", + "Thioridazine", + "Propoxyphene", + "Norpropoxyphene", + "N_Acetylprocainamide", + "Ketoconazole", + "Gamma_Hydroxybutyrate__GHB_", + "Estazolam__ProSom__", + "Norketamine", + "Ketamine", + "INHALANTS_PANEL", + "_1_1_Difluoroethane", + "_1_1_1_2_Tetrafluoroethane", + "Topiramate", + "HALOCARBONS", + "HYDROCARBON_GASES", + "Nifedipine", + "_9_Hydroxyrisperidone", + "Desmethyldoxepin", + "Doxepin", + "FENTANYL_METABOLITE", + "Cocaine", + "Cocaethylene" +FROM tox_reports_raw; + +CREATE TABLE tox_reports2 AS SELECT + "ACCT_NUM", + "Doxylamine", + "_6_Acetylmorphine", + "DESIGNER_OPIOIDS_PANEL", + "Etonitazene", + "Isotonitazene", + "Etodesnitazene", + "Metodesnitazene", + "Butonitazene", + "Flunitazene", + "Isotodesnitazene", + "N_Pyrrolidino_Etonitazene", + "Loperamide", + "Etomidate", + "Tapentadol", + "Haloperidol", + "Primidone", + "Ziprasidone__Geodon__", + "Furosemide", + "Phenacetin", + "Dicyclomine", + "Zopiclone", + "Clonazepam", + "Amitriptyline", + "Nortriptyline", + "Levamisole", + "O_Desmethylvenlafaxine", + "Demoxepam", + "ADB_4en_PINACA", + "_4_cyano_CUMYL_BINACA", + "ADB_BINACA", + "_4_fluoro_MDMB_BINACA", + "Prochlorperazine", + "Prochlorperazine__Quan", + "Clozapine", + "Norclozapine", + "Venlafaxine", + "Duloxetine", + "Chlorpromazine", + "Zolpidem", + "Atomoxetine__Strattera__", + "Orphenadrine", + "Mirtazapine", + "MDA", + "Phenytoin", + "Phentermine", + "Atenolol", + "Mitragynine", + "Methylphenidate", + "ETHYLENE_GLYCOL", + "Oxcarbazepine_Metabolite", + "Benzocaine", + "Memantine", + "_5F_ADB", + "FUB_AMB", + "MDMB_FUBINACA", + "MDMB_FUBINACA_Metabolite", + "FUB_144", + "_5F_MDMB_PICA", + "_5F_ADB_Metabolite", + "_4CN_CUMYL_BINACA", + "ADB_FUBINACA", + "_4F_MDMB_BINACA", + "Dextrorphan_Levorphanol", + "Chlorpheniramine", + "Clonidine", + "Tadalafil", + "Zonisamide", + "Tetrahydrozoline", + "Hydrochlorothiazide", + "Butalbital", + "Bupivacaine", + "Phenobarbital", + "Procainamide", + "Sildenafil", + "Strychnine", + "Brorphine", + "AP_237", + "N_Desmethylsildenafil", + "Chlordiazepoxide", + "Glipizide", + "Lacosamide", + "Bisoprolol", + "Furanyl_Fentanyl", + "U_47700", + "Diltiazem", + "Salicylates", + "Guaifenesin", + "IRON", + "CARBON_MONOXIDE", + "Risperidone", + "Phencyclidine", + "Carisoprodol", + "Buspirone", + "_10_Hydroxycarbazepine", + "Fluphenazine__Prolixin__", + "Diphenoxylate", + "METHADONE_METABOLITE", + "Desmethylloperamide", + "Atomoxetine", + "Benztropine", + "Medazepam", + "Maprotiline", + "Metoprolol__Lopressor__", + "Citalopram_Escitalopram", + "_5_fluoro_MDMB_PICA", + "Pentobarbital", + "Secobarbital", + "Amobarbital", + "Butabarbital", + "THC", + "Loperamide__Imodium__", + "Sotalol", + "Hydroxyzine__Vistaril__", + "Norsertraline", + "Ketamine__Ketalar__", + "___Investigator_", + "Pregabalin__Lyrica__", + "Chlorophenylpiperazine", + "MDA__MDMA_Metabolite_", + "Lysergic_Acid_Diethylamide", + "Quinine", + "FUB_AMB___AB_FUBINACA", + "_5_fluoro_ADB", + "Hydroxybupropion", + "Phenytoin__Dilantin__", + "Imipramine", + "Desipramine", + "Delorazepam", + "Diclazepam", + "Eszopiclone__Lunesta__", + "ANALYSIS_METHOD_", + "FINDINGS_", + "TRACE_SUBSTANCE_ANALYSIS", + "SPECIMEN_RECEIVED_", + "Phenylethylmalonamide__PEMA_", + "Ropivacaine", + "Labetalol", + "Diltiazem__Cardizem__", + "Methyl_Ethyl_Ketone", + "Methyl_Isobutyl_Ketone", + "KETONE_PANEL", + "Cyclohexanone", + "Methyl_n_Butyl_Ketone", + "Itraconazole", + "SELENIUM", + "LEAD", + "MERCURY", + "METALS___ACUTE_POISONING", + "THALLIUM", + "ARSENIC", + "BISMUTH", + "ANTIMONY", + "Nortramadol", + "Risperidone__Risperdal__", + "Difluoroethane", + "Verapamil", + "Suvorexant", + "Lidocaine__Xylocaine__", + "FLUNITRAZEPAM__Rohypnol_", + "Vecuronium__Norcuron_", + "Mivacurium_Hydrolysis_Produc", + "Tubocurarine", + "Normeperidine", + "Rucuronium__Zemuron_", + "Atricurium_Cisatricurium_Hyd", + "Succinylmonocholine__Metabol", + "Doxacurium__Nuromax_", + "Meperidine", + "NEUROMUSCULAR_BLOCKING_AGENT", + "Bretylium", + "Laudanosine", + "Doxacurium_Hydrolysis_Produc", + "Succinylcholine__Suxamethoni", + "Pancuronium__Pavulon_", + "COCAINE___METABOLITES", + "Yohimbine", + "PMA", + "Norpseudoephedrine", + "Tiletamine", + "Lysergic_Acid_Diethylamide_", + "Levorphanol__Levo_Dromoran__", + "OPIATES", + "Toluene", + "PALIPERIDONE", + "Salvinorin_B", + "Nordoxepin", + "Carbamazepine", + "Carbamazepine_Epoxide", + "Glyburide", + "Mesoridazine", + "Thioridazine__Mellaril__", + "Indomethacin", + "Etomidate__Amidate__", + "Flecainide", + "Zaleplon__Sonata__", + "Dextro_Levo_Methorphan", + "_3_Methoxy_PCP", + "Acetyl_Fentanyl", + "Valeryl_Fentanyl", + "Butyrl_Fentanyl_Isobutyryl_F" +FROM tox_reports_raw; + +CREATE TABLE tox_reports3 AS SELECT + "ACCT_NUM", + "ZOLPIDEM__Ambien_", + "Glyburide__DiaBeta__", + "Nalbuphine", + "Desmethyltrimipramine", + "Zaleplon", + "Fluvoxamine", + "Reserpine", + "Amoxapine", + "Disopyramide", + "U_49900", + "Carbamazepine_10_11_epoxide", + "Fluphenazine", + "ortho_Fluoro_Fentanyl", + "_1_Hydroxymidazolam", + "Alprenolol", + "Methaqualone", + "ADB_CHMINACA", + "Vardenafil", + "Bromazepam", + "Sufentanil", + "CUMYL_THPINACA", + "Alfentanil", + "Voriconazole", + "U_51754", + "Iloperidone", + "Clomipramine", + "TRAMADOL_METABOLITE", + "Zolpidem_4_Phenyl_COOH", + "Zolpidem__Ambien__", + "ZOLPIDEM_METABOLITE", + "Glimepiride", + "Methocarbamol", + "Phenazepam", + "Desalkylflurazepam", + "Pheniramine", + "p_Methylmethoxyacetyl_Fentan", + "Loxapine", + "m_Methylmethoxyacetyl_Fentan", + "Ziprasidone", + "Lithium", + "n_Propanol__n_Propyl_Alcohol", + "Volatiles__Hydrocarbons", + "Isopropanol__Isopropyl_Alcoh", + "Methyl_Isobutyl_Ketone__MIBK", + "Ethanol__Ethyl_Alcohol_", + "Acetaldehyde", + "Pentane", + "Methyl_Acrylate", + "Ethyl_Benzene", + "n_Hexane", + "Methanol__Methyl_Alcohol_", + "Diethyl_Ether", + "n_Heptane", + "Styrene__Vinylbenzene_", + "Xylenes__o_m_p_", + "Ethyl_Acetate", + "Methyl_Ethyl_Ketone__MEK_", + "Benzene", + "Methylpentanes__2__and_3__Is", + "n_Butanol__Butyl_Alcohol_", + "Methyl_Tertiary_Butyl_Ether", + "Flunitrazolam", + "Flubromazepam", + "Nitrazolam", + "Alpha_Hydroxyetizolam", + "Triprolidine", + "_3_Hydroxy_PCP", + "Brompheniramine", + "Mescaline", + "Pyrilamine", + "N_Ethyl_Pentylone", + "Psilocin", + "Atropine", + "Diphacinone", + "Chlorophacinone", + "Dicumarol", + "Bromadiolone", + "Brodifacoum", + "Difenacoum", + "Desmethyltramadol", + "Amiodarone__Cordarone__", + "Desethylamiodarone", + "Fentanyl__Vitreous", + "BARBITURATE_PANEL", + "SPECIAL_REQUEST", + "Methemoglobin", + "Betaxolol", + "Loratadine", + "Lacosamide__Vimpat__", + "Baclofen", + "Clenbuterol", + "Norethandrolone_Metabolite", + "Methandrostenolone", + "Clostebol", + "Oxymetholone_Metabolite", + "Turinabol", + "Clostebol_Metabolite", + "Testosterone", + "Norandrostenedione", + "Stanozolol_Metabolite", + "Epitestosterone", + "Norethindrone", + "Boldenone", + "Norethandrolone", + "Nandrolone", + "Probenecid", + "ANABOLIC_STEROIDS", + "Stanozolol", + "Methyltestosterone", + "Tetrahydrogestrinone", + "T_EpiT_Ratio", + "Methandrostenolone_Metabolit", + "Nandrolone_Metabolite", + "Oxandrolone", + "Fluoxymesterone", + "Methenolone", + "Trenbolone_Metabolite", + "Bolasterone", + "Drostanolone_Metabolite", + "CYANIDE", + "Oxybutynin", + "Hydroxychloroquine", + "Amlodipine__Norvasc__", + "Albuterol", + "Mexiletine", + "Chlorothiazide", + "Magnesium", + "Pentazocine", + "Trimipramine", + "Esmolol", + "Timolol", + "Cyclizine", + "Brompheniramine__Drixoral__", + "Metformin", + "Nitrous_Oxide", + "_5F_ADB_Butanoic_Acid_Metabol", + "Disposal_Date___1yr__", + "MDMB_FUBINACA_Butanoic_Acid", + "Valproic_Acid", + "Propofol", + "SPECIMEN_NUM", + "PLACE_HOLDER", + "FIRST_NAME", + "MIDDLE_NAME", + "LAST_NAME", + "GENDER", + "COLLECT_DATE", + "RECEIVED_DATE", + "LAST_REPORT_DATE", + "DATE_OF_DEATH", + "PERFORMING_LOCATION", + "PERFORMING_LOCATION_NAME", + "LOCATION_ADDRESS_1", + "LOCATION_ADDRESS_2", + "LOCATION_CITY", + "LOCATION_STATE", + "LOCATION_ZIP", + "LOCATION_PHONE", + "DOD", + "month", + "year", + "Quarter", + "SUNMITTING_COUNTYU", + "CORONER_U", + "County", + "Coroner" +FROM tox_reports_raw; + CREATE INDEX tox_reports_fk ON tox_reports("ACCT_NUM"); +CREATE INDEX tox_reports1_fk ON tox_reports1("ACCT_NUM"); +CREATE INDEX tox_reports2_fk ON tox_reports2("ACCT_NUM"); +CREATE INDEX tox_reports3_fk ON tox_reports3("ACCT_NUM");