@WSDoc("Gets Full representation of Drug for the uuid path")
@ResponseBody()
public String getDrugByUuidFull(@PathVariable("uuid") String uuid, @RequestParam("v") String rep,
HttpServletRequest request) throws ResponseException {
initDrugController();
Drug drug = service.getDrugByUuid(uuid);
SimpleObject obj = getDrugAsSimpleObject(drug);
if (rep.equals("full")) {
obj.add("retired", drug.getRetired());
if (drug.getRetired()) {
obj.add("retiredBy", drug.getRetiredBy().getUuid());
obj.add("retireReason", drug.getRetireReason());
}
SimpleObject auditInfo = new SimpleObject();
auditInfo.add("creator", drug.getCreator().getUuid());
auditInfo.add("dateCreated", df.format(drug.getDateCreated()));
if (drug.getChangedBy() != null) {
auditInfo.add("changedBy", drug.getChangedBy().getUuid());
auditInfo.add("dateChanged", df.format(drug.getDateChanged()));
}
obj.add("auditInfo", auditInfo);
}
obj.add("resourceVersion", getResourceVersion());
return gson.toJson(obj);