Search in sources :

Example 1 with PreAdjFissDiagnosisCode

use of gov.cms.bfd.model.rda.PreAdjFissDiagnosisCode 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 2 with PreAdjFissDiagnosisCode

use of gov.cms.bfd.model.rda.PreAdjFissDiagnosisCode 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 3 with PreAdjFissDiagnosisCode

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

the class R4ClaimSamhsaMatcherTransformerTest method fissTest.

/**
 * These tests check if the transformed FISS claims result in the expected SAMHSA filtering
 * outcomes.
 */
@ParameterizedTest(name = "{index}: {0}")
@MethodSource
public void fissTest(String testName, LocalDate toDate, List<String> diagCodes, List<String> procCodes, boolean expectedResult, String errorMessagePostFix) {
    PreAdjFissClaim entity = new PreAdjFissClaim();
    String principalDxCode = diagCodes.get(0);
    String admittingDxCode = diagCodes.get(1);
    entity.setLastUpdated(Instant.ofEpochMilli(1));
    entity.setStmtCovToDate(toDate);
    entity.setPrincipleDiag(principalDxCode);
    entity.setAdmitDiagCode(admittingDxCode);
    Set<PreAdjFissDiagnosisCode> diagnoses = IntStream.range(0, diagCodes.size()).mapToObj(i -> {
        PreAdjFissDiagnosisCode diagCode = new PreAdjFissDiagnosisCode();
        diagCode.setPriority((short) i);
        diagCode.setDiagCd2(diagCodes.get(i));
        return diagCode;
    }).collect(Collectors.toSet());
    entity.setDiagCodes(diagnoses);
    Set<PreAdjFissProcCode> procedures = IntStream.range(0, procCodes.size()).mapToObj(i -> {
        PreAdjFissProcCode procCode = new PreAdjFissProcCode();
        procCode.setProcDate(LocalDate.EPOCH);
        procCode.setPriority((short) i);
        procCode.setProcCode(procCodes.get(i));
        return procCode;
    }).collect(Collectors.toSet());
    entity.setProcCodes(procedures);
    Claim claim = FissClaimTransformerV2.transform(new MetricRegistry(), entity);
    R4ClaimSamhsaMatcher matcher = new R4ClaimSamhsaMatcher();
    assertEquals(expectedResult, matcher.test(claim), testName + " " + errorMessagePostFix);
}
Also used : PreAdjFissClaim(gov.cms.bfd.model.rda.PreAdjFissClaim) IntStream(java.util.stream.IntStream) MetricRegistry(com.codahale.metrics.MetricRegistry) PreAdjFissProcCode(gov.cms.bfd.model.rda.PreAdjFissProcCode) Set(java.util.Set) Instant(java.time.Instant) Arguments(org.junit.jupiter.params.provider.Arguments) Collectors(java.util.stream.Collectors) PreAdjMcsClaim(gov.cms.bfd.model.rda.PreAdjMcsClaim) List(java.util.List) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) Stream(java.util.stream.Stream) PreAdjMcsDetail(gov.cms.bfd.model.rda.PreAdjMcsDetail) PreAdjMcsDiagnosisCode(gov.cms.bfd.model.rda.PreAdjMcsDiagnosisCode) LocalDate(java.time.LocalDate) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) Arguments.arguments(org.junit.jupiter.params.provider.Arguments.arguments) PreAdjFissDiagnosisCode(gov.cms.bfd.model.rda.PreAdjFissDiagnosisCode) Claim(org.hl7.fhir.r4.model.Claim) MethodSource(org.junit.jupiter.params.provider.MethodSource) PreAdjFissDiagnosisCode(gov.cms.bfd.model.rda.PreAdjFissDiagnosisCode) PreAdjFissProcCode(gov.cms.bfd.model.rda.PreAdjFissProcCode) MetricRegistry(com.codahale.metrics.MetricRegistry) PreAdjFissClaim(gov.cms.bfd.model.rda.PreAdjFissClaim) PreAdjFissClaim(gov.cms.bfd.model.rda.PreAdjFissClaim) PreAdjMcsClaim(gov.cms.bfd.model.rda.PreAdjMcsClaim) Claim(org.hl7.fhir.r4.model.Claim) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 4 with PreAdjFissDiagnosisCode

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

the class FissClaimTransformer method transformMessageArrays.

private void transformMessageArrays(FissClaim from, PreAdjFissClaim to, DataTransformer transformer, Instant now, String namePrefix) {
    for (short index = 0; index < from.getFissProcCodesCount(); ++index) {
        final String itemNamePrefix = namePrefix + "procCode" + "-" + index + "-";
        final FissProcedureCode itemFrom = from.getFissProcCodes(index);
        final PreAdjFissProcCode itemTo = transformMessageImpl(itemFrom, transformer, now, itemNamePrefix);
        itemTo.setDcn(from.getDcn());
        itemTo.setPriority(index);
        to.getProcCodes().add(itemTo);
    }
    for (short index = 0; index < from.getFissDiagCodesCount(); ++index) {
        final String itemNamePrefix = namePrefix + "diagCode" + "-" + index + "-";
        final FissDiagnosisCode itemFrom = from.getFissDiagCodes(index);
        final PreAdjFissDiagnosisCode itemTo = transformMessageImpl(itemFrom, transformer, now, itemNamePrefix);
        itemTo.setDcn(from.getDcn());
        itemTo.setPriority(index);
        to.getDiagCodes().add(itemTo);
    }
    for (short index = 0; index < from.getFissPayersCount(); ++index) {
        final String itemNamePrefix = namePrefix + "payer" + "-" + index + "-";
        final FissPayer itemFrom = from.getFissPayers(index);
        final PreAdjFissPayer itemTo = transformMessageImpl(itemFrom, transformer, now, itemNamePrefix);
        itemTo.setDcn(from.getDcn());
        itemTo.setPriority(index);
        to.getPayers().add(itemTo);
    }
    for (short index = 0; index < from.getFissAuditTrailCount(); ++index) {
        final String itemNamePrefix = namePrefix + "auditTrail" + "-" + index + "-";
        final FissAuditTrail itemFrom = from.getFissAuditTrail(index);
        final PreAdjFissAuditTrail itemTo = transformMessageImpl(itemFrom, transformer, now, itemNamePrefix);
        itemTo.setDcn(from.getDcn());
        itemTo.setPriority(index);
        to.getAuditTrail().add(itemTo);
    }
}
Also used : FissProcedureCode(gov.cms.mpsm.rda.v1.fiss.FissProcedureCode) PreAdjFissPayer(gov.cms.bfd.model.rda.PreAdjFissPayer) FissPayer(gov.cms.mpsm.rda.v1.fiss.FissPayer) PreAdjFissDiagnosisCode(gov.cms.bfd.model.rda.PreAdjFissDiagnosisCode) PreAdjFissProcCode(gov.cms.bfd.model.rda.PreAdjFissProcCode) PreAdjFissAuditTrail(gov.cms.bfd.model.rda.PreAdjFissAuditTrail) FissDiagnosisCode(gov.cms.mpsm.rda.v1.fiss.FissDiagnosisCode) PreAdjFissDiagnosisCode(gov.cms.bfd.model.rda.PreAdjFissDiagnosisCode) PreAdjFissAuditTrail(gov.cms.bfd.model.rda.PreAdjFissAuditTrail) FissAuditTrail(gov.cms.mpsm.rda.v1.fiss.FissAuditTrail) PreAdjFissPayer(gov.cms.bfd.model.rda.PreAdjFissPayer)

Example 5 with PreAdjFissDiagnosisCode

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

the class FissClaimTransformer method transformMessageImpl.

private PreAdjFissDiagnosisCode transformMessageImpl(FissDiagnosisCode from, DataTransformer transformer, Instant now, String namePrefix) {
    final PreAdjFissDiagnosisCode to = new PreAdjFissDiagnosisCode();
    transformer.copyString(namePrefix + PreAdjFissDiagnosisCode.Fields.diagCd2, false, 1, 7, from.getDiagCd2(), to::setDiagCd2);
    transformer.copyEnumAsString(namePrefix + PreAdjFissDiagnosisCode.Fields.diagPoaInd, true, 1, PreAdjFissDiagnosisCode_diagPoaInd_Extractor.getEnumString(from), to::setDiagPoaInd);
    transformer.copyOptionalString(namePrefix + PreAdjFissDiagnosisCode.Fields.bitFlags, 1, 4, from::hasBitFlags, from::getBitFlags, to::setBitFlags);
    to.setLastUpdated(now);
    return to;
}
Also used : PreAdjFissDiagnosisCode(gov.cms.bfd.model.rda.PreAdjFissDiagnosisCode)

Aggregations

PreAdjFissDiagnosisCode (gov.cms.bfd.model.rda.PreAdjFissDiagnosisCode)7 PreAdjFissClaim (gov.cms.bfd.model.rda.PreAdjFissClaim)5 PreAdjFissProcCode (gov.cms.bfd.model.rda.PreAdjFissProcCode)5 PreAdjFissPayer (gov.cms.bfd.model.rda.PreAdjFissPayer)3 FissDiagnosisCode (gov.cms.mpsm.rda.v1.fiss.FissDiagnosisCode)2 FissProcedureCode (gov.cms.mpsm.rda.v1.fiss.FissProcedureCode)2 BigDecimal (java.math.BigDecimal)2 Instant (java.time.Instant)2 LocalDate (java.time.LocalDate)2 Test (org.junit.jupiter.api.Test)2 MetricRegistry (com.codahale.metrics.MetricRegistry)1 Mbi (gov.cms.bfd.model.rda.Mbi)1 PreAdjFissAuditTrail (gov.cms.bfd.model.rda.PreAdjFissAuditTrail)1 PreAdjMcsClaim (gov.cms.bfd.model.rda.PreAdjMcsClaim)1 PreAdjMcsDetail (gov.cms.bfd.model.rda.PreAdjMcsDetail)1 PreAdjMcsDiagnosisCode (gov.cms.bfd.model.rda.PreAdjMcsDiagnosisCode)1 FissClaimTransformer (gov.cms.bfd.pipeline.rda.grpc.source.FissClaimTransformer)1 IdHasher (gov.cms.bfd.pipeline.sharedutils.IdHasher)1 FissClaimChange (gov.cms.mpsm.rda.v1.FissClaimChange)1 FissAuditTrail (gov.cms.mpsm.rda.v1.fiss.FissAuditTrail)1