EmrUiUtils { public String formatRegimenLong(RegimenOrder regimen, UiUtils ui) { if (CollectionUtils.isEmpty(regimen.getDrugOrders())) { return "Empty"; } List<String> components = new ArrayList<String>(); for (DrugOrder o : regimen.getDrugOrders()) { StringBuilder sb = new StringBuilder(); ConceptName cn = o.getConcept().getShortNameInLocale(CoreConstants.LOCALE); if (cn == null) { cn = o.getConcept().getName(CoreConstants.LOCALE); } sb.append(cn.getName()); if (o.getDrug() != null) { sb.append(" " + o.getDrug().getDoseStrength() + o.getDrug().getUnits()); } if (o.getDose() != null) { boolean hasDecimals = Math.floor(o.getDose()) != o.getDose(); String dose = hasDecimals ? ui.format(o.getDose()) : ui.format(o.getDose().intValue()); sb.append(" " + dose + o.getUnits()); } if (o.getFrequency() != null) { sb.append(" " + o.getFrequency()); } components.add(sb.toString()); } return OpenmrsUtil.join(components, " + "); }  String formatDrug(DrugReference drugRef, UiUtils ui); String formatRegimenShort(RegimenOrder regimen, UiUtils ui); String formatRegimenLong(RegimenOrder regimen, UiUtils ui); SimpleObject simpleRegimen(RegimenOrder regimen, UiUtils ui); List<SimpleObject> simpleRegimenHistory(RegimenChangeHistory history, UiUtils ui); List<SimpleObject> simpleRegimenDefinitions(Collection<RegimenDefinition> definitions, UiUtils ui);  }
@Ignore @Test public void formatRegimenLong() throws Exception{ RegimenOrder empty = new RegimenOrder(new HashSet<DrugOrder>()); Assert.assertThat(kenyaUi.formatRegimenLong(empty, ui), is("Empty")); Assert.assertThat(kenyaUi.formatRegimenLong(regimen, ui), is("DAPSONE 100mg OD + D4T 30ml BD")); }