class Dstu3BundleResourceProvider extends AbstractBundleResourceProvider<Bundle> {

    @Nonnull
    @Override
    protected Bundle createBatchResponse( @Nonnull FhirBatchRequest batchRequest )
    {
        final Bundle bundle = new Bundle();
        bundle.setType( batchRequest.isTransactional() ? Bundle.BundleType.TRANSACTIONRESPONSE : Bundle.BundleType.BATCHRESPONSE );

        batchRequest.getOperations().forEach( operation -> {
            if ( !operation.isProcessed() )
            {
                operation.getResult().internalServerError( "Operation has not been processed." );
            }

            final Bundle.BundleEntryComponent entry = bundle.addEntry();
            entry.getResponse().setStatus( getStatus( operation.getResult() ) );

            if ( operation.getResult().getId() != null && !operation.getResult().getId().isEmpty() )
            {
                entry.getResponse().setLocation(
                    operation.getFhirResourceType().getResourceTypeName() + "/" + operation.getResult().getId().getIdPart() );
            }

            if ( operation.getResult().getIssue() != null )
            {
                final OperationOutcome outcome = new OperationOutcome();
                final OperationOutcome.OperationOutcomeIssueComponent issue = outcome.addIssue();

                issue.setSeverity( convert( operation.getResult().getIssue().getSeverity() ) );
                issue.setCode( convert( operation.getResult().getIssue().getType() ) );
                issue.setDiagnostics( operation.getResult().getIssue().getDiagnostics() );

                entry.getResponse().setOutcome( outcome );
            }
        } );

        return bundle;
    }

    public  Dstu3BundleResourceProvider( @Nonnull FhirClientResourceRepository fhirClientResourceRepository, @Nonnull FhirClientSystemRepository fhirClientSystemRepository,
        @Nonnull FhirRepository fhirRepository, @Nonnull DhisRepository dhisRepository, @Nonnull RequestCacheService requestCacheService );

}