// Retrieve information on side effects of matched drug
Retrieve information on side effects of matched drug
// Retrieve information on side effects of matched drug
func QueryMeddraFreq(drugs []*Models.Drug, clinicalSigns []string) ([]*Models.Drug, error) {
	for _, value := range clinicalSigns {
		clinicalSignsSql += "WHEN meddra_freq.side_effect_name LIKE '" + value + "' THEN 1\n"
	}
	buckets := SplitQueries(drugs, NbThread)
	var wg sync.WaitGroup
	wg.Add(NbThread)
	var treated = 0
	for i := 0; i < NbThread; i++ {
		go ClinicalSignsFromCompoundId(buckets[i], clinicalSignsSql, &wg, &treated)
	}
	wg.Wait()
	fmt.Println("Done")
	fmt.Println(treated, " rows treated")
	return JoinQueries(buckets), nil
}
func QueryMeddraFreq ( drugs [ ] * Models . Drug , clinicalSigns [ ] string ) ( [ ] * Models . Drug , error ) { for _ , value := range clinicalSigns { clinicalSignsSql += " " + value + " \n " } buckets := SplitQueries ( drugs , NbThread ) var wg sync . WaitGroup wg . Add ( NbThread ) var treated = 0 for i := 0 ; i < NbThread ; i ++ { go ClinicalSignsFromCompoundId ( buckets [ i ] , clinicalSignsSql , & wg , & treated ) } wg . Wait ( ) fmt . Println ( " " ) fmt . Println ( treated , " " ) return JoinQueries ( buckets ) , nil }
Retrieve information on side effects of matched drug
Retrieve information on side effects of matched drug
// Build SQL string conditions based on clinical signs // Split queries into NbThread slices // Start multi threading