public void setQuestionService(QuestionService questionService) {
this.questionService = questionService;
}
public DeleteQuestionsResponseType deleteQuestions(AttributedURIType address, DeleteQuestionsType parameters) {
DeleteQuestionsResponseType response = new DeleteQuestionsResponseType();
try {
String careUnit = parameters.getCareUnitId().getExtension();
log.debug("DeleteQuestions called for careunit:" + careUnit);
List<String> idValues = parameters.getQuestionId();
Set<Long> ids = newHashSet();
for (String idValue : idValues) {
ids.add(Long.parseLong(idValue));
}
questionService.deleteQuestionsForCareUnit(careUnit, ids);
log.debug(ids.size() + " questions deleted for careunit:" + careUnit);
response.setResult(new ResultOfCall());
response.getResult().setResultCode(ResultCodeEnum.OK);
} catch (Exception e) {
log.warn("Error handling DeleteQuest message", e);
response.setResult(new ResultOfCall());
response.getResult().setResultCode(ResultCodeEnum.ERROR);
response.getResult().setErrorText(e.getMessage());
}
return response;
}