use of org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitComponent in project beneficiary-fhir-data by CMSgov.
the class TransformerTestUtils method assertBenefitBalanceEquals.
/**
* FIXME add allowed to method name
*
* @param expectedFinancialTypeSystem the expected {@link Coding#getSystem()} of the {@link
* BenefitComponent#getCode)} to find and verify
* @param expectedFinancialTypeCode the expected {@link Coding#getCode()} of the {@link
* BenefitComponent#getCode)} to find and verify
* @param expectedAmount the expected {@link BenefitComponent#getBenefitMoney}
* @param actuals the actual {@link BenefitComponent}s to verify
*/
static void assertBenefitBalanceEquals(String expectedFinancialTypeSystem, String expectedFinancialTypeCode, BigDecimal expectedAmount, List<BenefitComponent> actuals) {
Optional<BenefitComponent> benefitComponent = actuals.stream().filter(a -> isCodeInConcept(a.getType(), expectedFinancialTypeSystem, expectedFinancialTypeCode)).findFirst();
assertTrue(benefitComponent.isPresent());
try {
assertEquivalent(expectedAmount, benefitComponent.get().getAllowedMoney().getValue());
} catch (FHIRException e) {
throw new BadCodeMonkeyException(e);
}
}
use of org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitComponent in project beneficiary-fhir-data by CMSgov.
the class SNFClaimTransformerV2Test method shouldHavePrpayamtFinancial.
@Test
public void shouldHavePrpayamtFinancial() {
BenefitComponent benefit = TransformerTestUtilsV2.findFinancial("https://bluebutton.cms.gov/resources/variables/prpayamt", eob.getBenefitBalanceFirstRep().getFinancial());
BenefitComponent compare = new BenefitComponent().setType(new CodeableConcept().setCoding(Arrays.asList(new Coding("https://bluebutton.cms.gov/resources/codesystem/benefit-balance", "https://bluebutton.cms.gov/resources/variables/prpayamt", "NCH Primary Payer (if not Medicare) Claim Paid Amount")))).setUsed(new Money().setValueElement(new DecimalType("11.00")).setCurrency(TransformerConstants.CODED_MONEY_USD));
assertTrue(compare.equalsDeep(benefit));
}
use of org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitComponent in project beneficiary-fhir-data by CMSgov.
the class SNFClaimTransformerV2Test method shouldHaveClmPpsCptlFspAmtFinancial.
@Test
public void shouldHaveClmPpsCptlFspAmtFinancial() {
BenefitComponent benefit = TransformerTestUtilsV2.findFinancial("https://bluebutton.cms.gov/resources/variables/clm_pps_cptl_fsp_amt", eob.getBenefitBalanceFirstRep().getFinancial());
BenefitComponent compare = new BenefitComponent().setType(new CodeableConcept().setCoding(Arrays.asList(new Coding("https://bluebutton.cms.gov/resources/codesystem/benefit-balance", "https://bluebutton.cms.gov/resources/variables/clm_pps_cptl_fsp_amt", "Claim PPS Capital Federal Specific Portion (FSP) Amount")))).setUsed(new Money().setValueElement(new DecimalType("9.00")).setCurrency(TransformerConstants.CODED_MONEY_USD));
assertTrue(compare.equalsDeep(benefit));
}
use of org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitComponent in project beneficiary-fhir-data by CMSgov.
the class SNFClaimTransformerV2Test method shouldHaveBeneTotCoinsrncDaysCntFinancial.
@Test
public void shouldHaveBeneTotCoinsrncDaysCntFinancial() {
BenefitComponent benefit = TransformerTestUtilsV2.findFinancial("https://bluebutton.cms.gov/resources/variables/bene_tot_coinsrnc_days_cnt", eob.getBenefitBalanceFirstRep().getFinancial());
BenefitComponent compare = new BenefitComponent().setType(new CodeableConcept().setCoding(Arrays.asList(new Coding("https://bluebutton.cms.gov/resources/codesystem/benefit-balance", "https://bluebutton.cms.gov/resources/variables/bene_tot_coinsrnc_days_cnt", "Beneficiary Total Coinsurance Days Count")))).setUsed(new UnsignedIntType().setValue(17));
assertTrue(compare.equalsDeep(benefit));
}
use of org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitComponent in project beneficiary-fhir-data by CMSgov.
the class SNFClaimTransformerV2Test method shouldHaveNchIpTotDdctnAmtFinancial.
@Test
public void shouldHaveNchIpTotDdctnAmtFinancial() {
BenefitComponent benefit = TransformerTestUtilsV2.findFinancial("https://bluebutton.cms.gov/resources/variables/nch_ip_tot_ddctn_amt", eob.getBenefitBalanceFirstRep().getFinancial());
BenefitComponent compare = new BenefitComponent().setType(new CodeableConcept().setCoding(Arrays.asList(new Coding("https://bluebutton.cms.gov/resources/codesystem/benefit-balance", "https://bluebutton.cms.gov/resources/variables/nch_ip_tot_ddctn_amt", "NCH Inpatient (or other Part A) Total Deductible/Coinsurance Amount")))).setUsed(new Money().setValueElement(new DecimalType("14.00")).setCurrency(TransformerConstants.CODED_MONEY_USD));
assertTrue(compare.equalsDeep(benefit));
}
Aggregations