-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.clinical_tier1_therapy_r3`
(
  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 )"),
  Treatment_or_Therapy STRING OPTIONS(description="A yes/no/unknown/not applicable indicator related to the administration of therapeutic agents received."),
  Treatment_Type STRING OPTIONS(description="Text term that describes the kind of treatment administered."),
  Treatment_Effect STRING OPTIONS(description="The text term used to describe the pathologic effect a treatment(s) had on the tumor."),
  Treatment_Outcome STRING OPTIONS(description="Text term that describes the patient's final outcome after the treatment was administered."),
  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'"),
  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"),
  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'"),
  Initial_Disease_Status STRING OPTIONS(description="The text term used to describe the status of the patient's malignancy when the treatment began."),
  Regimen_or_Line_of_Therapy STRING OPTIONS(description="The text term used to describe the regimen or line of therapy."),
  Therapeutic_Agents STRING OPTIONS(description="Text identification of the individual agent(s) used as part of a treatment regimen."),
  Treatment_Intent_Type STRING OPTIONS(description="Text term to identify the reason for the administration of a treatment regimen. [Manually-curated]"),
  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."),
  Reason_Treatment_Ended STRING OPTIONS(description="The text term used to describe the reason a specific treatment or regimen ended."),
  Treatment_Arm STRING OPTIONS(description="Text term used to describe the treatment arm assigned to a patient at the time eligibility is determined."),
  Treatment_Dose STRING OPTIONS(description="The numeric value used to describe the dose of an agent the patient received."),
  Treatment_Dose_Units STRING OPTIONS(description="The text term used to describe the dose units of an agent the patient received."),
  Treatment_Effect_Indicator STRING OPTIONS(description="The text term used to indicate whether the treatment had an effect on the patient."),
  Treatment_Frequency STRING OPTIONS(description="The text term used to describe the frequency the patient received an agent or regimen."),
  Prior_Sites_of_Radiation STRING OPTIONS(description="The anatomic location to which radiation treatment was administered to a patient prior to enrollment on a protocol."),
  Immunosuppression STRING OPTIONS(description="The indicator that describes whether or not immunosuppressive therapy was administered."),
  Concomitant_Medication_Received_Type STRING OPTIONS(description="An enumerated list of the type of concomitant medication received by the patient."),
  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 - THERAPY R3 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 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_therapy_r3` (Component, HTAN_Participant_ID, Treatment_or_Therapy, Treatment_Type, Treatment_Effect, Treatment_Outcome, Days_to_Treatment_End, Treatment_Anatomic_Site, Days_to_Treatment_Start, Initial_Disease_Status, Regimen_or_Line_of_Therapy, Therapeutic_Agents, Treatment_Intent_Type, Chemo_Concurrent_to_Radiation, Number_of_Cycles, Reason_Treatment_Ended, Treatment_Arm, Treatment_Dose, Treatment_Dose_Units, Treatment_Effect_Indicator, Treatment_Frequency, Prior_Sites_of_Radiation, Immunosuppression, Concomitant_Medication_Received_Type, entityId, HTAN_Center, Data_Release, Manifest_Version, Uuid) VALUES ('Therapy', 'HTA1_962', 'Yes', 'Chemotherapy', NULL, NULL, '29064.0', NULL, '29001.0', NULL, NULL, 'Carboplatin', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'syn25882794', 'HTAN HTAPP', 'Release 2.0', 1, '225d8afb-4173-47b1-9f82-188733283055'), ('Therapy', 'HTA1_962', 'Yes', 'Chemotherapy', NULL, NULL, '29064.0', NULL, '29001.0', NULL, NULL, 'Pemetrexed', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'syn25882795', 'HTAN HTAPP', 'Release 2.0', 1, '804c100e-0c5a-44a2-b231-8d526e286841'), ('Therapy', 'HTA1_339', 'Yes', 'Chemotherapy', NULL, NULL, '30319.0', NULL, '30256.0', NULL, NULL, 'Carboplatin', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'syn25882796', 'HTAN HTAPP', 'Release 3.0', 1, '810a8c64-3fbe-465a-bef1-dfd01fba66a0'), ('Therapy', 'HTA13_1', 'Yes', 'Chemotherapy', NULL, NULL, NULL, NULL, NULL, 'Initial Diagnosis', NULL, 'Oxaliplatin', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'syn25557005', 'HTAN TNP SARDANA', 'Release 2.0', 1, '4c65bc88-7329-489a-861b-063164eb541c'), ('Therapy', 'HTA1_261', 'Yes', 'Chemotherapy', 'Not Reported', 'Stable Disease', '31211.0', NULL, '31145.0', 'Initial Diagnosis', '1.0', 'Carboplatin, pemetrexed', 'Cure', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'syn25882810', 'HTAN HTAPP', 'Release 2.0', 1, '8d79d844-9b41-48d2-9311-f7996a320411');