patient.setName( "John Doe" );
patient.setAge( 20 );
ksession.insert( patient );
// Go!
Diagnose diagnose = new Diagnose( Terminology.DIAGNOSE_X );
ksession.insert( diagnose );
ksession.fireAllRules();
// Print out recommendations
List<Recommendation> recommendations = recommendationService.getRecommendations();
for ( Recommendation recommendation: recommendations ) {
System.out.println( recommendation );
}
recommendations.clear();
// Simulate a diagnose: incomplete results
diagnose = new Diagnose( Terminology.DIAGNOSE_X_TYPE_UNKNOWN );
ksession.insert( diagnose );
ksession.fireAllRules();
// Print out recommendations
recommendations = recommendationService.getRecommendations();
for ( Recommendation recommendation: recommendations ) {
System.out.println( recommendation );
}
recommendations.clear();
// Simulate a diagnose: type2
diagnose = new Diagnose( Terminology.DIAGNOSE_X_TYPE2 );
ksession.insert( diagnose );
ksession.fireAllRules();
logger.close();