Search in sources :

Example 16 with PreAdjFissClaim

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));
}
Also used : RdaChange(gov.cms.bfd.pipeline.rda.grpc.RdaChange) PreAdjFissClaim(gov.cms.bfd.model.rda.PreAdjFissClaim)

Example 17 with PreAdjFissClaim

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());
    }
}
Also used : McsClaimStreamCaller(gov.cms.bfd.pipeline.rda.grpc.source.McsClaimStreamCaller) FissClaimChange(gov.cms.mpsm.rda.v1.FissClaimChange) FissClaimStreamCaller(gov.cms.bfd.pipeline.rda.grpc.source.FissClaimStreamCaller) PreAdjFissClaim(gov.cms.bfd.model.rda.PreAdjFissClaim) PipelineJobOutcome(gov.cms.bfd.pipeline.sharedutils.PipelineJobOutcome) ExecutorService(java.util.concurrent.ExecutorService) ManagedChannel(io.grpc.ManagedChannel) PreAdjMcsClaim(gov.cms.bfd.model.rda.PreAdjMcsClaim) McsClaimChange(gov.cms.mpsm.rda.v1.McsClaimChange) Test(org.junit.jupiter.api.Test)

Example 18 with PreAdjFissClaim

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);
}
Also used : PreAdjFissClaim(gov.cms.bfd.model.rda.PreAdjFissClaim) BigDecimal(java.math.BigDecimal) PreAdjFissPayer(gov.cms.bfd.model.rda.PreAdjFissPayer) Test(org.junit.jupiter.api.Test)

Example 19 with PreAdjFissClaim

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);
}
Also used : PreAdjFissClaim(gov.cms.bfd.model.rda.PreAdjFissClaim) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 20 with PreAdjFissClaim

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);
}
Also used : PreAdjFissProcCode(gov.cms.bfd.model.rda.PreAdjFissProcCode) PreAdjFissClaim(gov.cms.bfd.model.rda.PreAdjFissClaim) Test(org.junit.jupiter.api.Test)

Aggregations

PreAdjFissClaim (gov.cms.bfd.model.rda.PreAdjFissClaim)21 Test (org.junit.jupiter.api.Test)10 PreAdjFissDiagnosisCode (gov.cms.bfd.model.rda.PreAdjFissDiagnosisCode)6 PreAdjFissPayer (gov.cms.bfd.model.rda.PreAdjFissPayer)6 PreAdjFissProcCode (gov.cms.bfd.model.rda.PreAdjFissProcCode)6 FissClaimChange (gov.cms.mpsm.rda.v1.FissClaimChange)4 LocalDate (java.time.LocalDate)4 MetricRegistry (com.codahale.metrics.MetricRegistry)3 PreAdjMcsClaim (gov.cms.bfd.model.rda.PreAdjMcsClaim)3 BigDecimal (java.math.BigDecimal)3 Date (java.util.Date)3 List (java.util.List)3 Claim (org.hl7.fhir.r4.model.Claim)3 Meta (org.hl7.fhir.r4.model.Meta)3 Reference (org.hl7.fhir.r4.model.Reference)3 Timer (com.codahale.metrics.Timer)2 Trace (com.newrelic.api.agent.Trace)2 RdaChange (gov.cms.bfd.pipeline.rda.grpc.RdaChange)2 JsonMessageSource (gov.cms.bfd.pipeline.rda.grpc.server.JsonMessageSource)2 FissClaimStreamCaller (gov.cms.bfd.pipeline.rda.grpc.source.FissClaimStreamCaller)2