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);
}
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));
}
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));
}
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));
}
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));
}
Aggregations