@Override public void prepare(TestCase testCase) { facts = new ArrayList<Object>(maxStep); FactType observationResult = ksession.getKnowledgeBase().getFactType("opencds.test", "ObservationResult2"); try { for (int j = 0; j < maxStep; j++) { Object obs = null; obs = observationResult.newInstance(); CD cdFocus = new CD(); cdFocus.setCodeSystem("AHRQ v4.3"); cdFocus.setCode("10220"); observationResult.set( obs, "id", "001" + Integer.toString(j)); // UUID.randomUUID().toString()); observationResult.set(obs, "observationFocus", cdFocus); observationResult.set(obs, "subjectIsFocalPerson", true); CD cdCoded = new CD(); cdCoded.setCodeSystem("AHRQ v4.3"); cdCoded.setCode("34254"); ObservationValue obsValue = new ObservationValue(); obsValue.setConcept(cdCoded); obsValue.setIdentifier(UUID.randomUUID().toString()); observationResult.set(obs, "observationValue", obsValue); facts.add(obs); ksession.insert(obs); } } catch (InstantiationException e) { e .printStackTrace(); // To change body of catch statement use File | Settings | File // Templates. } catch (IllegalAccessException e) { e .printStackTrace(); // To change body of catch statement use File | Settings | File // Templates. } }