-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.srrs_clinical_tier2_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 )"),
  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."),
  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'"),
  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'"),
  Education_Level STRING OPTIONS(description="Highest level of education that the patient completed (direct patient-derived information)"),
  Country_of_Birth STRING OPTIONS(description="Country where the patient was born."),
  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"),
  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\""),
  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."),
  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"),
  Ethnicity STRING OPTIONS(description="An individual's self-described social and cultural grouping, specifically whether an individual describes themselves as Hispanic or Latino. The provided values are based on the categories defined by the U.S. Office of Management and Business and used by the U.S. Census Bureau."),
  Gender STRING OPTIONS(description="Text designations that identify gender. Gender is described as the assemblage of properties that distinguish people on the basis of their societal roles. [Identification of gender is based upon self-report and may come from a form, questionnaire, interview, etc.]"),
  Race STRING OPTIONS(description="An arbitrary classification of a taxonomic group that is a division of a species. It usually arises as a consequence of geographical isolation withina a species and is characterized by shared heredity, physical attributes and behavior, and in the case of humans, by common history, nationality, or geographic distribution."),
  Vital_Status STRING OPTIONS(description="The survival state of the person registered on the protocol."),
  Age_at_Diagnosis STRING OPTIONS(description="Age at the time of diagnosis expressed in number of days since birth."),
  Days_to_Last_Follow_up STRING OPTIONS(description="Time interval from the date of last follow up to the date of initial pathologic diagnosis, represented as a calculated number of days."),
  Days_to_Last_Known_Disease_Status STRING OPTIONS(description="Time interval from the date of last follow up to the date of initial pathologic diagnosis, represented as a calculated number of days."),
  Days_to_Recurrence STRING OPTIONS(description="Number of days between the date used for index and the date the patient's disease recurred."),
  Last_Known_Disease_Status STRING OPTIONS(description="Text term that describes the last known state or condition of an individual's neoplasm."),
  Morphology STRING OPTIONS(description="The third edition of the International Classification of Diseases for Oncology, published in 2000 used principally in tumor and cancer registries for coding the site (topography) and the histology (morphology) of neoplasms. The study of the structure of the cells and their arrangement to constitute tissues and, finally, the association among these to form organs. In pathology, the microscopic process of identifying normal and abnormal morphologic characteristics in tissues, by employing various cytochemical and immunocytochemical stains. A system of numbered categories for representation of data."),
  Primary_Diagnosis STRING OPTIONS(description="Text term used to describe the patient's histologic diagnosis, as described by the World Health Organization's (WHO) International Classification of Diseases for Oncology (ICD-O)."),
  Progression_or_Recurrence STRING OPTIONS(description="Yes/No/unknown indicator to identify whether a patient has had a new tumor event after initial treatment."),
  Site_of_Resection_or_Biopsy STRING OPTIONS(description="The text term used to describe the anatomic site of origin, of the patient's malignant disease, as described by the World Health Organization's (WHO) International Classification of Diseases for Oncology (ICD-O)."),
  Tissue_or_Organ_of_Origin STRING OPTIONS(description="The text term used to describe the anatomic site of origin, of the patient's malignant disease, as described by the World Health Organization's (WHO) International Classification of Diseases for Oncology (ICD-O)."),
  NCI_Atlas_Cancer_Site STRING OPTIONS(description="The primary tumor site used to calculate the incidence rate using the NCI Cancer Atlas, a digital atlas which provides geographical data related to cancer utilizing the Surveillance, Epidemiology, and End Results (SEER) Program cancer incidence rates for 2013 to 2017"),
  Tumor_Grade STRING OPTIONS(description="Numeric value to express the degree of abnormality of cancer cells, a measure of differentiation and aggressiveness."),
  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."),
  Days_to_Follow_Up STRING OPTIONS(description="Number of days between the date used for index and the date of the patient's last follow-up appointment or contact."),
  Gene_Symbol STRING OPTIONS(description="The text term used to describe a gene targeted or included in molecular analysis. For rearrangements, this is should be used to represent the reference gene. Note: This node is meant to capture molecular tests that were completed clinically for the participant and only includes data from diagnostic array that was completed prior to research sequencing was done. Do not include data related to research assay outputs here."),
  Molecular_Analysis_Method STRING OPTIONS(description="The text term used to describe the method used for molecular analysis. Note: This node is meant to capture molecular tests that were completed clinically for the participant and only includes data from diagnostic array that was completed prior to research sequencing was done. Do not include data related to research assay outputs here."),
  Test_Result STRING OPTIONS(description="The text term used to describe the result of the molecular test. If the test result was a numeric value see test_value. Note: This node is meant to capture molecular tests that were completed clinically for the participant and only includes data from diagnostic array that was completed prior to research sequencing was done. Do not include data related to research assay outputs here."),
  Treatment_Type STRING OPTIONS(description="Text term that describes the kind of treatment administered."),
  Tumor_Largest_Dimension_Diameter STRING OPTIONS(description="Numeric value used to describe the maximum diameter or dimension of the primary tumor, measured in centimeters."),
  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 SRRS CLINICAL TIER 2 DATA R2 VERSIONED",
  description="Data was extracted from HTAN Synapse projects in April 2022.",
  labels=[("access", "open"), ("data_type", "clinical_data"), ("program", "htan"), ("source", "htan"), ("category", "clinical_biospecimen_data"), ("status", "current")]
);

INSERT INTO `isb-cgc-bq.HTAN_versioned.srrs_clinical_tier2_r2` (Component, HTAN_Participant_ID, Timepoint_Label, Start_Days_from_Index, Stop_Days_from_Index, Education_Level, Country_of_Birth, Medically_Underserved_Area, Rural_vs_Urban, Cancer_Incidence, Cancer_Incidence_Location, Ethnicity, Gender, Race, Vital_Status, Age_at_Diagnosis, Days_to_Last_Follow_up, Days_to_Last_Known_Disease_Status, Days_to_Recurrence, Last_Known_Disease_Status, Morphology, Primary_Diagnosis, Progression_or_Recurrence, Site_of_Resection_or_Biopsy, Tissue_or_Organ_of_Origin, NCI_Atlas_Cancer_Site, Tumor_Grade, Pack_Years_Smoked, Years_Smoked, Days_to_Follow_Up, Gene_Symbol, Molecular_Analysis_Method, Test_Result, Treatment_Type, Tumor_Largest_Dimension_Diameter, entityId, HTAN_Center, Data_Release) VALUES ('SRRSClinicalDataTier2', 'HTA3_11009', 'Baseline', '24303', 'None', 'Data not available', 'None', 'Medically Underserved Area - Yes', 'Urban Cluster (population 2500 - 50000)', '31.9', 'Archuleta, Colorado', 'not hispanic or latino', 'male', 'white', 'Alive', '23885', '687', '633', '6573', 'Loco-regional recurrence/progression', '8071/3', 'Squamous cell carcinoma NOS', 'Yes - Progression or Recurrence', 'Lower lobe lung', 'Lower lobe lung', 'None', 'G2', '100', '50', '24554', 'not applicable', 'Not Applicable', 'Not Applicable', 'Surgery', '3.4cm', 'syn26449918', 'HTAN SRRS', 'Release 2.0'), ('SRRSClinicalDataTier2', 'HTA12_HT112C1', 'End of Treatment', '21999', 'None', 'Data not available', 'None', 'Medically Underserved Area - No', 'Urban Cluster (population 2500 - 50000)', '42.0', 'Madison, Illinois', 'not hispanic or latino', 'female', 'white', 'Alive', '21269', '64', '565', '0', 'Tumor free', '8140', 'Adenocarcinoma intestinal type', 'No', 'Liver', 'Rectum NOS', 'None', 'G1', '0', '0', '6573', 'not applicable', 'Not Applicable', 'Not Applicable', 'Surgery', '3.0cm', 'syn26464373', 'HTAN SRRS', 'Release 2.0'), ('SRRSClinicalDataTier2', 'HTA5_1833', 'Baseline', '22215', 'None', 'Data not available', 'None', 'Medically Underserved Area - Yes', 'Urban Population (population >50000)', '34.6', 'Middlesex, Massachusetts', 'not hispanic or latino', 'male', 'white', 'Alive', '22199', '168', '168', '0', 'With tumor', '8140/3', 'Adenocarcinoma NOS', 'No', 'Rectosigmoid junction', 'Colon NOS', 'None', 'G2', '0', '0', '22367', 'MLH1, MSH2, MSH6, PMS2', 'IHC', 'Normal', 'Surgery', '6.2cm', 'syn26469445', 'HTAN SRRS', 'Release 2.0');