@Test public void firstObs_shouldFindFirstObsWithConcept() { Encounter e = new Encounter(); EncounterWrapper wrapper = new EncounterWrapper(e); Assert.assertNull(wrapper.firstObs(Dictionary.getConcept(Dictionary.CD4_COUNT))); Obs obs0 = new Obs(); obs0.setConcept(Dictionary.getConcept(Dictionary.CD4_PERCENT)); obs0.setValueNumeric(50.0); e.addObs(obs0); Obs obs1 = new Obs(); obs1.setConcept(Dictionary.getConcept(Dictionary.CD4_COUNT)); obs1.setValueNumeric(123.0); e.addObs(obs1); Assert.assertEquals(new Double(123.0), wrapper.firstObs(Dictionary.getConcept(Dictionary.CD4_COUNT)).getValueNumeric()); }
public Obs firstObs(Concept concept) { for (Obs obs : target.getAllObs()) { if (obs.getConcept().equals(concept)) { return obs; } } return null; }
EncounterWrapper extends AbstractObjectWrapper<Encounter> { public Obs firstObs(Concept concept) { for (Obs obs : target.getAllObs()) { if (obs.getConcept().equals(concept)) { return obs; } } return null; } }
EncounterWrapper extends AbstractObjectWrapper<Encounter> { public Obs firstObs(Concept concept) { for (Obs obs : target.getAllObs()) { if (obs.getConcept().equals(concept)) { return obs; } } return null; } EncounterWrapper(Encounter target); }
EncounterWrapper extends AbstractObjectWrapper<Encounter> { public Obs firstObs(Concept concept) { for (Obs obs : target.getAllObs()) { if (obs.getConcept().equals(concept)) { return obs; } } return null; } EncounterWrapper(Encounter target); Obs firstObs(Concept concept); List<Obs> allObs(Concept concept); Provider getProvider(); void setProvider(Provider provider); }
EncounterWrapper extends AbstractObjectWrapper<Encounter> { public Obs firstObs(Concept concept) { for (Obs obs : target.getAllObs()) { if (obs.getConcept().equals(concept)) { return obs; } } return null; } EncounterWrapper(Encounter target); Obs firstObs(Concept concept); List<Obs> allObs(Concept concept); Provider getProvider(); void setProvider(Provider provider);  }