-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.clinical_tier3_lung_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'"),
  Lung_Cancer_Detection_Method_Type STRING OPTIONS(description="The means, manner of procedure, or systematic course of actions performed in order to discover or identify lung cancer"),
  Lung_Cancer_Participant_Procedure_History STRING OPTIONS(description="Text name of a surgical or operative procedure used in a natural history protocol of a lung cancer participant."),
  Lung_Adjacent_Histology_Type STRING OPTIONS(description="The type of morphologic characteristics observed by microscope in the tissue next to a benign or malignant tissue growth"),
  Lung_Tumor_Location_Anatomic_Site STRING OPTIONS(description="Anatomic location of the tumor inside the lung"),
  Lung_Tumor_Lobe_Bronchial_Location STRING OPTIONS(description="Anatomic lobe and bronchial location of the tumor inside the lung"),
  Current_Lung_Cancer_Symptoms STRING OPTIONS(description="Reported lung cancer related symptoms person is currently experiencing"),
  Lung_Topography STRING OPTIONS(description="Lung PCA specific topography (not covered in previous tiers)"),
  Lung_Cancer_Harboring_Genomic_Aberrations STRING OPTIONS(description="Genomic aberrations in participants with lung cancer (specific lung cancer associated gene mutations not covered in Tiers 1 and 2)"),
  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 3 DATA - LUNG 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_tier3_lung_r2` (Component, HTAN_Participant_ID, Timepoint_Label, Start_Days_from_Index, Stop_Days_from_Index, Lung_Cancer_Detection_Method_Type, Lung_Cancer_Participant_Procedure_History, Lung_Adjacent_Histology_Type, Lung_Tumor_Location_Anatomic_Site, Lung_Tumor_Lobe_Bronchial_Location, Current_Lung_Cancer_Symptoms, Lung_Topography, Lung_Cancer_Harboring_Genomic_Aberrations, entityId, HTAN_Center, Data_Release) VALUES ('LungCancerTier3', 'HTA3_8001', 'baseline', '0', 'None', 'None', 'Lobectomy Right', 'None', 'Right', 'Lower lobe', 'None', 'None', 'None', 'syn24994796', 'HTAN BU', 'Release 2.0'), ('LungCancerTier3', 'HTA3_8002', 'baseline', '0', 'None', 'None', 'Lobectomy Left', 'None', 'Left', 'Upper lobe', 'None', 'None', 'None', 'syn24994797', 'HTAN BU', 'Release 2.0'), ('LungCancerTier3', 'HTA3_8003', 'baseline', '0', 'None', 'None', 'Lobectomy Right', 'None', 'Right', 'Upper lobe', 'None', 'None', 'None', 'syn24994798', 'HTAN BU', 'Release 2.0'), ('LungCancerTier3', 'HTA3_8004', 'baseline', '0', 'None', 'None', 'Mediastinoscopy', 'None', 'Right', 'Lower lobe', 'None', 'None', 'None', 'syn24994799', 'HTAN BU', 'Release 2.0'), ('LungCancerTier3', 'HTA3_8005', 'baseline', '0', 'None', 'None', 'Lobectomy Left', 'None', 'Left', 'Upper lobe', 'None', 'None', 'None', 'syn24994800', 'HTAN BU', 'Release 2.0');