Search in sources :

Example 21 with Extension

use of org.hl7.fhir.dstu2016may.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());
}
Also used : Extension(org.hl7.fhir.r4.model.Extension) Test(org.junit.jupiter.api.Test)

Example 22 with Extension

use of org.hl7.fhir.dstu2016may.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));
}
Also used : Extension(org.hl7.fhir.r4.model.Extension) Money(org.hl7.fhir.r4.model.Money) Test(org.junit.jupiter.api.Test)

Example 23 with Extension

use of org.hl7.fhir.dstu2016may.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));
}
Also used : Extension(org.hl7.fhir.r4.model.Extension) Coding(org.hl7.fhir.r4.model.Coding) Test(org.junit.jupiter.api.Test)

Example 24 with Extension

use of org.hl7.fhir.dstu2016may.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));
}
Also used : Extension(org.hl7.fhir.r4.model.Extension) Identifier(org.hl7.fhir.r4.model.Identifier) Coding(org.hl7.fhir.r4.model.Coding) Period(org.hl7.fhir.r4.model.Period) SimpleDateFormat(java.text.SimpleDateFormat) Date(java.util.Date) Test(org.junit.jupiter.api.Test)

Example 25 with Extension

use of org.hl7.fhir.dstu2016may.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));
}
Also used : Extension(org.hl7.fhir.r4.model.Extension) DateType(org.hl7.fhir.r4.model.DateType) SimpleDateFormat(java.text.SimpleDateFormat) Date(java.util.Date) Test(org.junit.jupiter.api.Test)

Aggregations

Extension (org.hl7.fhir.r4.model.Extension)154 ArrayList (java.util.ArrayList)104 Coding (org.hl7.fhir.r4.model.Coding)69 Test (org.junit.jupiter.api.Test)69 Extension (org.hl7.fhir.dstu3.model.Extension)67 FHIRException (org.hl7.fhir.exceptions.FHIRException)55 StructureDefinition (org.hl7.fhir.r5.model.StructureDefinition)46 ElementDefinition (org.hl7.fhir.r5.model.ElementDefinition)42 Extension (org.hl7.fhir.r5.model.Extension)41 XhtmlNode (org.hl7.fhir.utilities.xhtml.XhtmlNode)39 Test (org.junit.Test)36 Cell (org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Cell)35 List (java.util.List)34 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)34 Date (java.util.Date)30 Coding (org.hl7.fhir.dstu3.model.Coding)29 Piece (org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Piece)27 Row (org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Row)27 Reference (org.hl7.fhir.dstu3.model.Reference)26 Patient (org.hl7.fhir.r4.model.Patient)26