Search in sources :

Example 71 with Operation

use of org.hl7.fhir.utilities.graphql.Operation in project cqf-ruler by DBCG.

the class MeasureEvaluateProviderIT method testMeasureEvaluateWithAdditionalData.

@Test
public void testMeasureEvaluateWithAdditionalData() throws Exception {
    String mainBundleAsText = stringFromResource("Exm104FhirR4MeasurePartBundle.json");
    Bundle bundle = (Bundle) getFhirContext().newJsonParser().parseResource(mainBundleAsText);
    getClient().transaction().withBundle(bundle).execute();
    String additionalBundleAsText = stringFromResource("Exm104FhirR4MeasureAdditionalData.json");
    Bundle additionalData = (Bundle) getFhirContext().newJsonParser().parseResource(additionalBundleAsText);
    Parameters params = new Parameters();
    params.addParameter().setName("periodStart").setValue(new StringType("2019-01-01"));
    params.addParameter().setName("periodEnd").setValue(new StringType("2020-01-01"));
    params.addParameter().setName("reportType").setValue(new StringType("subject"));
    params.addParameter().setName("subject").setValue(new StringType("Patient/numer-EXM104"));
    params.addParameter().setName("lastReceivedOn").setValue(new StringType("2019-12-12"));
    params.addParameter().setName("additionalData").setResource(additionalData);
    MeasureReport returnMeasureReport = getClient().operation().onInstance(new IdType("Measure", "measure-EXM104-8.2.000")).named("$evaluate-measure").withParameters(params).returnResourceType(MeasureReport.class).execute();
    assertNotNull(returnMeasureReport);
}
Also used : Parameters(org.hl7.fhir.r4.model.Parameters) StringType(org.hl7.fhir.r4.model.StringType) Bundle(org.hl7.fhir.r4.model.Bundle) MeasureReport(org.hl7.fhir.r4.model.MeasureReport) IdType(org.hl7.fhir.r4.model.IdType) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) RestIntegrationTest(org.opencds.cqf.ruler.test.RestIntegrationTest)

Example 72 with Operation

use of org.hl7.fhir.utilities.graphql.Operation in project cqf-ruler by DBCG.

the class CareGapsProviderIT method testSubjectMultiple.

@SuppressWarnings("java:S5778")
@Test
public void testSubjectMultiple() throws Exception {
    Parameters params = new Parameters();
    params.addParameter().setName("periodStart").setValue(new StringType(periodStartValid));
    params.addParameter().setName("periodEnd").setValue(new StringType(periodEndValid));
    params.addParameter().setName("subject").setValue(new StringType(subjectPatientValid));
    params.addParameter().setName("subject").setValue(new StringType(subjectGroupValid));
    params.addParameter().setName("status").setValue(new StringType(statusValid));
    params.addParameter().setName("measureId").setValue(new StringType(measureIdValid));
    assertThrows(InternalErrorException.class, () -> {
        getClient().operation().onType(Measure.class).named("$care-gaps").withParameters(params).useHttpGet().returnResourceType(Parameters.class).execute();
    });
}
Also used : Parameters(org.hl7.fhir.r4.model.Parameters) StringType(org.hl7.fhir.r4.model.StringType) Measure(org.hl7.fhir.r4.model.Measure) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) RestIntegrationTest(org.opencds.cqf.ruler.test.RestIntegrationTest)

Example 73 with Operation

use of org.hl7.fhir.utilities.graphql.Operation in project cqf-ruler by DBCG.

the class CareGapsProviderIT method testPeriodEndInvalid.

@SuppressWarnings("java:S5778")
@Test
public void testPeriodEndInvalid() throws Exception {
    Parameters params = new Parameters();
    params.addParameter().setName("periodStart").setValue(new StringType(periodStartValid));
    params.addParameter().setName("periodEnd").setValue(new StringType(dateInvalid));
    params.addParameter().setName("subject").setValue(new StringType(subjectPatientValid));
    params.addParameter().setName("status").setValue(new StringType(statusValid));
    params.addParameter().setName("measureId").setValue(new StringType(measureIdValid));
    assertThrows(InternalErrorException.class, () -> {
        getClient().operation().onType(Measure.class).named("$care-gaps").withParameters(params).useHttpGet().returnResourceType(Parameters.class).execute();
    });
}
Also used : Parameters(org.hl7.fhir.r4.model.Parameters) StringType(org.hl7.fhir.r4.model.StringType) Measure(org.hl7.fhir.r4.model.Measure) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) RestIntegrationTest(org.opencds.cqf.ruler.test.RestIntegrationTest)

Example 74 with Operation

use of org.hl7.fhir.utilities.graphql.Operation in project cqf-ruler by DBCG.

the class CareGapsProviderIT method testSubjectAndOrganization.

@SuppressWarnings("java:S5778")
@Test
public void testSubjectAndOrganization() throws Exception {
    Parameters params = new Parameters();
    params.addParameter().setName("periodStart").setValue(new StringType(periodStartValid));
    params.addParameter().setName("periodEnd").setValue(new StringType(periodEndValid));
    params.addParameter().setName("subject").setValue(new StringType(subjectPatientValid));
    params.addParameter().setName("status").setValue(new StringType(statusValid));
    params.addParameter().setName("measureId").setValue(new StringType(measureIdValid));
    params.addParameter().setName("organization").setValue(new StringType(organizationValid));
    assertThrows(InternalErrorException.class, () -> {
        getClient().operation().onType(Measure.class).named("$care-gaps").withParameters(params).useHttpGet().returnResourceType(Parameters.class).execute();
    });
}
Also used : Parameters(org.hl7.fhir.r4.model.Parameters) StringType(org.hl7.fhir.r4.model.StringType) Measure(org.hl7.fhir.r4.model.Measure) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) RestIntegrationTest(org.opencds.cqf.ruler.test.RestIntegrationTest)

Example 75 with Operation

use of org.hl7.fhir.utilities.graphql.Operation in project cqf-ruler by DBCG.

the class CareGapsProviderIT method testSubjectReferenceInvalid.

@SuppressWarnings("java:S5778")
@Test
public void testSubjectReferenceInvalid() throws Exception {
    Parameters params = new Parameters();
    params.addParameter().setName("periodStart").setValue(new StringType(periodStartValid));
    params.addParameter().setName("periodEnd").setValue(new StringType(periodEndValid));
    params.addParameter().setName("subject").setValue(new StringType(subjectReferenceInvalid));
    params.addParameter().setName("status").setValue(new StringType(statusValid));
    params.addParameter().setName("measureId").setValue(new StringType(measureIdValid));
    assertThrows(InternalErrorException.class, () -> {
        getClient().operation().onType(Measure.class).named("$care-gaps").withParameters(params).useHttpGet().returnResourceType(Parameters.class).execute();
    });
}
Also used : Parameters(org.hl7.fhir.r4.model.Parameters) StringType(org.hl7.fhir.r4.model.StringType) Measure(org.hl7.fhir.r4.model.Measure) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) RestIntegrationTest(org.opencds.cqf.ruler.test.RestIntegrationTest)

Aggregations

Parameters (org.hl7.fhir.r4.model.Parameters)72 Test (org.junit.jupiter.api.Test)69 RestIntegrationTest (org.opencds.cqf.ruler.test.RestIntegrationTest)63 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)63 StringType (org.hl7.fhir.r4.model.StringType)62 ArrayList (java.util.ArrayList)60 IOException (java.io.IOException)54 List (java.util.List)54 Bundle (org.hl7.fhir.r4.model.Bundle)53 IGenericClient (ca.uhn.fhir.rest.client.api.IGenericClient)52 Collectors (java.util.stream.Collectors)51 Beneficiary (gov.cms.bfd.model.rif.Beneficiary)50 RequestHeaders (gov.cms.bfd.server.war.commons.RequestHeaders)48 FileOutputStream (java.io.FileOutputStream)47 Collections (java.util.Collections)47 Optional (java.util.Optional)47 File (java.io.File)46 Arrays (java.util.Arrays)46 CommonHeaders (gov.cms.bfd.server.war.commons.CommonHeaders)45 TransformerConstants (gov.cms.bfd.server.war.commons.TransformerConstants)45