Search in sources :

Example 16 with RifRecordEvent

use of gov.cms.bfd.model.rif.RifRecordEvent in project beneficiary-fhir-data by CMSgov.

the class RifFilesProcessorTest method process1InpatientClaimRecord.

/**
 * Ensures that {@link RifFilesProcessor} can correctly handle {@link
 * StaticRifResource#SAMPLE_A_INPATIENT}.
 */
@Test
public void process1InpatientClaimRecord() {
    RifFilesEvent filesEvent = new RifFilesEvent(Instant.now(), StaticRifResource.SAMPLE_A_INPATIENT.toRifFile());
    RifFilesProcessor processor = new RifFilesProcessor();
    RifFileRecords rifFileRecords = processor.produceRecords(filesEvent.getFileEvents().get(0));
    List<RifRecordEvent<?>> rifEventsList = rifFileRecords.getRecords().collect(Collectors.toList());
    assertEquals(StaticRifResource.SAMPLE_A_INPATIENT.getRecordCount(), rifEventsList.size());
    RifRecordEvent<?> rifRecordEvent = rifEventsList.get(0);
    assertEquals(StaticRifResource.SAMPLE_A_INPATIENT.getRifFileType(), rifRecordEvent.getFileEvent().getFile().getFileType());
    assertNotNull(rifRecordEvent.getRecord());
    assertTrue(rifRecordEvent.getRecord() instanceof InpatientClaim);
    // Verify the claim header.
    InpatientClaim claimGroup = (InpatientClaim) rifRecordEvent.getRecord();
    assertEquals(RecordAction.INSERT, rifRecordEvent.getRecordAction());
    assertEquals(claimGroup.getBeneficiaryId(), rifRecordEvent.getBeneficiaryId());
    assertEquals("567834", claimGroup.getBeneficiaryId());
    assertEquals("333333222222", claimGroup.getClaimId());
    assertEquals(new BigDecimal(900), claimGroup.getClaimGroupId());
    assertEquals('V', claimGroup.getNearLineRecordIdCode());
    assertEquals("60", claimGroup.getClaimTypeCode());
    assertEquals(LocalDate.of(2016, 01, 15), claimGroup.getDateFrom());
    assertEquals(LocalDate.of(2016, 01, 27), claimGroup.getDateThrough());
    assertEquals('3', claimGroup.getClaimQueryCode());
    assertEquals("777776", claimGroup.getProviderNumber());
    assertEquals('1', claimGroup.getClaimServiceClassificationTypeCode());
    assertTrue(claimGroup.getClaimNonPaymentReasonCode().isPresent());
    assertEquals(new BigDecimal("7699.48"), claimGroup.getPaymentAmount());
    assertEquals(new BigDecimal("11.00"), claimGroup.getPrimaryPayerPaidAmount());
    assertEquals("IA", claimGroup.getProviderStateCode());
    assertEquals("5555553305", claimGroup.getOrganizationNpi().get());
    assertEquals("161999999", claimGroup.getAttendingPhysicianNpi().get());
    assertEquals("3333444555", claimGroup.getOperatingPhysicianNpi().get());
    assertEquals("161943433", claimGroup.getOtherPhysicianNpi().get());
    assertEquals("51", claimGroup.getPatientDischargeStatusCode());
    assertEquals(new BigDecimal("84999.37"), claimGroup.getTotalChargeAmount());
    assertEquals(LocalDate.of(2016, 1, 15), claimGroup.getClaimAdmissionDate().get());
    assertEquals('1', claimGroup.getAdmissionTypeCd());
    assertEquals(new Character('4'), claimGroup.getSourceAdmissionCd().get());
    assertEquals(new BigDecimal("10.00"), claimGroup.getPassThruPerDiemAmount());
    assertEquals(new BigDecimal("112.00"), claimGroup.getDeductibleAmount());
    assertEquals(new BigDecimal("5.00"), claimGroup.getPartACoinsuranceLiabilityAmount());
    assertEquals(new BigDecimal("6.00"), claimGroup.getBloodDeductibleLiabilityAmount());
    assertEquals(new BigDecimal("4.00"), claimGroup.getProfessionalComponentCharge());
    assertEquals(new BigDecimal("33.00"), claimGroup.getNoncoveredCharge());
    assertEquals(new BigDecimal("14.00"), claimGroup.getTotalDeductionAmount());
    assertEquals(new BigDecimal("646.23"), claimGroup.getClaimTotalPPSCapitalAmount().get());
    assertEquals(new BigDecimal("552.56"), claimGroup.getClaimPPSCapitalFSPAmount().get());
    assertEquals(new BigDecimal("0"), claimGroup.getClaimPPSCapitalOutlierAmount().get());
    assertEquals(new BigDecimal("68.58"), claimGroup.getClaimPPSCapitalIMEAmount().get());
    assertEquals(new BigDecimal("0"), claimGroup.getClaimPPSCapitalExceptionAmount().get());
    assertEquals(new BigDecimal("0"), claimGroup.getClaimPPSOldCapitalHoldHarmlessAmount().get());
    assertEquals(new BigDecimal(12), claimGroup.getUtilizationDayCount());
    assertEquals(new BigDecimal(0), claimGroup.getCoinsuranceDayCount());
    assertEquals(new BigDecimal(0), claimGroup.getNonUtilizationDayCount());
    assertEquals(new BigDecimal(19), claimGroup.getBloodPintsFurnishedQty());
    assertEquals(LocalDate.of(2016, 1, 27), claimGroup.getBeneficiaryDischargeDate().get());
    assertEquals(new BigDecimal("23.99"), claimGroup.getDrgOutlierApprovedPaymentAmount().get());
    assertEquals("R4444", claimGroup.getDiagnosisAdmittingCode().get());
    assertEquals('0', claimGroup.getDiagnosisAdmittingCodeVersion().get().charValue());
    assertEquals("R5555", claimGroup.getDiagnosisPrincipalCode().get());
    assertEquals('0', claimGroup.getDiagnosisPrincipalCodeVersion().get().charValue());
    assertEquals("R5555", claimGroup.getDiagnosis1Code().get());
    assertEquals('0', claimGroup.getDiagnosis1CodeVersion().get().charValue());
    assertEquals('Y', claimGroup.getDiagnosis1PresentOnAdmissionCode().get().charValue());
    assertEquals("0TCDDEE", claimGroup.getProcedure1Code().get());
    assertEquals('0', claimGroup.getProcedure1CodeVersion().get().charValue());
    assertEquals(LocalDate.of(2016, 1, 16), claimGroup.getProcedure1Date().get());
    assertEquals(new BigDecimal("120.56"), claimGroup.getClaimUncompensatedCareAmount().get());
    assertEquals("28486613848", claimGroup.getFiDocumentClaimControlNumber().get());
    assertEquals("261660474641024", claimGroup.getFiOriginalClaimControlNumber().get());
    assertEquals(1, claimGroup.getLines().size());
    // Verify one of the claim lines.
    InpatientClaimLine claimLine = claimGroup.getLines().get(0);
    assertEquals(new BigDecimal("84888.88"), claimLine.getTotalChargeAmount());
    assertEquals(new BigDecimal("3699.00"), claimLine.getNonCoveredChargeAmount());
    assertEquals("345345345", claimLine.getRevenueCenterRenderingPhysicianNPI().get());
}
Also used : InpatientClaim(gov.cms.bfd.model.rif.InpatientClaim) RifRecordEvent(gov.cms.bfd.model.rif.RifRecordEvent) RifFileRecords(gov.cms.bfd.model.rif.RifFileRecords) RifFilesEvent(gov.cms.bfd.model.rif.RifFilesEvent) BigDecimal(java.math.BigDecimal) InpatientClaimLine(gov.cms.bfd.model.rif.InpatientClaimLine) Test(org.junit.jupiter.api.Test)

Example 17 with RifRecordEvent

use of gov.cms.bfd.model.rif.RifRecordEvent in project beneficiary-fhir-data by CMSgov.

the class RifFilesProcessorTest method process1OutpatientClaimRecord.

/**
 * Ensures that {@link RifFilesProcessor} can correctly handle {@link
 * StaticRifResource#SAMPLE_A_OUTPATIENT}.
 */
@Test
public void process1OutpatientClaimRecord() {
    RifFilesEvent filesEvent = new RifFilesEvent(Instant.now(), StaticRifResource.SAMPLE_A_OUTPATIENT.toRifFile());
    RifFilesProcessor processor = new RifFilesProcessor();
    RifFileRecords rifFileRecords = processor.produceRecords(filesEvent.getFileEvents().get(0));
    List<RifRecordEvent<?>> rifEventsList = rifFileRecords.getRecords().collect(Collectors.toList());
    assertEquals(StaticRifResource.SAMPLE_A_OUTPATIENT.getRecordCount(), rifEventsList.size());
    RifRecordEvent<?> rifRecordEvent = rifEventsList.get(0);
    assertEquals(StaticRifResource.SAMPLE_A_OUTPATIENT.getRifFileType(), rifRecordEvent.getFileEvent().getFile().getFileType());
    assertNotNull(rifRecordEvent.getRecord());
    assertTrue(rifRecordEvent.getRecord() instanceof OutpatientClaim);
    // Verify the claim header.
    OutpatientClaim claimGroup = (OutpatientClaim) rifRecordEvent.getRecord();
    assertEquals(RecordAction.INSERT, rifRecordEvent.getRecordAction());
    assertEquals(claimGroup.getBeneficiaryId(), rifRecordEvent.getBeneficiaryId());
    assertEquals("567834", claimGroup.getBeneficiaryId());
    assertEquals("1234567890", claimGroup.getClaimId());
    assertEquals(new BigDecimal(900), claimGroup.getClaimGroupId());
    assertEquals('W', claimGroup.getNearLineRecordIdCode());
    assertEquals("40", claimGroup.getClaimTypeCode());
    assertEquals(LocalDate.of(2011, 01, 24), claimGroup.getDateFrom());
    assertEquals(LocalDate.of(2011, 01, 24), claimGroup.getDateThrough());
    assertEquals('3', claimGroup.getClaimQueryCode());
    assertEquals("999999", claimGroup.getProviderNumber());
    assertEquals("A", claimGroup.getClaimNonPaymentReasonCode().get());
    assertEquals(new BigDecimal("693.11"), claimGroup.getPaymentAmount());
    assertEquals(new BigDecimal("11.00"), claimGroup.getPrimaryPayerPaidAmount());
    assertEquals("KY", claimGroup.getProviderStateCode());
    assertEquals("1497758544", claimGroup.getOrganizationNpi().get());
    assertEquals("2222222222", claimGroup.getAttendingPhysicianNpi().get());
    assertEquals("3333333333", claimGroup.getOperatingPhysicianNpi().get());
    assertTrue(claimGroup.getOtherPhysicianNpi().isPresent());
    assertEquals("1", claimGroup.getPatientDischargeStatusCode().get());
    assertEquals(new BigDecimal("8888.85"), claimGroup.getTotalChargeAmount());
    assertEquals(new BigDecimal("6.00"), claimGroup.getBloodDeductibleLiabilityAmount());
    assertEquals(new BigDecimal("66.89"), claimGroup.getProfessionalComponentCharge());
    assertEquals("R5555", claimGroup.getDiagnosisPrincipalCode().get());
    assertEquals('0', claimGroup.getDiagnosisPrincipalCodeVersion().get().charValue());
    assertEquals("R5555", claimGroup.getDiagnosis1Code().get());
    assertEquals('0', claimGroup.getDiagnosis1CodeVersion().get().charValue());
    assertEquals(new BigDecimal("112.00"), claimGroup.getDeductibleAmount());
    assertEquals(new BigDecimal("175.73"), claimGroup.getCoinsuranceAmount());
    assertEquals(new BigDecimal("693.92"), claimGroup.getProviderPaymentAmount());
    assertEquals(new BigDecimal("44.00"), claimGroup.getBeneficiaryPaymentAmount());
    assertEquals("32490593716374487", claimGroup.getFiDocumentClaimControlNumber().get());
    assertEquals("373273882012", claimGroup.getFiOriginalClaimControlNumber().get());
    assertEquals(1, claimGroup.getLines().size());
    // Verify one of the claim lines.
    OutpatientClaimLine claimLine = claimGroup.getLines().get(0);
    assertEquals(new BigDecimal(25), claimLine.getLineNumber());
    assertEquals("M99", claimGroup.getLines().get(0).getHcpcsCode().get());
    assertEquals("XX", claimGroup.getLines().get(0).getHcpcsInitialModifierCode().get());
    assertFalse(claimLine.getHcpcsSecondModifierCode().isPresent());
    assertEquals(new BigDecimal("10.45"), claimGroup.getLines().get(0).getBloodDeductibleAmount());
    assertEquals(new BigDecimal("12.89"), claimGroup.getLines().get(0).getCashDeductibleAmount());
    assertEquals(new BigDecimal(5000.00), claimGroup.getLines().get(0).getPaymentAmount());
    assertEquals(new BigDecimal(134.00), claimGroup.getLines().get(0).getNonCoveredChargeAmount());
    assertEquals("345345345", claimLine.getRevenueCenterRenderingPhysicianNPI().get());
}
Also used : OutpatientClaim(gov.cms.bfd.model.rif.OutpatientClaim) RifRecordEvent(gov.cms.bfd.model.rif.RifRecordEvent) RifFileRecords(gov.cms.bfd.model.rif.RifFileRecords) OutpatientClaimLine(gov.cms.bfd.model.rif.OutpatientClaimLine) RifFilesEvent(gov.cms.bfd.model.rif.RifFilesEvent) BigDecimal(java.math.BigDecimal) Test(org.junit.jupiter.api.Test)

Example 18 with RifRecordEvent

use of gov.cms.bfd.model.rif.RifRecordEvent in project beneficiary-fhir-data by CMSgov.

the class RifFilesProcessorTest method process1HospiceClaimRecord.

/**
 * Ensures that {@link RifFilesProcessor} can correctly handle {@link
 * StaticRifResource#SAMPLE_A_HOSPICE}.
 */
@Test
public void process1HospiceClaimRecord() {
    RifFilesEvent filesEvent = new RifFilesEvent(Instant.now(), StaticRifResource.SAMPLE_A_HOSPICE.toRifFile());
    RifFilesProcessor processor = new RifFilesProcessor();
    RifFileRecords rifFileRecords = processor.produceRecords(filesEvent.getFileEvents().get(0));
    List<RifRecordEvent<?>> rifEventsList = rifFileRecords.getRecords().collect(Collectors.toList());
    assertEquals(StaticRifResource.SAMPLE_A_HOSPICE.getRecordCount(), rifEventsList.size());
    RifRecordEvent<?> rifRecordEvent = rifEventsList.get(0);
    assertEquals(StaticRifResource.SAMPLE_A_HOSPICE.getRifFileType(), rifRecordEvent.getFileEvent().getFile().getFileType());
    assertNotNull(rifRecordEvent.getRecord());
    assertTrue(rifRecordEvent.getRecord() instanceof HospiceClaim);
    // Verify the claim header.
    HospiceClaim claimGroup = (HospiceClaim) rifRecordEvent.getRecord();
    assertEquals(RecordAction.INSERT, rifRecordEvent.getRecordAction());
    assertEquals(claimGroup.getBeneficiaryId(), rifRecordEvent.getBeneficiaryId());
    assertEquals("567834", claimGroup.getBeneficiaryId());
    assertEquals("9992223422", claimGroup.getClaimId());
    assertEquals(new BigDecimal(900), claimGroup.getClaimGroupId());
    assertEquals('V', claimGroup.getNearLineRecordIdCode());
    assertEquals("50", claimGroup.getClaimTypeCode());
    assertEquals(LocalDate.of(2014, 1, 01), claimGroup.getDateFrom());
    assertEquals(LocalDate.of(2014, 1, 30), claimGroup.getDateThrough());
    assertEquals("12345", claimGroup.getProviderNumber());
    assertEquals("P", claimGroup.getClaimNonPaymentReasonCode().get());
    assertEquals('1', claimGroup.getClaimServiceClassificationTypeCode());
    assertEquals(new BigDecimal("130.32"), claimGroup.getPaymentAmount());
    assertEquals(new BigDecimal("0"), claimGroup.getPrimaryPayerPaidAmount());
    assertEquals("AZ", claimGroup.getProviderStateCode());
    assertEquals("999999999", claimGroup.getOrganizationNpi().get());
    assertEquals("8888888888", claimGroup.getAttendingPhysicianNpi().get());
    assertEquals("30", claimGroup.getPatientDischargeStatusCode());
    assertEquals(new BigDecimal("199.99"), claimGroup.getTotalChargeAmount());
    assertEquals(new Character('C'), claimGroup.getPatientStatusCd().get());
    assertEquals(new BigDecimal(30), claimGroup.getUtilizationDayCount());
    assertEquals(LocalDate.of(2015, 6, 29), claimGroup.getBeneficiaryDischargeDate().get());
    assertEquals("R5555", claimGroup.getDiagnosisPrincipalCode().get());
    assertEquals('9', claimGroup.getDiagnosisPrincipalCodeVersion().get().charValue());
    assertEquals(LocalDate.of(2014, 7, 06), claimGroup.getClaimHospiceStartDate().get());
    assertEquals("38875439343923937", claimGroup.getFiOriginalClaimControlNumber().get());
    assertEquals("2718813985998", claimGroup.getFiDocumentClaimControlNumber().get());
    assertEquals(1, claimGroup.getLines().size());
    // Verify one of the claim lines.
    HospiceClaimLine claimLine = claimGroup.getLines().get(0);
    assertEquals(new BigDecimal(1), claimLine.getLineNumber());
    assertEquals("651", claimLine.getRevenueCenterCode());
    assertEquals(new BigDecimal("26.00"), claimGroup.getLines().get(0).getPaymentAmount());
    assertEquals(new BigDecimal("300.00"), claimGroup.getLines().get(0).getNonCoveredChargeAmount().get());
    assertEquals("Q9999", claimGroup.getLines().get(0).getHcpcsInitialModifierCode().get());
    assertEquals("345345345", claimLine.getRevenueCenterRenderingPhysicianNPI().get());
}
Also used : HospiceClaimLine(gov.cms.bfd.model.rif.HospiceClaimLine) RifRecordEvent(gov.cms.bfd.model.rif.RifRecordEvent) RifFileRecords(gov.cms.bfd.model.rif.RifFileRecords) HospiceClaim(gov.cms.bfd.model.rif.HospiceClaim) RifFilesEvent(gov.cms.bfd.model.rif.RifFilesEvent) BigDecimal(java.math.BigDecimal) Test(org.junit.jupiter.api.Test)

Example 19 with RifRecordEvent

use of gov.cms.bfd.model.rif.RifRecordEvent in project beneficiary-fhir-data by CMSgov.

the class RifFilesProcessorTest method process1CarrierClaimRecord.

/**
 * Ensures that {@link RifFilesProcessor} can correctly handle {@link
 * StaticRifResource#SAMPLE_A_CARRIER}.
 */
@Test
public void process1CarrierClaimRecord() {
    RifFilesEvent filesEvent = new RifFilesEvent(Instant.now(), StaticRifResource.SAMPLE_A_CARRIER.toRifFile());
    RifFilesProcessor processor = new RifFilesProcessor();
    RifFileRecords rifFileRecords = processor.produceRecords(filesEvent.getFileEvents().get(0));
    List<RifRecordEvent<?>> rifEventsList = rifFileRecords.getRecords().collect(Collectors.toList());
    assertEquals(StaticRifResource.SAMPLE_A_CARRIER.getRecordCount(), rifEventsList.size());
    RifRecordEvent<?> rifRecordEvent = rifEventsList.get(0);
    assertEquals(StaticRifResource.SAMPLE_A_CARRIER.getRifFileType(), rifRecordEvent.getFileEvent().getFile().getFileType());
    assertNotNull(rifRecordEvent.getRecord());
    assertTrue(rifRecordEvent.getRecord() instanceof CarrierClaim);
    // Verify the claim header.
    CarrierClaim claimGroup = (CarrierClaim) rifRecordEvent.getRecord();
    assertEquals(RecordAction.INSERT, rifRecordEvent.getRecordAction());
    assertEquals(claimGroup.getBeneficiaryId(), rifRecordEvent.getBeneficiaryId());
    assertEquals("567834", claimGroup.getBeneficiaryId());
    assertEquals("9991831999", claimGroup.getClaimId());
    assertEquals(new BigDecimal(900), claimGroup.getClaimGroupId());
    assertEquals('O', claimGroup.getNearLineRecordIdCode());
    assertEquals("71", claimGroup.getClaimTypeCode());
    assertEquals(LocalDate.of(1999, 10, 27), claimGroup.getDateFrom());
    assertEquals(LocalDate.of(1999, 10, 27), claimGroup.getDateThrough());
    assertEquals(LocalDate.of(1999, 11, 6), claimGroup.getWeeklyProcessDate());
    assertEquals('1', claimGroup.getClaimEntryCode());
    assertEquals("1", claimGroup.getClaimDispositionCode());
    assertEquals("61026", claimGroup.getCarrierNumber());
    assertEquals("1", claimGroup.getPaymentDenialCode());
    assertEquals(new BigDecimal("199.99"), claimGroup.getPaymentAmount());
    assertEquals(new BigDecimal("0"), claimGroup.getPrimaryPayerPaidAmount());
    assertEquals("1234534", claimGroup.getReferringPhysicianUpin().get());
    assertEquals("8765676", claimGroup.getReferringPhysicianNpi().get());
    assertEquals(new Character('A'), claimGroup.getProviderAssignmentIndicator().get());
    assertEquals(new BigDecimal("123.45"), claimGroup.getProviderPaymentAmount());
    assertEquals(new BigDecimal("888.00"), claimGroup.getBeneficiaryPaymentAmount());
    assertEquals(new BigDecimal("245.04"), claimGroup.getSubmittedChargeAmount());
    assertEquals(new BigDecimal("166.23"), claimGroup.getAllowedChargeAmount());
    assertEquals(new BigDecimal("777.00"), claimGroup.getBeneficiaryPartBDeductAmount());
    assertEquals(new Character('5'), claimGroup.getHcpcsYearCode().get());
    assertEquals("K25852", claimGroup.getReferringProviderIdNumber());
    assertEquals("H5555", claimGroup.getDiagnosisPrincipalCode().get());
    assertEquals(new Character('0'), claimGroup.getDiagnosisPrincipalCodeVersion().get());
    assertEquals("H5555", claimGroup.getDiagnosis1Code().get());
    assertEquals(new Character('0'), claimGroup.getDiagnosis1CodeVersion().get());
    assertEquals("H8888", claimGroup.getDiagnosis2Code().get());
    assertEquals(new Character('0'), claimGroup.getDiagnosis2CodeVersion().get());
    assertEquals("H66666", claimGroup.getDiagnosis3Code().get());
    assertEquals(new Character('0'), claimGroup.getDiagnosis3CodeVersion().get());
    assertEquals("H77777", claimGroup.getDiagnosis4Code().get());
    assertEquals(new Character('0'), claimGroup.getDiagnosis4CodeVersion().get());
    assertFalse(claimGroup.getDiagnosis5Code().isPresent());
    assertFalse(claimGroup.getDiagnosis5CodeVersion().isPresent());
    assertEquals(1, claimGroup.getLines().size());
    assertEquals("0", claimGroup.getClinicalTrialNumber().get());
    assertEquals("74655592568216", claimGroup.getClaimCarrierControlNumber().get());
    // Verify one of the claim lines.
    CarrierClaimLine claimLine = claimGroup.getLines().get(0);
    assertEquals(new BigDecimal(6), claimLine.getLineNumber());
    assertEquals("K25555", claimLine.getPerformingProviderIdNumber());
    assertFalse(claimLine.getPerformingPhysicianUpin().isPresent());
    assertEquals("1923124", claimLine.getPerformingPhysicianNpi().get());
    assertTrue(claimLine.getOrganizationNpi().isPresent());
    assertEquals('0', claimLine.getProviderTypeCode());
    assertEquals("204299999", claimLine.getProviderTaxNumber());
    assertEquals("IL", claimLine.getProviderStateCode().get());
    assertEquals("555558202", claimLine.getProviderZipCode().get());
    assertEquals("41", claimLine.getProviderSpecialityCode().get());
    assertEquals(new Character('1'), claimLine.getProviderParticipatingIndCode().get());
    assertEquals('0', claimLine.getReducedPaymentPhysicianAsstCode());
    assertEquals(new BigDecimal(1), claimLine.getServiceCount());
    assertEquals('1', claimLine.getCmsServiceTypeCode());
    assertEquals("11", claimLine.getPlaceOfServiceCode());
    assertEquals("15", claimLine.getLinePricingLocalityCode());
    assertEquals(LocalDate.of(1999, 10, 27), claimLine.getFirstExpenseDate().get());
    assertEquals(LocalDate.of(1999, 10, 27), claimLine.getLastExpenseDate().get());
    assertEquals("92999", claimLine.getHcpcsCode().get());
    assertTrue(claimLine.getHcpcsInitialModifierCode().isPresent());
    assertFalse(claimLine.getHcpcsSecondModifierCode().isPresent());
    assertEquals("T2D", claimLine.getBetosCode().get());
    assertEquals(new BigDecimal("37.5"), claimLine.getPaymentAmount());
    assertEquals(new BigDecimal("0"), claimLine.getBeneficiaryPaymentAmount());
    assertEquals(new BigDecimal("37.5"), claimLine.getProviderPaymentAmount());
    assertEquals(new BigDecimal("0"), claimLine.getBeneficiaryPartBDeductAmount());
    assertTrue(claimLine.getPrimaryPayerCode().isPresent());
    assertEquals(new BigDecimal("0"), claimLine.getPrimaryPayerPaidAmount());
    assertEquals(new BigDecimal("9.57"), claimLine.getCoinsuranceAmount());
    assertEquals(new BigDecimal("75"), claimLine.getSubmittedChargeAmount());
    assertEquals(new BigDecimal("47.84"), claimLine.getAllowedChargeAmount());
    assertEquals("A", claimLine.getProcessingIndicatorCode().get());
    assertEquals(new Character('0'), claimLine.getPaymentCode().get());
    assertEquals(new Character('0'), claimLine.getServiceDeductibleCode().get());
    assertEquals(new BigDecimal("1"), claimLine.getMtusCount());
    assertEquals(new Character('3'), claimLine.getMtusCode().get());
    assertEquals("H12345", claimLine.getDiagnosisCode().get());
    assertEquals(new Character('0'), claimLine.getDiagnosisCodeVersion().get());
    assertFalse(claimLine.getHpsaScarcityCode().isPresent());
    assertFalse(claimLine.getRxNumber().isPresent());
    assertEquals(new BigDecimal("42.0"), claimLine.getHctHgbTestResult());
    assertEquals("R1", claimLine.getHctHgbTestTypeCode().get());
    assertEquals("49035044700", claimLine.getNationalDrugCode().get());
    assertEquals("BB889999AA", claimLine.getCliaLabNumber().get());
    assertEquals(new BigDecimal(0), claimLine.getAnesthesiaUnitCount());
}
Also used : CarrierClaimLine(gov.cms.bfd.model.rif.CarrierClaimLine) RifRecordEvent(gov.cms.bfd.model.rif.RifRecordEvent) RifFileRecords(gov.cms.bfd.model.rif.RifFileRecords) CarrierClaim(gov.cms.bfd.model.rif.CarrierClaim) RifFilesEvent(gov.cms.bfd.model.rif.RifFilesEvent) BigDecimal(java.math.BigDecimal) Test(org.junit.jupiter.api.Test)

Example 20 with RifRecordEvent

use of gov.cms.bfd.model.rif.RifRecordEvent in project beneficiary-fhir-data by CMSgov.

the class RifFilesProcessorTest method process1SNFClaimRecord.

/**
 * Ensures that {@link RifFilesProcessor} can correctly handle {@link
 * StaticRifResource#SAMPLE_A_SNF}.
 */
@Test
public void process1SNFClaimRecord() {
    RifFilesEvent filesEvent = new RifFilesEvent(Instant.now(), StaticRifResource.SAMPLE_A_SNF.toRifFile());
    RifFilesProcessor processor = new RifFilesProcessor();
    RifFileRecords rifFileRecords = processor.produceRecords(filesEvent.getFileEvents().get(0));
    List<RifRecordEvent<?>> rifEventsList = rifFileRecords.getRecords().collect(Collectors.toList());
    assertEquals(StaticRifResource.SAMPLE_A_SNF.getRecordCount(), rifEventsList.size());
    RifRecordEvent<?> rifRecordEvent = rifEventsList.get(0);
    assertEquals(StaticRifResource.SAMPLE_A_SNF.getRifFileType(), rifRecordEvent.getFileEvent().getFile().getFileType());
    assertNotNull(rifRecordEvent.getRecord());
    assertTrue(rifRecordEvent.getRecord() instanceof SNFClaim);
    // Verify the claim header.
    SNFClaim claimGroup = (SNFClaim) rifRecordEvent.getRecord();
    assertEquals(RecordAction.INSERT, rifRecordEvent.getRecordAction());
    assertEquals(claimGroup.getBeneficiaryId(), rifRecordEvent.getBeneficiaryId());
    assertEquals("567834", claimGroup.getBeneficiaryId());
    assertEquals("777777777", claimGroup.getClaimId());
    assertEquals(new BigDecimal(900), claimGroup.getClaimGroupId());
    assertEquals('V', claimGroup.getNearLineRecordIdCode());
    assertEquals("20", claimGroup.getClaimTypeCode());
    assertEquals(LocalDate.of(2013, 12, 01), claimGroup.getDateFrom());
    assertEquals(LocalDate.of(2013, 12, 18), claimGroup.getDateThrough());
    assertEquals('3', claimGroup.getClaimQueryCode());
    assertEquals("299999", claimGroup.getProviderNumber());
    assertEquals("B", claimGroup.getClaimNonPaymentReasonCode().get());
    assertEquals('1', claimGroup.getClaimServiceClassificationTypeCode());
    assertEquals(new BigDecimal("3333.33"), claimGroup.getPaymentAmount());
    assertEquals(new BigDecimal("11.00"), claimGroup.getPrimaryPayerPaidAmount());
    assertEquals("FL", claimGroup.getProviderStateCode());
    assertEquals("1111111111", claimGroup.getOrganizationNpi().get());
    assertEquals("2222222222", claimGroup.getAttendingPhysicianNpi().get());
    assertEquals("3333333333", claimGroup.getOperatingPhysicianNpi().get());
    assertEquals("4444444444", claimGroup.getOtherPhysicianNpi().get());
    assertEquals("1", claimGroup.getPatientDischargeStatusCode());
    assertEquals(new BigDecimal("5555.03"), claimGroup.getTotalChargeAmount());
    assertEquals(LocalDate.of(2013, 11, 5), claimGroup.getClaimAdmissionDate().get());
    assertEquals('3', claimGroup.getAdmissionTypeCd());
    assertEquals('4', claimGroup.getSourceAdmissionCd().get().charValue());
    assertEquals(new BigDecimal("112.00"), claimGroup.getDeductibleAmount());
    assertEquals(new BigDecimal("5.00"), claimGroup.getPartACoinsuranceLiabilityAmount());
    assertEquals(new BigDecimal("6.00"), claimGroup.getBloodDeductibleLiabilityAmount());
    assertEquals(new BigDecimal("33.00"), claimGroup.getNoncoveredCharge());
    assertEquals(new BigDecimal("14.00"), claimGroup.getTotalDeductionAmount());
    assertEquals(new BigDecimal("9.00"), claimGroup.getClaimPPSCapitalFSPAmount().get());
    assertEquals(new BigDecimal("8.00"), claimGroup.getClaimPPSCapitalOutlierAmount().get());
    assertEquals(new BigDecimal("7.00"), claimGroup.getClaimPPSCapitalDisproportionateShareAmt().get());
    assertEquals(new BigDecimal("6.00"), claimGroup.getClaimPPSCapitalIMEAmount().get());
    assertEquals(new BigDecimal("5.00"), claimGroup.getClaimPPSCapitalExceptionAmount().get());
    assertEquals(new BigDecimal("4.00"), claimGroup.getClaimPPSOldCapitalHoldHarmlessAmount().get());
    assertEquals(new BigDecimal(17), claimGroup.getUtilizationDayCount());
    assertEquals(new BigDecimal(17), claimGroup.getCoinsuranceDayCount());
    assertEquals(new BigDecimal(0), claimGroup.getNonUtilizationDayCount());
    assertEquals(new BigDecimal(19), claimGroup.getBloodPintsFurnishedQty());
    assertEquals(LocalDate.of(2013, 9, 23), claimGroup.getQualifiedStayFromDate().get());
    assertEquals(LocalDate.of(2013, 11, 5), claimGroup.getQualifiedStayThroughDate().get());
    assertEquals(LocalDate.of(2002, 1, 11), claimGroup.getNoncoveredStayFromDate().get());
    assertEquals(LocalDate.of(2002, 1, 21), claimGroup.getNoncoveredStayThroughDate().get());
    assertFalse(claimGroup.getCoveredCareThroughDate().isPresent());
    assertEquals(LocalDate.of(2002, 1, 31), claimGroup.getMedicareBenefitsExhaustedDate().get());
    assertEquals(LocalDate.of(2013, 12, 18), claimGroup.getBeneficiaryDischargeDate().get());
    assertEquals("R4444", claimGroup.getDiagnosisAdmittingCode().get());
    assertEquals('9', claimGroup.getDiagnosisAdmittingCodeVersion().get().charValue());
    assertEquals("R2222", claimGroup.getDiagnosisExternal1Code().get());
    assertEquals('9', claimGroup.getDiagnosisExternal1CodeVersion().get().charValue());
    assertEquals("23443453453", claimGroup.getFiDocumentClaimControlNumber().get());
    assertEquals("34534535535", claimGroup.getFiOriginalClaimControlNumber().get());
    assertEquals(1, claimGroup.getLines().size());
    // Verify one of the claim lines.
    SNFClaimLine claimLine = claimGroup.getLines().get(0);
    assertEquals("MMM", claimLine.getHcpcsCode().get());
    assertEquals(new BigDecimal("95.00"), claimLine.getTotalChargeAmount());
    assertEquals(new BigDecimal("88.00"), claimLine.getNonCoveredChargeAmount());
    assertEquals("345345345", claimLine.getRevenueCenterRenderingPhysicianNPI().get());
}
Also used : SNFClaimLine(gov.cms.bfd.model.rif.SNFClaimLine) RifRecordEvent(gov.cms.bfd.model.rif.RifRecordEvent) RifFileRecords(gov.cms.bfd.model.rif.RifFileRecords) SNFClaim(gov.cms.bfd.model.rif.SNFClaim) RifFilesEvent(gov.cms.bfd.model.rif.RifFilesEvent) BigDecimal(java.math.BigDecimal) Test(org.junit.jupiter.api.Test)

Aggregations

RifRecordEvent (gov.cms.bfd.model.rif.RifRecordEvent)27 RifFileRecords (gov.cms.bfd.model.rif.RifFileRecords)16 RifFilesEvent (gov.cms.bfd.model.rif.RifFilesEvent)15 CSVRecord (org.apache.commons.csv.CSVRecord)14 RecordAction (gov.cms.bfd.model.rif.RecordAction)13 Test (org.junit.jupiter.api.Test)13 BigDecimal (java.math.BigDecimal)11 Beneficiary (gov.cms.bfd.model.rif.Beneficiary)6 BadCodeMonkeyException (gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException)6 BeneficiaryHistory (gov.cms.bfd.model.rif.BeneficiaryHistory)5 CarrierClaim (gov.cms.bfd.model.rif.CarrierClaim)5 CarrierClaimLine (gov.cms.bfd.model.rif.CarrierClaimLine)4 RifFileEvent (gov.cms.bfd.model.rif.RifFileEvent)4 IOException (java.io.IOException)4 List (java.util.List)4 BeneficiaryMonthly (gov.cms.bfd.model.rif.BeneficiaryMonthly)3 LoadedBatch (gov.cms.bfd.model.rif.LoadedBatch)3 LoadedFile (gov.cms.bfd.model.rif.LoadedFile)3 RifFileType (gov.cms.bfd.model.rif.RifFileType)3 SkippedRifRecord (gov.cms.bfd.model.rif.SkippedRifRecord)3