use of gov.cms.bfd.model.rda.PreAdjFissProcCode in project beneficiary-fhir-data by CMSgov.
the class FissClaimTransformer method transformMessageImpl.
private PreAdjFissProcCode transformMessageImpl(FissProcedureCode from, DataTransformer transformer, Instant now, String namePrefix) {
final PreAdjFissProcCode to = new PreAdjFissProcCode();
transformer.copyString(namePrefix + PreAdjFissProcCode.Fields.procCode, false, 1, 10, from.getProcCd(), to::setProcCode);
transformer.copyOptionalString(namePrefix + PreAdjFissProcCode.Fields.procFlag, 1, 4, from::hasProcFlag, from::getProcFlag, to::setProcFlag);
transformer.copyOptionalDate(namePrefix + PreAdjFissProcCode.Fields.procDate, from::hasProcDt, from::getProcDt, to::setProcDate);
to.setLastUpdated(now);
return to;
}
use of gov.cms.bfd.model.rda.PreAdjFissProcCode 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;
}
use of gov.cms.bfd.model.rda.PreAdjFissProcCode 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;
}
use of gov.cms.bfd.model.rda.PreAdjFissProcCode 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);
}
use of gov.cms.bfd.model.rda.PreAdjFissProcCode 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);
}
}
Aggregations