Search in sources :

Example 16 with CodeableConcept

use of org.hl7.fhir.dstu2016may.model.CodeableConcept in project beneficiary-fhir-data by CMSgov.

the class AbstractSamhsaMatcherTest method samhsaCodingTest.

/**
 * Parameterized tests for {@link AbstractSamhsaMatcher#isSamhsaCoding(CodeableConcept, Predicate,
 * Predicate)}
 *
 * <p>The target method takes a {@link CodeableConcept} and two {@link Predicate}s (one for ICD9
 * checks and one for ICD10 checks). The test checks each combination of coding system/predicate
 * result.
 */
@ParameterizedTest(name = "{index}: System(\"{0}\"), isSamsaICD9(\"{2}\"), isSamsaICD10(\"{3}\"), Expected(\"{4}\")")
@MethodSource
public void samhsaCodingTest(String system, CodeableConcept concept, boolean isIcd9Code, boolean isIcd10Code, boolean expectedResult, String errorMessage) {
    Coding mockCoding = mock(Coding.class);
    doReturn(system).when(mockCoding).getSystem();
    doReturn("some code").when(mockCoding).getCode();
    Optional.ofNullable(concept).ifPresent(c -> doReturn(List.of(mockCoding)).when(c).getCoding());
    // unchecked - This is ok for making a mock.
    // noinspection unchecked
    AbstractSamhsaMatcher<IBaseResource> matcherSpy = spy(AbstractSamhsaMatcher.class);
    doReturn(false).when(matcherSpy).isSamhsaCptCode(any(Coding.class));
    // unchecked - This is ok for making a mock.
    // noinspection unchecked
    Predicate<Coding> mockPredicateIcd9 = mock(Predicate.class);
    doReturn(isIcd9Code).when(mockPredicateIcd9).test(mockCoding);
    // unchecked - This is ok for making a mock.
    // noinspection unchecked
    Predicate<Coding> mockPredicateIcd10 = mock(Predicate.class);
    doReturn(isIcd10Code).when(mockPredicateIcd10).test(mockCoding);
    assertEquals(expectedResult, matcherSpy.isSamhsaCoding(concept, mockPredicateIcd9, mockPredicateIcd10), errorMessage);
}
Also used : Coding(gov.cms.bfd.server.war.adapters.Coding) IBaseResource(org.hl7.fhir.instance.model.api.IBaseResource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 17 with CodeableConcept

use of org.hl7.fhir.dstu2016may.model.CodeableConcept in project beneficiary-fhir-data by CMSgov.

the class OutpatientClaimTransformerV2Test method shouldHaveLineItemAdjudicationRevCntrPrvdrPmtAmt.

@Test
public void shouldHaveLineItemAdjudicationRevCntrPrvdrPmtAmt() {
    AdjudicationComponent adjudication = TransformerTestUtilsV2.findAdjudicationByCategory("https://bluebutton.cms.gov/resources/variables/rev_cntr_prvdr_pmt_amt", eob.getItemFirstRep().getAdjudication());
    AdjudicationComponent compare = new AdjudicationComponent().setCategory(new CodeableConcept().setCoding(Arrays.asList(new Coding("http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBAdjudication", "paidtoprovider", "Paid to provider"), new Coding("https://bluebutton.cms.gov/resources/codesystem/adjudication", "https://bluebutton.cms.gov/resources/variables/rev_cntr_prvdr_pmt_amt", "Revenue Center (Medicare) Provider Payment Amount")))).setAmount(new Money().setValue(200).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)

Example 18 with CodeableConcept

use of org.hl7.fhir.dstu2016may.model.CodeableConcept in project beneficiary-fhir-data by CMSgov.

the class OutpatientClaimTransformerV2Test method shouldHaveLineItemAdjudicationRevCntrCoinsrncWgeAdjstdC.

@Test
public void shouldHaveLineItemAdjudicationRevCntrCoinsrncWgeAdjstdC() {
    AdjudicationComponent adjudication = TransformerTestUtilsV2.findAdjudicationByCategory("https://bluebutton.cms.gov/resources/variables/rev_cntr_coinsrnc_wge_adjstd_c", eob.getItemFirstRep().getAdjudication());
    AdjudicationComponent compare = new AdjudicationComponent().setCategory(new CodeableConcept().setCoding(Arrays.asList(new Coding("http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBAdjudication", "coinsurance", "Co-insurance"), new Coding("https://bluebutton.cms.gov/resources/codesystem/adjudication", "https://bluebutton.cms.gov/resources/variables/rev_cntr_coinsrnc_wge_adjstd_c", "Revenue Center Coinsurance/Wage Adjusted Coinsurance Amount")))).setAmount(new Money().setValue(15.23).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)

Example 19 with CodeableConcept

use of org.hl7.fhir.dstu2016may.model.CodeableConcept in project beneficiary-fhir-data by CMSgov.

the class OutpatientClaimTransformerV2Test method shouldHaveLineItemAdjudicationRevCntrCashDdctblAmt.

@Test
public void shouldHaveLineItemAdjudicationRevCntrCashDdctblAmt() {
    AdjudicationComponent adjudication = TransformerTestUtilsV2.findAdjudicationByCategory("https://bluebutton.cms.gov/resources/variables/rev_cntr_cash_ddctbl_amt", eob.getItemFirstRep().getAdjudication());
    AdjudicationComponent compare = new AdjudicationComponent().setCategory(new CodeableConcept().setCoding(Arrays.asList(new Coding("http://terminology.hl7.org/CodeSystem/adjudication", "deductible", "Deductible"), new Coding("https://bluebutton.cms.gov/resources/codesystem/adjudication", "https://bluebutton.cms.gov/resources/variables/rev_cntr_cash_ddctbl_amt", "Revenue Center Cash Deductible Amount")))).setAmount(new Money().setValue(12.89).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)

Example 20 with CodeableConcept

use of org.hl7.fhir.dstu2016may.model.CodeableConcept in project beneficiary-fhir-data by CMSgov.

the class OutpatientClaimTransformerV2Test method shouldHaveLineItemAdjudicationRevCntr1stAnsiCd.

@Test
public void shouldHaveLineItemAdjudicationRevCntr1stAnsiCd() {
    AdjudicationComponent adjudication = TransformerTestUtilsV2.findAdjudicationByReason("CO120", eob.getItemFirstRep().getAdjudication());
    AdjudicationComponent compare = new AdjudicationComponent().setCategory(new CodeableConcept().setCoding(Arrays.asList(new Coding("http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBAdjudicationDiscriminator", "denialreason", "Denial Reason")))).setReason(new CodeableConcept().setCoding(Arrays.asList(new Coding("https://bluebutton.cms.gov/resources/variables/rev_cntr_1st_ansi_cd", "CO120", null))));
    assertTrue(compare.equalsDeep(adjudication));
}
Also used : 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

CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)566 Coding (org.hl7.fhir.r4.model.Coding)368 Test (org.junit.jupiter.api.Test)260 Test (org.junit.Test)155 CodeableConcept (org.hl7.fhir.dstu3.model.CodeableConcept)152 ArrayList (java.util.ArrayList)126 Money (org.hl7.fhir.r4.model.Money)122 Coding (org.hl7.fhir.dstu3.model.Coding)71 Date (java.util.Date)70 AdjudicationComponent (org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent)67 Reference (org.hl7.fhir.r4.model.Reference)64 Identifier (org.hl7.fhir.r4.model.Identifier)61 BenefitComponent (org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitComponent)60 BundleEntryComponent (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent)50 CodeableConcept (org.hl7.fhir.r5.model.CodeableConcept)47 DecimalType (org.hl7.fhir.r4.model.DecimalType)44 Concept (org.openmrs.Concept)42 Extension (org.hl7.fhir.r4.model.Extension)38 Resource (org.hl7.fhir.r4.model.Resource)38 List (java.util.List)37