package org.diagbot.repository;

import org.diagbot.entity.node.Disease;
import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.neo4j.repository.Neo4jRepository;

import java.util.List;
import java.util.Map;

public interface DiseaseRepository extends Neo4jRepository<Disease, Long> {
    List<Disease> findByNameContaining(String token);

    // find High Risk Disease
    @Query("MATCH (d:Disease) WHERE d.name in {0} RETURN d.name as name, d.high_risk as risk")
    List<Map<String, Object>> findHighRiskDisease(List<String> diseaselist);

    //get high risk
    @Query("match(d:Disease) where d.name in {0} return d.name as name, d.high_risk as risk")
    List<Map<String, Object>> getHighRisk(List diagList);

}
