public Facility getFacilityByCode(String facilityCode) { Facility facility; if ((facility = facilityRepository.getByCode(facilityCode)) == null) { throw new DataException(ERROR_FACILITY_CODE_INVALID); } facility.setSupportedPrograms( (List<ProgramSupported>) select( facility.getSupportedPrograms(), new Predicate() { @Override public boolean evaluate(Object o) { return ((ProgramSupported) o).getActive(); } })); return facility; }
public Facility getByCode(Facility facility) { return facilityRepository.getByCode(facility.getCode()); }