use of org.hl7.fhir.r4.model.Parameters in project cqf-ruler by DBCG.
the class MeasureEvaluateProviderIT method testMeasureEvaluate.
@Test
public void testMeasureEvaluate() throws Exception {
String bundleAsText = stringFromResource("Exm105Fhir3Measure.json");
Bundle bundle = (Bundle) getFhirContext().newJsonParser().parseResource(bundleAsText);
getClient().transaction().withBundle(bundle).execute();
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("individual"));
params.addParameter().setName("subject").setValue(new StringType("Patient/denom-EXM105-FHIR3"));
params.addParameter().setName("lastReceivedOn").setValue(new StringType("2019-12-12"));
MeasureReport returnMeasureReport = getClient().operation().onInstance(new IdType("Measure", "measure-EXM105-FHIR3-8.0.000")).named("$evaluate-measure").withParameters(params).returnResourceType(MeasureReport.class).execute();
assertNotNull(returnMeasureReport);
// System.out.println("Resource:"+this.getFhirContext().newJsonParser().setPrettyPrint(true).encodeResourceToString(returnMeasureReport));
}
use of org.hl7.fhir.r4.model.Parameters in project cqf-ruler by DBCG.
the class MeasureEvaluateProviderIT method testMeasureEvaluateWithAdditionalData.
@Test
public void testMeasureEvaluateWithAdditionalData() throws Exception {
String mainBundleAsText = stringFromResource("Exm105FhirR3MeasurePartBundle.json");
Bundle bundle = (Bundle) getFhirContext().newJsonParser().parseResource(mainBundleAsText);
getClient().transaction().withBundle(bundle).execute();
String additionalBundleAsText = stringFromResource("Exm105FhirR3MeasureAdditionalData.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("individual"));
params.addParameter().setName("subject").setValue(new StringType("Patient/denom-EXM105-FHIR3"));
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-EXM105-FHIR3-8.0.000")).named("$evaluate-measure").withParameters(params).returnResourceType(MeasureReport.class).execute();
assertNotNull(returnMeasureReport);
}
use of org.hl7.fhir.r4.model.Parameters in project cqf-ruler by DBCG.
the class CareGapsProviderIT method testPractitionerAndOrganization.
@Test
public void testPractitionerAndOrganization() 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("status").setValue(new StringType(statusValid));
params.addParameter().setName("measureId").setValue(new StringType(measureIdValid));
params.addParameter().setName("organization").setValue(new StringType(organizationValid));
params.addParameter().setName("practitioner").setValue(new StringType(practitionerValid));
assertThrows(InternalErrorException.class, () -> {
getClient().operation().onType(Measure.class).named("$care-gaps").withParameters(params).useHttpGet().returnResourceType(Parameters.class).execute();
});
// TODO: implement practitioner and organization
// assertDoesNotThrow(() -> {
// getClient().operation().onType(Measure.class).named("$care-gaps")
// .withParameters(params)
// .useHttpGet()
// .returnResourceType(Parameters.class)
// .execute();
// });
}
use of org.hl7.fhir.r4.model.Parameters in project cqf-ruler by DBCG.
the class DataOperationProviderIT method testDstu3MeasureDataRequirementsOperation.
@Disabled("Erroring because could not convert r5 Library to dstu3")
@Test
public void testDstu3MeasureDataRequirementsOperation() throws IOException {
String bundleAsText = stringFromResource("Exm105Dstu3MeasureBundle.json");
Bundle bundle = (Bundle) getFhirContext().newJsonParser().parseResource(bundleAsText);
getClient().transaction().withBundle(bundle).execute();
Parameters params = new Parameters();
params.addParameter().setName("startPeriod").setValue(new StringType("2019-01-01"));
params.addParameter().setName("endPeriod").setValue(new StringType("2020-01-01"));
Library returnLibrary = getClient().operation().onInstance(new IdType("Measure", "measure-EXM105-FHIR3-8.0.000")).named("$data-requirements").withParameters(params).returnResourceType(Library.class).execute();
assertNotNull(returnLibrary);
}
use of org.hl7.fhir.r4.model.Parameters in project cqf-ruler by DBCG.
the class CareGapsProvider method patientReports.
// warning for greater than 7 parameters
@SuppressWarnings("squid:S00107")
private Parameters.ParametersParameterComponent patientReports(RequestDetails requestDetails, String periodStart, String periodEnd, Patient patient, List<String> status, List<Measure> measures, String organization) {
// TODO: add organization to report, if it exists.
Composition composition = getComposition(patient);
List<DetectedIssue> detectedIssues = new ArrayList<>();
Map<String, Resource> evaluatedResources = new HashMap<>();
List<MeasureReport> reports = getReports(requestDetails, periodStart, periodEnd, patient, status, measures, composition, detectedIssues, evaluatedResources);
if (reports.isEmpty()) {
return null;
}
return initializePatientParameter(patient).setResource(addBundleEntries(requestDetails.getFhirServerBase(), composition, detectedIssues, reports, evaluatedResources));
}
Aggregations