|
|
|
@ -4,18 +4,27 @@ import com.cmkg.cmkg.node.disease;
|
|
|
|
|
import org.springframework.data.neo4j.annotation.Query;
|
|
|
|
|
import org.springframework.data.neo4j.repository.Neo4jRepository;
|
|
|
|
|
import org.springframework.data.repository.query.Param;
|
|
|
|
|
import org.springframework.stereotype.Repository;
|
|
|
|
|
import scala.util.parsing.json.JSONArray;
|
|
|
|
|
import scala.util.parsing.json.JSONObject;
|
|
|
|
|
|
|
|
|
|
@Repository
|
|
|
|
|
public interface QuestionRespository extends Neo4jRepository<disease,Long>{
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* param疾病铭恒
|
|
|
|
|
* param疾病名
|
|
|
|
|
*
|
|
|
|
|
* return 返回疾病的id
|
|
|
|
|
*/
|
|
|
|
|
@Query("match(n:Disease) where n.name={name} return n.did")
|
|
|
|
|
int getDiseaseId(@Param("name") String name);
|
|
|
|
|
public Long getDiseaseId(@Param("name") String name);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* param the name of medicine
|
|
|
|
|
*
|
|
|
|
|
* return the id of medicine
|
|
|
|
|
*/
|
|
|
|
|
@Query("match(n:Yangsheng) where n.name={name} return n.yid")
|
|
|
|
|
public Long getMedicineId(@Param("name") String name);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 对应问题模板 nm(病症) 症状
|
|
|
|
@ -24,8 +33,8 @@ public interface QuestionRespository extends Neo4jRepository<disease,Long>{
|
|
|
|
|
*
|
|
|
|
|
* return 返回疾病的症状
|
|
|
|
|
*/
|
|
|
|
|
@Query("match(n:Disease) where n.name={name} return n.symptom")
|
|
|
|
|
String getDiseaseSymptom(@Param("name") String name);
|
|
|
|
|
@Query("match(n:Disease) where n.name={name} return n.syptom")
|
|
|
|
|
public String getDiseaseSymptom(@Param("name") String name);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 对应问题模板 nm 治疗方法
|
|
|
|
@ -34,8 +43,8 @@ public interface QuestionRespository extends Neo4jRepository<disease,Long>{
|
|
|
|
|
*
|
|
|
|
|
* return 对应的药
|
|
|
|
|
*/
|
|
|
|
|
@Query("match (n)-[r:my]-(b) return b limit 10")
|
|
|
|
|
String[] getDiseaseToMedicine(@Param("name") String name);
|
|
|
|
|
@Query("match (n)-[r:my]-(b) return b.name limit 10")
|
|
|
|
|
public String[] getDiseaseToMedicine(@Param("name") String name);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 对应模板问题 nnt 用法
|
|
|
|
@ -44,8 +53,8 @@ public interface QuestionRespository extends Neo4jRepository<disease,Long>{
|
|
|
|
|
*
|
|
|
|
|
* return 药品用法
|
|
|
|
|
*/
|
|
|
|
|
@Query("match(n:yangsheng) where n.name={name} return n.operation")
|
|
|
|
|
String getMedicineOperation(@Param("name") String name);
|
|
|
|
|
@Query("match(n:Yangsheng) where n.name={name} return n.operation")
|
|
|
|
|
public String getMedicineOperation(@Param("name") String name);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 对应模板问题 nnt 作用
|
|
|
|
@ -56,5 +65,5 @@ public interface QuestionRespository extends Neo4jRepository<disease,Long>{
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@Query("match(n:Yangsheng) where n.name={name} return n.symptom")
|
|
|
|
|
String getMedicineSyndromes(@Param("name") String name);
|
|
|
|
|
public String getMedicineSyndromes(@Param("name") String name);
|
|
|
|
|
}
|
|
|
|
|