use of org.hl7.gravity.refimpl.sdohexchange.fhir.factory.PatientTaskUpdateBundleFactory in project Gravity-SDOH-Exchange-RI by FHIR.
the class PatientTaskService method update.
public void update(String id, UpdateTaskRequestDto update, UserDto user) {
Task task = ehrClient.read().resource(Task.class).withId(id).execute();
if (task == null) {
throw new ResourceNotFoundException(new IdType(Task.class.getSimpleName(), id));
}
PatientTaskUpdateBundleFactory updateBundleFactory = new PatientTaskUpdateBundleFactory();
updateBundleFactory.setTask(task);
updateBundleFactory.setStatus(update.getFhirStatus());
updateBundleFactory.setStatusReason(update.getStatusReason());
updateBundleFactory.setComment(update.getComment());
updateBundleFactory.setUser(user);
ehrClient.transaction().withBundle(updateBundleFactory.createUpdateBundle()).execute();
}
Aggregations