All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.cqframework.cql.elm.requirements.ElmDisjunctiveRequirement Maven / Gradle / Ivy

package org.cqframework.cql.elm.requirements;

import java.util.ArrayList;
import java.util.List;
import org.hl7.elm.r1.Expression;
import org.hl7.elm.r1.VersionedIdentifier;

public class ElmDisjunctiveRequirement extends ElmExpressionRequirement {
    public ElmDisjunctiveRequirement(VersionedIdentifier libraryIdentifier, Expression expression) {
        super(libraryIdentifier, expression);
    }

    private List arguments = new ArrayList();

    public List getArguments() {
        return arguments;
    }

    @Override
    public ElmExpressionRequirement combine(ElmRequirement requirement) {
        if (requirement instanceof ElmDisjunctiveRequirement) {
            for (ElmExpressionRequirement argument : ((ElmDisjunctiveRequirement) requirement).getArguments()) {
                arguments.add(argument);
            }
        } else if (requirement instanceof ElmConjunctiveRequirement) {
            arguments.add((ElmExpressionRequirement) requirement);
        } else if (requirement instanceof ElmExpressionRequirement) {
            arguments.add((ElmExpressionRequirement) requirement);
        } else if (requirement instanceof ElmRequirements) {
            for (ElmRequirement r : ((ElmRequirements) requirement).getRequirements()) {
                combine(r);
            }
        }
        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy