use of org.hl7.fhir.r4.model.Claim in project beneficiary-fhir-data by CMSgov.
the class DMEClaimTransformerV2Test method shouldHaveCarrClmCashDdctblAmtFinancial.
@Test
public void shouldHaveCarrClmCashDdctblAmtFinancial() {
BenefitComponent benefit = TransformerTestUtilsV2.findFinancial("https://bluebutton.cms.gov/resources/variables/carr_clm_cash_ddctbl_apld_amt", eob.getBenefitBalanceFirstRep().getFinancial());
// Need to maintain trailing 0s in USD amount
BigDecimal amt = new BigDecimal(777.00);
amt = amt.setScale(2, RoundingMode.HALF_DOWN);
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/carr_clm_cash_ddctbl_apld_amt", "Carrier Claim Cash Deductible Applied Amount (sum of all line-level deductible amounts)")))).setUsed(new Money().setValue(amt).setCurrency(TransformerConstants.CODED_MONEY_USD));
assertTrue(compare.equalsDeep(benefit));
}
use of org.hl7.fhir.r4.model.Claim in project beneficiary-fhir-data by CMSgov.
the class DMEClaimTransformerV2Test method shouldHaveNchCarrClmAlwdAmtFinancial.
@Test
public void shouldHaveNchCarrClmAlwdAmtFinancial() {
BenefitComponent benefit = TransformerTestUtilsV2.findFinancial("https://bluebutton.cms.gov/resources/variables/nch_carr_clm_alowd_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_carr_clm_alowd_amt", "NCH Carrier Claim Allowed Charge Amount (sum of all line-level allowed charges)")))).setUsed(new Money().setValue(754.79).setCurrency(TransformerConstants.CODED_MONEY_USD));
assertTrue(compare.equalsDeep(benefit));
}
use of org.hl7.fhir.r4.model.Claim in project beneficiary-fhir-data by CMSgov.
the class DMEClaimTransformerV2Test method before.
@BeforeEach
public void before() {
claim = generateClaim();
ExplanationOfBenefit genEob = DMEClaimTransformerV2.transform(new MetricRegistry(), claim, Optional.empty());
IParser parser = fhirContext.newJsonParser();
String json = parser.encodeResourceToString(genEob);
eob = parser.parseResource(ExplanationOfBenefit.class, json);
}
use of org.hl7.fhir.r4.model.Claim in project beneficiary-fhir-data by CMSgov.
the class DMEClaimTransformerV2Test method shouldHaveClmTotChrgAmtTotal.
@Test
public void shouldHaveClmTotChrgAmtTotal() {
// Only one so just pull it directly and compare
TotalComponent total = eob.getTotalFirstRep();
TotalComponent compare = new TotalComponent().setCategory(new CodeableConcept().setCoding(Arrays.asList(new Coding("http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBAdjudication", "priorpayerpaid", "Prior payer paid"), new Coding("https://bluebutton.cms.gov/resources/codesystem/adjudication", "https://bluebutton.cms.gov/resources/variables/clm_tot_chrg_amt", "Claim Total Charge Amount")))).setAmount(new Money().setValue(0).setCurrency(TransformerConstants.CODED_MONEY_USD));
assertTrue(compare.equalsDeep(total));
}
use of org.hl7.fhir.r4.model.Claim in project beneficiary-fhir-data by CMSgov.
the class CarrierClaimTransformerV2Test method generateClaim.
/**
* Generates the Claim object to be used in multiple tests
*
* @return claim object
* @throws FHIRException
*/
public CarrierClaim generateClaim() throws FHIRException {
List<Object> parsedRecords = ServerTestUtils.parseData(Arrays.asList(StaticRifResourceGroup.SAMPLE_A.getResources()));
CarrierClaim claim = parsedRecords.stream().filter(r -> r instanceof CarrierClaim).map(r -> (CarrierClaim) r).findFirst().get();
claim.setLastUpdated(Instant.now());
return claim;
}
Aggregations