use of org.hl7.fhir.r4.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;
}
use of org.hl7.fhir.r4.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;
}
use of org.hl7.fhir.r4.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()));
}
}
}
Aggregations