-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.clinical_tier3_brain_r4`
(
  entityId STRING OPTIONS(description="Synapse ID of entity"),
  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'"),
  HTAN_Participant_ID STRING OPTIONS(description="HTAN ID associated with a patient based on HTAN ID SOP (eg HTANx_yyy )"),
  CNS_Tumor_Primary_Anatomic_Site STRING OPTIONS(description="Primary tumor location in the central nervous system that comprise the tissues of the central nervous system (brain and spinal cord)-not covered in Tiers 1 and 2"),
  Glioma_Specific_Radiation_Field STRING OPTIONS(description="A description of the location on or within the CNS where radiation was administered in a partcipant with glioma"),
  Id STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819"),
  Infra_Tentorial_Ependymoma_Molecular_Subgroup STRING OPTIONS(description="Text term to identify the molecular subgroup in a infra tentorial ependymoma"),
  Supra_Tentorial_Ependymoma_Molecular_Subgroup STRING OPTIONS(description="Text term to identify the molecular subgroup in a supra tentorial ependymoma"),
  Glioma_Specific_Metastasis_Sites STRING OPTIONS(description="Evidence of active brain metastasis including leptomeningeal involvement"),
  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."),
  Component STRING OPTIONS(description="Category of metadata (e.g. Diagnosis, Biospecimen, scRNA-seq Level 1, etc.); provide the same one for all items/rows."),
  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'"),
  Neuroblastoma_MYCN_Gene_Amplification_Status STRING OPTIONS(description="Neuroblastoma MYCN amplification or over-expression status"),
  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 3 DATA - NEUROBLASTOMA AND GLIOMA R4 VERSIONED",
  description="This table contains third-tier, neuroblastoma and glioma 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_tier3_brain_r4` (entityId, Stop_Days_from_Index, HTAN_Participant_ID, CNS_Tumor_Primary_Anatomic_Site, Glioma_Specific_Radiation_Field, Id, Infra_Tentorial_Ependymoma_Molecular_Subgroup, Supra_Tentorial_Ependymoma_Molecular_Subgroup, Glioma_Specific_Metastasis_Sites, Timepoint_Label, Component, Start_Days_from_Index, Neuroblastoma_MYCN_Gene_Amplification_Status, HTAN_Center, Manifest_Id, Manifest_Version) VALUES ('syn25883902', NULL, 'HTA1_281', 'Cerebellar/Posterior fossa', NULL, '51ee03c0-00cc-4438-ba97-42caa9e4476f', NULL, NULL, NULL, 'Not Recorded', 'NeuroblastomaandGliomaTier3', 'Not Applicable', NULL, 'HTAN HTAPP', 'syn52234452', 2), ('syn25883903', NULL, 'HTA1_289', 'Cerebellar/Posterior fossa', NULL, '13cf19e0-8d5d-4cba-97d3-8215a608f4a0', NULL, NULL, NULL, 'Not Recorded', 'NeuroblastomaandGliomaTier3', 'Not Applicable', NULL, 'HTAN HTAPP', 'syn52234452', 2);