use of org.hl7.fhir.dstu3.model.ExplanationOfBenefit.BenefitComponent in project beneficiary-fhir-data by CMSgov.
the class SNFClaimTransformerV2Test method shouldHaveClmPpsCptlExcptnAmtFinancial.
@Test
public void shouldHaveClmPpsCptlExcptnAmtFinancial() {
BenefitComponent benefit = TransformerTestUtilsV2.findFinancial("https://bluebutton.cms.gov/resources/variables/clm_pps_cptl_excptn_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_excptn_amt", "Claim PPS Capital Exception Amount")))).setUsed(new Money().setValueElement(new DecimalType("5.00")).setCurrency(TransformerConstants.CODED_MONEY_USD));
assertTrue(compare.equalsDeep(benefit));
}
use of org.hl7.fhir.dstu3.model.ExplanationOfBenefit.BenefitComponent in project beneficiary-fhir-data by CMSgov.
the class SNFClaimTransformerV2Test method shouldHaveClmPpsCptlOutlierAmtFinancial.
@Test
public void shouldHaveClmPpsCptlOutlierAmtFinancial() {
BenefitComponent benefit = TransformerTestUtilsV2.findFinancial("https://bluebutton.cms.gov/resources/variables/clm_pps_cptl_outlier_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_outlier_amt", "Claim PPS Capital Outlier Amount")))).setUsed(new Money().setValueElement(new DecimalType("8.00")).setCurrency(TransformerConstants.CODED_MONEY_USD));
assertTrue(compare.equalsDeep(benefit));
}
use of org.hl7.fhir.dstu3.model.ExplanationOfBenefit.BenefitComponent in project beneficiary-fhir-data by CMSgov.
the class SNFClaimTransformerV2Test method shouldHaveClmPpsCptlHldHrmlsAmtFinancial.
@Test
public void shouldHaveClmPpsCptlHldHrmlsAmtFinancial() {
BenefitComponent benefit = TransformerTestUtilsV2.findFinancial("https://bluebutton.cms.gov/resources/variables/clm_pps_old_cptl_hld_hrmls_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_old_cptl_hld_hrmls_amt", "Claim PPS Old Capital Hold Harmless Amount")))).setUsed(new Money().setValueElement(new DecimalType("4.00")).setCurrency(TransformerConstants.CODED_MONEY_USD));
assertTrue(compare.equalsDeep(benefit));
}
use of org.hl7.fhir.dstu3.model.ExplanationOfBenefit.BenefitComponent in project beneficiary-fhir-data by CMSgov.
the class OutpatientClaimTransformerV2Test method shouldHaveNchBeneBloodDdctblLbltyAmFinancial.
@Test
public void shouldHaveNchBeneBloodDdctblLbltyAmFinancial() {
BenefitComponent benefit = TransformerTestUtilsV2.findFinancial("https://bluebutton.cms.gov/resources/variables/nch_bene_blood_ddctbl_lblty_am", 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_bene_blood_ddctbl_lblty_am", "NCH Beneficiary Blood Deductible Liability Amount")))).setUsed(new Money().setValueElement(new DecimalType("6.00")).setCurrency(TransformerConstants.CODED_MONEY_USD));
assertTrue(compare.equalsDeep(benefit));
}
use of org.hl7.fhir.dstu3.model.ExplanationOfBenefit.BenefitComponent in project beneficiary-fhir-data by CMSgov.
the class TransformerUtils method findOrAddBenefitBalance.
/**
* @param eob the {@link ExplanationOfBenefit} that the {@link BenefitComponent} should be part of
* @param benefitCategory the {@link BenefitCategory} to map to {@link
* BenefitBalanceComponent#getCategory()}
* @return the already-existing {@link BenefitBalanceComponent} that matches the specified
* parameters, or a new one
*/
private static BenefitBalanceComponent findOrAddBenefitBalance(ExplanationOfBenefit eob, BenefitCategory benefitCategory) {
Optional<BenefitBalanceComponent> matchingBenefitBalance = eob.getBenefitBalance().stream().filter(bb -> isCodeInConcept(bb.getCategory(), benefitCategory.getSystem(), benefitCategory.toCode())).findAny();
if (matchingBenefitBalance.isPresent())
return matchingBenefitBalance.get();
CodeableConcept benefitCategoryConcept = new CodeableConcept();
benefitCategoryConcept.addCoding().setSystem(benefitCategory.getSystem()).setCode(benefitCategory.toCode()).setDisplay(benefitCategory.getDisplay());
BenefitBalanceComponent newBenefitBalance = new BenefitBalanceComponent(benefitCategoryConcept);
eob.addBenefitBalance(newBenefitBalance);
return newBenefitBalance;
}
Aggregations