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