<commit_before>package gov.va.models.util;

import gov.va.isaac.gui.AppContext;
import gov.va.isaac.gui.AppUtil;

import java.io.IOException;
import java.util.UUID;

import org.ihtsdo.otf.tcc.api.blueprint.TerminologyBuilderBI;
import org.ihtsdo.otf.tcc.api.coordinate.EditCoordinate;
import org.ihtsdo.otf.tcc.api.coordinate.StandardViewCoordinates;
import org.ihtsdo.otf.tcc.api.coordinate.ViewCoordinate;
import org.ihtsdo.otf.tcc.api.metadata.binding.Snomed;
import org.ihtsdo.otf.tcc.api.metadata.binding.TermAux;
import org.ihtsdo.otf.tcc.api.spec.ValidationException;
import org.ihtsdo.otf.tcc.datastore.BdbTermBuilder;
import org.ihtsdo.otf.tcc.datastore.BdbTerminologyStore;

/**
 * Base class containing common methods for building terminology objects.
 *
 * @author ocarlsen
 */
public class TerminologyBuilderBase {

    private final AppUtil appUtil;
    private final BdbTerminologyStore dataStore;
    private final TerminologyBuilderBI builder;

    protected TerminologyBuilderBase(AppContext appContext) throws ValidationException, IOException {
        super();
        this.appUtil = appContext.getAppUtil();
        this.dataStore = appContext.getDataStore();
        this.builder = new BdbTermBuilder(getEC(), getVC());
    }

    protected AppUtil getAppUtil() {
        return appUtil;
    }

    protected BdbTerminologyStore getDataStore() {
        return dataStore;
    }

    protected TerminologyBuilderBI getBuilder() {
        return builder;
    }

    protected EditCoordinate getEC() throws ValidationException, IOException {
        int authorNid = TermAux.USER.getLenient().getConceptNid();
        int module = Snomed.CORE_MODULE.getLenient().getNid();

        UUID editPathUUID = Snomed.SNOMED_RELEASE_PATH.getUuids()[0];  // SNOMED CORE path
        int editPathNid = dataStore.getNidForUuids(editPathUUID);

        return new EditCoordinate(authorNid, module, editPathNid);
    }

    protected ViewCoordinate getVC() throws IOException {
        return StandardViewCoordinates.getSnomedStatedLatest();
    }
}<commit_msg>Changing #getEC() method to look like Jesse's demo code.<commit_after>package gov.va.models.util;

import gov.va.isaac.gui.AppContext;
import gov.va.isaac.gui.AppUtil;

import java.io.IOException;

import org.ihtsdo.otf.tcc.api.blueprint.TerminologyBuilderBI;
import org.ihtsdo.otf.tcc.api.coordinate.EditCoordinate;
import org.ihtsdo.otf.tcc.api.coordinate.StandardViewCoordinates;
import org.ihtsdo.otf.tcc.api.coordinate.ViewCoordinate;
import org.ihtsdo.otf.tcc.api.metadata.binding.Snomed;
import org.ihtsdo.otf.tcc.api.metadata.binding.TermAux;
import org.ihtsdo.otf.tcc.api.spec.ValidationException;
import org.ihtsdo.otf.tcc.datastore.BdbTermBuilder;
import org.ihtsdo.otf.tcc.datastore.BdbTerminologyStore;

/**
 * Base class containing common methods for building terminology objects.
 *
 * @author ocarlsen
 */
public class TerminologyBuilderBase {

    private final AppUtil appUtil;
    private final BdbTerminologyStore dataStore;
    private final TerminologyBuilderBI builder;

    protected TerminologyBuilderBase(AppContext appContext) throws ValidationException, IOException {
        super();
        this.appUtil = appContext.getAppUtil();
        this.dataStore = appContext.getDataStore();
        this.builder = new BdbTermBuilder(getEC(), getVC());
    }

    protected AppUtil getAppUtil() {
        return appUtil;
    }

    protected BdbTerminologyStore getDataStore() {
        return dataStore;
    }

    protected TerminologyBuilderBI getBuilder() {
        return builder;
    }

    protected EditCoordinate getEC() throws ValidationException, IOException {
        int authorNid = TermAux.USER.getLenient().getConceptNid();
        int module = Snomed.CORE_MODULE.getLenient().getNid();
        int editPathNid = TermAux.SNOMED_CORE.getLenient().getConceptNid();

        return new EditCoordinate(authorNid, module, editPathNid);
    }

    protected ViewCoordinate getVC() throws IOException {
        return StandardViewCoordinates.getSnomedStatedLatest();
    }
}
{'fraction_non_alphanumeric': 0.09587020648967552, 'fraction_numerical': 0.0002458210422812193, 'mean_word_length': 3.998771498771499, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7152725', 'n_tokens_mistral': 1320, 'n_tokens_neox': 1292, 'n_words': 234}