@Test public void shouldListRegimeShortCodeAdults() throws Exception { List<RegimeShortCode> regimeShortCodes = repository.listRegimeShortCode(Regimen.RegimeType.Adults); assertThat(regimeShortCodes.size(), is(16)); assertThat(regimeShortCodes.get(0).getShortCode(), is("ABC+3TC+DTG")); assertThat(regimeShortCodes.get(15).getCode(), is("08S19")); }
public List<RegimeShortCode> listRegimeShortCode(Regimen.RegimeType type) throws LMISException { return dbUtil.withDao(RegimeShortCode.class, dao -> dao.queryBuilder() .where() .eq("type", type) .query()); }
RegimenRepository { public List<RegimeShortCode> listRegimeShortCode(Regimen.RegimeType type) throws LMISException { return dbUtil.withDao(RegimeShortCode.class, dao -> dao.queryBuilder() .where() .eq("type", type) .query()); } }
RegimenRepository { public List<RegimeShortCode> listRegimeShortCode(Regimen.RegimeType type) throws LMISException { return dbUtil.withDao(RegimeShortCode.class, dao -> dao.queryBuilder() .where() .eq("type", type) .query()); } @Inject  RegimenRepository(Context context); }
RegimenRepository { public List<RegimeShortCode> listRegimeShortCode(Regimen.RegimeType type) throws LMISException { return dbUtil.withDao(RegimeShortCode.class, dao -> dao.queryBuilder() .where() .eq("type", type) .query()); } @Inject  RegimenRepository(Context context); Regimen getByNameAndCategory(final String name, final Regimen.RegimeType category); Regimen getByCode(final String code); void batchSave(List<Regimen> regimens); void create(Regimen regimen); List<Regimen> listDefaultRegime(); List<RegimeShortCode> listRegimeShortCode(Regimen.RegimeType type); void deleteRegimeDirtyData(String programCode); }
RegimenRepository { public List<RegimeShortCode> listRegimeShortCode(Regimen.RegimeType type) throws LMISException { return dbUtil.withDao(RegimeShortCode.class, dao -> dao.queryBuilder() .where() .eq("type", type) .query()); } @Inject  RegimenRepository(Context context); Regimen getByNameAndCategory(final String name, final Regimen.RegimeType category); Regimen getByCode(final String code); void batchSave(List<Regimen> regimens); void create(Regimen regimen); List<Regimen> listDefaultRegime(); List<RegimeShortCode> listRegimeShortCode(Regimen.RegimeType type); void deleteRegimeDirtyData(String programCode);  }