Commit c922bb91 authored by Rob Tomsick's avatar Rob Tomsick

Play some code golf

parent 24f21474
......@@ -220,24 +220,17 @@ implements DictionaryService
{
limit = limit > 0 ? limit : this.resultLimit();
String ndcStr = null;
if (ndc.complete())
{
/* strip off the package component */
ndcStr = NDC.create(ArrayUtils.addAll(ndc.labelerCode(),
ndc.productCode()))
.toString();
}
else
{
ndcStr = ndc.toString();
}
final String ndcStr =
(ndc.complete()
? (new NDC(ndc.labelerCode(), ndc.productCode()))
: ndc)
.toString();
final List<UUID> ids =
this.ctx.select(field(name("id"), UUID.class))
.from(D_TABLE)
.where(field(name("ndc")).eq(ndcStr))
.orderBy(field(name("proprietary_name")).desc())
.where(field(name("ndc"), String.class).eq(ndcStr))
.orderBy(field(name("proprietary_name"), String.class).desc())
.limit(limit)
.fetch(field(name("id"), UUID.class));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment