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

org.opencds.cqf.cql.engine.debug.DebugResult Maven / Gradle / Ivy

There is a newer version: 1.5.4
Show newest version
package org.opencds.cqf.cql.engine.debug;

import org.cqframework.cql.elm.execution.Library;
import org.opencds.cqf.cql.engine.elm.execution.Executable;

import java.util.HashMap;
import java.util.Map;

public class DebugResult {
    private Map libraryResults;

    public DebugResult() {
        libraryResults = new HashMap();
    }

    public void logDebugResult(Executable node, Library currentLibrary, Object result, DebugAction action) {
        try {
            DebugLibraryResultEntry libraryResultEntry = libraryResults.get(currentLibrary.getIdentifier().getId());
            if (libraryResultEntry == null) {
                libraryResultEntry = new DebugLibraryResultEntry(currentLibrary.getIdentifier().getId());
                libraryResults.put(libraryResultEntry.getLibraryName(), libraryResultEntry);
            }
            if (libraryResultEntry != null) {
                libraryResultEntry.logDebugResultEntry(node, result);
            }

            if (action == DebugAction.LOG) {
                DebugUtilities.logDebugResult(node, currentLibrary, result);
            }
        }
        catch (Exception e) {
            // do nothing, an exception logging debug helps no one
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy