use of org.hl7.fhir.r4.model.Extension in project beneficiary-fhir-data by CMSgov.
the class HospiceClaimTransformerV2Test method shouldHaveExtensions.
@Test
public void shouldHaveExtensions() {
List<Extension> expected = eob.getExtension();
assertEquals(4, expected.size());
assertNotNull(TransformerTestUtilsV2.findExtensionByUrl("https://bluebutton.cms.gov/resources/variables/nch_near_line_rec_ident_cd", eob.getExtension()));
assertNotNull(TransformerTestUtilsV2.findExtensionByUrl("https://bluebutton.cms.gov/resources/variables/clm_mdcr_non_pmt_rsn_cd", eob.getExtension()));
assertNotNull(TransformerTestUtilsV2.findExtensionByUrl("https://bluebutton.cms.gov/resources/variables/clm_srvc_clsfctn_type_cd", eob.getExtension()));
List<Extension> compare = Arrays.asList(new Extension("https://bluebutton.cms.gov/resources/variables/nch_near_line_rec_ident_cd", new Coding("https://bluebutton.cms.gov/resources/variables/nch_near_line_rec_ident_cd", "V", "Part A institutional claim record (inpatient [IP], skilled nursing facility [SNF], hospice [HOS], or home health agency [HHA])")), new Extension("https://bluebutton.cms.gov/resources/variables/clm_mdcr_non_pmt_rsn_cd", new Coding("https://bluebutton.cms.gov/resources/variables/clm_mdcr_non_pmt_rsn_cd", "P", "Payment requested")), new Extension("https://bluebutton.cms.gov/resources/variables/clm_srvc_clsfctn_type_cd", new Coding("https://bluebutton.cms.gov/resources/variables/clm_srvc_clsfctn_type_cd", "1", null)), new Extension("https://bluebutton.cms.gov/resources/variables/fi_num", new Coding("https://bluebutton.cms.gov/resources/variables/fi_num", "6666", null)));
for (int i = 0; i < expected.size(); i++) {
assertTrue(compare.get(i).equalsDeep(expected.get(i)));
}
}
use of org.hl7.fhir.r4.model.Extension in project beneficiary-fhir-data by CMSgov.
the class HHAClaimTransformerV2Test method shouldHaveRevenueStatusCode.
/**
* Ensure that when the revenue status code exists in the claim, it should be mapped to an
* extension.
*
* <p>The specific code value of the extension is tested in {@link
* TransformerUtilsV2Test#mapEobCommonItemRevenueStatusCodeWhenStatusCodeExistsExpectExtensionOnItem()}
*/
@Test
public void shouldHaveRevenueStatusCode() {
String expectedExtensionUrl = "https://bluebutton.cms.gov/resources/variables/rev_cntr_stus_ind_cd";
assertNotNull(eob.getItem());
assertTrue(eob.getItem().size() > 0);
ExplanationOfBenefit.ItemComponent item = eob.getItem().get(0);
assertNotNull(item);
assertNotNull(item.getRevenue());
assertNotNull(item.getRevenue().getExtension());
assertEquals(1, item.getRevenue().getExtension().size());
Extension ext = item.getRevenue().getExtensionByUrl(expectedExtensionUrl);
assertNotNull(ext);
assertEquals(expectedExtensionUrl, ext.getUrl());
assertTrue(ext.getValue() instanceof Coding);
assertNotNull(((Coding) ext.getValue()).getCode());
}
use of org.hl7.fhir.r4.model.Extension in project beneficiary-fhir-data by CMSgov.
the class HHAClaimTransformerV2Test method shouldHaveFiNumberExtension.
/**
* Ensures the fi_num is correctly mapped to an eob as an extension when the
* fiscalIntermediaryNumber is present.
*/
@Test
public void shouldHaveFiNumberExtension() {
String expectedDiscriminator = "https://bluebutton.cms.gov/resources/variables/fi_num";
assertNotNull(eob.getExtension());
assertFalse(eob.getExtension().isEmpty());
Extension fiNumExtension = eob.getExtension().stream().filter(e -> expectedDiscriminator.equals(e.getUrl())).findFirst().orElse(null);
assertNotNull(fiNumExtension);
assertEquals("15999", ((Coding) fiNumExtension.getValue()).getCode());
}
use of org.hl7.fhir.r4.model.Extension in project beneficiary-fhir-data by CMSgov.
the class InpatientClaimTransformerV2Test method shouldContainDshOpClmValAmtExt.
@Test
public void shouldContainDshOpClmValAmtExt() {
Extension ex = TransformerTestUtilsV2.findExtensionByUrl("https://bluebutton.cms.gov/resources/variables/dsh_op_clm_val_amt", eob.getExtension());
Extension compare = new Extension("https://bluebutton.cms.gov/resources/variables/dsh_op_clm_val_amt", new Money().setValue(25).setCurrency(TransformerConstants.CODED_MONEY_USD));
assertTrue(compare.equalsDeep(ex));
}
use of org.hl7.fhir.r4.model.Extension in project beneficiary-fhir-data by CMSgov.
the class BeneficiaryTransformerV2Test method shouldHaveRaceExtension.
/**
* Top level Extension(s)
*/
@Test
public void shouldHaveRaceExtension() {
assertNotNull(beneficiary.getRace());
Extension ex = TransformerTestUtilsV2.findExtensionByUrl("https://bluebutton.cms.gov/resources/variables/race", patient.getExtension());
Extension compare = new Extension("https://bluebutton.cms.gov/resources/variables/race", new Coding("https://bluebutton.cms.gov/resources/variables/race", "1", "White"));
assertTrue(compare.equalsDeep(ex));
}
Aggregations