use of gov.cms.bfd.model.rda.PreAdjFissPayer 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);
}
}
use of gov.cms.bfd.model.rda.PreAdjFissPayer in project beneficiary-fhir-data by CMSgov.
the class FissClaimTransformer method transformMessageImpl.
private PreAdjFissPayer transformMessageImpl(FissPayer from, DataTransformer transformer, Instant now, String namePrefix) {
final PreAdjFissPayer to = new PreAdjFissPayer();
if (from.hasBeneZPayer()) {
to.setPayerType(PreAdjFissPayer.PayerType.BeneZ);
}
if (from.hasInsuredPayer()) {
to.setPayerType(PreAdjFissPayer.PayerType.Insured);
}
transformer.copyEnumAsString(namePrefix + PreAdjFissPayer.Fields.payersId, true, 1, PreAdjFissPayer_insuredPayer_payersId_Extractor.getEnumString(from), to::setPayersId);
transformer.copyOptionalString(namePrefix + PreAdjFissPayer.Fields.payersName, 1, 32, () -> from.hasInsuredPayer() && from.getInsuredPayer().hasPayersName(), () -> from.getInsuredPayer().getPayersName(), to::setPayersName);
transformer.copyEnumAsString(namePrefix + PreAdjFissPayer.Fields.relInd, true, 1, PreAdjFissPayer_insuredPayer_relInd_Extractor.getEnumString(from), to::setRelInd);
transformer.copyEnumAsString(namePrefix + PreAdjFissPayer.Fields.assignInd, true, 1, PreAdjFissPayer_insuredPayer_assignInd_Extractor.getEnumString(from), to::setAssignInd);
transformer.copyOptionalString(namePrefix + PreAdjFissPayer.Fields.providerNumber, 1, 13, () -> from.hasInsuredPayer() && from.getInsuredPayer().hasProviderNumber(), () -> from.getInsuredPayer().getProviderNumber(), to::setProviderNumber);
transformer.copyOptionalString(namePrefix + PreAdjFissPayer.Fields.adjDcnIcn, 1, 23, () -> from.hasInsuredPayer() && from.getInsuredPayer().hasAdjDcnIcn(), () -> from.getInsuredPayer().getAdjDcnIcn(), to::setAdjDcnIcn);
transformer.copyOptionalAmount(namePrefix + PreAdjFissPayer.Fields.priorPmt, () -> from.hasInsuredPayer() && from.getInsuredPayer().hasPriorPmt(), () -> from.getInsuredPayer().getPriorPmt(), to::setPriorPmt);
transformer.copyOptionalAmount(namePrefix + PreAdjFissPayer.Fields.estAmtDue, () -> from.hasInsuredPayer() && from.getInsuredPayer().hasEstAmtDue(), () -> from.getInsuredPayer().getEstAmtDue(), to::setEstAmtDue);
transformer.copyEnumAsString(namePrefix + PreAdjFissPayer.Fields.insuredRel, true, 2, PreAdjFissPayer_insuredPayer_insuredRel_Extractor.getEnumString(from), to::setInsuredRel);
transformer.copyOptionalString(namePrefix + PreAdjFissPayer.Fields.insuredName, 1, 25, () -> from.hasInsuredPayer() && from.getInsuredPayer().hasInsuredName(), () -> from.getInsuredPayer().getInsuredName(), to::setInsuredName);
transformer.copyOptionalString(namePrefix + PreAdjFissPayer.Fields.insuredSsnHic, 1, 19, () -> from.hasInsuredPayer() && from.getInsuredPayer().hasInsuredSsnHic(), () -> from.getInsuredPayer().getInsuredSsnHic(), to::setInsuredSsnHic);
transformer.copyOptionalString(namePrefix + PreAdjFissPayer.Fields.insuredGroupName, 1, 17, () -> from.hasInsuredPayer() && from.getInsuredPayer().hasInsuredGroupName(), () -> from.getInsuredPayer().getInsuredGroupName(), to::setInsuredGroupName);
transformer.copyOptionalString(namePrefix + PreAdjFissPayer.Fields.insuredGroupNbr, 1, 20, () -> from.hasInsuredPayer() && from.getInsuredPayer().hasInsuredGroupNbr(), () -> from.getInsuredPayer().getInsuredGroupNbr(), to::setInsuredGroupNbr);
transformer.copyOptionalString(namePrefix + PreAdjFissPayer.Fields.treatAuthCd, 1, 18, () -> from.hasInsuredPayer() && from.getInsuredPayer().hasTreatAuthCd(), () -> from.getInsuredPayer().getTreatAuthCd(), to::setTreatAuthCd);
transformer.copyEnumAsString(namePrefix + PreAdjFissPayer.Fields.insuredSex, true, 1, PreAdjFissPayer_insuredPayer_insuredSex_Extractor.getEnumString(from), to::setInsuredSex);
transformer.copyEnumAsString(namePrefix + PreAdjFissPayer.Fields.insuredRelX12, true, 2, PreAdjFissPayer_insuredPayer_insuredRelX12_Extractor.getEnumString(from), to::setInsuredRelX12);
transformer.copyOptionalDate(namePrefix + PreAdjFissPayer.Fields.insuredDob, () -> from.hasInsuredPayer() && from.getInsuredPayer().hasInsuredDob(), () -> from.getInsuredPayer().getInsuredDob(), to::setInsuredDob);
transformer.copyOptionalString(namePrefix + PreAdjFissPayer.Fields.insuredDobText, 1, 9, () -> from.hasInsuredPayer() && from.getInsuredPayer().hasInsuredDobText(), () -> from.getInsuredPayer().getInsuredDobText(), to::setInsuredDobText);
transformer.copyEnumAsString(namePrefix + PreAdjFissPayer.Fields.payersId, true, 1, PreAdjFissPayer_beneZPayer_payersId_Extractor.getEnumString(from), to::setPayersId);
transformer.copyOptionalString(namePrefix + PreAdjFissPayer.Fields.payersName, 1, 32, () -> from.hasBeneZPayer() && from.getBeneZPayer().hasPayersName(), () -> from.getBeneZPayer().getPayersName(), to::setPayersName);
transformer.copyEnumAsString(namePrefix + PreAdjFissPayer.Fields.relInd, true, 1, PreAdjFissPayer_beneZPayer_relInd_Extractor.getEnumString(from), to::setRelInd);
transformer.copyEnumAsString(namePrefix + PreAdjFissPayer.Fields.assignInd, true, 1, PreAdjFissPayer_beneZPayer_assignInd_Extractor.getEnumString(from), to::setAssignInd);
transformer.copyOptionalString(namePrefix + PreAdjFissPayer.Fields.providerNumber, 1, 13, () -> from.hasBeneZPayer() && from.getBeneZPayer().hasProviderNumber(), () -> from.getBeneZPayer().getProviderNumber(), to::setProviderNumber);
transformer.copyOptionalString(namePrefix + PreAdjFissPayer.Fields.adjDcnIcn, 1, 23, () -> from.hasBeneZPayer() && from.getBeneZPayer().hasAdjDcnIcn(), () -> from.getBeneZPayer().getAdjDcnIcn(), to::setAdjDcnIcn);
transformer.copyOptionalAmount(namePrefix + PreAdjFissPayer.Fields.priorPmt, () -> from.hasBeneZPayer() && from.getBeneZPayer().hasPriorPmt(), () -> from.getBeneZPayer().getPriorPmt(), to::setPriorPmt);
transformer.copyOptionalAmount(namePrefix + PreAdjFissPayer.Fields.estAmtDue, () -> from.hasBeneZPayer() && from.getBeneZPayer().hasEstAmtDue(), () -> from.getBeneZPayer().getEstAmtDue(), to::setEstAmtDue);
transformer.copyEnumAsString(namePrefix + PreAdjFissPayer.Fields.beneRel, true, 2, PreAdjFissPayer_beneZPayer_beneRel_Extractor.getEnumString(from), to::setBeneRel);
transformer.copyOptionalString(namePrefix + PreAdjFissPayer.Fields.beneLastName, 1, 15, () -> from.hasBeneZPayer() && from.getBeneZPayer().hasBeneLastName(), () -> from.getBeneZPayer().getBeneLastName(), to::setBeneLastName);
transformer.copyOptionalString(namePrefix + PreAdjFissPayer.Fields.beneFirstName, 1, 10, () -> from.hasBeneZPayer() && from.getBeneZPayer().hasBeneFirstName(), () -> from.getBeneZPayer().getBeneFirstName(), to::setBeneFirstName);
transformer.copyOptionalString(namePrefix + PreAdjFissPayer.Fields.beneMidInit, 1, 1, () -> from.hasBeneZPayer() && from.getBeneZPayer().hasBeneMidInit(), () -> from.getBeneZPayer().getBeneMidInit(), to::setBeneMidInit);
transformer.copyOptionalString(namePrefix + PreAdjFissPayer.Fields.beneSsnHic, 1, 19, () -> from.hasBeneZPayer() && from.getBeneZPayer().hasBeneSsnHic(), () -> from.getBeneZPayer().getBeneSsnHic(), to::setBeneSsnHic);
transformer.copyOptionalString(namePrefix + PreAdjFissPayer.Fields.insuredGroupName, 1, 17, () -> from.hasBeneZPayer() && from.getBeneZPayer().hasInsuredGroupName(), () -> from.getBeneZPayer().getInsuredGroupName(), to::setInsuredGroupName);
transformer.copyOptionalDate(namePrefix + PreAdjFissPayer.Fields.beneDob, () -> from.hasBeneZPayer() && from.getBeneZPayer().hasBeneDob(), () -> from.getBeneZPayer().getBeneDob(), to::setBeneDob);
transformer.copyEnumAsString(namePrefix + PreAdjFissPayer.Fields.beneSex, true, 1, PreAdjFissPayer_beneZPayer_beneSex_Extractor.getEnumString(from), to::setBeneSex);
transformer.copyOptionalString(namePrefix + PreAdjFissPayer.Fields.treatAuthCd, 1, 18, () -> from.hasBeneZPayer() && from.getBeneZPayer().hasTreatAuthCd(), () -> from.getBeneZPayer().getTreatAuthCd(), to::setTreatAuthCd);
transformer.copyEnumAsString(namePrefix + PreAdjFissPayer.Fields.insuredSex, true, 1, PreAdjFissPayer_beneZPayer_insuredSex_Extractor.getEnumString(from), to::setInsuredSex);
transformer.copyEnumAsString(namePrefix + PreAdjFissPayer.Fields.insuredRelX12, true, 2, PreAdjFissPayer_beneZPayer_insuredRelX12_Extractor.getEnumString(from), to::setInsuredRelX12);
to.setLastUpdated(now);
return to;
}
use of gov.cms.bfd.model.rda.PreAdjFissPayer in project beneficiary-fhir-data by CMSgov.
the class FissClaimTransformerTest method basicFieldsTestForBeneZPayerObjectTransformation.
/**
* Basic smoke test for transformation of BeneZ payer objects prior to all of the individual field
* tests.
*/
@Test
public void basicFieldsTestForBeneZPayerObjectTransformation() {
claimBuilder.setDcn("dcn").setHicNo("hicn").setCurrStatusEnum(FissClaimStatus.CLAIM_STATUS_MOVE).setCurrLoc1Enum(FissProcessingType.PROCESSING_TYPE_MANUAL).setCurrLoc2Enum(FissCurrentLocation2.CURRENT_LOCATION_2_FINAL).addFissPayers(FissPayer.newBuilder().setBeneZPayer(FissBeneZPayer.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").setBeneRelEnum(FissPatientRelationshipCode.PATIENT_RELATIONSHIP_CODE_EMPLOYEE).setBeneLastName("last-name").setBeneFirstName("first-name").setBeneMidInit("Z").setBeneSsnHic("ssn-hic").setInsuredGroupName("group-name").setBeneDob("2020-09-10").setBeneSexEnum(FissBeneficiarySex.BENEFICIARY_SEX_FEMALE).setTreatAuthCd("auth-code").setInsuredSexEnum(FissBeneficiarySex.BENEFICIARY_SEX_MALE).setInsuredRelX12Enum(FissPatientRelationshipCode.PATIENT_RELATIONSHIP_CODE_GRANDCHILD).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.BeneZ);
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.setBeneRel("08");
payer.setBeneLastName("last-name");
payer.setBeneFirstName("first-name");
payer.setBeneMidInit("Z");
payer.setBeneSsnHic("ssn-hic");
payer.setInsuredGroupName("group-name");
payer.setBeneDob(LocalDate.of(2020, 9, 10));
payer.setBeneSex("F");
payer.setTreatAuthCd("auth-code");
payer.setInsuredSex("M");
payer.setInsuredRelX12("13");
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);
}
Aggregations