use of gov.cms.bfd.model.rda.PreAdjFissAuditTrail in project beneficiary-fhir-data by CMSgov.
the class FissClaimTransformerTest method basicFieldsTestForAuditTrailObjectTransformation.
/**
* Basic smoke test for transformation of audit trail objects prior to all of the individual field
* tests.
*/
@Test
public void basicFieldsTestForAuditTrailObjectTransformation() {
claimBuilder.setDcn("dcn").setHicNo("hicn").setCurrStatusEnum(FissClaimStatus.CLAIM_STATUS_MOVE).setCurrLoc1Enum(FissProcessingType.PROCESSING_TYPE_MANUAL).setCurrLoc2Enum(FissCurrentLocation2.CURRENT_LOCATION_2_FINAL).addFissAuditTrail(FissAuditTrail.newBuilder().setBadtStatusEnum(FissClaimStatus.CLAIM_STATUS_MOVE).setBadtLoc("1").setBadtOperId("2").setBadtReas("3").setBadtCurrDateCymd("2021-12-03").build());
claim.setDcn("dcn");
claim.setHicNo("hicn");
claim.setCurrStatus('M');
claim.setCurrLoc1('M');
claim.setCurrLoc2("9997");
claim.setLastUpdated(clock.instant());
PreAdjFissAuditTrail auditTrail = new PreAdjFissAuditTrail();
auditTrail.setDcn("dcn");
auditTrail.setPriority((short) 0);
auditTrail.setBadtStatus("M");
auditTrail.setBadtLoc("1");
auditTrail.setBadtOperId("2");
auditTrail.setBadtReas("3");
auditTrail.setBadtCurrDate(LocalDate.of(2021, 12, 3));
auditTrail.setLastUpdated(claim.getLastUpdated());
claim.getAuditTrail().add(auditTrail);
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.getAuditTrail(), transformed.getAuditTrail(), PreAdjFissAuditTrail::getPriority);
}
use of gov.cms.bfd.model.rda.PreAdjFissAuditTrail in project beneficiary-fhir-data by CMSgov.
the class FissClaimTransformer method transformMessageImpl.
private PreAdjFissAuditTrail transformMessageImpl(FissAuditTrail from, DataTransformer transformer, Instant now, String namePrefix) {
final PreAdjFissAuditTrail to = new PreAdjFissAuditTrail();
to.setLastUpdated(now);
transformer.copyEnumAsString(namePrefix + PreAdjFissAuditTrail.Fields.badtStatus, true, 1, PreAdjFissAuditTrail_badtStatus_Extractor.getEnumString(from), to::setBadtStatus);
transformer.copyOptionalString(namePrefix + PreAdjFissAuditTrail.Fields.badtLoc, 1, 5, from::hasBadtLoc, from::getBadtLoc, to::setBadtLoc);
transformer.copyOptionalString(namePrefix + PreAdjFissAuditTrail.Fields.badtOperId, 1, 9, from::hasBadtOperId, from::getBadtOperId, to::setBadtOperId);
transformer.copyOptionalString(namePrefix + PreAdjFissAuditTrail.Fields.badtReas, 1, 5, from::hasBadtReas, from::getBadtReas, to::setBadtReas);
transformer.copyOptionalDate(namePrefix + PreAdjFissAuditTrail.Fields.badtCurrDate, from::hasBadtCurrDateCymd, from::getBadtCurrDateCymd, to::setBadtCurrDate);
return to;
}
use of gov.cms.bfd.model.rda.PreAdjFissAuditTrail 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