Am working on an application that helps user to enter symptoms that matches those existing in the database and gets disease(diagnosis).
I have the following database table with information about symptoms, diseases, and disease-symptoms which associates the two tables, as shown below:
DISEASE_T SYMPTOMS disease-symptoms ========== ========== ======== DISEASE_ID SYMPTOM_ID DISEASE_ID VALUE VALUE SYMPTOM_ID
I want to search user selected symptoms, which are array of symptoms id in disease-symptoms table and return top 5 matching disease IDs, based on, where most of the symptoms are matching with each disease.
For example, user select symptoms are 1,2,3 (cough,cold,headache)
DISEASE_T SYMPTOMS_T disease-symptoms ========= ========== =============== 1,malaria 1,cough 1,1 2,tuberculosis 2,cold 1,2 3,typhoid 3,headache 2,2 2,3 3,1 3,2 3,3
Help will be appreciated.