use of org.hisp.dhis.webapi.webdomain.DataValueFollowUpRequest in project dhis2-core by dhis2.
the class DataValueController method setDataValuesFollowUp.
@PutMapping(value = "/followups")
@ResponseStatus(value = HttpStatus.OK)
public void setDataValuesFollowUp(@RequestBody DataValuesFollowUpRequest request) {
List<DataValueFollowUpRequest> values = request == null ? null : request.getValues();
if (values == null || values.isEmpty() || values.stream().anyMatch(e -> e.getFollowup() == null)) {
throw new IllegalQueryException(ErrorCode.E2033);
}
List<DataValue> dataValues = new ArrayList<>();
for (DataValueFollowUpRequest e : values) {
DataValue dataValue = dataValueValidation.getAndValidateDataValue(e);
dataValue.setFollowup(e.getFollowup());
}
dataValueService.updateDataValues(dataValues);
}
Aggregations