Skip to content

Commit d975149

Browse files
RESTWS-760: Order resource does not include drug strength
1 parent e8838aa commit d975149

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

omod/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_10/DrugOrderSubclassHandler1_10.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import org.apache.commons.lang.StringUtils;
1515
import org.openmrs.CareSetting;
16+
import org.openmrs.Drug;
1617
import org.openmrs.DrugOrder;
1718
import org.openmrs.Order;
1819
import org.openmrs.OrderType;
@@ -202,4 +203,16 @@ public static String getDisplay(DrugOrder delegate) {
202203

203204
return ret.toString();
204205
}
206+
207+
@PropertyGetter("strength")
208+
public String getStrength(DrugOrder delegate) {
209+
StringBuilder ret = new StringBuilder();
210+
if (delegate.getDrug() != null) {
211+
Drug drug = delegate.getDrug();
212+
ret.append(drug.getStrength() != null ? drug.getStrength() : "[no strength]");
213+
} else {
214+
ret.append("[no strength]");
215+
}
216+
return ret.toString();
217+
}
205218
}

0 commit comments

Comments
 (0)