-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.clinical_tier1_therapy_r5`
(
  Days_to_Treatment_Start STRING OPTIONS(description="Number of days between the date used for index and the date the treatment started. If not applicable please enter 'Not Applicable'"),
  Chemo_Concurrent_to_Radiation STRING OPTIONS(description="The text term used to describe whether the patient was receiving chemotherapy concurrent to radiation."),
  Number_of_Cycles STRING OPTIONS(description="The numeric value used to describe the number of cycles of a specific treatment or regimen the patient received."),
  Treatment_Intent_Type STRING OPTIONS(description="Text term to identify the reason for the administration of a treatment regimen. [Manually-curated]"),
  Component STRING OPTIONS(description="Category of metadata (e.g. Diagnosis, Biospecimen, scRNA-seq Level 1, etc.); provide the same one for all items/rows."),
  Days_to_Treatment_End STRING OPTIONS(description="Number of days between the date used for index and the date the treatment ended. If not applicable please enter 'Not Applicable'"),
  Initial_Disease_Status STRING OPTIONS(description="The text term used to describe the status of the patient's malignancy when the treatment began."),
  Treatment_Frequency STRING OPTIONS(description="The text term used to describe the frequency the patient received an agent or regimen."),
  Reason_Treatment_Ended STRING OPTIONS(description="The text term used to describe the reason a specific treatment or regimen ended."),
  Treatment_Type STRING OPTIONS(description="Text term that describes the kind of treatment administered."),
  Therapeutic_Agents STRING OPTIONS(description="Text identification of the individual agent(s) used as part of a treatment regimen."),
  Treatment_Dose_Units STRING OPTIONS(description="The text term used to describe the dose units of an agent the patient received."),
  Treatment_Arm STRING OPTIONS(description="Text term used to describe the treatment arm assigned to a patient at the time eligibility is determined."),
  Treatment_Outcome STRING OPTIONS(description="Text term that describes the patient's final outcome after the treatment was administered."),
  Regimen_or_Line_of_Therapy STRING OPTIONS(description="The text term used to describe the regimen or line of therapy."),
  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"),
  Treatment_or_Therapy STRING OPTIONS(description="A yes/no/unknown/not applicable indicator related to the administration of therapeutic agents received."),
  HTAN_Participant_ID STRING OPTIONS(description="HTAN ID associated with a patient based on HTAN ID SOP (eg HTANx_yyy )"),
  Treatment_Effect STRING OPTIONS(description="The text term used to describe the pathologic effect a treatment(s) had on the tumor."),
  Treatment_Effect_Indicator STRING OPTIONS(description="The text term used to indicate whether the treatment had an effect on the patient."),
  Treatment_Dose STRING OPTIONS(description="The numeric value used to describe the dose of an agent the patient received."),
  Id STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819"),
  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 1 DATA - THERAPY R5 VERSIONED",
  description="This table contains clinical therapy or treatment 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 2024 and corresponds to HTAN Data Release 5.1. 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_therapy_r5` (Days_to_Treatment_Start, Chemo_Concurrent_to_Radiation, Number_of_Cycles, Treatment_Intent_Type, Component, Days_to_Treatment_End, Initial_Disease_Status, Treatment_Frequency, Reason_Treatment_Ended, Treatment_Type, Therapeutic_Agents, Treatment_Dose_Units, Treatment_Arm, Treatment_Outcome, Regimen_or_Line_of_Therapy, Treatment_Anatomic_Site, entityId, Treatment_or_Therapy, HTAN_Participant_ID, Treatment_Effect, Treatment_Effect_Indicator, Treatment_Dose, Id, HTAN_Center, Manifest_Id, Manifest_Version) VALUES (NULL, 'No', '3', 'Adjuvant', 'Therapy', NULL, 'Initial Diagnosis', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'syn28275195', 'Yes', 'HTA2_225', 'Unknown', NULL, NULL, '9e945011-f625-4686-8c70-350fcf28670b', 'HTAN HTAPP', 'syn42296367', 1), (NULL, 'No', '2', 'Adjuvant', 'Therapy', NULL, 'Initial Diagnosis', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'syn28275197', 'Yes', 'HTA2_229', 'Unknown', NULL, NULL, '66636f19-adb2-4394-8fde-3d596bea00fe', 'HTAN HTAPP', 'syn42296367', 1), ('21417.0', 'no', NULL, 'Cancer Control', 'Therapy', '21487.0', 'Residual Disease', NULL, NULL, 'Chemotherapy', NULL, NULL, NULL, 'Complete Response', '1.0', 'Lung NOS', NULL, 'yes', 'HTA3_80052', 'Complete Necrosis (No Viable Tumor)', 'yes', NULL, 'a70cdf2a-4094-4273-b377-be181a13ef10', 'HTAN BU', 'syn39148156', 4), ('21511.0', 'no', NULL, 'Cancer Control', 'Therapy', '22084.0', 'Residual Disease', NULL, NULL, 'Targeted Molecular Therapy', NULL, NULL, NULL, 'Complete Response', '1.0', 'Lung NOS', NULL, 'yes', 'HTA3_80052', 'Complete Necrosis (No Viable Tumor)', 'yes', NULL, '69be1f3e-d29a-4556-8f1d-9844fe40ad8a', 'HTAN BU', 'syn39148156', 4), ('26136', 'No', '13', 'Adjuvant', 'Therapy', '26514.0', 'Progressive Disease', NULL, 'Course of Therapy Completed', 'Immunotherapy (Including Vaccines)', 'Nivolumab', NULL, NULL, 'No Measurable Disease', '1st', 'Lymph nodes of axilla or arm', NULL, 'Yes', 'HTA5_1039', 'No Necrosis', 'Yes', '480', '9d631b6d-3e75-49b5-ba33-e012d1bb2cf6', 'HTAN DFCI', 'syn51360962', 8);