* @param groupTypes The {@link GroupType}s.
* @param ruleSet The {@link RuleSet}.
*/
private void readGroups(Map<String, ConceptType> conceptTypes, Map<String, ConstraintType> constraintTypes, Map<String, GroupType> groupTypes, RuleSet ruleSet) {
for (GroupType groupType : groupTypes.values()) {
Group group = getOrCreateGroup(groupType.getId(), ruleSet.getGroups());
for (ReferenceType referenceType : groupType.getIncludeConcept()) {
ConceptType includedConceptType = conceptTypes.get(referenceType.getRefId());
if (includedConceptType == null) {
ruleSet.getMissingConcepts().add(referenceType.getRefId());
} else {
group.getConcepts().add(getOrCreateConcept(referenceType.getRefId(), ruleSet.getConcepts()));
}
}
for (ReferenceType referenceType : groupType.getIncludeConstraint()) {
ConstraintType includedConstraintType = constraintTypes.get(referenceType.getRefId());
if (includedConstraintType == null) {
ruleSet.getMissingConstraints().add(referenceType.getRefId());
} else {
group.getConstraints().add(getOrCreateConstraint(referenceType.getRefId(), ruleSet.getConstraints()));
}
}
for (ReferenceType referenceType : groupType.getIncludeGroup()) {
GroupType includedConstraintType = groupTypes.get(referenceType.getRefId());
if (includedConstraintType == null) {
ruleSet.getMissingGroups().add(referenceType.getRefId());
} else {
group.getGroups().add(getOrCreateGroup(referenceType.getRefId(), ruleSet.getGroups()));
}
}
}
}