-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.clinical_tier1_exposure_r2`
(
  Component STRING OPTIONS(description="Category of metadata (e.g. Diagnosis, Biospecimen, scRNA-seq Level 1, etc.); provide the same one for all items/rows."),
  HTAN_Participant_ID STRING OPTIONS(description="HTAN ID associated with a patient based on HTAN ID SOP (eg HTANx_yyy )"),
  Start_Days_from_Index STRING OPTIONS(description="Number of days from the date of birth (index date) to the date of an event (e.g. exposure to environmental factor, treatment start, etc.). If not applicable please enter 'Not Applicable'"),
  Smoking_Exposure STRING OPTIONS(description="Indicate if individual has smoking exposure"),
  Alcohol_Exposure STRING OPTIONS(description="Indicate if individual has alcohol exposure"),
  Asbestos_Exposure STRING OPTIONS(description="The yes/no/unknown indicator used to describe whether the patient was exposed to asbestos."),
  Coal_Dust_Exposure STRING OPTIONS(description="The yes/no/unknown indicator used to describe whether a patient was exposed to fine powder derived by the crushing of coal."),
  Environmental_Tobacco_Smoke_Exposure STRING OPTIONS(description="The yes/no/unknown indicator used to describe whether a patient was exposed to smoke that is emitted from burning tobacco, including cigarettes, pipes, and cigars. This includes tobacco smoke exhaled by smokers."),
  Radon_Exposure STRING OPTIONS(description="The yes/no/unknown indicator used to describe whether the patient was exposed to radon."),
  Respirable_Crystalline_Silica_Exposure STRING OPTIONS(description="The yes/no/unknown indicator used to describe whether a patient was exposured to respirable crystalline silica, a widespread, naturally occurring, crystalline metal oxide that consists of different forms including quartz, cristobalite, tridymite, tripoli, ganister, chert and novaculite."),
  Pack_Years_Smoked STRING OPTIONS(description="Numeric computed value to represent lifetime tobacco exposure defined as number of cigarettes smoked per day x number of years smoked divided by 20."),
  Years_Smoked STRING OPTIONS(description="Numeric value (or unknown) to represent the number of years a person has been smoking."),
  Alcohol_Days_Per_Week STRING OPTIONS(description="Numeric value used to describe the average number of days each week that a person consumes an alcoholic beverage."),
  Alcohol_Drinks_Per_Day STRING OPTIONS(description="Numeric value used to describe the average number of alcoholic beverages a person consumes per day."),
  Alcohol_History STRING OPTIONS(description="A response to a question that asks whether the participant has consumed at least 12 drinks of any kind of alcoholic beverage in their lifetime."),
  Alcohol_Intensity STRING OPTIONS(description="Category to describe the patient's current level of alcohol use as self-reported by the patient."),
  Alcohol_Type STRING OPTIONS(description="Type of alcohol use"),
  Cigarettes_per_Day STRING OPTIONS(description="The average number of cigarettes smoked per day."),
  Smoking_Frequency STRING OPTIONS(description="The text term used to generally decribe how often the patient smokes."),
  Secondhand_Smoke_as_Child STRING OPTIONS(description="The text term used to indicate whether the patient was exposed to secondhand smoke as a child."),
  Smoke_Exposure_Duration STRING OPTIONS(description="Text term used to describe the length of time the patient was exposed to an environmental factor."),
  Type_of_Smoke_Exposure STRING OPTIONS(description="The text term used to describe the patient's specific type of smoke exposure."),
  Marijuana_Use_Per_Week STRING OPTIONS(description="Numeric value that represents the number of times the patient uses marijuana each day."),
  Tobacco_Use_per_Day STRING OPTIONS(description="Numeric value that represents the number of times the patient uses tobacco each day."),
  Smokeless_Tobacco_Quit_Age STRING OPTIONS(description="Smokeless tobacco quit age"),
  Time_Between_Waking_and_First_Smoke STRING OPTIONS(description="The text term used to describe the approximate amount of time elapsed between the time the patient wakes up in the morning to the time they smoke their first cigarette."),
  Tobacco_Smoking_Onset_Year STRING OPTIONS(description="The year in which the participant began smoking."),
  Tobacco_Smoking_Quit_Year STRING OPTIONS(description="The year in which the participant quit smoking."),
  Tobacco_Smoking_Status STRING OPTIONS(description="Category describing current smoking status and smoking history as self-reported by a patient"),
  Type_of_Tobacco_Used STRING OPTIONS(description="The text term used to describe the specific type of tobacco used by the patient."),
  COVID19_Occurrence_Indicator STRING OPTIONS(description="The indicator that describes whether or not a COVID-19 infectious disorder occurred."),
  COVID19_Current_Status STRING OPTIONS(description="The patient's current COVID-19 status of sign or symptom events or interventions"),
  COVID19_Positive_Lab_Test_Indicator STRING OPTIONS(description="The indicator that describes whether or not there was a COVID-19 positive test result."),
  COVID19_Antibody_Testing STRING OPTIONS(description="Text term that demonstrates the test results of immunoglobulin M (IgM) and immunoglobulin G (IgG) antibodies to the SARS-CoV-2 virus in subject serum samples."),
  COVID19_Complications_Severity STRING OPTIONS(description="Text term that retrospectively indicates the worst complications during COVID-19 infectious disorder in the patient."),
  COVID19_Cancer_Treatment_Followup STRING OPTIONS(description="Indicator that describes if cancer treatment was modified for the patient due to COVID-19 infectious disorder"),
  Ecig_vape_use STRING OPTIONS(description="Use of non-traditional cigarette nicotine delivery device (electronic cigarette, ENDS - electronic nicotine delivery system)"),
  Ecig_vape_30_day_use_num STRING OPTIONS(description="Number of days e-cigarettes or vaping device was used in the last 30 days"),
  Ecig_vape_times_per_day STRING OPTIONS(description="e-cig frequency of use (times per day—one “time” consists of around 15 puffs or lasts around 10 minutes)"),
  Type_of_smoke_exposure_cumulative_years STRING OPTIONS(description="The number of cumulative years of the patient's specific type of smoke exposure"),
  Chewing_tobacco_daily_use_count STRING OPTIONS(description="The quantity of daily use of tobacco, in the form of a plug, usually flavored, for chewing rather than smoking."),
  Second_hand_smoke_exposure_years STRING OPTIONS(description="The number of cumulative years of the patient's exposure to second-hand cigarette smoke"),
  entityId STRING OPTIONS(description="Synapse ID of entity"),
  HTAN_Center STRING OPTIONS(description="Name of HTAN Center e.g. HTAN HTAPP"),
  Data_Release STRING OPTIONS(description="Inclusion in HTAN Data Release e.g. Release 1.0")
)
OPTIONS(
  friendly_name="HTAN CLINICAL TIER 1 DATA - EXPOSURE R2 VERSIONED",
  description="Data was extracted from HTAN Synapse projects in April 2022. This table contains information about HTAN patient cases and their clinical information. More details: see https://data.humantumoratlas.org/standard/clinical",
  labels=[("access", "open"), ("data_type", "clinical_data"), ("program", "htan"), ("source", "htan"), ("category", "clinical_biospecimen_data"), ("status", "current")]
);

INSERT INTO `isb-cgc-bq.HTAN_versioned.clinical_tier1_exposure_r2` (Component, HTAN_Participant_ID, Start_Days_from_Index, Smoking_Exposure, Alcohol_Exposure, Asbestos_Exposure, Coal_Dust_Exposure, Environmental_Tobacco_Smoke_Exposure, Radon_Exposure, Respirable_Crystalline_Silica_Exposure, Pack_Years_Smoked, Years_Smoked, Alcohol_Days_Per_Week, Alcohol_Drinks_Per_Day, Alcohol_History, Alcohol_Intensity, Alcohol_Type, Cigarettes_per_Day, Smoking_Frequency, Secondhand_Smoke_as_Child, Smoke_Exposure_Duration, Type_of_Smoke_Exposure, Marijuana_Use_Per_Week, Tobacco_Use_per_Day, Smokeless_Tobacco_Quit_Age, Time_Between_Waking_and_First_Smoke, Tobacco_Smoking_Onset_Year, Tobacco_Smoking_Quit_Year, Tobacco_Smoking_Status, Type_of_Tobacco_Used, COVID19_Occurrence_Indicator, COVID19_Current_Status, COVID19_Positive_Lab_Test_Indicator, COVID19_Antibody_Testing, COVID19_Complications_Severity, COVID19_Cancer_Treatment_Followup, Ecig_vape_use, Ecig_vape_30_day_use_num, Ecig_vape_times_per_day, Type_of_smoke_exposure_cumulative_years, Chewing_tobacco_daily_use_count, Second_hand_smoke_exposure_years, entityId, HTAN_Center, Data_Release) VALUES ('Exposure', 'HTA12_1', 'Not Applicable', 'No - Smoking Exposure', 'Yes - Alcohol Exposure', 'No', 'No', 'unknown', 'unknown', 'unknown', 'None', 'None', '1.0', '2.0', 'Yes', 'Occasional Drinker', 'unknown', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'syn24996967', 'HTAN WUSTL', 'Release 2.0'), ('Exposure', 'HTA12_7', 'Not Applicable', 'Yes - Smoking Exposure', 'Yes - Alcohol Exposure', 'No', 'No', 'unknown', 'unknown', 'unknown', '53', '5', '3.0', '12.0', 'Yes', 'unknown', 'Beer', '5.0', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'Current Smoker', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'syn24996974', 'HTAN WUSTL', 'Release 2.0'), ('Exposure', 'HTA12_9', 'Not Applicable', 'Yes - Smoking Exposure', 'Yes - Alcohol Exposure', 'No', 'No', 'unknown', 'unknown', 'unknown', '10', '10', '3.0', '4.0', 'Yes', 'unknown', 'Beer', '40.0', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'Current Reformed Smoker for > 15 yrs', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'syn24996976', 'HTAN WUSTL', 'Release 2.0'), ('Exposure', 'HTA12_20', 'Not Applicable', 'Yes - Smoking Exposure', 'Yes - Alcohol Exposure', 'No', 'No', 'unknown', 'unknown', 'unknown', 'UNKNOWN', 'UNKNOWN', '3.0', '4.0', 'Yes', 'unknown', 'Beer', '25.0', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'Not Reported', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'syn24996990', 'HTAN WUSTL', 'Release 2.0'), ('Exposure', 'HTA12_8', 'Not Applicable', 'Yes - Smoking Exposure', 'Yes - Alcohol Exposure', 'No', 'No', 'unknown', 'unknown', 'unknown', '40', '40', '7.0', '12.0', 'Yes', 'Heavy Drinker', 'Beer', '30.0', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'Current Smoker', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'syn24996975', 'HTAN WUSTL', 'Release 2.0');