Reputation: 607
I am using Neo4j graph database to store medical symptoms and diseases . the purpose behind that is give recommendation of diseases a person can have from the symptoms the user has entered into the system. Right now I have stored various symptoms as follows .
It is a very basic graph structure , from which I am retrieving the disease by matching patterns through cypher query such as intersection of causes by Fever , Headache and Flu. What I want to achieve is to build a complex structure involving location and age factor and etc and write various algorithms to retrieve the most connected node by efficiently traversing. I am unable to find such complex structures into internet, So any suggestions would be appreciated. Even though It is not much coding like of question , please give some suggestions as it is just a college project ,and I have to go further in this.
Upvotes: 9
Views: 1410
Reputation: 545
Here is one simple model that can answer complex queries.
Have 3 types of nodes:
Once you build this with patient's data, you will have a sufficiently complex graph to do the following:
Since it is a college project, you can first try with some mock data. This method should be perfect mixture between effectiveness and simplicity.
Upvotes: 2
Reputation: 1097
Maybe you should rethink your model. IMHO, you have not separated symptoms, illness and maybe exams.
Give a look to the Neo4J labels
(:symptom)-[BELONGS]->(:symptomGroup)-[MAY_INDICATE]->(:illNess) (:exam)-[VERIFIES]->(:illNess)
You have to group symptoms
As it is a college project and maybe you are not a doctor, you are not expected to build a 'cure it all' system.
Handle the case where the solution is not found.
I shouldn't write that but I know that brilliant ppl working @ Vidal (French medical publisher) have published a graphgist on that topic recently.
Upvotes: 1
Reputation: 39925
To find the most connected node, aka the one having the most relationships use
MATCH (n)-[r]-()
RETURN n, count(r)
ORDER by count(r) desc
LIMIT 1
The above works with Neo4j 2.0. Please be aware that this traverses the full graph. But if your requirement is as such, you have to do the dirty work.
Upvotes: 0