How to use the type.conceptId function in type

To help you get started, we’ve selected a few type examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github IHTSDO / sct-snapshot-rest-api / routes / expressionsv1.js View on Github external
if (condition.cardinality) {
            exitWithError("Unsupported condition: cardinality");
        }
        if (condition.reverseFlag) {
            exitWithError("Unsupported condition: reverseFlag");
        }
        if (condition.typeId != "*") {
            if (condition.attributeOperator) {
                if (condition.attributeOperator == "descendantOrSelfOf") {
                    elemMatch["$or"] = [];
                    elemMatch["$or"].push({"type.conceptId" : condition.conceptId});
                    elemMatch["$or"].push({"typeInferredAncestors" : condition.conceptId});
                } else if (condition.attributeOperator == "descendantOf") {
                    elemMatch["typeInferredAncestors"] = condition.conceptId;
                } else {
                    elemMatch["type.conceptId"] = condition.typeId;
                }
            } else {
                elemMatch["type.conceptId"] = condition.typeId;
            }
        }
        // Process attribute value
        //if (condition.targetNode.content != "*") {
        //    var temp = [];
        //    computer.resolve(condition.targetNode, ast, temp;
        //}
        //queryPart.push({relationships: {"$elemMatch": elemMatch}});
        //TODO: update for nested definitions in attributes
        if (condition.targetNode) {
            if (condition.targetNode.rule == "simpleExpressionConstraint") {
                var targetExp = readSimpleExpressionConstraint(condition.targetNode, ast);
                //console.log(JSON.stringify(targetExp));
github IHTSDO / sct-snapshot-rest-api / routes / expressions.js View on Github external
if (condition.reverseFlag) {
            exitWithError("Unsupported condition: reverseFlag");
        }
        if (condition.typeId != "*") {
            if (condition.attributeOperator) {
                if (condition.attributeOperator == "descendantOrSelfOf") {
                    elemMatch["$or"] = [];
                    elemMatch["$or"].push({"type.conceptId" : condition.conceptId});
                    elemMatch["$or"].push({"typeInferredAncestors" : condition.conceptId});
                } else if (condition.attributeOperator == "descendantOf") {
                    elemMatch["typeInferredAncestors"] = condition.conceptId;
                } else {
                    elemMatch["type.conceptId"] = condition.typeId;
                }
            } else {
                elemMatch["type.conceptId"] = condition.typeId;
            }
        }
        // Process attribute value
        //if (condition.targetNode.content != "*") {
        //    var temp = [];
        //    computer.resolve(condition.targetNode, ast, temp;
        //}
        //queryPart.push({relationships: {"$elemMatch": elemMatch}});
        //TODO: update for nested definitions in attributes
        if (condition.targetNode) {
            if (condition.targetNode.rule == "simpleExpressionConstraint") {
                var targetExp = readSimpleExpressionConstraint(condition.targetNode, ast);
                //console.log(JSON.stringify(targetExp));
                if (targetExp.memberOf) {
                    elemMatch["targetMemberships"] = targetExp.conceptId;
                } else if (targetExp.criteria == "descendantOrSelfOf") {