-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.PDC_metadata.aliquot_to_case_mapping_current`
(
  program_name STRING OPTIONS(description="Name of the data's source program"),
  project_name STRING OPTIONS(description="Project name (e.g. CPTAC-2)"),
  case_id STRING OPTIONS(description="Unique identifier associated with a specific patient (e.g. 24cb0fcb-63d6-11e8-bcf1-0a2705229b82)"),
  case_submitter_id STRING OPTIONS(description="Unique identifier deriving from the data submitter that is associated with a specific patient (e.g. 05BR016)"),
  sample_id STRING OPTIONS(description="Unique PDC identifier for this sample (e.g. e8d83eb9-693a-11ea-b1fd-0aad30af8a83)"),
  sample_submitter_id STRING OPTIONS(description="Unique identifier deriving from the data submitter that is associated with a specific sample (e.g. Tumor Pat1)"),
  sample_type STRING OPTIONS(description="Text term to describe the source of a biospecimen used for a laboratory test"),
  preservation_method STRING OPTIONS(description="Text term that represents the method used to preserve the sample."),
  freezing_method STRING OPTIONS(description="Text term that represents the method used for freezing the sample"),
  time_between_clamping_and_freezing INT64 OPTIONS(description="Numeric representation of the elapsed time between the surgical clamping of blood supply and freezing of the sample, measured in minutes"),
  time_between_excision_and_freezing INT64 OPTIONS(description="Numeric representation of the elapsed time between the excision and freezing of the sample, measured in minutes"),
  days_to_collection INT64 OPTIONS(description="Time interval from the date of biospecimen collection to the date of initial pathologic diagnosis, represented as a calculated number of days"),
  initial_weight FLOAT64 OPTIONS(description="Numeric value that represents the initial weight of the sample, measured in milligrams"),
  current_weight FLOAT64 OPTIONS(description="Numeric value that represents the current weight of the sample, measured in milligrams"),
  shortest_dimension FLOAT64 OPTIONS(description="Numeric value that represents the shortest dimension of the sample, measured in millimeters"),
  intermediate_dimension FLOAT64 OPTIONS(description="Intermediate dimension of the sample, in millimeters"),
  longest_dimension FLOAT64 OPTIONS(description="Numeric value that represents the longest dimension of the sample, measured in millimeters"),
  aliquot_id STRING OPTIONS(description="Unique PDC identifier for this aliquot (e.g. e8db124a-693a-11ea-b1fd-0aad30af8a83)"),
  aliquot_submitter_id STRING OPTIONS(description="Aliquot submitter id assigned by program (e.g. T14)")
)
OPTIONS(
  friendly_name="PDC ALIQUOT IDS TO CASE IDS MAP",
  description="Aliquot data was extracted from file metadata information provided by CDA in August 2024 from the PDC release V4.3.",
  labels=[("access", "open"), ("data_type", "file_metadata"), ("source_0", "cda"), ("source_1", "pdc"), ("category", "metadata"), ("status", "current"), ("version", "v4_3")]
);

INSERT INTO `isb-cgc-bq.PDC_metadata.aliquot_to_case_mapping_current` (program_name, project_name, case_id, case_submitter_id, sample_id, sample_submitter_id, sample_type, preservation_method, freezing_method, time_between_clamping_and_freezing, time_between_excision_and_freezing, days_to_collection, initial_weight, current_weight, shortest_dimension, intermediate_dimension, longest_dimension, aliquot_id, aliquot_submitter_id) VALUES ('Broad Institute', 'Broad', '94383f6d-aa4d-4a34-966c-a33cdcc0e984', 'IR', 'c0fb3324-0264-4e8d-8251-e19ff2e582ba', 'IR', NULL, NULL, NULL, NULL, NULL, NULL, nan, nan, nan, nan, nan, '338bb59a-974f-46a8-992a-19dede9d9aca', 'IR'), ('Clinical Proteomic Tumor Analysis Consortium', 'CPTAC3-Other', 'd3cad9e3-843a-41cf-b335-40dbc287b4e9', 'CR1', '94b9d52d-eb3f-4297-99c1-dd6201db47c4', 'CR1', NULL, NULL, NULL, NULL, NULL, NULL, nan, nan, nan, nan, nan, '3f0c9758-abcc-4544-bfb4-a3457a6364f8', 'CR1'), ('Clinical Proteomic Tumor Analysis Consortium', 'CPTAC3-Other', '1324f7bb-34f6-4ebb-81f7-30952f4a5b62', 'CR2', '6f04c7f1-1d49-41a5-a5a4-252dc13e78c0', 'CR2', NULL, NULL, NULL, NULL, NULL, NULL, nan, nan, nan, nan, nan, '24235099-6e9f-4727-9a7d-4cac829a70c4', 'CR2'), ('Clinical Proteomic Tumor Analysis Consortium', 'CPTAC3-Other', '6e7561ef-f5b3-4bf0-8148-f0d155fb0d9d', 'CR3', '519dd6f1-5c2b-489a-971c-164e3e12bf43', 'CR3', NULL, NULL, NULL, NULL, NULL, NULL, nan, nan, nan, nan, nan, 'cdd292e3-412d-46a0-a8ec-d8a2f82cf3a9', 'CR3'), ('Clinical Proteomic Tumor Analysis Consortium', 'CPTAC3-Other', 'df044e27-1d57-4877-8cf0-86ae0f5908b5', 'CR4', 'd850aa0a-70f0-4995-bc29-122056f7c31b', 'CR4', NULL, NULL, NULL, NULL, NULL, NULL, nan, nan, nan, nan, nan, 'eb379a5f-765e-4ca7-8e05-2301106cf479', 'CR4');