-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.clinical_tier1_demographics_r2`
(
  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 )"),
  Ethnicity STRING OPTIONS(description="An individual's self-described social and cultural grouping, specifically whether an individual describes themselves as Hispanic or Latino. The provided values are based on the categories defined by the U.S. Office of Management and Business and used by the U.S. Census Bureau."),
  Gender STRING OPTIONS(description="Text designations that identify gender. Gender is described as the assemblage of properties that distinguish people on the basis of their societal roles. [Identification of gender is based upon self-report and may come from a form, questionnaire, interview, etc.]"),
  Race STRING OPTIONS(description="An arbitrary classification of a taxonomic group that is a division of a species. It usually arises as a consequence of geographical isolation withina a species and is characterized by shared heredity, physical attributes and behavior, and in the case of humans, by common history, nationality, or geographic distribution."),
  Vital_Status STRING OPTIONS(description="The survival state of the person registered on the protocol."),
  Days_to_Birth STRING OPTIONS(description="Number of days between the date used for index and the date from a person's date of birth represented as a calculated negative number of days."),
  Country_of_Residence STRING OPTIONS(description="Country of Residence at enrollment"),
  Age_Is_Obfuscated STRING OPTIONS(description="The age of the patient has been modified for compliance reasons. The actual age differs from what is reported. Other date intervals for this patient may also be modified."),
  Year_Of_Birth STRING OPTIONS(description="Numeric value to represent the calendar year in which an individual was born."),
  Occupation_Duration_Years STRING OPTIONS(description="The number of years a patient worked in a specific occupation."),
  Premature_At_Birth STRING OPTIONS(description="The yes/no/unknown indicator used to describe whether the patient was premature (less than 37 weeks gestation) at birth."),
  Weeks_Gestation_at_Birth STRING OPTIONS(description="Numeric value used to describe the number of weeks starting from the approximate date of the biological mother's last menstrual period and ending with the birth of the patient."),
  Year_of_Death STRING OPTIONS(description="Numeric value to represent the year of the death of an individual."),
  Age_at_Index STRING OPTIONS(description="For GDC submission only - this is going to be always 0 since HTAN's index is the date of birth"),
  Cause_of_Death STRING OPTIONS(description="The cause of death"),
  Cause_of_Death_Source STRING OPTIONS(description="The text term used to describe the source used to determine the patient's cause of death."),
  Days_to_Death STRING OPTIONS(description="Number of days between the date used for index and the date from a person's date of death represented as a calculated number of days."),
  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")
)
OPTIONS(
  friendly_name="HTAN CLINICAL TIER 1 DATA - DEMOGRAPHICS R2 VERSIONED",
  description="Data was extracted from HTAN Synapse projects in April 2022. This table contains information about HTAN patient cases and their clinical information. 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_demographics_r2` (Component, HTAN_Participant_ID, Ethnicity, Gender, Race, Vital_Status, Days_to_Birth, Country_of_Residence, Age_Is_Obfuscated, Year_Of_Birth, Occupation_Duration_Years, Premature_At_Birth, Weeks_Gestation_at_Birth, Year_of_Death, Age_at_Index, Cause_of_Death, Cause_of_Death_Source, Days_to_Death, entityId, HTAN_Center, Data_Release) VALUES ('Demographics', 'HTA3_8006', 'not hispanic or latino', 'male', 'Not Reported', 'Alive', '0', 'None', 'False', '1942', 'None', 'unknown', 'None', 'None', 'None', 'Not Applicable', 'None', 'None', 'syn24994142', 'HTAN BU', 'Release 1.0'), ('Demographics', 'HTA3_8001', 'not hispanic or latino', 'female', 'white', 'Alive', '0', 'None', 'False', '1946', 'None', 'unknown', 'None', 'None', 'None', 'Not Applicable', 'None', 'None', 'syn24994137', 'HTAN BU', 'Release 1.0'), ('Demographics', 'HTA3_8002', 'not hispanic or latino', 'female', 'white', 'Alive', '0', 'None', 'False', '1944', 'None', 'unknown', 'None', 'None', 'None', 'Not Applicable', 'None', 'None', 'syn24994138', 'HTAN BU', 'Release 1.0'), ('Demographics', 'HTA3_8003', 'not hispanic or latino', 'female', 'white', 'Alive', '0', 'None', 'False', '1942', 'None', 'unknown', 'None', 'None', 'None', 'Not Applicable', 'None', 'None', 'syn24994139', 'HTAN BU', 'Release 1.0'), ('Demographics', 'HTA3_8004', 'not hispanic or latino', 'female', 'white', 'Alive', '0', 'None', 'False', '1942', 'None', 'unknown', 'None', 'None', 'None', 'Not Applicable', 'None', 'None', 'syn24994140', 'HTAN BU', 'Release 1.0');