Search in sources :

Example 1 with ClaimRequest

use of gov.cms.mpsm.rda.v1.ClaimRequest in project beneficiary-fhir-data by CMSgov.

the class McsClaimStreamCaller method callService.

/**
 * Calls the getMcsClaims RPC. The Iterator from the RPC call is wrapped with a transforming
 * Iterator that converts the API McsClaim objects into database PreAdjMcsClaim entity objects.
 *
 * @param channel an already open channel to the service being called
 * @param startingSequenceNumber specifies the sequence number to send to the RDA API server
 * @return a blocking GrpcResponseStream of PreAdjMcsClaim entity objects
 * @throws Exception passes through any gRPC framework exceptions
 */
@Override
public GrpcResponseStream<McsClaimChange> callService(ManagedChannel channel, CallOptions callOptions, long startingSequenceNumber) throws Exception {
    logger.info("calling service");
    Preconditions.checkNotNull(channel);
    final ClaimRequest request = ClaimRequest.newBuilder().setSince(startingSequenceNumber).build();
    final MethodDescriptor<ClaimRequest, McsClaimChange> method = RDAServiceGrpc.getGetMcsClaimsMethod();
    final ClientCall<ClaimRequest, McsClaimChange> call = channel.newCall(method, callOptions);
    final Iterator<McsClaimChange> apiResults = ClientCalls.blockingServerStreamingCall(call, request);
    return new GrpcResponseStream<>(call, apiResults);
}
Also used : ClaimRequest(gov.cms.mpsm.rda.v1.ClaimRequest) McsClaimChange(gov.cms.mpsm.rda.v1.McsClaimChange)

Example 2 with ClaimRequest

use of gov.cms.mpsm.rda.v1.ClaimRequest in project beneficiary-fhir-data by CMSgov.

the class StoreRdaJsonApp method callService.

private static GrpcResponseStream<? extends MessageOrBuilder> callService(Config config, ManagedChannel channel) {
    final ClaimRequest request = ClaimRequest.newBuilder().setSince(config.startingSequenceNumber).build();
    final MethodDescriptor<ClaimRequest, ? extends MessageOrBuilder> method = config.claimType.methodSource.get();
    final ClientCall<ClaimRequest, ? extends MessageOrBuilder> call = channel.newCall(method, config.grpcConfig.createCallOptions());
    Iterator<? extends MessageOrBuilder> iterator = ClientCalls.blockingServerStreamingCall(call, request);
    return new GrpcResponseStream<>(call, iterator);
}
Also used : ClaimRequest(gov.cms.mpsm.rda.v1.ClaimRequest) GrpcResponseStream(gov.cms.bfd.pipeline.rda.grpc.source.GrpcResponseStream)

Example 3 with ClaimRequest

use of gov.cms.mpsm.rda.v1.ClaimRequest in project beneficiary-fhir-data by CMSgov.

the class FissClaimStreamCaller method callService.

/**
 * Calls the getFissClaims RPC. The Iterator from the RPC call is wrapped with a transforming
 * Iterator that converts the API FissClaim objects into database PreAdjFissClaim entity objects.
 *
 * @param channel an already open channel to the service being called
 * @param startingSequenceNumber specifies the sequence number to send to the RDA API server
 * @return a blocking GrpcResponseStream of PreAdjFissClaim entity objects
 * @throws Exception passes through any gRPC framework exceptions
 */
@Override
public GrpcResponseStream<FissClaimChange> callService(ManagedChannel channel, CallOptions callOptions, long startingSequenceNumber) throws Exception {
    logger.info("calling service");
    Preconditions.checkNotNull(channel);
    final ClaimRequest request = ClaimRequest.newBuilder().setSince(startingSequenceNumber).build();
    final MethodDescriptor<ClaimRequest, FissClaimChange> method = RDAServiceGrpc.getGetFissClaimsMethod();
    final ClientCall<ClaimRequest, FissClaimChange> call = channel.newCall(method, callOptions);
    final Iterator<FissClaimChange> apiResults = ClientCalls.blockingServerStreamingCall(call, request);
    return new GrpcResponseStream<>(call, apiResults);
}
Also used : ClaimRequest(gov.cms.mpsm.rda.v1.ClaimRequest) FissClaimChange(gov.cms.mpsm.rda.v1.FissClaimChange)

Aggregations

ClaimRequest (gov.cms.mpsm.rda.v1.ClaimRequest)3 GrpcResponseStream (gov.cms.bfd.pipeline.rda.grpc.source.GrpcResponseStream)1 FissClaimChange (gov.cms.mpsm.rda.v1.FissClaimChange)1 McsClaimChange (gov.cms.mpsm.rda.v1.McsClaimChange)1