use of org.hl7.fhir.r5.model.Measure 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.r5.model.Measure 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.r5.model.Measure in project cqf-ruler by DBCG.
the class SubmitDataProviderIT method testSubmitDataNoId.
@Test
public void testSubmitDataNoId() {
// Create a MR and a resource
MeasureReport mr = newResource(MeasureReport.class).setMeasure(new Reference("Measure/123"));
Observation obs = newResource(Observation.class).setValue(new StringType("ABC"));
// Submit it
mySubmitDataProvider.submitData(new SystemRequestDetails(), new IdType("Measure", "123"), mr, Lists.newArrayList(obs));
// Check if they made it to the db
Observation savedObs = search(Observation.class, Searches.all()).single();
assertNotNull(savedObs);
assertEquals("ABC", savedObs.getValue().primitiveValue());
MeasureReport savedMr = search(MeasureReport.class, Searches.all()).single();
assertNotNull(savedMr);
assertEquals("Measure/123", savedMr.getMeasure().getReference());
}
use of org.hl7.fhir.r5.model.Measure in project cqf-ruler by DBCG.
the class MeasureBuilder method measure.
private static Measure measure(String scoring) {
Measure measure = new Measure();
measure.setId("Measure/measure-Test");
measure.setName("Test");
measure.setVersion("1.0.0");
measure.setUrl("http://test.com/fhir/Measure/Test");
measure.getScoring().getCodingFirstRep().setCode(scoring);
return measure;
}
use of org.hl7.fhir.r5.model.Measure in project cqf-ruler by DBCG.
the class MeasureBuilder method measure.
private static Measure measure(String scoring) {
Measure measure = new Measure();
measure.setId("Measure/measure-Test");
measure.setName("Test");
measure.setVersion("1.0.0");
measure.setUrl("http://test.com/fhir/Measure/Test");
measure.getScoring().getCodingFirstRep().setCode(scoring);
return measure;
}
Aggregations