 					3 AS RowNum
 				FROM dbo.result_entities features
 				INNER JOIN dbo.result_entities refs ON refs.parent_id = features.id 
-					AND refs.attribute_id = 115 -- Reference bases
-				INNER JOIN dbo.result_entities snps ON snps.parent_id = features.id
-				INNER JOIN dbo.attribute_relationships ar ON snps.attribute_id = ar.attribute1_id
-					AND ar.relationship_id = 5     -- Variant of gene
-					AND ar.attribute2_id IN (34, 35)    -- F2, F5
-				WHERE features.attribute_id = 114   -- VCF Feature
-
-				UNION ALL
-
-				-- Grab vcf features, features have children specific SNPs, which have children SNP allele attributes
+					AND refs.attribute_id = 100 -- Reference bases
+				INNER JOIN dbo.result_entities snps ON snps.parent_id = features.id
+				INNER JOIN dbo.attribute_relationships ar ON snps.attribute_id = ar.attribute1_id
+					AND ar.relationship_id = 5     -- Variant of gene
+					AND ar.attribute2_id IN (34, 35)      -- F2, F5
+				WHERE features.attribute_id = 96   -- GVF Feature
+
+				UNION ALL
+
+				-- Grab GVF features, features have children specific SNPs, which have children SNP allele attributes
 				-- Limit this to just SNPs that are under CYP2C19
 				SELECT features.patient_id, features.id, snps.attribute_id AS [snp_id], alleles.value_short_text,
 					ROW_NUMBER() OVER (PARTITION BY snps.id, snps.attribute_id ORDER BY features.patient_id, snps.attribute_id) AS RowNum

					3 AS RowNum
				FROM dbo.result_entities features
				INNER JOIN dbo.result_entities refs ON refs.parent_id = features.id 
					AND refs.attribute_id = 115 -- Reference bases
				INNER JOIN dbo.result_entities snps ON snps.parent_id = features.id
				INNER JOIN dbo.attribute_relationships ar ON snps.attribute_id = ar.attribute1_id
					AND ar.relationship_id = 5     -- Variant of gene
					AND ar.attribute2_id = 32      -- CYP2C9
				WHERE features.attribute_id = 114   -- VCF Feature

				UNION ALL

				-- Grab vcf features, features have children specific SNPs, which have children SNP allele attributes
				-- Limit this to just SNPs that are under CYP2C19
				SELECT features.patient_id, features.id, snps.attribute_id AS [snp_id], alleles.value_short_text,
					ROW_NUMBER() OVER (PARTITION BY snps.id, snps.attribute_id ORDER BY features.patient_id, snps.attribute_id) AS RowNum

				SELECT features.patient_id, features.id, snps.attribute_id AS [snp_id], CONVERT(VARCHAR, res_dt.value_date_time, 101) AS [value_short_text],
					4 AS RowNum
				FROM dbo.result_entities features
				INNER JOIN dbo.result_entities gvf ON gvf.id = features.parent_id
					AND gvf.attribute_id = 74  -- GVF result
				INNER JOIN dbo.result_entities res_dt ON res_dt.parent_id = gvf.id 
					AND res_dt.attribute_id = 72 -- Reference bases
				INNER JOIN dbo.result_entities snps ON snps.parent_id = features.id
				INNER JOIN dbo.attribute_relationships ar ON snps.attribute_id = ar.attribute1_id AND ar.relationship_id = 5
					AND ar.attribute2_id IN (34, 35)      -- F2, F5
				INNER JOIN dbo.patients p ON p.id = features.patient_id

				UNION ALL
