-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.clinical_tier1_therapy_r4`
(
  Id STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819"),
  Treatment_Type STRING OPTIONS(description="Text term that describes the kind of treatment administered."),
  Treatment_Dose_Units STRING OPTIONS(description="The text term used to describe the dose units of an agent the patient received."),
  Chemo_Concurrent_to_Radiation STRING OPTIONS(description="The text term used to describe whether the patient was receiving chemotherapy concurrent to radiation."),
  Treatment_Frequency STRING OPTIONS(description="The text term used to describe the frequency the patient received an agent or regimen."),
  entityId STRING OPTIONS(description="Synapse ID of entity"),
  Reason_Treatment_Ended STRING OPTIONS(description="The text term used to describe the reason a specific treatment or regimen ended."),
  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_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'"),
  Treatment_Arm STRING OPTIONS(description="Text term used to describe the treatment arm assigned to a patient at the time eligibility is determined."),
  HTAN_Participant_ID STRING OPTIONS(description="HTAN ID associated with a patient based on HTAN ID SOP (eg HTANx_yyy )"),
  Treatment_Dose STRING OPTIONS(description="The numeric value used to describe the dose of an agent the patient received."),
  Treatment_Outcome STRING OPTIONS(description="Text term that describes the patient's final outcome after the treatment was administered."),
  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"),
  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."),
  Initial_Disease_Status STRING OPTIONS(description="The text term used to describe the status of the patient's malignancy when the treatment began."),
  Therapeutic_Agents STRING OPTIONS(description="Text identification of the individual agent(s) used as part of a treatment regimen."),
  Treatment_or_Therapy STRING OPTIONS(description="A yes/no/unknown/not applicable indicator related to the administration of therapeutic agents received."),
  Treatment_Effect STRING OPTIONS(description="The text term used to describe the pathologic effect a treatment(s) had on the tumor."),
  Treatment_Intent_Type STRING OPTIONS(description="Text term to identify the reason for the administration of a treatment regimen. [Manually-curated]"),
  Regimen_or_Line_of_Therapy STRING OPTIONS(description="The text term used to describe the regimen or line of therapy."),
  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_Effect_Indicator STRING OPTIONS(description="The text term used to indicate whether the treatment had an effect on the patient."),
  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 R4 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 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_tier1_therapy_r4` (Id, Treatment_Type, Treatment_Dose_Units, Chemo_Concurrent_to_Radiation, Treatment_Frequency, entityId, Reason_Treatment_Ended, Component, Days_to_Treatment_Start, Treatment_Arm, HTAN_Participant_ID, Treatment_Dose, Treatment_Outcome, Treatment_Anatomic_Site, Number_of_Cycles, Initial_Disease_Status, Therapeutic_Agents, Treatment_or_Therapy, Treatment_Effect, Treatment_Intent_Type, Regimen_or_Line_of_Therapy, Days_to_Treatment_End, Treatment_Effect_Indicator, HTAN_Center, Manifest_Id, Manifest_Version) VALUES ('fcaa858d-7787-40a1-9daf-6b8fc2a8446d', 'Targeted Molecular Therapy', NULL, NULL, NULL, NULL, NULL, 'Therapy', '24708', NULL, 'HTA9_7', NULL, NULL, NULL, NULL, NULL, 'Olaparib', NULL, NULL, NULL, 'Olaparib', '24760', NULL, 'HTAN OHSU', 'syn39141376', 5), ('1c9c57fe-b470-400f-9c4f-555672f6f42b', 'Targeted Molecular Therapy', NULL, NULL, NULL, NULL, NULL, 'Therapy', '22874', NULL, 'HTA9_8', NULL, NULL, NULL, NULL, NULL, 'Olaparib', NULL, NULL, NULL, 'Olaparib', '22947', NULL, 'HTAN OHSU', 'syn39141376', 5), ('8a04e5e0-907a-4232-99a1-d1b39dac7124', 'Targeted Molecular Therapy', NULL, NULL, NULL, NULL, NULL, 'Therapy', '19748', NULL, 'HTA9_9', NULL, NULL, NULL, NULL, NULL, 'Olaparib', NULL, NULL, NULL, 'Olaparib', '19814', NULL, 'HTAN OHSU', 'syn39141376', 5), ('a952ea20-c260-4e14-a409-5ec15ced44eb', 'Targeted Molecular Therapy', NULL, NULL, NULL, NULL, NULL, 'Therapy', '26221', NULL, 'HTA9_10', NULL, NULL, NULL, NULL, NULL, 'Olaparib', NULL, NULL, NULL, 'Olaparib', '26529', NULL, 'HTAN OHSU', 'syn39141376', 5), ('1eed0f87-fab0-48bb-ad1d-33d3757e5f42', 'Targeted Molecular Therapy', NULL, NULL, NULL, NULL, NULL, 'Therapy', '9981', NULL, 'HTA9_11', NULL, NULL, NULL, NULL, NULL, 'Olaparib', NULL, NULL, NULL, 'Olaparib', '10028', NULL, 'HTAN OHSU', 'syn39141376', 5);