Search in sources :

Example 1 with MeasureGroupStratifierComponent

use of org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent in project cqf-ruler by DBCG.

the class MeasureBuilder method addStratifier.

public MeasureBuilder addStratifier(String stratifierId, String expression) {
    MeasureGroupStratifierComponent mgsc = measure.getGroupFirstRep().addStratifier();
    mgsc.getCriteria().setExpression(expression);
    mgsc.setId(stratifierId);
    return this;
}
Also used : MeasureGroupStratifierComponent(org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponent)

Example 2 with MeasureGroupStratifierComponent

use of org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent in project cqf-ruler by DBCG.

the class MeasureBuilder method addStratifier.

public MeasureBuilder addStratifier(String stratifierId, String expression) {
    MeasureGroupStratifierComponent mgsc = measure.getGroupFirstRep().addStratifier();
    mgsc.setCriteria(expression);
    mgsc.setId(stratifierId);
    return this;
}
Also used : MeasureGroupStratifierComponent(org.hl7.fhir.dstu3.model.Measure.MeasureGroupStratifierComponent)

Example 3 with MeasureGroupStratifierComponent

use of org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent in project org.hl7.fhir.core by hapifhir.

the class MeasureValidator method validateMeasureReportGroupStratifiers.

private void validateMeasureReportGroupStratifiers(ValidatorHostContext hostContext, MeasureContext m, MeasureGroupComponent mg, List<ValidationMessage> errors, Element mrg, NodeStack stack, boolean inProgress) {
    // there must be a population for each population defined in the measure, and no 4others.
    List<MeasureGroupStratifierComponent> strats = new ArrayList<>();
    List<Element> slist = mrg.getChildrenByName("stratifier");
    int i = 0;
    for (Element mrgs : slist) {
        NodeStack ns = stack.push(mrgs, i, mrgs.getProperty().getDefinition(), mrgs.getProperty().getDefinition());
        CodeableConcept cc = ObjectConverter.readAsCodeableConcept(mrgs.getNamedChild("code"));
        if (rule(errors, IssueType.BUSINESSRULE, mrgs.line(), mrgs.col(), ns.getLiteralPath(), cc != null, I18nConstants.MEASURE_MR_GRP_POP_NO_CODE)) {
            MeasureGroupStratifierComponent mgs = getGroupStratifierForCode(cc, mg);
            if (rule(errors, IssueType.BUSINESSRULE, mrg.line(), mrg.col(), ns.getLiteralPath(), mgs != null, I18nConstants.MEASURE_MR_GRP_POP_UNK_CODE)) {
                if (rule(errors, IssueType.BUSINESSRULE, mrg.line(), mrg.col(), ns.getLiteralPath(), !strats.contains(mgs), I18nConstants.MEASURE_MR_GRP_POP_DUPL_CODE)) {
                    strats.add(mgs);
                    validateMeasureReportGroupStratifier(hostContext, m, mgs, errors, mrgs, ns, inProgress);
                }
            }
        }
        i++;
    }
    for (MeasureGroupStratifierComponent mgs : mg.getStratifier()) {
        if (!strats.contains(mgs)) {
            rule(errors, IssueType.BUSINESSRULE, mrg.line(), mrg.col(), stack.getLiteralPath(), strats.contains(mg), I18nConstants.MEASURE_MR_GRP_MISSING_BY_CODE, DataRenderer.display(context, mgs.getCode()));
        }
    }
}
Also used : MeasureGroupStratifierComponent(org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent) Element(org.hl7.fhir.r5.elementmodel.Element) ArrayList(java.util.ArrayList) NodeStack(org.hl7.fhir.validation.instance.utils.NodeStack) CodeableConcept(org.hl7.fhir.r5.model.CodeableConcept)

Aggregations

ArrayList (java.util.ArrayList)1 MeasureGroupStratifierComponent (org.hl7.fhir.dstu3.model.Measure.MeasureGroupStratifierComponent)1 MeasureGroupStratifierComponent (org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponent)1 Element (org.hl7.fhir.r5.elementmodel.Element)1 CodeableConcept (org.hl7.fhir.r5.model.CodeableConcept)1 MeasureGroupStratifierComponent (org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent)1 NodeStack (org.hl7.fhir.validation.instance.utils.NodeStack)1