-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.clinical_tier1_followup_r3_v2`
(
  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 )"),
  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. If not applicable please enter 'Not Applicable'"),
  Adverse_Event STRING OPTIONS(description="Text that represents the Common Terminology Criteria for Adverse Events low level term name for an adverse event."),
  Progression_or_Recurrence STRING OPTIONS(description="Yes/No/unknown indicator to identify whether a patient has had a new tumor event after initial treatment."),
  Barretts_Esophagus_Goblet_Cells_Present STRING OPTIONS(description="Presence or absennce of Barretts esophagus goblet cells."),
  BMI STRING OPTIONS(description="A calculated numerical quantity that represents an individual's weight to height ratio."),
  Cause_of_Response STRING OPTIONS(description="The text term used to describe the suspected cause or reason for the patient disease response."),
  Comorbidity STRING OPTIONS(description="The text term used to describe a comorbidity disease, which coexists with the patient's malignant disease."),
  Comorbidity_Method_of_Diagnosis STRING OPTIONS(description="The text term used to describe the method used to diagnose the patient's comorbidity disease."),
  Days_to_Adverse_Event STRING OPTIONS(description="Number of days between the date used for index and the date of the patient's adverse event. If not applicable please enter 'Not Applicable'"),
  Days_to_Comorbidity STRING OPTIONS(description="Number of days between the date used for index and the date the patient was diagnosed with a comorbidity. If not applicable please enter 'Not Applicable'"),
  Diabetes_Treatment_Type STRING OPTIONS(description="Text term used to describe the types of treatment used to manage diabetes."),
  Disease_Response STRING OPTIONS(description="Code assigned to describe the patient's response or outcome to the disease."),
  DLCO_Ref_Predictive_Percent STRING OPTIONS(description="The value, as a percentage of predicted lung volume, measuring the amount of carbon monoxide detected in a patient's lungs."),
  ECOG_Performance_Status STRING OPTIONS(description="The ECOG functional performance status of the patient/participant."),
  FEV1_FVC_Post_Bronch_Percent STRING OPTIONS(description="Percentage value to represent result of Forced Expiratory Volume in 1 second (FEV1) divided by the Forced Vital Capacity (FVC) post-bronchodilator."),
  FEV_1_FVC_Pre_Bronch_Percent STRING OPTIONS(description="Percentage value to represent result of Forced Expiratory Volume in 1 second (FEV1) divided by the Forced Vital Capacity (FVC) pre-bronchodilator."),
  FEV1_Ref_Post_Bronch_Percent STRING OPTIONS(description="The percentage comparison to a normal value reference range of the volume of air that a patient can forcibly exhale from the lungs in one second post-bronchodilator."),
  FEV1_Ref_Pre_Bronch_Percent STRING OPTIONS(description="The percentage comparison to a normal value reference range of the volume of air that a patient can forcibly exhale from the lungs in one second pre-bronchodilator."),
  Height STRING OPTIONS(description="The height of the patient in centimeters."),
  Hepatitis_Sustained_Virological_Response STRING OPTIONS(description="The yes/no/unknown indicator used to describe whether the patient received treatment for a risk factor the patient had at the time of or prior to their diagnosis."),
  HPV_Positive_Type STRING OPTIONS(description="Text classification to represent the strain or type of human papillomavirus identified in an individual."),
  Karnofsky_Performance_Status STRING OPTIONS(description="Text term used to describe the classification used of the functional capabilities of a person."),
  Menopause_Status STRING OPTIONS(description="Text term used to describe the patient's menopause status."),
  Pancreatitis_Onset_Year STRING OPTIONS(description="Date of onset of pancreatitis."),
  Reflux_Treatment_Type STRING OPTIONS(description="Text term used to describe the types of treatment used to manage gastroesophageal reflux disease (GERD)."),
  Risk_Factor STRING OPTIONS(description="The text term used to describe a risk factor the patient had at the time of or prior to their diagnosis."),
  Risk_Factor_Treatment STRING OPTIONS(description="The yes/no/unknown indicator used to describe whether the patient received treatment for a risk factor the patient had at the time of or prior to their diagnosis."),
  Viral_Hepatitis_Serologies STRING OPTIONS(description="Text term that describes the kind of serological laboratory test used to determine the patient's hepatitus status."),
  Weight STRING OPTIONS(description="The weight of the patient measured in kilograms."),
  Adverse_Event_Grade STRING OPTIONS(description="The text term used to describe a specific histone variants, which are proteins that substitute for the core canonical histones."),
  AIDS_Risk_Factors STRING OPTIONS(description="The text term used to describe a risk factor of the acquired immunodeficiency syndrome (AIDS) that the patient either had at time time of the study or experienced in the past."),
  Body_Surface_Area STRING OPTIONS(description="Numeric value used to represent the 2-dimensional extent of the body surface relating height to weight."),
  CD4_Count STRING OPTIONS(description="The text term used to describe the outcome of the procedure to determine the amount of the CD4 expressing cells in a sample."),
  CDC_HIV_Risk_Factors STRING OPTIONS(description="The text term used to describe a risk factor for human immunodeficiency virus, as described by the Center for Disease Control."),
  Days_to_imaging STRING OPTIONS(description="Number of days between the date used for index and the date the imaging or scan was performed on the patient. If not applicable please enter 'Not Applicable'"),
  Evidence_of_Recurrence_Type STRING OPTIONS(description="The text term used to describe the type of evidence used to determine whether the patient's disease recurred"),
  HAART_Treatment_Indicator STRING OPTIONS(description="The text term used to indicate whether the patient received Highly Active Antiretroviral Therapy (HAART)."),
  HIV_Viral_Load STRING OPTIONS(description="Numeric value that represents the concentration of an analyte or aliquot extracted from the sample or sample portion, measured in milligrams per milliliter."),
  Hormonal_Contraceptive_Use STRING OPTIONS(description="The text term used to indicate whether the patient used hormonal contraceptives."),
  Hysterectomy_Margins_Involved STRING OPTIONS(description="The text term used to indicate whether the patient's disease was determined to be involved based on the surgical margins of the hysterectomy."),
  Hysterectomy_Type STRING OPTIONS(description="The text term used to describe the type of hysterectomy the patient had."),
  Imaging_Result STRING OPTIONS(description="The text term used to describe the result of the imaging or scan performed on the patient."),
  Imaging_Type STRING OPTIONS(description="The text term used to describe the type of imaging or scan performed on the patient."),
  Immunosuppressive_Treatment_Type STRING OPTIONS(description="The text term used to describe the type of immunosuppresive treatment the patient received."),
  Nadir_CD4_Count STRING OPTIONS(description="Numeric value that represents the lowest point to which the CD4 count has dropped (nadir)."),
  Pregnancy_Outcome STRING OPTIONS(description="The text term used to describe the type of pregnancy the patient had"),
  Recist_Targeted_Regions_Number STRING OPTIONS(description="Numeric value that represents the number of baseline target lesions, as described by the Response Evaluation Criteria in Solid Tumours (RECIST) criteria"),
  Recist_Targeted_Regions_Sum STRING OPTIONS(description="Numeric value that represents the sum of baseline target lesions, as described by the Response Evaluation Criteria in Solid Tumours (RECIST) criteria."),
  Scan_Tracer_Used STRING OPTIONS(description="The text term used to describe the type of tracer used during the imaging or scan of the patient."),
  Days_to_Recurrence STRING OPTIONS(description="Number of days between the date used for index and the date the patient's disease recurred. If not applicable please enter 'Not Applicable'"),
  Progression_or_Recurrence_Anatomic_Site STRING OPTIONS(description="The text term used to describe the anatomic site of resection; biopsy; tissue or organ of biospecimen origin; progression or recurrent disease; treatment"),
  Anatomic_Site STRING OPTIONS(description="The text term used to describe the anatomic site of resection; biopsy; tissue or organ of biospecimen origin; progression or recurrent disease; treatment"),
  Treatment_Anatomic_Site STRING OPTIONS(description="The text term used to describe the anatomic site of resection; biopsy; tissue or organ of biospecimen origin; progression or recurrent disease; treatment"),
  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"),
  Manifest_Version INT64 OPTIONS(description="Latest version of metadata manifest"),
  Uuid STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819")
)
OPTIONS(
  friendly_name="HTAN CLINICAL TIER 1 DATA - FOLLOW UP R3 VERSIONED",
  description="This table contains follow up clinical information about HTAN patient cases based on the NCI Genomic Data Commons (GDC) clinical data model. Data was extracted from HTAN Synapse projects in April 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_tier1_followup_r3_v2` (Component, HTAN_Participant_ID, Days_to_Follow_Up, Adverse_Event, Progression_or_Recurrence, Barretts_Esophagus_Goblet_Cells_Present, BMI, Cause_of_Response, Comorbidity, Comorbidity_Method_of_Diagnosis, Days_to_Adverse_Event, Days_to_Comorbidity, Diabetes_Treatment_Type, Disease_Response, DLCO_Ref_Predictive_Percent, ECOG_Performance_Status, FEV1_FVC_Post_Bronch_Percent, FEV_1_FVC_Pre_Bronch_Percent, FEV1_Ref_Post_Bronch_Percent, FEV1_Ref_Pre_Bronch_Percent, Height, Hepatitis_Sustained_Virological_Response, HPV_Positive_Type, Karnofsky_Performance_Status, Menopause_Status, Pancreatitis_Onset_Year, Reflux_Treatment_Type, Risk_Factor, Risk_Factor_Treatment, Viral_Hepatitis_Serologies, Weight, Adverse_Event_Grade, AIDS_Risk_Factors, Body_Surface_Area, CD4_Count, CDC_HIV_Risk_Factors, Days_to_imaging, Evidence_of_Recurrence_Type, HAART_Treatment_Indicator, HIV_Viral_Load, Hormonal_Contraceptive_Use, Hysterectomy_Margins_Involved, Hysterectomy_Type, Imaging_Result, Imaging_Type, Immunosuppressive_Treatment_Type, Nadir_CD4_Count, Pregnancy_Outcome, Recist_Targeted_Regions_Number, Recist_Targeted_Regions_Sum, Scan_Tracer_Used, Days_to_Recurrence, Progression_or_Recurrence_Anatomic_Site, Anatomic_Site, Treatment_Anatomic_Site, entityId, HTAN_Center, Data_Release, Manifest_Version, Uuid) VALUES ('FollowUp', 'HTA2_229', '23158', NULL, 'No', NULL, '21.63', NULL, NULL, 'Unknown', NULL, NULL, 'Not Reported', 'Not Reported', NULL, NULL, NULL, NULL, NULL, NULL, '165.1', NULL, NULL, NULL, 'Postmenopausal', NULL, NULL, 'Not Reported', 'Not Reported', 'Hepatitis C Virus RNA', '59.0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Former User', 'Not Reported', 'Hysterectomy NOS', 'Unknown', 'MRI', 'Other', NULL, 'Not Reported', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'syn28274801', 'HTAN HTAPP', 'Release 3.0', 1, 'ac5b8b10-dc30-4940-840f-38000c517317'), ('FollowUp', 'HTA2_225', '21362', NULL, 'No', NULL, '49.98', NULL, NULL, 'Unknown', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '160.0', NULL, NULL, NULL, 'Postmenopausal', NULL, NULL, NULL, 'Unknown', 'Hepatitis C Antibody', '127.3', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Never Used', 'Not Reported', 'Hysterectomy NOS', 'Unknown', 'MRI', 'Other', NULL, 'Unknown', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'syn28274798', 'HTAN HTAPP', 'Release 3.0', 1, '6f13a740-0b2f-4bbb-ad8c-05afeea3e0ae'), ('FollowUp', 'HTA1_274', '23583', NULL, 'No', NULL, '23.1', NULL, NULL, NULL, NULL, NULL, NULL, 'TF-Tumor Free', NULL, '0.0', NULL, '76.0', NULL, '96.0', '160.0', NULL, NULL, NULL, 'Postmenopausal', NULL, NULL, NULL, NULL, NULL, '59.5', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'syn28260696', 'HTAN HTAPP', 'Release 2.0', 1, 'c5899c82-04b5-400b-b574-73237a6e4e77'), ('FollowUp', 'HTA1_322', '22112', NULL, 'No', NULL, '34.9', NULL, NULL, NULL, NULL, NULL, NULL, 'TF-Tumor Free', NULL, '0.0', NULL, '80.0', NULL, '100.0', '160.0', NULL, NULL, NULL, 'Unknown', NULL, NULL, NULL, NULL, NULL, '89.4', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'syn28260702', 'HTAN HTAPP', 'Release 3.0', 1, '5aaacf0c-4087-488e-aad1-134b669aada5'), ('FollowUp', 'HTA1_324', '27168', NULL, 'No', NULL, '24.6', NULL, NULL, NULL, NULL, NULL, NULL, 'TF-Tumor Free', NULL, '1.0', NULL, '49.0', NULL, '72.0', '188.0', NULL, NULL, NULL, 'Not Reported', NULL, NULL, NULL, NULL, NULL, '83.1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'syn28260709', 'HTAN HTAPP', 'Release 2.0', 1, 'b2f5a14c-f306-4944-a486-1d367c992f3f');