use of org.hl7.gravity.refimpl.sdohexchange.dto.converter.OurTaskBundleToDtoConverter in project Gravity-SDOH-Exchange-RI by FHIR.
the class OurTaskService method read.
public TaskDto read(String id) {
Bundle taskBundle = taskRepository.find(id, Lists.newArrayList(Task.INCLUDE_FOCUS, Task.INCLUDE_BASED_ON, Task.INCLUDE_OWNER.asNonRecursive()));
Task ourTask = FhirUtil.getFirstFromBundle(taskBundle, Task.class);
if (Objects.isNull(ourTask)) {
throw new ResourceNotFoundException(new IdType(Task.class.getSimpleName(), id));
}
if (!ourTask.getIntent().equals(Task.TaskIntent.FILLERORDER)) {
throw new TaskReadException("The intent of Task/" + id + " is not filler-order.");
}
return new OurTaskBundleToDtoConverter().convert(taskBundle).stream().findFirst().get();
}
Aggregations