-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.clinical_tier1_familyhistory_r4`
(
  entityId STRING OPTIONS(description="Synapse ID of entity"),
  HTAN_Participant_ID STRING OPTIONS(description="HTAN ID associated with a patient based on HTAN ID SOP (eg HTANx_yyy )"),
  Relationship_Gender STRING OPTIONS(description="The text term used to describe the gender of the patient's relative with a history of cancer."),
  Relationship_Age_at_Diagnosis STRING OPTIONS(description="The age (in years) when the patient's relative was first diagnosed."),
  Id STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819"),
  Relationship_Type STRING OPTIONS(description="The subgroup that describes the state of connectedness between members of the unit of society organized around kinship ties."),
  Relative_with_Cancer_History STRING OPTIONS(description="The yes/no/unknown indicator used to describe whether any of the patient's relatives have a history of cancer."),
  Component STRING OPTIONS(description="Category of metadata (e.g. Diagnosis, Biospecimen, scRNA-seq Level 1, etc.); provide the same one for all items/rows."),
  Relationship_Primary_Diagnosis STRING OPTIONS(description="The text term used to describe the malignant diagnosis of the patient's relative with a history of cancer."),
  Relatives_with_Cancer_History_Count STRING OPTIONS(description="The number of relatives the patient has with a known history of cancer."),
  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 - FAMILY HISTORY R4 VERSIONED",
  description="This table contains family history clinical 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_familyhistory_r4` (entityId, HTAN_Participant_ID, Relationship_Gender, Relationship_Age_at_Diagnosis, Id, Relationship_Type, Relative_with_Cancer_History, Component, Relationship_Primary_Diagnosis, Relatives_with_Cancer_History_Count, HTAN_Center, Manifest_Id, Manifest_Version) VALUES ('syn28270513', 'HTA1_286', NULL, NULL, '6b88710f-1360-4e46-9869-5eb2c96f717a', NULL, NULL, 'FamilyHistory', NULL, NULL, 'HTAN HTAPP', 'syn42236954', 1), ('syn28270514', 'HTA1_288', NULL, NULL, '3ddd15b9-ec7f-4b48-b56f-3d3c58d15145', NULL, NULL, 'FamilyHistory', NULL, NULL, 'HTAN HTAPP', 'syn42236954', 1), ('syn28270519', 'HTA1_289', NULL, NULL, '76b55478-dbab-4915-ae90-b1f8a030c006', NULL, NULL, 'FamilyHistory', NULL, NULL, 'HTAN HTAPP', 'syn42236954', 1), ('syn27537846', 'HTA10_01', NULL, NULL, '933a0b75-cf5d-4d3b-8fd4-528da650cae7', NULL, NULL, 'FamilyHistory', NULL, NULL, 'HTAN Stanford', 'syn39285152', 1), ('syn27537847', 'HTA10_02', NULL, NULL, '1ad81de1-0d4e-4861-8b23-15f26a53fc13', NULL, NULL, 'FamilyHistory', NULL, NULL, 'HTAN Stanford', 'syn39285152', 1);