Search in sources :

Example 1 with CoverageRequirementsDiscoveryOperationHardCodedResponse

use of org.hl7.davinci.CoverageRequirementsDiscoveryOperationHardCodedResponse in project CRD by HL7-DaVinci.

the class CoverageRequirementsDiscoveryOperationHardCodedResponseTests method testCrdSuccess.

@Test
@DisplayName("Test CRD with good data.")
void testCrdSuccess() {
    CoverageRequirementsDiscoveryOperationHardCodedResponse crdop = new CoverageRequirementsDiscoveryOperationHardCodedResponse();
    // valid parameters
    Parameters.ParametersParameterComponent request = buildRequest(buildCoverageEligibilityRequest("1234"), buildPatient("patient-4", "Bob Smith"), buildCoverage("4321"), buildProvider("5678"), buildInsurer("87654", "InsureCo"), buildFacility(), buildCondition("condition-1"), buildDevice("XYZ-123"), buildProcedure("12345678"), buildMedication(40));
    Endpoint endpoint = buildEndpoint();
    CodeableConcept requestQualification = buildRequestQualification();
    Parameters outParams = crdop.coverageRequirementsDiscovery(request, endpoint, requestQualification);
    assertFalse(outParams.isEmpty());
}
Also used : CoverageRequirementsDiscoveryOperationHardCodedResponse(org.hl7.davinci.CoverageRequirementsDiscoveryOperationHardCodedResponse) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Example 2 with CoverageRequirementsDiscoveryOperationHardCodedResponse

use of org.hl7.davinci.CoverageRequirementsDiscoveryOperationHardCodedResponse in project CRD by HL7-DaVinci.

the class CoverageRequirementsDiscoveryOperationHardCodedResponseTests method testCrdFail.

@Test
@DisplayName("Test CRD with bad data.")
void testCrdFail() {
    CoverageRequirementsDiscoveryOperationHardCodedResponse crdop = new CoverageRequirementsDiscoveryOperationHardCodedResponse();
    // empty parameters
    Parameters.ParametersParameterComponent request = new Parameters.ParametersParameterComponent();
    Endpoint endpoint = buildEndpoint();
    CodeableConcept requestQualification = buildRequestQualification();
    Parameters outParams = crdop.coverageRequirementsDiscovery(request, endpoint, requestQualification);
    assertTrue(outParams.isEmpty());
    // missing CoverageEligibilityRequest
    request = buildRequest(null, buildPatient("patient-4", "Bob Smith"), buildCoverage("4321"), buildProvider("5678"), buildInsurer("87654", "InsureCo"), buildFacility(), buildCondition("condition-1"), buildDevice("XYZ-123"), buildProcedure("12345678"), buildMedication(40));
    outParams = crdop.coverageRequirementsDiscovery(request, endpoint, requestQualification);
    assertTrue(outParams.isEmpty());
    // missing patient
    request = buildRequest(buildCoverageEligibilityRequest("1234"), null, buildCoverage("4321"), buildProvider("5678"), buildInsurer("87654", "InsureCo"), buildFacility(), buildCondition("condition-1"), buildDevice("XYZ-123"), buildProcedure("12345678"), buildMedication(40));
    outParams = crdop.coverageRequirementsDiscovery(request, endpoint, requestQualification);
    assertTrue(outParams.isEmpty());
    // missing coverage
    request = buildRequest(buildCoverageEligibilityRequest("1234"), buildPatient("patient-4", "Bob Smith"), null, buildProvider("5678"), buildInsurer("87654", "InsureCo"), buildFacility(), buildCondition("condition-1"), buildDevice("XYZ-123"), buildProcedure("12345678"), buildMedication(40));
    outParams = crdop.coverageRequirementsDiscovery(request, endpoint, requestQualification);
    assertTrue(outParams.isEmpty());
    // missing provider
    request = buildRequest(buildCoverageEligibilityRequest("1234"), buildPatient("patient-4", "Bob Smith"), buildCoverage("4321"), null, buildInsurer("87654", "InsureCo"), buildFacility(), buildCondition("condition-1"), buildDevice("XYZ-123"), buildProcedure("12345678"), buildMedication(40));
    outParams = crdop.coverageRequirementsDiscovery(request, endpoint, requestQualification);
    assertTrue(outParams.isEmpty());
    // missing insurer
    request = buildRequest(buildCoverageEligibilityRequest("1234"), buildPatient("patient-4", "Bob Smith"), buildCoverage("4321"), buildProvider("5678"), null, buildFacility(), buildCondition("condition-1"), buildDevice("XYZ-123"), buildProcedure("12345678"), buildMedication(40));
    outParams = crdop.coverageRequirementsDiscovery(request, endpoint, requestQualification);
    assertTrue(outParams.isEmpty());
}
Also used : CoverageRequirementsDiscoveryOperationHardCodedResponse(org.hl7.davinci.CoverageRequirementsDiscoveryOperationHardCodedResponse) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Aggregations

CoverageRequirementsDiscoveryOperationHardCodedResponse (org.hl7.davinci.CoverageRequirementsDiscoveryOperationHardCodedResponse)2 DisplayName (org.junit.jupiter.api.DisplayName)2 Test (org.junit.jupiter.api.Test)2