-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.clinical_tier2_r4`
(
  Sentinel_Lymph_Node_Count STRING OPTIONS(description="Numeric count of sentinel lymph nodes."),
  COVID19_Positive_Lab_Test_Indicator STRING OPTIONS(description="The indicator that describes whether or not there was a COVID-19 positive test result."),
  Id STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819"),
  Known_Genetic_Predisposition_Mutation STRING OPTIONS(description="A yes/no/unknown indicator to identify whether there is a known genetic predisposition mutation present in the patient."),
  Timepoint_Label STRING OPTIONS(description="Label to identify the time point at which the clinical data or biospecimen was obtained (e.g. Baseline, End of Treatment, Overall survival, Final). NO PHI/PII INFORMATION IS ALLOWED."),
  Extent_of_Tumor_Resection STRING OPTIONS(description="The degree to which the lesion has been cut out, or resected."),
  Prior_Sites_of_Radiation STRING OPTIONS(description="The anatomic location to which radiation treatment was administered to a patient prior to enrollment on a protocol."),
  Cancer_Incidence_Location STRING OPTIONS(description="The county and state in which the patient lives and to which the cancer_incidence data correlates. Record as \"County, State\" as they appear in the incidence box from which the cancer_incidence data is obtained in the https://gis.cancer.gov/canceratlas/tableview/ website"),
  Ecig_vape_use STRING OPTIONS(description="Use of non-traditional cigarette nicotine delivery device (electronic cigarette, ENDS - electronic nicotine delivery system)"),
  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)"),
  Cancer_Incidence STRING OPTIONS(description="Incidence of specific cancer type in a defined area (a number between 0 and 100). The rate of incident cases per population of 100,000 persons of a specific type of cancer as designated in the \"primary_diagnosis\" data element in the county where the patient resides, using the most recent 2013-2017 NCI Cancer Atlas derived data.  Use patient zip code to find the county the patient lives in by going to https://www.unitedstateszipcodes.org/. Enter the zip code in the main text field and use the asociated county on the right side of the result field. On the https://gis.cancer.gov/canceratlas/tableview/ website, choose \"Incidence\" from the Topic dropdown menu, state of interest from the Area menu, \"All Races\" from the Race menu, and the cancer type (\"Both Sexes\" when possible) from the Statistic menu. Find the county of interest and enter the numeric Age-Adjusted Rate per 100,000 as the value."),
  COVID19_Current_Status STRING OPTIONS(description="The patient's current COVID-19 status of sign or symptom events or interventions"),
  Mode_of_Cancer_Detection STRING OPTIONS(description="Text term used to describe the mode of cancer detection, like standard of care screening or random detection"),
  Tumor_Extranodal_Extension_Indicator STRING OPTIONS(description="The indicator to determine extranodal involvement or extent of the disease."),
  entityId STRING OPTIONS(description="Synapse ID of entity"),
  Cancer_Associated_Gene_Mutations STRING OPTIONS(description="Type of inherited germline or other gene mutations that confers heightened susceptibility to cancer identified in patient history"),
  Second_hand_smoke_exposure_years STRING OPTIONS(description="The number of cumulative years of the patient's exposure to second-hand cigarette smoke"),
  Other_Biopsy_Resection_Site STRING OPTIONS(description="A description of the location on or within the human body where the surgical biopsy/resection procedure was performed (Not covered under HTAN Clinical Data Tier 1)"),
  Concomitant_Medication_Received_Type STRING OPTIONS(description="An enumerated list of the type of concomitant medication received by 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"),
  COVID19_Complications_Severity STRING OPTIONS(description="Text term that retrospectively indicates the worst complications during COVID-19 infectious disorder in the patient."),
  Component STRING OPTIONS(description="Category of metadata (e.g. Diagnosis, Biospecimen, scRNA-seq Level 1, etc.); provide the same one for all items/rows."),
  Precancerous_Condition_Type STRING OPTIONS(description="The classification of pre-cancerous cells found in a specific collection of data being studied by the Consortium for Molecular and Cellular Characterization of Screen-Detected Lesions (MCL)."),
  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."),
  Mismatch_Repair_System_Status STRING OPTIONS(description="The text that best describes the condition or state of MMR (mismatch repair system) in the patient"),
  Immunosuppression STRING OPTIONS(description="The indicator that describes whether or not immunosuppressive therapy was administered."),
  HTAN_Participant_ID STRING OPTIONS(description="HTAN ID associated with a patient based on HTAN ID SOP (eg HTANx_yyy )"),
  Hereditary_Cancer_Predisposition_Syndrome STRING OPTIONS(description="History of presence of inherited genetic predisposition syndrome that confers heightened susceptibility to cancer in the patient."),
  Lab_Tests_for_MMR_Status STRING OPTIONS(description="Laboratory tests used to evaluate the status of mismatch repair pathways"),
  Medically_Underserved_Area STRING OPTIONS(description="Areas or populations designated by HRSA as having too few primary care providers, high infant mortality, high poverty or a high elderly population:  Use patient zip code to find the county the patient lives in by going to https://www.unitedstateszipcodes.org/ - enter the zip code in the main text field and use the associated county on the right side of the result field. Go to data.hrsa.gov website and select \"Query Data\". Pick the Medically Underserved Areas/Populations (MUA/P) data source in the step 1 menu and select \"View Data\". Enter the name of the county (_______ county) in the first \"Service Area\" column, adding the state in the 5th column may help direct you to the data.  If the designation type in the third column is \"medically underserved area\" enter \"Yes\" as the value. If the county generates a \"No data available in table\" enter \"No\" as the value.  A value of \"Unknown\" indicates that sufficient data was not available to look up the value.  If value is yes, complete the Medically_underserved_score d"),
  Family_Member_Vital_Status_Indicator STRING OPTIONS(description="The response indicates whether the family member of the patient with a history of cancer is alive. (Extension to GDC attributes in Family History Tier 1)"),
  Country_of_Birth STRING OPTIONS(description="Country where the patient was born."),
  Stop_Days_from_Index STRING OPTIONS(description="Number of days from the date of birth (index date) to the end date of the event (e.g. exposure to environmental factor, treatment start, etc.). Note: if the event occurs at a single time point, e.g. a diagnosis or a lab test, the values for this column is 'Not Applicable'"),
  Rural_vs_Urban STRING OPTIONS(description="Density of population in the county of residence, based on census data (updated last on 4/28/20). Use patient zip code to find the county the patient lives in by going to https://www.unitedstateszipcodes.org/. Enter the zip code in the main text field and use the associated county on the right side of the result field. Go to https://www2.census.gov/programs-surveys/acs/data/covid_19/Data_Profiles_for_HHS/050-County_By_State/. Select the dp02_XX.csv file where XX = the two letter abbreviation for the appropriate state. On row 166 find the total population for the appropriate county.  If the total population is <2,500 enter a value of \"Rural Population\"; if 2,500 - 50,000 enter a value of \"Urban Cluster\"; or if >50,000 enter \"Urban Population\""),
  Medically_Underserved_Score STRING OPTIONS(description="Index of Medical Underservice (IMU) score, a number between 0 and 100, where 0 represents completely underserved and 100 represents best served or least underserved. Use patient zip code to find the county the patient lives in by going to https://www.unitedstateszipcodes.org/. Enter the zip code in the main text field and use the asociated county on the right side of the result field. Go to data.hrsa.gov website and select Query Data. Pick the Medically Underserved Areas/Populations (MUA/P) data source in the step 1 menu and select View Data. Enter the name of the county (______ county) in the first \"Service Area\" column, adding the state in the 5th column may help direct you to the data. Enter the Index of Medical Underservice Score in the fourth column to one decimal place as the value."),
  Sentinel_Node_Positive_Assessment_Count STRING OPTIONS(description="The number or amount of metastatic neoplasms related to the confirmed presence of disease or specific microorganisms during examination of the first rounded mass of lymphatic tissue to which cancer is likely to spread from the primary tumor."),
  Education_Level STRING OPTIONS(description="Highest level of education that the patient completed (direct patient-derived information)"),
  Satellite_Metastasis_Present_Indicator STRING OPTIONS(description="A yes/no indicator to ask if intransit metastases or satellite lesions are present."),
  COVID19_Occurrence_Indicator STRING OPTIONS(description="The indicator that describes whether or not a COVID-19 infectious disorder occurred."),
  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."),
  Ecig_vape_30_day_use_num STRING OPTIONS(description="Number of days e-cigarettes or vaping device was used in the last 30 days"),
  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'"),
  Mutational_Signatures STRING OPTIONS(description="Mutational signatures identified in the patient, includes signatures linked to selected exogenous carcinogens, endogenous and enzymatic modification of DNA or defective DNA repair. Note: Include only outputs of tests that were completed clinically for the participant and only include data from a diagnostic array that was completed prior to research sequencing was done. "),
  Type_of_smoke_exposure_cumulative_years STRING OPTIONS(description="The number of cumulative years of the patient's specific type of smoke exposure"),
  HTAN_Center STRING OPTIONS(description="Name of HTAN Center e.g. HTAN HTAPP"),
  Manifest_Id STRING OPTIONS(description="Synapse ID of manifest containing file annotation"),
  Manifest_Version INT64 OPTIONS(description="Latest version of metadata manifest")
)
OPTIONS(
  friendly_name="HTAN CLINICAL TIER 2 DATA R4 VERSIONED",
  description="This table contains second tier clinical information about HTAN patient cases, specifically disease-agnostic extensions to the GDC clinical data model. Data was extracted from HTAN Synapse projects in October 2023. 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_tier2_r4` (Sentinel_Lymph_Node_Count, COVID19_Positive_Lab_Test_Indicator, Id, Known_Genetic_Predisposition_Mutation, Timepoint_Label, Extent_of_Tumor_Resection, Prior_Sites_of_Radiation, Cancer_Incidence_Location, Ecig_vape_use, Ecig_vape_times_per_day, Cancer_Incidence, COVID19_Current_Status, Mode_of_Cancer_Detection, Tumor_Extranodal_Extension_Indicator, entityId, Cancer_Associated_Gene_Mutations, Second_hand_smoke_exposure_years, Other_Biopsy_Resection_Site, Concomitant_Medication_Received_Type, COVID19_Cancer_Treatment_Followup, COVID19_Complications_Severity, Component, Precancerous_Condition_Type, COVID19_Antibody_Testing, Mismatch_Repair_System_Status, Immunosuppression, HTAN_Participant_ID, Hereditary_Cancer_Predisposition_Syndrome, Lab_Tests_for_MMR_Status, Medically_Underserved_Area, Family_Member_Vital_Status_Indicator, Country_of_Birth, Stop_Days_from_Index, Rural_vs_Urban, Medically_Underserved_Score, Sentinel_Node_Positive_Assessment_Count, Education_Level, Satellite_Metastasis_Present_Indicator, COVID19_Occurrence_Indicator, Chewing_tobacco_daily_use_count, Ecig_vape_30_day_use_num, Start_Days_from_Index, Mutational_Signatures, Type_of_smoke_exposure_cumulative_years, HTAN_Center, Manifest_Id, Manifest_Version) VALUES (NULL, 'Not Applicable', '0f5eec8b-5604-4f0d-a8bc-f86cc70980e4', NULL, 'baseline', NULL, NULL, NULL, 'unknown', NULL, NULL, 'Patient never had any symptoms of COVID-19', NULL, NULL, 'syn24994555', NULL, NULL, NULL, NULL, 'Not Applicable', 'Not Applicable', 'ClinicalDataTier2', NULL, 'unknown', NULL, NULL, 'HTA3_8001', NULL, NULL, NULL, 'Not Reported', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'No', NULL, NULL, '0', NULL, NULL, 'HTAN BU', 'syn39148191', 2), (NULL, 'Not Applicable', '9f0ea119-67d7-4128-ad45-c1bf876ff3c0', NULL, 'baseline', NULL, NULL, NULL, 'unknown', NULL, NULL, 'Patient never had any symptoms of COVID-19', NULL, NULL, 'syn24994556', NULL, NULL, NULL, NULL, 'Not Applicable', 'Not Applicable', 'ClinicalDataTier2', NULL, 'unknown', NULL, NULL, 'HTA3_8002', NULL, NULL, NULL, 'unknown', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'No', NULL, NULL, '0', NULL, NULL, 'HTAN BU', 'syn39148191', 2), (NULL, 'Not Applicable', '38231009-7b2f-4209-8809-45d209b3e405', NULL, 'baseline', NULL, NULL, NULL, 'unknown', NULL, NULL, 'Patient never had any symptoms of COVID-19', NULL, NULL, 'syn24994557', NULL, NULL, NULL, NULL, 'Not Applicable', 'Not Applicable', 'ClinicalDataTier2', NULL, 'unknown', NULL, NULL, 'HTA3_8003', NULL, NULL, NULL, 'unknown', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'No', NULL, NULL, '0', NULL, NULL, 'HTAN BU', 'syn39148191', 2), (NULL, 'Not Applicable', '9201b05a-a57d-4f25-a9b5-5f4bb47bda5a', NULL, 'baseline', NULL, NULL, NULL, 'unknown', NULL, NULL, 'Patient never had any symptoms of COVID-19', NULL, NULL, 'syn24994558', NULL, NULL, NULL, NULL, 'Not Applicable', 'Not Applicable', 'ClinicalDataTier2', NULL, 'unknown', NULL, NULL, 'HTA3_8004', NULL, NULL, NULL, 'Vital Status Dead', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'No', NULL, NULL, '0', NULL, NULL, 'HTAN BU', 'syn39148191', 2), (NULL, 'Not Applicable', 'bb4e76c9-20e6-439f-a2ee-82e47a781eeb', NULL, 'baseline', NULL, NULL, NULL, 'unknown', NULL, NULL, 'Patient never had any symptoms of COVID-19', NULL, NULL, 'syn24994560', NULL, NULL, NULL, NULL, 'Not Applicable', 'Not Applicable', 'ClinicalDataTier2', NULL, 'unknown', NULL, NULL, 'HTA3_8005', NULL, NULL, NULL, 'Not Reported', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'No', NULL, NULL, '0', NULL, NULL, 'HTAN BU', 'syn39148191', 2);