org.mitre.midiki.workshop
Class WorkshopDatabaseTest

java.lang.Object
  |
  +--org.mitre.midiki.workshop.WorkshopDatabaseTest

public class WorkshopDatabaseTest
extends java.lang.Object

Simple test class for dialogue workshop backend. Allows a user to run tests against the disease database from the command line. Run with no arguments to get the syntax for specific tests. It should be easy for a Java programmer to adapt this class to the needs of a dialogue system with a Java interface.

Since:
1.0

Constructor Summary
WorkshopDatabaseTest()
           
 
Method Summary
static java.lang.String containsIgnoreCase(java.util.Collection c, java.lang.String s)
          Checks the container for a copy of this string, ignoring case.
static void main(java.lang.String[] args)
          Reads arguments and tests queries against the specified database.
static MedicalHistory parseHistory(java.lang.String s, WorkshopDatabase wd)
          Parses a symptom specification of the form "symptom"/ into a MedicalHistory object.
static Symptom parseSymptom(java.lang.String s, WorkshopDatabase wd)
          Parses a symptom specification of the form "symptom"/ into a Symptom object.
static DiagnosticTest parseTest(java.lang.String s, WorkshopDatabase wd)
          Parses a symptom specification of the form "symptom"/ into a DiagnosticTest object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkshopDatabaseTest

public WorkshopDatabaseTest()
Method Detail

containsIgnoreCase

public static java.lang.String containsIgnoreCase(java.util.Collection c,
                                                  java.lang.String s)
Checks the container for a copy of this string, ignoring case. If the item is found, the canonical version is returned.
Parameters:
c - a Container value
s - a String value
Returns:
a String value

parseSymptom

public static Symptom parseSymptom(java.lang.String s,
                                   WorkshopDatabase wd)
Parses a symptom specification of the form "symptom"/ into a Symptom object. The test component of the symptom is not specified. If the component is not specified, it is assumed to be "yes".

parseSymptom("headache/yes") yields Symptom(headache,"",yes)
parseSymptom("\"headache\"/no") yields Symptom(headache,"",no)
parseSymptom("headache") yields Symptom(headache,"",yes)
Parameters:
s - a String value
wd - a WorkshopDatabase in which to search for the symptom name
Returns:
a Symptom value

parseTest

public static DiagnosticTest parseTest(java.lang.String s,
                                       WorkshopDatabase wd)
Parses a symptom specification of the form "symptom"/ into a DiagnosticTest object. The test and result components of the test are not specified. If the component is not specified, it is assumed to be "yes".
Parameters:
s - a String value
wd - a WorkshopDatabase in which to search for the test name
Returns:
a DiagnosticTest value
See Also:
parseSymptom

parseHistory

public static MedicalHistory parseHistory(java.lang.String s,
                                          WorkshopDatabase wd)
Parses a symptom specification of the form "symptom"/ into a MedicalHistory object. If the component is not specified, it is assumed to be "yes".
Parameters:
s - a String value
wd - a WorkshopDatabase in which to search for the history item name
Returns:
a MedicalHistory value
See Also:
parseSymptom

main

public static void main(java.lang.String[] args)
Reads arguments and tests queries against the specified database.
Parameters:
args - a String[] value