use of org.hl7.gravity.refimpl.sdohexchange.fhir.factory.OurTaskUpdateBundleFactory in project Gravity-SDOH-Exchange-RI by FHIR.
the class OurTaskService method update.
public void update(String id, UpdateOurTaskRequestDto update, UserDto user) {
Bundle taskBundle = taskRepository.find(id, Lists.newArrayList(Task.INCLUDE_FOCUS));
TaskInfoHolder taskInfo = new TaskInfoBundleExtractor().extract(taskBundle).stream().findFirst().orElseThrow(() -> new ResourceNotFoundException(new IdType(Task.class.getSimpleName(), id)));
OurTaskUpdateBundleFactory bundleFactory = new OurTaskUpdateBundleFactory();
bundleFactory.setTask(taskInfo.getTask());
bundleFactory.setServiceRequest(taskInfo.getServiceRequest());
bundleFactory.setStatus(update.getTaskStatus());
bundleFactory.setStatusReason(update.getStatusReason());
bundleFactory.setComment(update.getComment());
bundleFactory.setUser(user);
taskRepository.transaction(bundleFactory.createUpdateBundle());
}
Aggregations