Search in sources :

Example 1 with IMeasureEvaluationSeed

use of com.ibm.cohort.engine.measure.seed.IMeasureEvaluationSeed in project quality-measure-and-cohort-service by Alvearie.

the class MeasureEvaluator method evaluatePatientMeasure.

/**
 * Evaluate a FHIR Quality Measure for a given Patient.
 *
 * The evaluate operation creates a default parameter for the CQL engine named
 * "Measurement Period" that is populated with Interval[periodStart, true,
 * periodEnd, true]. The <a href=
 * "https://www.hl7.org/fhir/measure-operation-evaluate-measure.html">FHIR
 * evaluate operation</a> defines these values as the FHIR
 * <a href="https://www.hl7.org/fhir/datatypes.html#date">date</a> type which is
 * a human readable expression that can be a partial date (e.g. YEAR,
 * YEAR-MONTH, or YEAR-MONTH-DAY format). FHIR dates do not include a timezone,
 * so the periodStart and periodEnd are interpreted as occurring in the timezone
 * of the server evaluating the request.
 *
 * @param measure         FHIR Measure resource
 * @param patientId       FHIR resource ID of the Patient resource to use as the
 *                        subject of the evaluation
 * @param periodStart     FHIR date string representing the start of the
 *                        Measurement Period.
 * @param periodEnd       FHIR date string representing the end of the
 *                        Measurement Period.
 * @param parameters      override values for parameters defined in the CQL
 *                        libraries used to evaluate the measure
 * @param evidenceOptions Settings that control what evidence will be written
 *                        into the MeasureReport
 * @return FHIR MeasureReport
 */
public MeasureReport evaluatePatientMeasure(Measure measure, String patientId, String periodStart, String periodEnd, Map<String, Parameter> parameters, MeasureEvidenceOptions evidenceOptions) {
    MeasureEvaluationSeeder seeder = new MeasureEvaluationSeeder(terminologyProvider, dataProviders, libraryDependencyGatherer, libraryResolver);
    seeder.disableDebugLogging();
    IMeasureEvaluationSeed seed = seeder.create(measure, periodStart, periodEnd, "ProductLine", parameters);
    CDMMeasureEvaluation evaluation = new CDMMeasureEvaluation(seed.getDataProvider(), seed.getMeasurementPeriod());
    return evaluation.evaluatePatientMeasure(measure, seed.getContext(), Collections.singletonList(patientId), evidenceOptions, parameters, MeasureReport.MeasureReportType.INDIVIDUAL);
}
Also used : IMeasureEvaluationSeed(com.ibm.cohort.engine.measure.seed.IMeasureEvaluationSeed) MeasureEvaluationSeeder(com.ibm.cohort.engine.measure.seed.MeasureEvaluationSeeder)

Example 2 with IMeasureEvaluationSeed

use of com.ibm.cohort.engine.measure.seed.IMeasureEvaluationSeed in project quality-measure-and-cohort-service by Alvearie.

the class MeasureEvaluator method evaluatePatientListMeasure.

public MeasureReport evaluatePatientListMeasure(List<String> patientIds, Measure measure, Map<String, Parameter> parameters, MeasureEvidenceOptions evidenceOptions) {
    MeasureEvaluationSeeder seeder = new MeasureEvaluationSeeder(terminologyProvider, dataProviders, libraryDependencyGatherer, libraryResolver);
    seeder.disableDebugLogging();
    Pair<String, String> period = getMeasurementPeriodStrategy().getMeasurementPeriod(measure, parameters);
    IMeasureEvaluationSeed seed = seeder.create(measure, period.getLeft(), period.getRight(), "ProductLine", parameters);
    CDMMeasureEvaluation evaluation = new CDMMeasureEvaluation(seed.getDataProvider(), seed.getMeasurementPeriod());
    return evaluation.evaluatePatientMeasure(measure, seed.getContext(), patientIds, evidenceOptions, parameters, MeasureReport.MeasureReportType.SUBJECTLIST);
}
Also used : IMeasureEvaluationSeed(com.ibm.cohort.engine.measure.seed.IMeasureEvaluationSeed) MeasureEvaluationSeeder(com.ibm.cohort.engine.measure.seed.MeasureEvaluationSeeder)

Aggregations

IMeasureEvaluationSeed (com.ibm.cohort.engine.measure.seed.IMeasureEvaluationSeed)2 MeasureEvaluationSeeder (com.ibm.cohort.engine.measure.seed.MeasureEvaluationSeeder)2