-- DBMS: snowflake
create or replace TABLE PHARMACOGENOMICS (
	"datasourceId" VARCHAR(16777216),
	"datasourceVersion" VARCHAR(16777216),
	"datatypeId" VARCHAR(16777216),
	"directionality" VARCHAR(16777216),
	"evidenceLevel" VARCHAR(16777216),
	"genotype" VARCHAR(16777216),
	"genotypeAnnotationText" VARCHAR(16777216),
	"genotypeId" VARCHAR(16777216),
	"haplotypeFromSourceId" VARCHAR(16777216),
	"haplotypeId" VARCHAR(16777216),
	"literature" VARIANT,
	"pgxCategory" VARCHAR(16777216),
	"phenotypeFromSourceId" VARCHAR(16777216),
	"phenotypeText" VARCHAR(16777216),
	"studyId" VARCHAR(16777216),
	"targetFromSourceId" VARCHAR(16777216),
	"variantFunctionalConsequenceId" VARCHAR(16777216),
	"variantRsId" VARCHAR(16777216),
	"isDirectTarget" BOOLEAN,
	"drugs" VARIANT
);

INSERT INTO "OPEN_TARGETS_PLATFORM_1"."PLATFORM"."PHARMACOGENOMICS" (studyId, haplotypeId, isDirectTarget, genotypeId, evidenceLevel, datasourceId, targetFromSourceId, drugs, phenotypeFromSourceId, literature, directionality, genotype, datasourceVersion, genotypeAnnotationText, haplotypeFromSourceId, variantFunctionalConsequenceId, variantRsId, phenotypeText, datatypeId, pgxCategory) VALUES ('613976757', NULL, False, '1_225838705_A_G,G', '3', 'pharmgkb', 'ENSG00000143819', '{
  "list": [
    {
      "element": {
        "drugFromSource": "carbamazepine",
        "drugId": "CHEMBL108"
      }
    }
  ]
}', NULL, '{
  "list": [
    {
      "element": "23252947"
    },
    {
      "element": "19620853"
    },
    {
      "element": "22188362"
    },
    {
      "element": "15692831"
    },
    {
      "element": "25495409"
    },
    {
      "element": "26555147"
    },
    {
      "element": "26555147"
    }
  ]
}', NULL, 'GG', '2024-05-05', 'Patients with the GG genotype may require an increased dose of carbamazepine as compared to patients with the AA genotype, although this is contradicted in one study. Other genetic and clinical factors may also influence dose of carbamazepine.', NULL, 'SO_0001583', 'rs2234922', 'increased dose of carbamazepine', 'clinical_annotation', 'dosage'), ('613976757', NULL, False, '1_225838705_A_A,G', '3', 'pharmgkb', 'ENSG00000143819', '{
  "list": [
    {
      "element": {
        "drugFromSource": "carbamazepine",
        "drugId": "CHEMBL108"
      }
    }
  ]
}', NULL, '{
  "list": [
    {
      "element": "23252947"
    },
    {
      "element": "19620853"
    },
    {
      "element": "22188362"
    },
    {
      "element": "15692831"
    },
    {
      "element": "25495409"
    },
    {
      "element": "26555147"
    },
    {
      "element": "26555147"
    }
  ]
}', NULL, 'AG', '2024-05-05', 'Patients with the AG genotype may require an increased dose of carbamazepine as compared to patients with the AA genotype, although this is contradicted in one study. Other genetic and clinical factors may also influence dose of carbamazepine.', NULL, 'SO_0001583', 'rs2234922', 'increased dose of carbamazepine', 'clinical_annotation', 'dosage'), ('613976757', NULL, False, '1_225838705_A_A,A', '3', 'pharmgkb', 'ENSG00000143819', '{
  "list": [
    {
      "element": {
        "drugFromSource": "carbamazepine",
        "drugId": "CHEMBL108"
      }
    }
  ]
}', NULL, '{
  "list": [
    {
      "element": "23252947"
    },
    {
      "element": "19620853"
    },
    {
      "element": "22188362"
    },
    {
      "element": "15692831"
    },
    {
      "element": "25495409"
    },
    {
      "element": "26555147"
    },
    {
      "element": "26555147"
    }
  ]
}', NULL, 'AA', '2024-05-05', 'Patients with the AA genotype may require a decreased dose of carbamazepine as compared to patients with the AG or GG genotype, although this is contradicted in one study. Other genetic and clinical factors may also influence dose of carbamazepine.', NULL, 'SO_0002073', 'rs2234922', 'decreased dose of carbamazepine', 'clinical_annotation', 'dosage'), ('613976848', NULL, False, '6_31639273_C_C,T', '3', 'pharmgkb', 'ENSG00000204463', '{
  "list": [
    {
      "element": {
        "drugFromSource": "carbamazepine",
        "drugId": "CHEMBL108"
      }
    }
  ]
}', NULL, '{
  "list": [
    {
      "element": "16538176"
    }
  ]
}', NULL, 'CT', '2024-05-05', 'Patients with the CT genotype who are treated with carbamazepine may have an increased risk of Stevens-Johnson syndrome as compared to patients with the TT genotype. Other genetic and clinical factors may also influence a patient''s risk for Stevens-Johnson syndrome with carbamazepine treatment.', NULL, 'SO_0001627', 'rs750332', 'increased risk of Stevens-Johnson syndrome', 'clinical_annotation', 'toxicity'), ('613977037', NULL, False, '6_31810495_G_A,G', '3', 'pharmgkb', 'ENSG00000204390', '{
  "list": [
    {
      "element": {
        "drugFromSource": "carbamazepine",
        "drugId": "CHEMBL108"
      }
    }
  ]
}', NULL, '{
  "list": [
    {
      "element": "16538175"
    }
  ]
}', NULL, 'AG', '2024-05-05', 'Patients with the AG genotype may have a decreased but not non-existent chance of severe hypersensitivity to carbamazepine treatment as compared to patients with the AA genotype. Other genetic and clinical factors may also influence a patient''s chance of adverse response.', NULL, 'SO_0001583', 'rs2227956', 'decreased chance of severe hypersensitivity to carbamazepine treatment', 'clinical_annotation', 'toxicity');