throw new WebApplicationException(Response.Status.PRECONDITION_FAILED);
}
persistenceSvc.beginTx();
EntityManager em = persistenceSvc.getEntityManager();
Medication entity = data.resolveEntity(em);
createEntity(data.resolveEntity(em));
persistenceSvc.commitTx();
return Response.created(uriInfo.getAbsolutePath().resolve(entity.getMedicationId() + "/")).build();
} finally {
persistenceSvc.close();
}
}