use of org.hl7.fhir.r5.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.r5.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.r5.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));
}
use of org.hl7.fhir.r5.model.Extension in project beneficiary-fhir-data by CMSgov.
the class BeneficiaryTransformerV2Test method shouldIncludeMedicareExtensionIdentifierCurrent.
@Test
public void shouldIncludeMedicareExtensionIdentifierCurrent() {
Identifier mcId = TransformerTestUtilsV2.findIdentifierBySystem("http://hl7.org/fhir/sid/us-mbi", patient.getIdentifier());
Extension extension = new Extension("https://bluebutton.cms.gov/resources/codesystem/identifier-currency", new Coding("https://bluebutton.cms.gov/resources/codesystem/identifier-currency", "current", "Current"));
Period period = new Period();
try {
Date start = (new SimpleDateFormat("yyyy-MM-dd")).parse("2020-07-30");
period.setStart(start, TemporalPrecisionEnum.DAY);
} catch (Exception e) {
}
Identifier compare = new Identifier();
compare.setValue("3456789").setSystem("http://hl7.org/fhir/sid/us-mbi").setPeriod(period).getType().addCoding().setCode("MC").setSystem("http://terminology.hl7.org/CodeSystem/v2-0203").setDisplay("Patient's Medicare number").addExtension(extension);
assertTrue(compare.equalsDeep(mcId));
}
use of org.hl7.fhir.r5.model.Extension in project beneficiary-fhir-data by CMSgov.
the class BeneficiaryTransformerV2Test method shouldHaveReferenceYearExtension.
/**
* test to verify that {@link gov.cms.bfd.server.war.r4.providers.BeneficiaryTransformerV2}
* hanldes patient reference year extension.
*/
@Test
public void shouldHaveReferenceYearExtension() {
Extension ex = TransformerTestUtilsV2.findExtensionByUrl("https://bluebutton.cms.gov/resources/variables/rfrnc_yr", patient.getExtension());
DateType yearValue = null;
try {
Date dt = new SimpleDateFormat("yyyy-MM-dd").parse("2018-01-01");
yearValue = new DateType(dt, TemporalPrecisionEnum.YEAR);
} catch (Exception e) {
}
Extension compare = new Extension().setValue(yearValue).setUrl("https://bluebutton.cms.gov/resources/variables/rfrnc_yr");
assertTrue(compare.equalsDeep(ex));
}
Aggregations