-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.clinical_tier3_melanoma_r5`
(
  History_of_Chronic_UV_Exposure STRING OPTIONS(description="History of chronic UV exposure"),
  Cutaneous_Melanoma_Tumor_Regression_Range STRING OPTIONS(description="Description of the degree to which tumor cells are replaced by lymphocytic inflammation with or without dermal melanophages and fibrosis._Range; the difference between the lowest and highest numerical values."),
  Melanoma_Lesion_Size STRING OPTIONS(description="Diameter of lesion determined on skin examination (pre-bx), in mm"),
  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."),
  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'"),
  Cutaneous_Melanoma_Surgical_Margins STRING OPTIONS(description="Text term to indicate presence of tumor at resection margins"),
  Fitzpatrick_Skin_Tone STRING OPTIONS(description="The Fitzpatrick classification of skin phototype"),
  Cutaneous_Melanoma_Tumor_Infiltrating_Lymphocytes STRING OPTIONS(description="Description of degree of lymphocytic infiltration surrounding and disrupting tumor cells of the vertical growth phase in a cutaneous melanoma."),
  Cutaneous_Melanoma_Additional_Findings STRING OPTIONS(description="Significant pathologic finding present in addition to the cutaneous melanoma."),
  entityId STRING OPTIONS(description="Synapse ID of entity"),
  Melanoma_Biopsy_Resection_Sites STRING OPTIONS(description="Biopsy resection sites specific to melanoma (not covered in Tiers 1 and 2)"),
  History_of_Atypical_Nevi STRING OPTIONS(description="Patient has a history of atypical nevi"),
  Cutaneous_Melanoma_Ulceration STRING OPTIONS(description="Description of extent of disruption to the surface of the skin caused by the cutaneous melanoma."),
  Immediate_Family_History_Melanoma STRING OPTIONS(description="Text that describes the age at which the family member was diagnosed with melanoma skin cancer in relationship to their 50th birthday."),
  Melanoma_Specimen_Clark_Level_Value STRING OPTIONS(description="Definition of the Clark level or depth of involvement of a melanoma in the skin or a specimen."),
  HTAN_Participant_ID STRING OPTIONS(description="HTAN ID associated with a patient based on HTAN ID SOP (eg HTANx_yyy )"),
  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'"),
  History_of_Blistering_Sunburn STRING OPTIONS(description="Patient has history of blistering sunburn"),
  History_of_Tanning_Bed_Use STRING OPTIONS(description="History of tanning bed use of the patient"),
  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 3 DATA - MELANOMA R5 VERSIONED",
  description="This table contains third-tier, melanoma clinical information about HTAN patient cases. 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_tier3_melanoma_r5` (History_of_Chronic_UV_Exposure, Cutaneous_Melanoma_Tumor_Regression_Range, Melanoma_Lesion_Size, Timepoint_Label, Component, Stop_Days_from_Index, Cutaneous_Melanoma_Surgical_Margins, Fitzpatrick_Skin_Tone, Cutaneous_Melanoma_Tumor_Infiltrating_Lymphocytes, Cutaneous_Melanoma_Additional_Findings, entityId, Melanoma_Biopsy_Resection_Sites, History_of_Atypical_Nevi, Cutaneous_Melanoma_Ulceration, Immediate_Family_History_Melanoma, Melanoma_Specimen_Clark_Level_Value, HTAN_Participant_ID, Start_Days_from_Index, History_of_Blistering_Sunburn, History_of_Tanning_Bed_Use, Id, HTAN_Center, Manifest_Id, Manifest_Version) VALUES ('Outdoor recreational', 'Absent', NULL, 'Pre-Treatment', 'MelanomaTier3', NULL, 'Negative', 'I', 'Nonbrisk', 'Not Applicable', NULL, 'Skin of chest', 'unknown', 'Absent', 'unknown', 'IV', 'HTA5_1340', '25884', 'unknown', 'Not Reported', 'f09a4f85-2a83-4a28-a41f-a7ef0e616064', 'HTAN DFCI', 'syn51360975', 6), ('Outdoor recreational', 'Absent', NULL, 'Pre-Treatment', 'MelanomaTier3', NULL, 'Positive', 'II', 'Absent', 'Other', NULL, 'Skin of back', 'No', 'Absent', 'unknown', 'IV', 'HTA5_1043', '26695', 'Yes', 'Never', '5370c95c-b2cd-4159-a7a3-f79713a9203c', 'HTAN DFCI', 'syn51360975', 6), ('Outdoor recreational', 'Absent', NULL, 'Pre-Treatment', 'MelanomaTier3', NULL, 'Negative', 'II', 'unknown', 'Not Applicable', NULL, 'Skin of lower limb and hip', 'Not Reported', 'Absent', NULL, 'II', 'HTA5_1791', '26818', 'No', 'Never', '90ab1f36-e255-4470-a5b2-d1561d102870', 'HTAN DFCI', 'syn51360975', 6), ('Outdoor recreational', 'Absent', NULL, 'Pre-Treatment', 'MelanomaTier3', NULL, 'Positive', 'II', 'Nonbrisk', 'Not Applicable', NULL, 'Not Reported', 'Yes (less than 50)', 'Absent', NULL, 'III', 'HTA5_1039', '24461', 'Yes', 'Never', '26df7492-738d-49a2-bbf2-18099fa62838', 'HTAN DFCI', 'syn51360975', 6), ('Not Reported', 'Absent', NULL, 'Pre-Treatment', 'MelanomaTier3', NULL, 'Positive', 'II', 'unknown', 'Other', NULL, 'Skin of lower limb and hip', 'Yes (more than 50)', 'Absent', 'Before age 50', 'IV', 'HTA5_1654', '29820', 'Yes', 'Never', 'aa248c65-380b-4bd9-b088-01981a31703e', 'HTAN DFCI', 'syn51360975', 6);