Search in sources :

Example 11 with System

use of org.hl7.gravity.refimpl.sdohexchange.sdohmappings.System 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));
}
Also used : Coding(org.hl7.fhir.r4.model.Coding) ArrayList(java.util.ArrayList) ExplanationOfBenefit(org.hl7.fhir.r4.model.ExplanationOfBenefit) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept)

Example 12 with System

use of org.hl7.gravity.refimpl.sdohexchange.sdohmappings.System 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));
}
Also used : Coding(org.hl7.fhir.r4.model.Coding) ArrayList(java.util.ArrayList) ExplanationOfBenefit(org.hl7.fhir.r4.model.ExplanationOfBenefit) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept)

Example 13 with System

use of org.hl7.gravity.refimpl.sdohexchange.sdohmappings.System in project beneficiary-fhir-data by CMSgov.

the class TransformerUtilsTest method addCareTeamPractitioner.

@Test
public void addCareTeamPractitioner() {
    ExplanationOfBenefit eob = new ExplanationOfBenefit();
    TransformerUtils.addCareTeamPractitioner(eob, null, "system", "123", ClaimCareteamrole.PRIMARY);
    assertEquals(1, eob.getCareTeam().size(), "Expect there to be one care team member");
    TransformerUtils.addCareTeamPractitioner(eob, null, "system", "123", ClaimCareteamrole.ASSIST);
    assertEquals(2, eob.getCareTeam().size(), "Expect there to be two care team members");
    TransformerUtils.addCareTeamPractitioner(eob, null, "system", "123", ClaimCareteamrole.ASSIST);
    assertEquals(2, eob.getCareTeam().size(), "Expect there to be two care team members");
}
Also used : ExplanationOfBenefit(org.hl7.fhir.dstu3.model.ExplanationOfBenefit) Test(org.junit.jupiter.api.Test)

Example 14 with System

use of org.hl7.gravity.refimpl.sdohexchange.sdohmappings.System 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));
}
Also used : Coding(org.hl7.fhir.dstu3.model.Coding) ArrayList(java.util.ArrayList) ExplanationOfBenefit(org.hl7.fhir.dstu3.model.ExplanationOfBenefit) CodeableConcept(org.hl7.fhir.dstu3.model.CodeableConcept)

Example 15 with System

use of org.hl7.gravity.refimpl.sdohexchange.sdohmappings.System in project beneficiary-fhir-data by CMSgov.

the class SamhsaMatcherFromClaimTransformerTest method verifySamhsaMatcherForDiagnosisPackage.

/**
 * Verify SAMHSA matcher for package 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 verifySamhsaMatcherForDiagnosisPackage(String system, String code, boolean shouldMatch, ExplanationOfBenefit explanationOfBenefit) {
    ExplanationOfBenefit modifiedEob = explanationOfBenefit.copy();
    // Set diagnosis DRG
    for (ExplanationOfBenefit.DiagnosisComponent diagnosisComponent : modifiedEob.getDiagnosis()) {
        if (diagnosisComponent.getDiagnosisCodeableConcept() != null) {
            diagnosisComponent.getDiagnosisCodeableConcept().setCoding(new ArrayList<>());
        }
        CodeableConcept codeableConcept = new CodeableConcept();
        Coding coding = new Coding(system, code, null);
        codeableConcept.setCoding(Collections.singletonList(coding));
        diagnosisComponent.setPackageCode(codeableConcept);
    }
    // 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).getService().setCoding(codings);
    assertEquals(shouldMatch, samhsaMatcher.test(modifiedEob));
}
Also used : Coding(org.hl7.fhir.dstu3.model.Coding) ArrayList(java.util.ArrayList) ExplanationOfBenefit(org.hl7.fhir.dstu3.model.ExplanationOfBenefit) CodeableConcept(org.hl7.fhir.dstu3.model.CodeableConcept)

Aggregations

Test (org.junit.jupiter.api.Test)92 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)75 ArrayList (java.util.ArrayList)70 Coding (org.hl7.fhir.r4.model.Coding)70 Identifier (org.hl7.fhir.r4.model.Identifier)62 FHIRException (org.hl7.fhir.exceptions.FHIRException)45 BundleEntryComponent (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent)45 Resource (org.hl7.fhir.r4.model.Resource)45 XhtmlNode (org.hl7.fhir.utilities.xhtml.XhtmlNode)38 Test (org.junit.Test)37 Coding (org.hl7.fhir.dstu3.model.Coding)32 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)32 HashMap (java.util.HashMap)30 IBaseResource (org.hl7.fhir.instance.model.api.IBaseResource)28 List (java.util.List)27 IOException (java.io.IOException)26 Bundle (org.hl7.fhir.r4.model.Bundle)26 Patient (org.hl7.fhir.r4.model.Patient)25 CommaSeparatedStringBuilder (org.hl7.fhir.utilities.CommaSeparatedStringBuilder)24 CodeableConcept (org.hl7.fhir.dstu3.model.CodeableConcept)21