Skip to content

Commit

Permalink
BFD-1745 code changes for dme claims new schema (#1110)
Browse files Browse the repository at this point in the history
* ignore .pid files created by migrator

* changes for DME claims related code to use new schema DME tables

* fix imports for Disabled
  • Loading branch information
mackec1 authored May 11, 2022
1 parent be38e90 commit 4dc348f
Show file tree
Hide file tree
Showing 19 changed files with 30 additions and 31 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
*.iml
*.ipr
*.iws
*.pid
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,10 @@ private void process(PackageElement annotatedPackage) throws IOException {
new MappingSpec(annotatedPackage.getQualifiedName().toString())
.setRifLayout(RifLayout.parse(spreadsheetWorkbook, annotation.dmeSheet()))
.setHeaderEntity("DMEClaim")
.setHeaderTable("dme_claims")
.setHeaderTable("dme_claims_new")
.setHeaderEntityIdField("CLM_ID")
.setHasLines(true)
.setLineTable("dme_claim_lines")
.setLineTable("dme_claim_lines_new")
.setLineEntityLineNumberField("LINE_NUM")
.setHeaderEntityAdditionalDatabaseFields(
createDetailsForAdditionalDatabaseFields(Arrays.asList("LAST_UPDATED"))));
Expand Down Expand Up @@ -1317,7 +1317,6 @@ private boolean isFutureBigint(String tableName, RifField rifField) {
"beneficiaries_history",
"medicare_beneficiaryid_history",
"carrier_claims",
"dme_claims",
"hha_claims",
"hospice_claims",
"inpatient_claims",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
DML_IND|BENE_ID|CLM_ID|CLM_GRP_ID|FINAL_ACTION|NCH_NEAR_LINE_REC_IDENT_CD|NCH_CLM_TYPE_CD|CLM_FROM_DT|CLM_THRU_DT|NCH_WKLY_PROC_DT|CARR_CLM_ENTRY_CD|CLM_DISP_CD|CARR_NUM|CARR_CLM_PMT_DNL_CD|CLM_PMT_AMT|CARR_CLM_PRMRY_PYR_PD_AMT|CARR_CLM_PRVDR_ASGNMT_IND_SW|NCH_CLM_PRVDR_PMT_AMT|NCH_C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ICD_DGNS_CD|LINE_ICD_DGNS_VRSN_CD|LINE_DME_PRCHS_PRICE_AMT|PRVDR_NUM|PRVDR_NPI|DMERC_LINE_PRCNG_STATE_CD|PRVDR_STATE_CD|DMERC_LINE_SUPPLR_TYPE_CD|HCPCS_3RD_MDFR_CD|HCPCS_4TH_MDFR_CD|DMERC_LINE_SCRN_SVGS_AMT|DMERC_LINE_MTUS_CNT|DMERC_LINE_MTUS_CD|LINE_HCT_HGB_RSLT_NUM|LINE_HCT_HGB_TYPE_CD|LINE_NDC_CD
INSERT|567834|2188888888|900|F|M|82|03-FEB-2014|03-FEB-2014|14-FEB-2014|1|01|99999|1|777.75|0|A|666.75|666.66|1752.75|754.79|777.00|3|R5555|0|R5555|0|R6666|0|||||||||||||||||||||I99999|1306849450|0|74655592568216|1|9994931888|A5|1|60|P|12|03-FEB-2014|03-FEB-2014|345|YY||D9Z|123.45|11.00|120.00|18.00|E|11.00|20.20|20.29|130.45|129.45|A|0|0|G6666|0|82.29|1219966666|1244444444|AL|MO|3|||0.00|60|3|44.4|R2|000000000|
INSERT|567834|2188888888|900|F|M|82|03-FEB-2014|03-FEB-2014|14-FEB-2014|1|01|99999|1|777.75|0|A|666.75|666.66|1752.75|754.79|777.00|3|R5555|0|R5555|0|R6666|0|||||||||||||||||||||I99999|1306849450|0|74655592568216|1|9994931888|A5|1|60|P|12|03-FEB-2014|03-FEB-2014|345|YY||D9Z|123.45|11.00|120.00|18.00|E|11.00|20.20|20.29|130.45|129.45|A|0|0|G6666|0|82.29|1219966666|1244444444|AL|MO|3|||0.00|60.234|3|44.4|R2|000000000|
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ public void process1DMEClaimRecord() {
assertEquals(claimGroup.getBeneficiaryId(), rifRecordEvent.getBeneficiaryId());
assertEquals(567834L, claimGroup.getBeneficiaryId());
assertEquals(2188888888L, claimGroup.getClaimId());
assertEquals(new BigDecimal(900), claimGroup.getClaimGroupId());
assertEquals(900L, claimGroup.getClaimGroupId());
assertEquals('M', claimGroup.getNearLineRecordIdCode());
assertEquals("82", claimGroup.getClaimTypeCode());
assertEquals(LocalDate.of(2014, 02, 03), claimGroup.getDateFrom());
Expand All @@ -832,16 +832,16 @@ public void process1DMEClaimRecord() {
assertEquals("99999", claimGroup.getCarrierNumber());
assertEquals("1", claimGroup.getPaymentDenialCode());
assertEquals(new BigDecimal("777.75"), claimGroup.getPaymentAmount());
assertEquals(new BigDecimal("0"), claimGroup.getPrimaryPayerPaidAmount());
assertEquals(BigDecimal.ZERO, claimGroup.getPrimaryPayerPaidAmount());
assertEquals('A', claimGroup.getProviderAssignmentIndicator());
assertEquals(new BigDecimal("666.75"), claimGroup.getProviderPaymentAmount());
assertEquals(new BigDecimal("666.66"), claimGroup.getBeneficiaryPaymentAmount());
assertEquals(new BigDecimal("1752.75"), claimGroup.getSubmittedChargeAmount());
assertEquals(new BigDecimal("754.79"), claimGroup.getAllowedChargeAmount());
assertEquals(new BigDecimal("777.00"), claimGroup.getBeneficiaryPartBDeductAmount());
assertEquals('3', claimGroup.getHcpcsYearCode().get().charValue());
assertEquals(Character.valueOf('3'), claimGroup.getHcpcsYearCode().get());
assertEquals("R5555", claimGroup.getDiagnosis1Code().get());
assertEquals('0', claimGroup.getDiagnosis1CodeVersion().get().charValue());
assertEquals(Character.valueOf('0'), claimGroup.getDiagnosis1CodeVersion().get());
assertEquals("1306849450", claimGroup.getReferringPhysicianNpi().get());
assertEquals("0", claimGroup.getClinicalTrialNumber().get());
assertEquals(1, claimGroup.getLines().size());
Expand All @@ -850,10 +850,10 @@ public void process1DMEClaimRecord() {
// Verify one of the claim lines.
DMEClaimLine claimLine = claimGroup.getLines().get(0);

assertEquals(new BigDecimal(1), claimLine.getLineNumber());
assertEquals(1, claimLine.getLineNumber());
assertEquals("9994931888", claimLine.getProviderTaxNumber());
assertEquals("A5", claimLine.getProviderSpecialityCode().get());
assertEquals('1', claimLine.getProviderParticipatingIndCode().get().charValue());
assertEquals(Character.valueOf('1'), claimLine.getProviderParticipatingIndCode().get());
assertEquals(new BigDecimal("60"), claimLine.getServiceCount());
assertEquals('P', claimLine.getCmsServiceTypeCode());
assertEquals("12", claimLine.getPlaceOfServiceCode());
Expand All @@ -876,15 +876,15 @@ public void process1DMEClaimRecord() {
assertEquals(new BigDecimal("129.45"), claimLine.getAllowedChargeAmount());
assertEquals("A", claimLine.getProcessingIndicatorCode().get());
assertEquals('0', claimLine.getPaymentCode().get().charValue());
assertEquals('0', claimLine.getServiceDeductibleCode().get().charValue());
assertEquals(Character.valueOf('0'), claimLine.getServiceDeductibleCode().get());
assertEquals(new BigDecimal("82.29"), claimLine.getPurchasePriceAmount());
assertEquals("1244444444", claimLine.getProviderNPI().get());
assertEquals("AL", claimLine.getPricingStateCode().get());
assertEquals("MO", claimLine.getProviderStateCode());
assertEquals(Character.valueOf('3'), claimLine.getSupplierTypeCode().get());
assertEquals(new BigDecimal("0.00"), claimLine.getScreenSavingsAmount().get());
assertEquals(new BigDecimal("60"), claimLine.getMtusCount());
assertEquals('3', claimLine.getMtusCode().get().charValue());
assertEquals(new BigDecimal("60.234"), claimLine.getMtusCount());
assertEquals(Character.valueOf('3'), claimLine.getMtusCode().get());
assertEquals(new BigDecimal("44.4"), claimLine.getHctHgbTestResult());
assertEquals("R2", claimLine.getHctHgbTestTypeCode().get());
assertEquals("000000000", claimLine.getNationalDrugCode().get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private static ExplanationOfBenefit transformClaim(
claimGroup.getClaimId(),
claimGroup.getBeneficiaryId(),
ClaimTypeV2.DME,
claimGroup.getClaimGroupId().toPlainString(),
String.valueOf(claimGroup.getClaimGroupId()),
MedicareSegment.PART_A,
Optional.of(claimGroup.getDateFrom()),
Optional.of(claimGroup.getDateThrough()),
Expand Down Expand Up @@ -171,7 +171,7 @@ private static void handleClaimLines(

// Override the default sequence
// CLM_LINE_NUM => item.sequence
item.setSequence(line.getLineNumber().intValue());
item.setSequence(line.getLineNumber());

// add an extension for the provider billing number as there is not a good place
// to map this in the existing FHIR specification
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private static ExplanationOfBenefit transformClaim(
claimGroup.getClaimId(),
claimGroup.getBeneficiaryId(),
ClaimType.DME,
claimGroup.getClaimGroupId().toPlainString(),
String.valueOf(claimGroup.getClaimGroupId()),
MedicareSegment.PART_B,
Optional.of(claimGroup.getDateFrom()),
Optional.of(claimGroup.getDateThrough()),
Expand Down Expand Up @@ -131,7 +131,7 @@ private static ExplanationOfBenefit transformClaim(

for (DMEClaimLine claimLine : claimGroup.getLines()) {
ItemComponent item = eob.addItem();
item.setSequence(claimLine.getLineNumber().intValue());
item.setSequence(claimLine.getLineNumber());

/*
* add an extension for the provider billing number as there is not a good place
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ public void shouldHaveLineItemExtension() {
"https://bluebutton.cms.gov/resources/variables/dmerc_line_mtus_cnt",
new Quantity()
.setUnit("Number of services")
.setValue(60)
.setValue(new BigDecimal("60.234"))
.setSystem("https://bluebutton.cms.gov/resources/variables/dmerc_line_mtus_cd")
.setCode("3"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,7 @@ private void adjustDmeRecordForSamhsaDiagnosis(
.get();

entityManager.getTransaction().begin();
dmeRifRecord = entityManager.find(DMEClaim.class, String.valueOf(dmeRifRecord.getClaimId()));
dmeRifRecord = entityManager.find(DMEClaim.class, dmeRifRecord.getClaimId());
dmeRifRecord.setDiagnosis2Code(
Optional.of(Stu3EobSamhsaMatcherTest.SAMPLE_SAMHSA_ICD_9_DIAGNOSIS_CODE));
dmeRifRecord.setDiagnosis2CodeVersion(Optional.of('9'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import gov.cms.bfd.server.war.commons.MedicareSegment;
import gov.cms.bfd.server.war.commons.TransformerConstants;
import gov.cms.bfd.server.war.commons.TransformerContext;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
Expand Down Expand Up @@ -77,7 +76,7 @@ static void assertMatches(
claim.getClaimId(),
claim.getBeneficiaryId(),
ClaimType.DME,
claim.getClaimGroupId().toPlainString(),
String.valueOf(claim.getClaimGroupId()),
MedicareSegment.PART_B,
Optional.of(claim.getDateFrom()),
Optional.of(claim.getDateThrough()),
Expand Down Expand Up @@ -106,7 +105,7 @@ static void assertMatches(
assertEquals(1, eob.getItem().size());
ItemComponent eobItem0 = eob.getItem().get(0);
DMEClaimLine claimLine1 = claim.getLines().get(0);
assertEquals(claimLine1.getLineNumber(), new BigDecimal(eobItem0.getSequence()));
assertEquals(claimLine1.getLineNumber(), eobItem0.getSequence());

TransformerTestUtils.assertExtensionIdentifierEquals(
CcwCodebookVariable.SUPLRNUM, claimLine1.getProviderBillingNumber(), eobItem0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1497,7 +1497,7 @@ private void adjustDmeRecordForSamhsaDiagnosis(
.get();

entityManager.getTransaction().begin();
dmeRifRecord = entityManager.find(DMEClaim.class, String.valueOf(dmeRifRecord.getClaimId()));
dmeRifRecord = entityManager.find(DMEClaim.class, dmeRifRecord.getClaimId());
dmeRifRecord.setDiagnosis2Code(
Optional.of(Stu3EobSamhsaMatcherTest.SAMPLE_SAMHSA_ICD_9_DIAGNOSIS_CODE));
dmeRifRecord.setDiagnosis2CodeVersion(Optional.of('9'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@
}, {
"url" : "https://bluebutton.cms.gov/resources/variables/dmerc_line_mtus_cnt",
"valueQuantity" : {
"value" : 60,
"value" : 60.234,
"unit" : "Number of services",
"system" : "https://bluebutton.cms.gov/resources/variables/dmerc_line_mtus_cd",
"code" : "3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@
}, {
"url" : "https://bluebutton.cms.gov/resources/variables/dmerc_line_mtus_cnt",
"valueQuantity" : {
"value" : 60,
"value" : 60.234,
"unit" : "Number of services",
"system" : "https://bluebutton.cms.gov/resources/variables/dmerc_line_mtus_cd",
"code" : "3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
}, {
"url" : "https://bluebutton.cms.gov/resources/variables/dmerc_line_mtus_cnt",
"valueQuantity" : {
"value" : 60,
"value" : 60.234,
"unit" : "Number of services",
"system" : "https://bluebutton.cms.gov/resources/variables/dmerc_line_mtus_cd",
"code" : "3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@
}, {
"url" : "https://bluebutton.cms.gov/resources/variables/dmerc_line_mtus_cnt",
"valueQuantity" : {
"value" : 60,
"value" : 60.234,
"unit" : "Number of services",
"system" : "https://bluebutton.cms.gov/resources/variables/dmerc_line_mtus_cd",
"code" : "3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@
}, {
"url" : "https://bluebutton.cms.gov/resources/variables/dmerc_line_mtus_cnt",
"valueQuantity" : {
"value" : 60,
"value" : 60.234,
"unit" : "Number of services",
"system" : "https://bluebutton.cms.gov/resources/variables/dmerc_line_mtus_cd",
"code" : "3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,7 @@
}, {
"url" : "https://bluebutton.cms.gov/resources/variables/dmerc_line_mtus_cnt",
"valueQuantity" : {
"value" : 60,
"value" : 60.234,
"unit" : "Number of services",
"system" : "https://bluebutton.cms.gov/resources/variables/dmerc_line_mtus_cd",
"code" : "3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@
}, {
"url" : "https://bluebutton.cms.gov/resources/variables/dmerc_line_mtus_cnt",
"valueQuantity" : {
"value" : 60,
"value" : 60.234,
"unit" : "Number of services",
"system" : "https://bluebutton.cms.gov/resources/variables/dmerc_line_mtus_cd",
"code" : "3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@
}, {
"url" : "https://bluebutton.cms.gov/resources/variables/dmerc_line_mtus_cnt",
"valueQuantity" : {
"value" : 60,
"value" : 60.234,
"unit" : "Number of services",
"system" : "https://bluebutton.cms.gov/resources/variables/dmerc_line_mtus_cd",
"code" : "3"
Expand Down

0 comments on commit 4dc348f

Please sign in to comment.