           fields (cdb/run-query db {:select [:*] :from [:field]})
           probes (cdb/run-query db {:select [:value] :from [:code]})
           positions (cdb/run-query db {:select [:*] :from [:field_position]})
-          genes (cdb/run-query db {:select [:*] :from [:field_gene]})]
+          genes (cdb/run-query db {:select [:*] :from [:field_gene]})
+          probe-field (:ID (first (cdb/run-query db {:select [:id] :from [:field] :where [:= :name "name"]})))
+          data (map :PID (cdb/run-query db {:select [[(hsqltypes/read-sql-call [:unpackValue probe-field :row]) :pid]]
+                                            :from [:field_position]}))]
 
       (ct/is (= probemap [{:NAME "probes"}]))
       (ct/is (= (set probes)

                 {:NAME "probe2" :ID 3 :DATASET_ID 1}
                 {:NAME "probe3" :ID 4 :DATASET_ID 1}
                 {:NAME "probe4" :ID 5 :DATASET_ID 1}
                 {:NAME "probe5" :ID 6 :DATASET_ID 1} ])))))

(defn detect-cgdata-genomic [db]
  (ct/testing "detect cgdata genomic"

                   {:FIELD_ID 3 :ROW 6 :GENE "GENEB"}
                   {:FIELD_ID 3 :ROW 6 :GENE "GENEC"}
                   {:FIELD_ID 3 :ROW 7 :GENE "GENED"}
                   {:FIELD_ID 3 :ROW 8 :GENE "GENEE"}])))
      (ct/is (= data ["probe1" "probe5" "probe2" "probe6" "probe3" "probe7" "probe4" "probe8" "probe9"])))))

(defn detect-cgdata-clinical [db]
  (ct/testing "detect cgdata clinical"
