use of org.hl7.fhir.r4b.model.CodeableConcept in project beneficiary-fhir-data by CMSgov.
the class SamhsaMatcherR4FromClaimTransformerV2Test method verifySamhsaMatcherForDiagnosisIcd.
/**
* Verify SAMHSA matcher for ICD item with the given system, code and if the expectation is that
* there should be a match for this combination.
*
* @param system the system value
* @param code the code
* @param shouldMatch if the matcher should match on this combination
*/
private void verifySamhsaMatcherForDiagnosisIcd(String system, String code, boolean shouldMatch, ExplanationOfBenefit explanationOfBenefit) {
ExplanationOfBenefit modifiedEob = explanationOfBenefit.copy();
// Set diagnosis
for (ExplanationOfBenefit.DiagnosisComponent diagnosisComponent : modifiedEob.getDiagnosis()) {
CodeableConcept codeableConcept = diagnosisComponent.getDiagnosisCodeableConcept();
ArrayList<Coding> codingList = new ArrayList<>();
codingList.add(new Coding().setSystem(system).setCode(code));
codeableConcept.setCoding(codingList);
diagnosisComponent.setPackageCode(null);
}
// Set procedure to empty so we dont check it for matches
for (ExplanationOfBenefit.ProcedureComponent diagnosisComponent : modifiedEob.getProcedure()) {
CodeableConcept codeableConcept = diagnosisComponent.getProcedureCodeableConcept();
ArrayList<Coding> codingList = new ArrayList<>();
codeableConcept.setCoding(codingList);
}
// Set item coding to non-SAMHSA so we dont check it for matches
List<Coding> codings = new ArrayList<>();
Coding coding = new Coding();
coding.setSystem(TransformerConstants.CODING_SYSTEM_HCPCS);
coding.setCode(NON_SAMHSA_HCPCS_CODE);
codings.add(coding);
modifiedEob.getItem().get(0).getProductOrService().setCoding(codings);
assertEquals(shouldMatch, samhsaMatcherV2.test(modifiedEob));
}
use of org.hl7.fhir.r4b.model.CodeableConcept in project beneficiary-fhir-data by CMSgov.
the class SamhsaMatcherR4FromClaimTransformerV2Test method verifySamhsaMatcherForProcedureIcd.
/**
* Verify SAMHSA matcher for ICD item with the given system, code and if the expectation is that
* there should be a match for this combination.
*
* @param system the system value
* @param code the code
* @param shouldMatch if the matcher should match on this combination
*/
private void verifySamhsaMatcherForProcedureIcd(String system, String code, boolean shouldMatch, ExplanationOfBenefit explanationOfBenefit) {
ExplanationOfBenefit modifiedEob = explanationOfBenefit.copy();
// Set diagnosis to empty so we dont check it for matches
for (ExplanationOfBenefit.DiagnosisComponent diagnosisComponent : modifiedEob.getDiagnosis()) {
CodeableConcept codeableConcept = diagnosisComponent.getDiagnosisCodeableConcept();
ArrayList<Coding> codingList = new ArrayList<>();
codeableConcept.setCoding(codingList);
diagnosisComponent.setPackageCode(null);
}
// Set procedure
for (ExplanationOfBenefit.ProcedureComponent diagnosisComponent : modifiedEob.getProcedure()) {
CodeableConcept codeableConcept = diagnosisComponent.getProcedureCodeableConcept();
ArrayList<Coding> codingList = new ArrayList<>();
codingList.add(new Coding().setSystem(system).setCode(code));
codeableConcept.setCoding(codingList);
}
// Set item coding to non-SAMHSA so we dont check it for matches
List<Coding> codings = new ArrayList<>();
Coding coding = new Coding();
coding.setSystem(TransformerConstants.CODING_SYSTEM_HCPCS);
coding.setCode(NON_SAMHSA_HCPCS_CODE);
codings.add(coding);
modifiedEob.getItem().get(0).getProductOrService().setCoding(codings);
assertEquals(shouldMatch, samhsaMatcherV2.test(modifiedEob));
}
use of org.hl7.fhir.r4b.model.CodeableConcept in project beneficiary-fhir-data by CMSgov.
the class TransformerUtilsV2Test method mapEobCommonItemRevenueStatusCodeWhenStatusCodeDoesNotExistExpectNoExtensionOnItem.
/**
* Verifies the item revenue status code is not mapped to an extension when the revenue status
* code field is not present (empty optional).
*/
@Test
public void mapEobCommonItemRevenueStatusCodeWhenStatusCodeDoesNotExistExpectNoExtensionOnItem() {
ExplanationOfBenefit eob = new ExplanationOfBenefit();
ExplanationOfBenefit.ItemComponent item = new ExplanationOfBenefit.ItemComponent();
eob.addItem(item);
CodeableConcept revenue = new CodeableConcept();
item.setRevenue(revenue);
Optional<String> statusCode = Optional.empty();
TransformerUtilsV2.mapEobCommonItemRevenueStatusCode(item, eob, statusCode);
assertNotNull(item);
assertNotNull(item.getRevenue());
assertNotNull(item);
assertNotNull(item.getRevenue());
assertNotNull(item.getRevenue().getExtension());
assertEquals(0, item.getRevenue().getExtension().size());
}
use of org.hl7.fhir.r4b.model.CodeableConcept in project beneficiary-fhir-data by CMSgov.
the class TransformerUtilsTest method createCodeableConcept_display.
/**
* Verifies that {@link
* gov.cms.bfd.server.war.stu3.providers.TransformerUtils#createCodeableConcept(org.hl7.fhir.instance.model.api.IAnyResource,
* CcwCodebookVariable, String)} sets {@link Coding#getDisplay()} correctly.
*/
@Test
public void createCodeableConcept_display() {
Patient patientA = new Patient();
patientA.setId("12345");
CodeableConcept raceConcept_4 = TransformerUtils.createCodeableConcept(patientA, CcwCodebookVariable.RACE, "4");
assertEquals("Asian", raceConcept_4.getCodingFirstRep().getDisplay());
// This code isn't valid and shouldn't end up with a matching display.
CodeableConcept raceConcept_12 = TransformerUtils.createCodeableConcept(patientA, CcwCodebookVariable.RACE, "12");
assertNull(raceConcept_12.getCodingFirstRep().getDisplay());
/*
* The REV_CNTR_PMT_MTHD_IND_CD Variable has value collisions. Verify that those
* are handled correctly.
*/
CodeableConcept paymentMethodConcept_1 = TransformerUtils.createCodeableConcept(patientA, CcwCodebookVariable.REV_CNTR_PMT_MTHD_IND_CD, "1");
assertNull(paymentMethodConcept_1.getCodingFirstRep().getDisplay());
}
use of org.hl7.fhir.r4b.model.CodeableConcept in project beneficiary-fhir-data by CMSgov.
the class SamhsaMatcherFromClaimTransformerTest method verifySamhsaMatcherForProcedureIcd.
/**
* Verify SAMHSA matcher for ICD item with the given system, code and if the expectation is that
* there should be a match for this combination.
*
* @param system the system value
* @param code the code
* @param shouldMatch if the matcher should match on this combination
*/
private void verifySamhsaMatcherForProcedureIcd(String system, String code, boolean shouldMatch, ExplanationOfBenefit explanationOfBenefit) {
ExplanationOfBenefit modifiedEob = explanationOfBenefit.copy();
// Set diagnosis to empty so we dont check it for matches
for (ExplanationOfBenefit.DiagnosisComponent diagnosisComponent : modifiedEob.getDiagnosis()) {
CodeableConcept codeableConcept = diagnosisComponent.getDiagnosisCodeableConcept();
ArrayList<Coding> codingList = new ArrayList<>();
if (codeableConcept != null) {
codeableConcept.setCoding(codingList);
diagnosisComponent.setPackageCode(null);
}
}
// Set procedure
for (ExplanationOfBenefit.ProcedureComponent diagnosisComponent : modifiedEob.getProcedure()) {
CodeableConcept codeableConcept = diagnosisComponent.getProcedureCodeableConcept();
ArrayList<Coding> codingList = new ArrayList<>();
codingList.add(new Coding().setSystem(system).setCode(code));
codeableConcept.setCoding(codingList);
}
// Set item coding to non-SAMHSA so we dont check it for matches
List<Coding> codings = new ArrayList<>();
Coding coding = new Coding();
coding.setSystem(TransformerConstants.CODING_SYSTEM_HCPCS);
coding.setCode(NON_SAMHSA_HCPCS_CODE);
codings.add(coding);
modifiedEob.getItem().get(0).getService().setCoding(codings);
assertEquals(shouldMatch, samhsaMatcher.test(modifiedEob));
}
Aggregations