pawan9977
pawan9977

Reputation: 607

Neo4j - Storing Medical symptoms in graph

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 .Medical Symptoms

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

Answers (3)

GautamJeyaraman
GautamJeyaraman

Reputation: 545

Here is one simple model that can answer complex queries.

Have 3 types of nodes:

  1. Symptom or Factor - This can be any symptom, temperature, location, age, sex or any factor that can be a cause of the disease.
  2. Patient or Case - This node will have all the required symptom nodes as incoming nodes and will be connected to one disease.
  3. Disease - This node will indicate the disease.

Once you build this with patient's data, you will have a sufficiently complex graph to do the following:

  1. Based on the current patient's symptoms, you can write a simple path query to get the most possible disease. This will not just give you a single disease, but will give you a list of possible diseases and a confidence score based on past patient records.
  2. You can also show interesting statistics like all patient's in location A and age B generally get disease C.
  3. This will also be a database of all past patient's records.

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

Jerome_B
Jerome_B

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

Stefan Armbruster
Stefan Armbruster

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

Related Questions