// QueryHPO - Return array of diseases from the HPO databases
Return array of diseases from the HPO databases
// QueryHPO - Return array of diseases from the HPO databases
func QueryHPO(query Queries.ITamalouQuery) ([]*Models.Disease, error) {
	switch query.Type() {
	case "or":
	case "and":
		var mergeDiseases []*Models.Disease
		for _, child := range query.Children() {
			diseases, err := QueryHPO(child)
			if err != nil {
				return nil, err
			}
			if len(mergeDiseases) > 0 {
				mergeDiseases = Models.Merge(mergeDiseases, diseases, string(query.Type()))
			} else {
				mergeDiseases = diseases
			}
		}
		return mergeDiseases, nil
	default:
		diseasesHPIDs, err := QueryIndex(query)
		if err != nil {
			return nil, fmt.Errorf("Error in QueryHPO when querying the index: %v", err)
		}
		return SQLiteQuery(diseasesHPIDs)
	}
	return nil, nil
}
func QueryHPO ( query Queries . ITamalouQuery ) ( [ ] * Models . Disease , error ) { switch query . Type ( ) { case " " : case " " : var mergeDiseases [ ] * Models . Disease for _ , child := range query . Children ( ) { diseases , err := QueryHPO ( child ) if err != nil { return nil , err } if len ( mergeDiseases ) > 0 { mergeDiseases = Models . Merge ( mergeDiseases , diseases , string ( query . Type ( ) ) ) } else { mergeDiseases = diseases } } return mergeDiseases , nil default : diseasesHPIDs , err := QueryIndex ( query ) if err != nil { return nil , fmt . Errorf ( " " , err ) } return SQLiteQuery ( diseasesHPIDs ) } return nil , nil }
Return array of diseases from the HPO databases
Return array of diseases from the HPO databases