Search in sources :

Example 96 with Coding

use of org.hl7.fhir.r4b.model.Coding 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 97 with Coding

use of org.hl7.fhir.r4b.model.Coding 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 98 with Coding

use of org.hl7.fhir.r4b.model.Coding in project beneficiary-fhir-data by CMSgov.

the class BeneficiaryTransformerV2Test method verifyDualResourceExtension.

/**
 * helper function to verify that {@link
 * gov.cms.bfd.server.war.r4.providers.BeneficiaryTransformerV2} correctly handles patient Part D
 * attributee.
 */
private void verifyDualResourceExtension(String dualId) {
    String uri = "https://bluebutton.cms.gov/resources/variables/" + dualId;
    Extension ex = TransformerTestUtilsV2.findExtensionByUrl(uri, patient.getExtension());
    assertNotNull(ex);
    Extension compare = new Extension(uri, new Coding(uri, "**", "Enrolled in Medicare A and/or B, but no Part D enrollment data for the beneficiary. (This status was indicated as 'XX' for 2006-2009)"));
    assertTrue(compare.equalsDeep(ex));
}
Also used : Extension(org.hl7.fhir.r4.model.Extension) Coding(org.hl7.fhir.r4.model.Coding)

Example 99 with Coding

use of org.hl7.fhir.r4b.model.Coding in project beneficiary-fhir-data by CMSgov.

the class CarrierClaimTransformerV2Test method shouldHaveClmPassThruClaimSubmittedChargeFinancial.

@Test
public void shouldHaveClmPassThruClaimSubmittedChargeFinancial() {
    BenefitComponent benefit = TransformerTestUtilsV2.findFinancial("https://bluebutton.cms.gov/resources/variables/nch_carr_clm_sbmtd_chrg_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_sbmtd_chrg_amt", "NCH Carrier Claim Submitted Charge Amount (sum of all line-level submitted charges)")))).setUsed(new Money().setValueElement(new DecimalType("245.04")).setCurrency(TransformerConstants.CODED_MONEY_USD));
    assertTrue(compare.equalsDeep(benefit));
}
Also used : Money(org.hl7.fhir.r4.model.Money) Coding(org.hl7.fhir.r4.model.Coding) DecimalType(org.hl7.fhir.r4.model.DecimalType) BenefitComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitComponent) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept) Test(org.junit.jupiter.api.Test)

Example 100 with Coding

use of org.hl7.fhir.r4b.model.Coding in project beneficiary-fhir-data by CMSgov.

the class CarrierClaimTransformerV2Test method shouldHaveLineItemEligibleAdjudication.

@Test
public void shouldHaveLineItemEligibleAdjudication() {
    AdjudicationComponent adjudication = TransformerTestUtilsV2.findAdjudicationByCategory("eligible", eob.getItemFirstRep().getAdjudication());
    AdjudicationComponent compare = new AdjudicationComponent().setCategory(new CodeableConcept().setCoding(Arrays.asList(new Coding("http://terminology.hl7.org/CodeSystem/adjudication", "eligible", "Eligible Amount"), new Coding("https://bluebutton.cms.gov/resources/codesystem/adjudication", "https://bluebutton.cms.gov/resources/variables/line_alowd_chrg_amt", "Line Allowed Charge Amount")))).setAmount(new Money().setValue(75).setCurrency(TransformerConstants.CODED_MONEY_USD));
    assertTrue(compare.equalsDeep(adjudication));
}
Also used : Money(org.hl7.fhir.r4.model.Money) Coding(org.hl7.fhir.r4.model.Coding) AdjudicationComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept) Test(org.junit.jupiter.api.Test)

Aggregations

Coding (org.hl7.fhir.r4.model.Coding)633 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)373 Test (org.junit.jupiter.api.Test)344 Test (org.junit.Test)175 ArrayList (java.util.ArrayList)133 Money (org.hl7.fhir.r4.model.Money)117 Coding (org.hl7.fhir.dstu3.model.Coding)114 Extension (org.hl7.fhir.r4.model.Extension)77 CodeableConcept (org.hl7.fhir.dstu3.model.CodeableConcept)73 MockHttpServletResponse (org.springframework.mock.web.MockHttpServletResponse)68 Date (java.util.Date)66 AdjudicationComponent (org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent)65 Reference (org.hl7.fhir.r4.model.Reference)65 FHIRException (org.hl7.fhir.exceptions.FHIRException)63 SupportingInformationComponent (org.hl7.fhir.r4.model.ExplanationOfBenefit.SupportingInformationComponent)62 Bundle (org.hl7.fhir.r4.model.Bundle)58 BenefitComponent (org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitComponent)57 Coding (org.hl7.fhir.r5.model.Coding)54 Observation (org.hl7.fhir.r4.model.Observation)49 DecimalType (org.hl7.fhir.r4.model.DecimalType)46