Search in sources :

Example 1 with PreAdjFissPayer

use of gov.cms.bfd.model.rda.PreAdjFissPayer in project beneficiary-fhir-data by CMSgov.

the class FissClaimTransformerTest method basicFieldsTestForInsuredPayerObjectTransformation.

/**
 * Basic smoke test for transformation of insured payer objects prior to all of the individual
 * field tests.
 */
@Test
public void basicFieldsTestForInsuredPayerObjectTransformation() {
    claimBuilder.setDcn("dcn").setHicNo("hicn").setCurrStatusEnum(FissClaimStatus.CLAIM_STATUS_MOVE).setCurrLoc1Enum(FissProcessingType.PROCESSING_TYPE_MANUAL).setCurrLoc2Enum(FissCurrentLocation2.CURRENT_LOCATION_2_FINAL).addFissPayers(FissPayer.newBuilder().setInsuredPayer(FissInsuredPayer.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").setInsuredRelEnum(FissPatientRelationshipCode.PATIENT_RELATIONSHIP_CODE_EMPLOYEE).setInsuredName("insured-name").setInsuredSsnHic("ssn-hic").setInsuredGroupName("group-name").setInsuredGroupNbr("group-num").setTreatAuthCd("auth-code").setInsuredSexEnum(FissBeneficiarySex.BENEFICIARY_SEX_MALE).setInsuredRelX12Enum(FissPatientRelationshipCode.PATIENT_RELATIONSHIP_CODE_GRANDCHILD).setInsuredDobText("11222021").setInsuredDob("2021-11-22").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.Insured);
    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.setInsuredRel("08");
    payer.setInsuredName("insured-name");
    payer.setInsuredSsnHic("ssn-hic");
    payer.setInsuredGroupName("group-name");
    payer.setInsuredGroupNbr("group-num");
    payer.setTreatAuthCd("auth-code");
    payer.setInsuredSex("M");
    payer.setInsuredRelX12("13");
    payer.setInsuredDob(LocalDate.of(2021, 11, 22));
    payer.setInsuredDobText("11222021");
    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 2 with PreAdjFissPayer

use of gov.cms.bfd.model.rda.PreAdjFissPayer in project beneficiary-fhir-data by CMSgov.

the class RDATestUtils method fissTestDataA.

/**
 * One FISS claim for testing
 *
 * @return The FISS test claim A
 */
private PreAdjFissClaim fissTestDataA(Mbi mbi) {
    PreAdjFissClaim claim = PreAdjFissClaim.builder().sequenceNumber(1L).dcn("123456").hicNo("hicnumber").currStatus('a').currLoc1('z').currLoc2("Somda").medaProvId("meda12345").fedTaxNumber("tax12345").totalChargeAmount(new BigDecimal("1234.32")).receivedDate(LocalDate.ofEpochDay(0)).currTranDate(LocalDate.ofEpochDay(1)).admitDiagCode("admitcd").principleDiag("princcd").npiNumber("8876543211").mbiRecord(mbi).fedTaxNumber("abc123").lobCd("r").lastUpdated(Instant.ofEpochMilli(0)).stmtCovFromDate(LocalDate.ofEpochDay(200)).stmtCovToDate(LocalDate.ofEpochDay(200)).servTypeCd("A").freqCd("C").build();
    Set<PreAdjFissProcCode> procCodes = Set.of(PreAdjFissProcCode.builder().dcn("123456").priority((short) 0).procCode("CODEABC").procFlag("FLAG").procDate(LocalDate.ofEpochDay(200)).lastUpdated(Instant.ofEpochMilli(0)).build(), PreAdjFissProcCode.builder().dcn("123456").priority((short) 1).procCode("CODECBA").procFlag("FLA2").lastUpdated(Instant.ofEpochMilli(0)).build());
    Set<PreAdjFissDiagnosisCode> diagnosisCodes = Set.of(PreAdjFissDiagnosisCode.builder().dcn("123456").priority((short) 0).diagCd2("admitcd").diagPoaInd("Z").build(), PreAdjFissDiagnosisCode.builder().dcn("123456").priority((short) 1).diagCd2("other").diagPoaInd("U").build(), PreAdjFissDiagnosisCode.builder().dcn("123456").priority((short) 2).diagCd2("princcd").diagPoaInd("n").build());
    Set<PreAdjFissPayer> payers = Set.of(PreAdjFissPayer.builder().dcn("123456").priority((short) 0).beneFirstName("jim").beneMidInit("k").beneLastName("baker").beneSex("m").beneDob(LocalDate.of(1975, 3, 1)).payerType(PreAdjFissPayer.PayerType.BeneZ).payersName("MEDICARE").build(), PreAdjFissPayer.builder().dcn("123456").priority((short) 1).insuredName("BAKER  JIM  K").payerType(PreAdjFissPayer.PayerType.Insured).payersName("BCBS KC").build());
    claim.setPayers(payers);
    claim.setProcCodes(procCodes);
    claim.setDiagCodes(diagnosisCodes);
    return claim;
}
Also used : PreAdjFissDiagnosisCode(gov.cms.bfd.model.rda.PreAdjFissDiagnosisCode) PreAdjFissProcCode(gov.cms.bfd.model.rda.PreAdjFissProcCode) PreAdjFissClaim(gov.cms.bfd.model.rda.PreAdjFissClaim) BigDecimal(java.math.BigDecimal) PreAdjFissPayer(gov.cms.bfd.model.rda.PreAdjFissPayer)

Example 3 with PreAdjFissPayer

use of gov.cms.bfd.model.rda.PreAdjFissPayer in project beneficiary-fhir-data by CMSgov.

the class RDATestUtils method fissTestDataB.

/**
 * One FISS claim for testing
 *
 * @return The FISS test claim B
 */
private PreAdjFissClaim fissTestDataB(Mbi mbi) {
    PreAdjFissClaim claim = PreAdjFissClaim.builder().sequenceNumber(2L).dcn("123457").hicNo("hicnumbe2").currStatus('t').currLoc1('r').currLoc2("Somdb").medaProvId("meda12346").fedTaxNumber("tax12345").totalChargeAmount(new BigDecimal("1235.32")).receivedDate(LocalDate.ofEpochDay(8)).currTranDate(LocalDate.ofEpochDay(12)).admitDiagCode("admitcc").principleDiag("princcc").npiNumber("8876543212").mbiRecord(mbi).fedTaxNumber("abc124").lobCd("k").lastUpdated(Instant.ofEpochMilli(5000)).stmtCovFromDate(LocalDate.ofEpochDay(211)).stmtCovToDate(LocalDate.ofEpochDay(211)).servTypeCd("A").freqCd("C").build();
    Set<PreAdjFissProcCode> procCodes = Set.of(PreAdjFissProcCode.builder().dcn("123457").priority((short) 0).procCode("CODEABD").procFlag("FLAC").procDate(LocalDate.ofEpochDay(211)).lastUpdated(Instant.ofEpochMilli(5000)).build());
    Set<PreAdjFissDiagnosisCode> diagnosisCodes = Set.of(PreAdjFissDiagnosisCode.builder().dcn("123457").priority((short) 0).diagCd2("princcc").diagPoaInd("Y").build(), PreAdjFissDiagnosisCode.builder().dcn("123457").priority((short) 1).diagCd2("other2").diagPoaInd("w").build(), PreAdjFissDiagnosisCode.builder().dcn("123457").priority((short) 2).diagCd2("admitcc").diagPoaInd("1").build());
    Set<PreAdjFissPayer> payers = Set.of(PreAdjFissPayer.builder().dcn("123457").priority((short) 0).beneFirstName("alice").beneMidInit("r").beneLastName("smith").beneSex("f").beneDob(LocalDate.of(1981, 8, 13)).payerType(PreAdjFissPayer.PayerType.BeneZ).payersName("MEDICARE").build(), PreAdjFissPayer.builder().dcn("123457").priority((short) 1).insuredName("SMITH  ALICE  R").payerType(PreAdjFissPayer.PayerType.Insured).payersName("BCBS KC").build());
    claim.setPayers(payers);
    claim.setProcCodes(procCodes);
    claim.setDiagCodes(diagnosisCodes);
    return claim;
}
Also used : PreAdjFissDiagnosisCode(gov.cms.bfd.model.rda.PreAdjFissDiagnosisCode) PreAdjFissProcCode(gov.cms.bfd.model.rda.PreAdjFissProcCode) PreAdjFissClaim(gov.cms.bfd.model.rda.PreAdjFissClaim) BigDecimal(java.math.BigDecimal) PreAdjFissPayer(gov.cms.bfd.model.rda.PreAdjFissPayer)

Example 4 with PreAdjFissPayer

use of gov.cms.bfd.model.rda.PreAdjFissPayer in project beneficiary-fhir-data by CMSgov.

the class FissClaimResponseTransformerV2 method getContainedPatient.

private static Resource getContainedPatient(PreAdjFissClaim claimGroup) {
    Optional<PreAdjFissPayer> optional = claimGroup.getPayers().stream().filter(p -> p.getPayerType() == PreAdjFissPayer.PayerType.BeneZ).findFirst();
    Patient patient;
    if (optional.isPresent()) {
        PreAdjFissPayer benePayer = optional.get();
        patient = getContainedPatient(claimGroup.getMbi(), new PatientInfo(benePayer.getBeneFirstName(), benePayer.getBeneLastName(), ifNotNull(benePayer.getBeneMidInit(), s -> s.charAt(0) + "."), benePayer.getBeneDob(), benePayer.getBeneSex()));
    } else {
        patient = getContainedPatient(claimGroup.getMbi(), null);
    }
    return patient;
}
Also used : Trace(com.newrelic.api.agent.Trace) PreAdjFissPayer(gov.cms.bfd.model.rda.PreAdjFissPayer) Date(java.util.Date) Identifier(org.hl7.fhir.r4.model.Identifier) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept) Reference(org.hl7.fhir.r4.model.Reference) ArrayList(java.util.ArrayList) C4BBIdentifierType(gov.cms.bfd.server.war.commons.carin.C4BBIdentifierType) Map(java.util.Map) ClaimType(org.hl7.fhir.r4.model.codesystems.ClaimType) Meta(org.hl7.fhir.r4.model.Meta) Patient(org.hl7.fhir.r4.model.Patient) PreAdjFissClaim(gov.cms.bfd.model.rda.PreAdjFissClaim) MetricRegistry(com.codahale.metrics.MetricRegistry) DateType(org.hl7.fhir.r4.model.DateType) BadCodeMonkeyException(gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException) Resource(org.hl7.fhir.r4.model.Resource) ClaimResponse(org.hl7.fhir.r4.model.ClaimResponse) BBCodingSystems(gov.cms.bfd.server.war.commons.BBCodingSystems) AbstractTransformerV2(gov.cms.bfd.server.war.r4.providers.preadj.common.AbstractTransformerV2) List(java.util.List) Coding(org.hl7.fhir.r4.model.Coding) Timer(com.codahale.metrics.Timer) Optional(java.util.Optional) Extension(org.hl7.fhir.r4.model.Extension) Patient(org.hl7.fhir.r4.model.Patient) PreAdjFissPayer(gov.cms.bfd.model.rda.PreAdjFissPayer)

Example 5 with PreAdjFissPayer

use of gov.cms.bfd.model.rda.PreAdjFissPayer in project beneficiary-fhir-data by CMSgov.

the class FissClaimTransformerV2 method getContainedPatient.

private static Resource getContainedPatient(PreAdjFissClaim claimGroup) {
    Optional<PreAdjFissPayer> optional = claimGroup.getPayers().stream().filter(p -> p.getPayerType() == PreAdjFissPayer.PayerType.BeneZ).findFirst();
    Patient patient;
    if (optional.isPresent()) {
        PreAdjFissPayer benePayer = optional.get();
        patient = getContainedPatient(claimGroup.getMbi(), new PatientInfo(benePayer.getBeneFirstName(), benePayer.getBeneLastName(), ifNotNull(benePayer.getBeneMidInit(), s -> s.charAt(0) + "."), benePayer.getBeneDob(), benePayer.getBeneSex()));
    } else {
        patient = getContainedPatient(claimGroup.getMbi(), null);
    }
    return patient;
}
Also used : Trace(com.newrelic.api.agent.Trace) PreAdjFissPayer(gov.cms.bfd.model.rda.PreAdjFissPayer) Date(java.util.Date) Identifier(org.hl7.fhir.r4.model.Identifier) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept) IcdCode(gov.cms.bfd.server.war.commons.IcdCode) Reference(org.hl7.fhir.r4.model.Reference) C4BBClaimIdentifierType(gov.cms.bfd.server.war.commons.carin.C4BBClaimIdentifierType) Money(org.hl7.fhir.r4.model.Money) C4BBIdentifierType(gov.cms.bfd.server.war.commons.carin.C4BBIdentifierType) Locale(java.util.Locale) ObjectUtils(org.apache.commons.lang3.ObjectUtils) ExDiagnosistype(org.hl7.fhir.r4.model.codesystems.ExDiagnosistype) StringType(org.hl7.fhir.r4.model.StringType) ClaimType(org.hl7.fhir.r4.model.codesystems.ClaimType) PreAdjFissDiagnosisCode(gov.cms.bfd.model.rda.PreAdjFissDiagnosisCode) Meta(org.hl7.fhir.r4.model.Meta) Patient(org.hl7.fhir.r4.model.Patient) PreAdjFissClaim(gov.cms.bfd.model.rda.PreAdjFissClaim) MetricRegistry(com.codahale.metrics.MetricRegistry) C4BBSupportingInfoType(gov.cms.bfd.server.war.commons.carin.C4BBSupportingInfoType) BadCodeMonkeyException(gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException) PreAdjFissProcCode(gov.cms.bfd.model.rda.PreAdjFissProcCode) Period(org.hl7.fhir.r4.model.Period) Resource(org.hl7.fhir.r4.model.Resource) ProcessPriority(org.hl7.fhir.r4.model.codesystems.ProcessPriority) Collectors(java.util.stream.Collectors) BBCodingSystems(gov.cms.bfd.server.war.commons.BBCodingSystems) Objects(java.util.Objects) AbstractTransformerV2(gov.cms.bfd.server.war.r4.providers.preadj.common.AbstractTransformerV2) Organization(org.hl7.fhir.r4.model.Organization) List(java.util.List) TransformerConstants(gov.cms.bfd.server.war.commons.TransformerConstants) C4BBOrganizationIdentifierType(gov.cms.bfd.server.war.commons.carin.C4BBOrganizationIdentifierType) Coding(org.hl7.fhir.r4.model.Coding) LocalDate(java.time.LocalDate) Timer(com.codahale.metrics.Timer) Optional(java.util.Optional) Extension(org.hl7.fhir.r4.model.Extension) Comparator(java.util.Comparator) Collections(java.util.Collections) Claim(org.hl7.fhir.r4.model.Claim) Patient(org.hl7.fhir.r4.model.Patient) PreAdjFissPayer(gov.cms.bfd.model.rda.PreAdjFissPayer)

Aggregations

PreAdjFissPayer (gov.cms.bfd.model.rda.PreAdjFissPayer)8 PreAdjFissClaim (gov.cms.bfd.model.rda.PreAdjFissClaim)6 PreAdjFissDiagnosisCode (gov.cms.bfd.model.rda.PreAdjFissDiagnosisCode)4 PreAdjFissProcCode (gov.cms.bfd.model.rda.PreAdjFissProcCode)4 BigDecimal (java.math.BigDecimal)4 MetricRegistry (com.codahale.metrics.MetricRegistry)2 Timer (com.codahale.metrics.Timer)2 Trace (com.newrelic.api.agent.Trace)2 BBCodingSystems (gov.cms.bfd.server.war.commons.BBCodingSystems)2 C4BBIdentifierType (gov.cms.bfd.server.war.commons.carin.C4BBIdentifierType)2 AbstractTransformerV2 (gov.cms.bfd.server.war.r4.providers.preadj.common.AbstractTransformerV2)2 BadCodeMonkeyException (gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException)2 Date (java.util.Date)2 List (java.util.List)2 Optional (java.util.Optional)2 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)2 Coding (org.hl7.fhir.r4.model.Coding)2 Extension (org.hl7.fhir.r4.model.Extension)2 Identifier (org.hl7.fhir.r4.model.Identifier)2 Meta (org.hl7.fhir.r4.model.Meta)2