String drugUuid = post.get("drug").toString();
Drug drug = Context.getConceptService().getDrugByUuid(drugUuid);
if (drug == null) {
// drug doesn't exist, so we won't create the drug info
throw new ObjectNotFoundException();
}
// create drug info POJO and add required relationship with a Drug
DrugInfo drugInfo = new DrugInfo();
drugInfo.setDrug(drug);