|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--org.mitre.midiki.workshop.WorkshopDatabase
Simple medical diagnosis database to support the MITRE Dialogue Workshop. Primary usage is to identify possible diseases in database given a list of symptoms, either present or absent, and further symptoms which can be used to narrow a diagnosis if multiple diseases can be diagnosed. Not intended for use with a large number of diseases; the algorithms used were chosen for ease of implementation, not scalability.
Serializable, Serialized Form| Field Summary | |
protected java.util.ArrayList |
diseaseList
Unsorted list of disease names. |
protected java.util.ArrayList |
diseases
List of detailed records for diseases. |
protected DiseaseToSymptomMapping[] |
diseasesByHistory
Column headers for the sparse matrix. |
protected DiseaseToSymptomMapping[] |
diseasesBySymptom
Column headers for the sparse matrix. |
protected DiseaseToSymptomMapping[] |
diseasesByTest
Column headers for the sparse matrix. |
protected DiseaseToSymptomMapping[] |
historyByDisease
Row headers for the sparse matrix. |
protected java.util.List |
historyList
Unsorted list of medical history item names. |
protected java.util.List |
symptomList
Unsorted list of resolved symptom names. |
protected DiseaseToSymptomMapping[] |
symptomsByDisease
Row headers for the sparse matrix. |
protected java.util.ArrayList |
synonymList
List of synonym sets. |
protected java.util.List |
testList
Unsorted list of test names. |
protected DiseaseToSymptomMapping[] |
testsByDisease
Row headers for the sparse matrix. |
protected java.util.HashMap |
uniqueHistory
Maps resolved names of all history to the appropriate record. |
protected java.util.HashMap |
uniqueSymptoms
Maps resolved names of all symptoms to the appropriate record. |
protected java.util.HashMap |
uniqueTests
Maps resolved names of all tests to the appropriate record. |
| Constructor Summary | |
WorkshopDatabase()
Creates an empty WorkshopDatabase instance. |
|
| Method Summary | |
protected boolean |
compatibleWithSymptoms(java.lang.String diseaseName,
java.util.List symptoms,
java.util.List tests,
java.util.List history)
Returns true if the specified disease is compatible with the observed symptoms. |
protected java.util.LinkedList |
discriminatingHistory(java.util.List diseases,
java.util.List history)
Calculates the history which can be used to discriminate between some of the specified diseases. |
protected java.util.LinkedList |
discriminatingSymptoms(java.util.List diseases,
java.util.List symptoms)
Calculates the symptoms which can be used to discriminate between some of the specified diseases. |
protected java.util.LinkedList |
discriminatingTests(java.util.List diseases,
java.util.List tests)
Calculates the tests which can be used to discriminate between some of the specified diseases. |
protected int |
diseaseIndex(java.lang.String diseaseName)
Converts a disease name into a numeric index. |
java.util.List |
getAllDiseases()
Returns a list containing the names of all the diseases in the database. |
java.util.List |
getAllHistoryItems()
Returns the list of unique history items in the database. |
java.util.List |
getAllSymptoms()
Returns the list of unique symptoms in the database. |
java.util.List |
getAllSymptomSynonyms()
Returns all synonym sets specified in the database. |
java.util.List |
getAllTestNames()
Returns the names of tests in the database. |
java.util.List |
getAllTests()
Returns the list of unique tests in the database. |
QueryResponse |
getApplicableDiseases(java.util.List symptoms,
java.util.List tests,
java.util.List history)
Searches the database for diseases matching the specified symptoms. |
Disease |
getDiseaseDescription(java.lang.String diseaseName)
Locates the detailed record for the specified disease. |
protected int |
historyIndex(java.lang.String historyName)
Converts a history name to a numeric index. |
void |
printDiseasesBySymptom()
Prints a cross-reference listing of diseases by symptom on System.out. |
protected java.lang.String |
resolveSynonyms(java.lang.String s)
Checks all known synonym sets for the specified string. |
protected int |
symptomIndex(java.lang.String symptomName)
Converts a symptom name to a numeric index. |
protected int |
testIndex(java.lang.String testName)
Converts a test name to a numeric index. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.ArrayList diseaseList
protected java.util.ArrayList synonymList
protected java.util.List symptomList
protected java.util.List testList
protected java.util.List historyList
protected java.util.ArrayList diseases
protected java.util.HashMap uniqueSymptoms
protected java.util.HashMap uniqueTests
protected java.util.HashMap uniqueHistory
protected DiseaseToSymptomMapping[] symptomsByDisease
protected DiseaseToSymptomMapping[] diseasesBySymptom
protected DiseaseToSymptomMapping[] testsByDisease
protected DiseaseToSymptomMapping[] diseasesByTest
protected DiseaseToSymptomMapping[] historyByDisease
protected DiseaseToSymptomMapping[] diseasesByHistory
| Constructor Detail |
public WorkshopDatabase()
WorkshopDatabase instance.
Use WorkshopDatabaseFactory.newDatabase() to populate it,
or load it from an ObjectInputStream.| Method Detail |
protected java.lang.String resolveSynonyms(java.lang.String s)
s - a String valueString valueprotected int diseaseIndex(java.lang.String diseaseName)
diseaseName - a String valueint valueprotected int symptomIndex(java.lang.String symptomName)
symptomName - a String valueint valueprotected int testIndex(java.lang.String testName)
testName - a String valueint valueprotected int historyIndex(java.lang.String historyName)
historyName - a String valueint value
protected boolean compatibleWithSymptoms(java.lang.String diseaseName,
java.util.List symptoms,
java.util.List tests,
java.util.List history)
diseaseName - a String valuesymptoms - a List valuetests - a List valuehistory - a List valueboolean value
protected java.util.LinkedList discriminatingSymptoms(java.util.List diseases,
java.util.List symptoms)
diseases - a List of possible diseasessymptoms - a List of known symptomsLinkedList of possible discriminators
protected java.util.LinkedList discriminatingTests(java.util.List diseases,
java.util.List tests)
diseases - a List of possible diseasestests - a List of known testsLinkedList of possible discriminators
protected java.util.LinkedList discriminatingHistory(java.util.List diseases,
java.util.List history)
diseases - a List of possible diseaseshistory - a List of known historyLinkedList of possible discriminatorspublic void printDiseasesBySymptom()
public java.util.List getAllDiseases()
getDiseaseDescription() is warranted
to work for every name in this list.List valuepublic java.util.List getAllSymptoms()
List valuepublic java.util.List getAllTestNames()
List valuepublic java.util.List getAllTests()
List valuepublic java.util.List getAllHistoryItems()
List valuepublic java.util.List getAllSymptomSynonyms()
List value
public QueryResponse getApplicableDiseases(java.util.List symptoms,
java.util.List tests,
java.util.List history)
symptoms - a List valueQueryResponse valuepublic Disease getDiseaseDescription(java.lang.String diseaseName)
diseaseName - a String valueDisease value
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||