use of gov.cms.bfd.model.rda.PreAdjFissClaim in project beneficiary-fhir-data by CMSgov.
the class FissClaimRdaSinkTest method createClaim.
private RdaChange<PreAdjFissClaim> createClaim(String dcn) {
PreAdjFissClaim claim = new PreAdjFissClaim();
claim.setDcn(dcn);
claim.setApiSource(VERSION);
return new RdaChange<>(nextSeq++, RdaChange.Type.INSERT, claim, clock.instant().minusMillis(12));
}
use of gov.cms.bfd.model.rda.PreAdjFissClaim in project beneficiary-fhir-data by CMSgov.
the class RdaServerJobIT method testRandom.
@Test
public void testRandom() throws Exception {
final RdaServerJob.Config config = RdaServerJob.Config.builder().serverMode(RdaServerJob.Config.ServerMode.Random).serverName(SERVER_NAME).randomSeed(1L).randomMaxClaims(4).build();
final RdaServerJob job = new RdaServerJob(config);
final ExecutorService exec = Executors.newCachedThreadPool();
final Future<PipelineJobOutcome> outcome = exec.submit(job);
try {
waitForServerToStart(job);
final ManagedChannel fissChannel = InProcessChannelBuilder.forName(SERVER_NAME).build();
final FissClaimStreamCaller fissCaller = new FissClaimStreamCaller();
final GrpcResponseStream<FissClaimChange> fissStream = fissCaller.callService(fissChannel, CallOptions.DEFAULT, 2);
assertTrue(fissStream.hasNext());
RdaChange<PreAdjFissClaim> fissChange = fissTransformer.transformClaim(fissStream.next());
assertMatches(fissCaller.callVersionService(fissChannel, CallOptions.DEFAULT), "Random:1:.*");
assertEquals(2L, fissChange.getSequenceNumber());
assertTrue(fissStream.hasNext());
fissChange = fissTransformer.transformClaim(fissStream.next());
assertEquals(3L, fissChange.getSequenceNumber());
assertFalse(fissStream.hasNext());
final ManagedChannel mcsChannel = InProcessChannelBuilder.forName(SERVER_NAME).build();
final McsClaimStreamCaller mcsCaller = new McsClaimStreamCaller();
final GrpcResponseStream<McsClaimChange> mcsStream = mcsCaller.callService(mcsChannel, CallOptions.DEFAULT, 3);
assertTrue(mcsStream.hasNext());
RdaChange<PreAdjMcsClaim> mcsChange = mcsTransformer.transformClaim(mcsStream.next());
assertMatches(mcsCaller.callVersionService(mcsChannel, CallOptions.DEFAULT), "Random:1:.*");
assertEquals(3L, mcsChange.getSequenceNumber());
assertFalse(mcsStream.hasNext());
} finally {
exec.shutdownNow();
exec.awaitTermination(10, TimeUnit.SECONDS);
assertEquals(PipelineJobOutcome.WORK_DONE, outcome.get());
}
}
use of gov.cms.bfd.model.rda.PreAdjFissClaim in project beneficiary-fhir-data by CMSgov.
the class FissClaimTransformerTest method basicFieldsTestForBeneZPayerObjectTransformation.
/**
* Basic smoke test for transformation of BeneZ payer objects prior to all of the individual field
* tests.
*/
@Test
public void basicFieldsTestForBeneZPayerObjectTransformation() {
claimBuilder.setDcn("dcn").setHicNo("hicn").setCurrStatusEnum(FissClaimStatus.CLAIM_STATUS_MOVE).setCurrLoc1Enum(FissProcessingType.PROCESSING_TYPE_MANUAL).setCurrLoc2Enum(FissCurrentLocation2.CURRENT_LOCATION_2_FINAL).addFissPayers(FissPayer.newBuilder().setBeneZPayer(FissBeneZPayer.newBuilder().setPayersIdEnum(FissPayersCode.PAYERS_CODE_BLACK_LUNG).setPayersName("payers-name").setRelIndEnum(FissReleaseOfInformation.RELEASE_OF_INFORMATION_NO_RELEASE_ON_FILE).setAssignIndEnum(FissAssignmentOfBenefitsIndicator.ASSIGNMENT_OF_BENEFITS_INDICATOR_BENEFITS_ASSIGNED).setProviderNumber("provider-num").setAdjDcnIcn("dcn-icn").setPriorPmt("123.45").setEstAmtDue("234.56").setBeneRelEnum(FissPatientRelationshipCode.PATIENT_RELATIONSHIP_CODE_EMPLOYEE).setBeneLastName("last-name").setBeneFirstName("first-name").setBeneMidInit("Z").setBeneSsnHic("ssn-hic").setInsuredGroupName("group-name").setBeneDob("2020-09-10").setBeneSexEnum(FissBeneficiarySex.BENEFICIARY_SEX_FEMALE).setTreatAuthCd("auth-code").setInsuredSexEnum(FissBeneficiarySex.BENEFICIARY_SEX_MALE).setInsuredRelX12Enum(FissPatientRelationshipCode.PATIENT_RELATIONSHIP_CODE_GRANDCHILD).build()).build());
claim.setDcn("dcn");
claim.setHicNo("hicn");
claim.setCurrStatus('M');
claim.setCurrLoc1('M');
claim.setCurrLoc2("9997");
claim.setLastUpdated(clock.instant());
PreAdjFissPayer payer = new PreAdjFissPayer();
payer.setDcn("dcn");
payer.setPriority((short) 0);
payer.setPayerType(PreAdjFissPayer.PayerType.BeneZ);
payer.setPayersId("H");
payer.setPayersName("payers-name");
payer.setRelInd("N");
payer.setAssignInd("Y");
payer.setProviderNumber("provider-num");
payer.setAdjDcnIcn("dcn-icn");
payer.setPriorPmt(new BigDecimal("123.45"));
payer.setEstAmtDue(new BigDecimal("234.56"));
payer.setBeneRel("08");
payer.setBeneLastName("last-name");
payer.setBeneFirstName("first-name");
payer.setBeneMidInit("Z");
payer.setBeneSsnHic("ssn-hic");
payer.setInsuredGroupName("group-name");
payer.setBeneDob(LocalDate.of(2020, 9, 10));
payer.setBeneSex("F");
payer.setTreatAuthCd("auth-code");
payer.setInsuredSex("M");
payer.setInsuredRelX12("13");
payer.setLastUpdated(claim.getLastUpdated());
claim.getPayers().add(payer);
changeBuilder.setSeq(MIN_SEQUENCE_NUM).setChangeType(ChangeType.CHANGE_TYPE_UPDATE).setClaim(claimBuilder.build());
PreAdjFissClaim transformed = transformer.transformClaim(changeBuilder.build()).getClaim();
assertThat(transformed, samePropertyValuesAs(claim));
TransformerTestUtils.assertListContentsHaveSamePropertyValues(claim.getPayers(), transformed.getPayers(), PreAdjFissPayer::getPriority);
}
use of gov.cms.bfd.model.rda.PreAdjFissClaim in project beneficiary-fhir-data by CMSgov.
the class FissClaimTransformerTest method setUp.
@BeforeEach
public void setUp() {
changeBuilder = FissClaimChange.newBuilder();
claimBuilder = FissClaim.newBuilder();
claim = new PreAdjFissClaim();
claim.setSequenceNumber(0L);
}
use of gov.cms.bfd.model.rda.PreAdjFissClaim in project beneficiary-fhir-data by CMSgov.
the class FissClaimTransformerTest method basicFieldsTestForProcCodeObjectTransformation.
/**
* Basic smoke test for transformation of procedure code objects prior to all of the individual
* field tests.
*/
@Test
public void basicFieldsTestForProcCodeObjectTransformation() {
claimBuilder.setDcn("dcn").setHicNo("hicn").setCurrStatusEnum(FissClaimStatus.CLAIM_STATUS_MOVE).setCurrLoc1Enum(FissProcessingType.PROCESSING_TYPE_MANUAL).setCurrLoc2Enum(FissCurrentLocation2.CURRENT_LOCATION_2_FINAL).addFissProcCodes(FissProcedureCode.newBuilder().setProcCd("code-1").setProcFlag("fl-1").build()).addFissProcCodes(FissProcedureCode.newBuilder().setProcCd("code-2").setProcFlag("fl-2").setProcDt("2021-07-06").build());
claim.setDcn("dcn");
claim.setHicNo("hicn");
claim.setCurrStatus('M');
claim.setCurrLoc1('M');
claim.setCurrLoc2("2");
claim.setLastUpdated(clock.instant());
PreAdjFissProcCode code = new PreAdjFissProcCode();
code.setDcn("dcn");
code.setPriority((short) 0);
code.setProcCode("code-1");
code.setProcFlag("fl-1");
code.setLastUpdated(claim.getLastUpdated());
claim.getProcCodes().add(code);
code = new PreAdjFissProcCode();
code.setDcn("dcn");
code.setPriority((short) 1);
code.setProcCode("code-2");
code.setProcFlag("fl-2");
code.setProcDate(LocalDate.of(2021, 7, 6));
code.setLastUpdated(claim.getLastUpdated());
claim.getProcCodes().add(code);
changeBuilder.setSeq(MIN_SEQUENCE_NUM).setChangeType(ChangeType.CHANGE_TYPE_INSERT).setClaim(claimBuilder.build());
PreAdjFissClaim transformed = transformer.transformClaim(changeBuilder.build()).getClaim();
TransformerTestUtils.assertListContentsHaveSamePropertyValues(claim.getProcCodes(), transformed.getProcCodes(), PreAdjFissProcCode::getPriority);
}
Aggregations