Neo4j - Storing Medical symptoms in graph
Asked Answered
P

3

9

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.

Planogamete answered 6/3, 2014 at 13:28 Comment(3)
Could you please clarify what you're asking? You wrote that you want to build a "complex structure involving location and age factor", but you are "unable to find such complex structures". Are you asking for help modelling your schema? Are you looking for a data sources you can use to fill your graph?Sethsethi
Yeah exactly , I am unable to find such complex structure , can you help me model my schema?Planogamete
Which sources do you use as dataset of diseases and symptoms ?Shew
W
2

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.

Warplane answered 14/3, 2014 at 16:9 Comment(0)
L
1

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.

Linsk answered 11/3, 2014 at 11:19 Comment(0)
C
0

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.

Chrestomathy answered 6/3, 2014 at 13:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.