-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.srrs_biospecimen_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_Biospecimen_ID STRING OPTIONS(description="HTAN ID associated with a biosample based on HTAN ID SOP (eg HTANx_yyy_zzz)"),
  Source_HTAN_Biospecimen_ID STRING OPTIONS(description="This is the HTAN ID that may have been assigned to the biospecimen at the site of biospecimen origin (e.g. BU)."),
  HTAN_Parent_ID STRING OPTIONS(description="HTAN ID of parent from which the biospecimen was obtained. Parent could be another biospecimen or a research participant."),
  Adjacent_Biospecimen_IDs STRING OPTIONS(description="List of HTAN Identifiers (separated by commas) of adjacent biospecimens cut from the same sample; for example HTA3_3000_3, HTA3_3000_4, ..."),
  Biospecimen_Type STRING OPTIONS(description="Biospecimen Type"),
  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."),
  Collection_Days_from_Index STRING OPTIONS(description="Number of days from the research participant's index date that the biospecimen was obtained. If not applicable please enter 'Not Applicable'"),
  Acquisition_Method_Type STRING OPTIONS(description="Records the method of acquisition or source for the specimen under consideration."),
  Ischemic_Time STRING OPTIONS(description="Duration of time, in seconds, between when the specimen stopped receiving oxygen and when it was preserved or processed. Integer value."),
  Ischemic_Temperature STRING OPTIONS(description="Specify whether specimen experienced warm or cold ischemia."),
  Collection_Media STRING OPTIONS(description="Material Specimen is collected into post procedure"),
  Topography_Code STRING OPTIONS(description="Topography Code, indicating site within the body, based on ICD-O-3."),
  Additional_Topography STRING OPTIONS(description="Topography not included in the ICD-O-3 Topography codes."),
  Fixative_Type STRING OPTIONS(description="Text term to identify the type of fixative used to preserve a tissue specimen"),
  Storage_Method STRING OPTIONS(description="The method by which a biomaterial was stored after preservation or before another protocol was used."),
  Preinvasive_Morphology STRING OPTIONS(description="Histologic Morphology not included in ICD-O-3 morphology codes, for preinvasive lesions included in the HTAN"),
  Histologic_Morphology_Code STRING OPTIONS(description="Histologic Morphology Code, based on ICD-O-3. Any valid ICD-O-3 morphology code. See https://seer.cancer.gov/icd-o-3/ and https://seer.cancer.gov/icd-o-3/sitetype.icdo3.20200629.xlsx. Examples: 80510"),
  Preservation_Method STRING OPTIONS(description="Text term that represents the method used to preserve the sample."),
  Processing_Days_from_Index STRING OPTIONS(description="Number of days from the research participant's index date that the biospecimen was processed. If not applicable please enter 'Not Applicable'"),
  Protocol_Link STRING OPTIONS(description="Protocols.io ID or DOI link to a free/open protocol resource describing in detail the assay protocol (e.g. surface markers used in Smart-seq, dissociation duration,  lot/batch numbers for key reagents such as primers, sequencing reagent kits, etc.) or the protocol by which the sample was obtained or generated."),
  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 SRRS BIOSPECIMEN DATA R3 VERSIONED",
  description="This table captures essential biospecimen data elements specific to SRRS (Standardized Repository of Reference Specimens) HTAN samples. Data was extracted from HTAN Synapse projects in April 2023.",
  labels=[("access", "open"), ("data_type", "biospecimen"), ("program", "htan"), ("source", "htan"), ("category", "clinical_biospecimen_data"), ("status", "current")]
);

INSERT INTO `isb-cgc-bq.HTAN_versioned.srrs_biospecimen_r3` (Component, HTAN_Biospecimen_ID, Source_HTAN_Biospecimen_ID, HTAN_Parent_ID, Adjacent_Biospecimen_IDs, Biospecimen_Type, Timepoint_Label, Collection_Days_from_Index, Acquisition_Method_Type, Ischemic_Time, Ischemic_Temperature, Collection_Media, Topography_Code, Additional_Topography, Fixative_Type, Storage_Method, Preinvasive_Morphology, Histologic_Morphology_Code, Preservation_Method, Processing_Days_from_Index, Protocol_Link, entityId, HTAN_Center, Data_Release, Manifest_Version, Uuid) VALUES ('SRRSBiospecimen', 'HTA3_11009_14000001', NULL, 'HTA3_11009', NULL, 'Tissue Biospecimen Type', 'surgical treatment', '24028', 'Surgical Resection', 'unknown', NULL, NULL, 'C34.9', NULL, 'OCT media', 'Frozen at -80C', NULL, '8072/3', 'OCT', 'unknown', 'dx.doi.org/10.17504/protocols.io.bzuvp6w6', 'syn26452761', 'HTAN SRRS', 'Release 2.0', 4, 'd77305e6-e808-4b48-9360-df4c234e5e04'), ('SRRSBiospecimen', 'HTA3_11009_14000002', NULL, 'HTA3_11009', NULL, 'Tissue Biospecimen Type', 'surgical treatment', '24028', 'Surgical Resection', 'unknown', NULL, NULL, 'C34.9', NULL, 'OCT media', 'Frozen at -80C', 'Squamous Carcinoma in situ', '8072/3', 'OCT', 'unknown', 'dx.doi.org/10.17504/protocols.io.bzuvp6w6', 'syn26452762', 'HTAN SRRS', 'Release 2.0', 4, '898a1a5f-be93-4bb2-8e61-36cee36a3788'), ('SRRSBiospecimen', 'HTA3_11009_14000003', NULL, 'HTA3_11009', NULL, 'Tissue Biospecimen Type', 'surgical treatment', '24028', 'Surgical Resection', 'unknown', NULL, NULL, 'C34.9', NULL, 'OCT media', 'Frozen at -80C', 'Normal WDA', 'unknown', 'OCT', 'unknown', 'dx.doi.org/10.17504/protocols.io.bzuvp6w6', 'syn26452763', 'HTAN SRRS', 'Release 2.0', 4, 'e4f187dc-a8a6-4816-b5ec-44beaf753e17'), ('SRRSBiospecimen', 'HTA3_11009_14000004', NULL, 'HTA3_11009', 'HTA3_11009_14000001', 'Tissue Biospecimen Type', 'surgical treatment', '24028', 'Surgical Resection', 'unknown', NULL, NULL, 'C34.9', NULL, 'OCT media', 'Frozen at -80C', 'Severe dysplasia', 'unknown', 'OCT', 'unknown', 'dx.doi.org/10.17504/protocols.io.bzuvp6w6', 'syn26452764', 'HTAN SRRS', 'Release 2.0', 4, '98a26668-bf19-42a7-a9fa-d758ef97eb35'), ('SRRSBiospecimen', 'HTA3_11009_14000005', NULL, 'HTA3_11009', 'HTA3_11009_14000003', 'Tissue Biospecimen Type', 'surgical treatment', '24028', 'Surgical Resection', 'unknown', NULL, NULL, 'C34.9', NULL, 'OCT media', 'Frozen at -80C', NULL, 'unknown', 'OCT', 'unknown', 'dx.doi.org/10.17504/protocols.io.bzuvp6w6', 'syn26452765', 'HTAN SRRS', 'Release 2.0', 4, 'f6fd7b0a-da8c-40e6-bf92-51b31f7f3ed6');