Search in sources :

Example 16 with CarrierClaim

use of gov.cms.bfd.model.rif.CarrierClaim 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 17 with CarrierClaim

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

the class RifFilesProcessor method buildCarrierClaimEvent.

/**
 * @param fileEvent the {@link RifFileEvent} being processed
 * @param csvRecords the {@link CSVRecord}s to be mapped, which must be from a {@link
 *     RifFileType#CARRIER} {@link RifFile}
 * @return a {@link RifRecordEvent} built from the specified {@link CSVRecord}s
 */
private static RifRecordEvent<CarrierClaim> buildCarrierClaimEvent(RifFileEvent fileEvent, List<CSVRecord> csvRecords) {
    if (LOGGER.isTraceEnabled())
        LOGGER.trace(csvRecords.toString());
    CSVRecord firstCsvRecord = csvRecords.get(0);
    RecordAction recordAction = RecordAction.match(firstCsvRecord.get("DML_IND"));
    CarrierClaim claim = CarrierClaimParser.parseRif(csvRecords);
    return new RifRecordEvent<CarrierClaim>(fileEvent, csvRecords, recordAction, claim.getBeneficiaryId(), claim);
}
Also used : RifRecordEvent(gov.cms.bfd.model.rif.RifRecordEvent) CSVRecord(org.apache.commons.csv.CSVRecord) RecordAction(gov.cms.bfd.model.rif.RecordAction) CarrierClaim(gov.cms.bfd.model.rif.CarrierClaim)

Example 18 with CarrierClaim

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

the class ExplanationOfBenefitResourceProviderIT method searchForEobsWithLargePageSizesOnFewerResults.

/**
 * Verifies that {@link ExplanationOfBenefitResourceProvider#findByPatient} works as expected for
 * a {@link Patient} that does exist in the DB, with a page size of 50 with fewer (8) results.
 *
 * @throws FHIRException (indicates test failure)
 */
@Test
public void searchForEobsWithLargePageSizesOnFewerResults() throws FHIRException {
    List<Object> loadedRecords = ServerTestUtils.get().loadData(Arrays.asList(StaticRifResourceGroup.SAMPLE_A.getResources()));
    IGenericClient fhirClient = ServerTestUtils.get().createFhirClient();
    Beneficiary beneficiary = loadedRecords.stream().filter(r -> r instanceof Beneficiary).map(r -> (Beneficiary) r).findFirst().get();
    Bundle searchResults = fhirClient.search().forResource(ExplanationOfBenefit.class).where(ExplanationOfBenefit.PATIENT.hasId(TransformerUtils.buildPatientId(beneficiary))).count(50).returnBundle(Bundle.class).execute();
    assertNotNull(searchResults);
    /*
     * Verify the bundle contains a key for total and that the value matches the
     * number of entries in the bundle
     */
    assertEquals(loadedRecords.stream().filter(r -> !(r instanceof Beneficiary)).filter(r -> !(r instanceof BeneficiaryHistory)).filter(r -> !(r instanceof MedicareBeneficiaryIdHistory)).count(), searchResults.getTotal());
    /*
     * Verify that only the first and last links exist as there are no previous or
     * next pages.
     */
    assertNotNull(searchResults.getLink(Constants.LINK_FIRST));
    assertNotNull(searchResults.getLink(Constants.LINK_LAST));
    assertNull(searchResults.getLink(Constants.LINK_NEXT));
    assertNull(searchResults.getLink(Constants.LINK_PREVIOUS));
    /*
     * Verify that each of the expected claims (one for every claim type) is present
     * and looks correct.
     */
    CarrierClaim carrierClaim = loadedRecords.stream().filter(r -> r instanceof CarrierClaim).map(r -> (CarrierClaim) r).findFirst().get();
    assertEquals(1, filterToClaimType(searchResults, ClaimType.CARRIER).size());
    CarrierClaimTransformerTest.assertMatches(carrierClaim, filterToClaimType(searchResults, ClaimType.CARRIER).get(0), Optional.empty());
    DMEClaim dmeClaim = loadedRecords.stream().filter(r -> r instanceof DMEClaim).map(r -> (DMEClaim) r).findFirst().get();
    DMEClaimTransformerTest.assertMatches(dmeClaim, filterToClaimType(searchResults, ClaimType.DME).get(0), Optional.empty());
    HHAClaim hhaClaim = loadedRecords.stream().filter(r -> r instanceof HHAClaim).map(r -> (HHAClaim) r).findFirst().get();
    HHAClaimTransformerTest.assertMatches(hhaClaim, filterToClaimType(searchResults, ClaimType.HHA).get(0));
    HospiceClaim hospiceClaim = loadedRecords.stream().filter(r -> r instanceof HospiceClaim).map(r -> (HospiceClaim) r).findFirst().get();
    HospiceClaimTransformerTest.assertMatches(hospiceClaim, filterToClaimType(searchResults, ClaimType.HOSPICE).get(0));
    InpatientClaim inpatientClaim = loadedRecords.stream().filter(r -> r instanceof InpatientClaim).map(r -> (InpatientClaim) r).findFirst().get();
    InpatientClaimTransformerTest.assertMatches(inpatientClaim, filterToClaimType(searchResults, ClaimType.INPATIENT).get(0));
    OutpatientClaim outpatientClaim = loadedRecords.stream().filter(r -> r instanceof OutpatientClaim).map(r -> (OutpatientClaim) r).findFirst().get();
    OutpatientClaimTransformerTest.assertMatches(outpatientClaim, filterToClaimType(searchResults, ClaimType.OUTPATIENT).get(0));
    PartDEvent partDEvent = loadedRecords.stream().filter(r -> r instanceof PartDEvent).map(r -> (PartDEvent) r).findFirst().get();
    PartDEventTransformerTest.assertMatches(partDEvent, filterToClaimType(searchResults, ClaimType.PDE).get(0));
    SNFClaim snfClaim = loadedRecords.stream().filter(r -> r instanceof SNFClaim).map(r -> (SNFClaim) r).findFirst().get();
    SNFClaimTransformerTest.assertMatches(snfClaim, filterToClaimType(searchResults, ClaimType.SNF).get(0));
}
Also used : Arrays(java.util.Arrays) Bundle(org.hl7.fhir.dstu3.model.Bundle) Date(java.util.Date) Constants(ca.uhn.fhir.rest.api.Constants) InpatientClaim(gov.cms.bfd.model.rif.InpatientClaim) DateTimeDt(ca.uhn.fhir.model.primitive.DateTimeDt) PartDEvent(gov.cms.bfd.model.rif.PartDEvent) SNFClaim(gov.cms.bfd.model.rif.SNFClaim) DateRangeParam(ca.uhn.fhir.rest.param.DateRangeParam) BeforeAll(org.junit.jupiter.api.BeforeAll) IBaseResource(org.hl7.fhir.instance.model.api.IBaseResource) BeneficiaryHistory(gov.cms.bfd.model.rif.BeneficiaryHistory) IGenericClient(ca.uhn.fhir.rest.client.api.IGenericClient) Triple(org.apache.commons.lang3.tuple.Triple) OutpatientClaim(gov.cms.bfd.model.rif.OutpatientClaim) IdDt(ca.uhn.fhir.model.primitive.IdDt) ExplanationOfBenefit(org.hl7.fhir.dstu3.model.ExplanationOfBenefit) InvalidRequestException(ca.uhn.fhir.rest.server.exceptions.InvalidRequestException) Instant(java.time.Instant) Collectors(java.util.stream.Collectors) Test(org.junit.jupiter.api.Test) Beneficiary(gov.cms.bfd.model.rif.Beneficiary) List(java.util.List) TransformerConstants(gov.cms.bfd.server.war.commons.TransformerConstants) EntityManagerFactory(javax.persistence.EntityManagerFactory) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) CarrierClaim(gov.cms.bfd.model.rif.CarrierClaim) Optional(java.util.Optional) TokenAndListParam(ca.uhn.fhir.rest.param.TokenAndListParam) Assertions.assertThrows(org.junit.jupiter.api.Assertions.assertThrows) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) RequestHeaders(gov.cms.bfd.server.war.commons.RequestHeaders) IBaseBundle(org.hl7.fhir.instance.model.api.IBaseBundle) ArrayList(java.util.ArrayList) HHAClaim(gov.cms.bfd.model.rif.HHAClaim) PipelineTestUtils(gov.cms.bfd.pipeline.sharedutils.PipelineTestUtils) RequestDetails(ca.uhn.fhir.rest.api.server.RequestDetails) ImmutableList(com.google.common.collect.ImmutableList) ReferenceParam(ca.uhn.fhir.rest.param.ReferenceParam) DMEClaim(gov.cms.bfd.model.rif.DMEClaim) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) ResourceNotFoundException(ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException) StaticRifResourceGroup(gov.cms.bfd.model.rif.samples.StaticRifResourceGroup) ServerTestUtils(gov.cms.bfd.server.war.ServerTestUtils) StringClientParam(ca.uhn.fhir.rest.gclient.StringClientParam) CommonHeaders(gov.cms.bfd.server.war.commons.CommonHeaders) ImmutableTriple(org.apache.commons.lang3.tuple.ImmutableTriple) TokenClientParam(ca.uhn.fhir.rest.gclient.TokenClientParam) HospiceClaim(gov.cms.bfd.model.rif.HospiceClaim) EntityManager(javax.persistence.EntityManager) MedicareBeneficiaryIdHistory(gov.cms.bfd.model.rif.MedicareBeneficiaryIdHistory) AfterEach(org.junit.jupiter.api.AfterEach) ChronoUnit(java.time.temporal.ChronoUnit) Patient(org.hl7.fhir.dstu3.model.Patient) FHIRException(org.hl7.fhir.exceptions.FHIRException) BeneficiaryHistory(gov.cms.bfd.model.rif.BeneficiaryHistory) InpatientClaim(gov.cms.bfd.model.rif.InpatientClaim) IGenericClient(ca.uhn.fhir.rest.client.api.IGenericClient) Bundle(org.hl7.fhir.dstu3.model.Bundle) IBaseBundle(org.hl7.fhir.instance.model.api.IBaseBundle) OutpatientClaim(gov.cms.bfd.model.rif.OutpatientClaim) CarrierClaim(gov.cms.bfd.model.rif.CarrierClaim) MedicareBeneficiaryIdHistory(gov.cms.bfd.model.rif.MedicareBeneficiaryIdHistory) SNFClaim(gov.cms.bfd.model.rif.SNFClaim) PartDEvent(gov.cms.bfd.model.rif.PartDEvent) DMEClaim(gov.cms.bfd.model.rif.DMEClaim) HHAClaim(gov.cms.bfd.model.rif.HHAClaim) HospiceClaim(gov.cms.bfd.model.rif.HospiceClaim) Beneficiary(gov.cms.bfd.model.rif.Beneficiary) Test(org.junit.jupiter.api.Test)

Example 19 with CarrierClaim

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

the class CarrierClaimTransformerTest method transformSampleURecord.

/**
 * Verifies that {@link
 * gov.cms.bfd.server.war.stu3.providers.CarrierClaimTransformer#transform(Object)} works as
 * expected when run against the {@link StaticRifResource#SAMPLE_U_CARRIER} {@link CarrierClaim}.
 *
 * @throws FHIRException (indicates test failure)
 */
@Test
public void transformSampleURecord() throws FHIRException {
    List<Object> parsedRecords = ServerTestUtils.parseData(Arrays.asList(StaticRifResourceGroup.SAMPLE_U.getResources()));
    CarrierClaim claim = parsedRecords.stream().filter(r -> r instanceof CarrierClaim).map(r -> (CarrierClaim) r).findFirst().get();
    ExplanationOfBenefit eob = CarrierClaimTransformer.transform(new MetricRegistry(), claim, Optional.of(true));
    assertMatches(claim, eob, Optional.of(true));
}
Also used : Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) Arrays(java.util.Arrays) MetricRegistry(com.codahale.metrics.MetricRegistry) ExplanationOfBenefit(org.hl7.fhir.dstu3.model.ExplanationOfBenefit) StaticRifResource(gov.cms.bfd.model.rif.samples.StaticRifResource) MedicareSegment(gov.cms.bfd.server.war.commons.MedicareSegment) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) ItemComponent(org.hl7.fhir.dstu3.model.ExplanationOfBenefit.ItemComponent) Instant(java.time.Instant) ClaimCareteamrole(org.hl7.fhir.dstu3.model.codesystems.ClaimCareteamrole) Test(org.junit.jupiter.api.Test) BigDecimal(java.math.BigDecimal) List(java.util.List) CareTeamComponent(org.hl7.fhir.dstu3.model.ExplanationOfBenefit.CareTeamComponent) TransformerConstants(gov.cms.bfd.server.war.commons.TransformerConstants) CcwCodebookVariable(gov.cms.bfd.model.codebook.data.CcwCodebookVariable) CarrierClaim(gov.cms.bfd.model.rif.CarrierClaim) CarrierClaimLine(gov.cms.bfd.model.rif.CarrierClaimLine) Optional(java.util.Optional) FHIRException(org.hl7.fhir.exceptions.FHIRException) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) StaticRifResourceGroup(gov.cms.bfd.model.rif.samples.StaticRifResourceGroup) ServerTestUtils(gov.cms.bfd.server.war.ServerTestUtils) MetricRegistry(com.codahale.metrics.MetricRegistry) CarrierClaim(gov.cms.bfd.model.rif.CarrierClaim) ExplanationOfBenefit(org.hl7.fhir.dstu3.model.ExplanationOfBenefit) Test(org.junit.jupiter.api.Test)

Example 20 with CarrierClaim

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

the class ClaimTypeTest method verifyServiceEndAttributeFunc.

/**
 * Verifies that our service end date function is working as expected. Since we are type casting
 * our claim object, we need to verify that every ClaimType is tested.
 */
@Test
public void verifyServiceEndAttributeFunc() {
    LocalDate start = LocalDate.now();
    LocalDate end = start.plusDays(10);
    CarrierClaim carrierClaim = new CarrierClaim();
    carrierClaim.setDateFrom(start);
    carrierClaim.setDateThrough(end);
    DMEClaim dmeClaim = new DMEClaim();
    dmeClaim.setDateFrom(start);
    dmeClaim.setDateThrough(end);
    HHAClaim hhaClaim = new HHAClaim();
    hhaClaim.setDateFrom(start);
    hhaClaim.setDateThrough(end);
    HospiceClaim hospiceClaim = new HospiceClaim();
    hospiceClaim.setDateFrom(start);
    hospiceClaim.setDateThrough(end);
    InpatientClaim inpatientClaim = new InpatientClaim();
    inpatientClaim.setDateFrom(start);
    inpatientClaim.setDateThrough(end);
    OutpatientClaim outpatientClaim = new OutpatientClaim();
    outpatientClaim.setDateFrom(start);
    outpatientClaim.setDateThrough(end);
    PartDEvent partDEvent = new PartDEvent();
    partDEvent.setPrescriptionFillDate(end);
    SNFClaim snfClaim = new SNFClaim();
    snfClaim.setDateFrom(start);
    snfClaim.setDateThrough(end);
    ImmutableMap.Builder<ClaimType, Object> builder = ImmutableMap.builder();
    builder.put(ClaimType.CARRIER, carrierClaim);
    builder.put(ClaimType.DME, dmeClaim);
    builder.put(ClaimType.HHA, hhaClaim);
    builder.put(ClaimType.HOSPICE, hospiceClaim);
    builder.put(ClaimType.INPATIENT, inpatientClaim);
    builder.put(ClaimType.OUTPATIENT, outpatientClaim);
    builder.put(ClaimType.PDE, partDEvent);
    builder.put(ClaimType.SNF, snfClaim);
    Map<ClaimType, Object> claimTypeToClaim = builder.build();
    // Verify that we're testing all of the ClaimTypes that are defined
    EnumSet.allOf(ClaimType.class).stream().forEach(claimType -> assertTrue(claimTypeToClaim.containsKey(claimType), String.format("ClaimType %s not tested", claimType.name())));
    claimTypeToClaim.entrySet().forEach(entry -> assertEquals(end, entry.getKey().getServiceEndAttributeFunction().apply(entry.getValue()), String.format("Claim type %s does not match expectations", entry.getKey().name())));
}
Also used : InpatientClaim(gov.cms.bfd.model.rif.InpatientClaim) OutpatientClaim(gov.cms.bfd.model.rif.OutpatientClaim) CarrierClaim(gov.cms.bfd.model.rif.CarrierClaim) SNFClaim(gov.cms.bfd.model.rif.SNFClaim) LocalDate(java.time.LocalDate) PartDEvent(gov.cms.bfd.model.rif.PartDEvent) ImmutableMap(com.google.common.collect.ImmutableMap) DMEClaim(gov.cms.bfd.model.rif.DMEClaim) HHAClaim(gov.cms.bfd.model.rif.HHAClaim) HospiceClaim(gov.cms.bfd.model.rif.HospiceClaim) Test(org.junit.jupiter.api.Test)

Aggregations

CarrierClaim (gov.cms.bfd.model.rif.CarrierClaim)26 Test (org.junit.jupiter.api.Test)19 InpatientClaim (gov.cms.bfd.model.rif.InpatientClaim)18 StaticRifResourceGroup (gov.cms.bfd.model.rif.samples.StaticRifResourceGroup)18 ServerTestUtils (gov.cms.bfd.server.war.ServerTestUtils)18 TransformerConstants (gov.cms.bfd.server.war.commons.TransformerConstants)18 Arrays (java.util.Arrays)18 List (java.util.List)18 Optional (java.util.Optional)18 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)18 DMEClaim (gov.cms.bfd.model.rif.DMEClaim)17 HHAClaim (gov.cms.bfd.model.rif.HHAClaim)17 HospiceClaim (gov.cms.bfd.model.rif.HospiceClaim)17 OutpatientClaim (gov.cms.bfd.model.rif.OutpatientClaim)17 PartDEvent (gov.cms.bfd.model.rif.PartDEvent)17 SNFClaim (gov.cms.bfd.model.rif.SNFClaim)17 Beneficiary (gov.cms.bfd.model.rif.Beneficiary)16 IGenericClient (ca.uhn.fhir.rest.client.api.IGenericClient)15 PipelineTestUtils (gov.cms.bfd.pipeline.sharedutils.PipelineTestUtils)15 CommonHeaders (gov.cms.bfd.server.war.commons.CommonHeaders)15