Search in sources :

Example 1 with GitHubPopup

use of org.monarchinitiative.loinc2hpo.gui.GitHubPopup in project loinc2hpo by monarch-initiative.

the class AnnotateTabController method suggestNewChildTerm.

@FXML
private void suggestNewChildTerm(ActionEvent e) {
    e.consume();
    initializeGitHubLabelsIfNecessary();
    LoincEntry loincEntrySelected = loincTableView.getSelectionModel().getSelectedItem();
    if (loincEntrySelected == null) {
        logger.error("Select a loinc code before making a suggestion");
        PopUps.showInfoMessage("Please select a loinc code before creating GitHub issue", "Error: No HPO Term selected");
        return;
    }
    loincIdSelected = loincEntrySelected.getLOINC_Number();
    logger.info("Selected loinc to create github issue for: " + loincIdSelected);
    HPO_Class_Found hpoSelected = (HPO_Class_Found) hpoListView.getSelectionModel().getSelectedItem();
    if (hpoSelected == null) {
        HPO_TreeView hpoSelectedInTree = treeView.getSelectionModel().getSelectedItem().getValue();
        hpoSelected = hpoSelectedInTree.hpo_class_found;
    }
    if (hpoSelected == null) {
        logger.error("Select a hpo term before making a suggestion");
        PopUps.showInfoMessage("Please select a hpo term before creating GitHub issue", "Error: No HPO Term selected");
        return;
    }
    HpoTerm hpoTerm = model.getTermMap().get(hpoSelected.getLabel());
    GitHubPopup popup = new GitHubPopup(loincEntrySelected, hpoTerm, true);
    initializeGitHubLabelsIfNecessary();
    popup.setLabels(model.getGithublabels());
    popup.setupGithubUsernamePassword(githubUsername, githubPassword);
    popup.setBiocuratorId(model.getBiocuratorID());
    logger.debug("get biocurator id from model: " + model.getBiocuratorID());
    popup.displayWindow(Main.getPrimarystage());
    String githubissue = popup.retrieveGitHubIssue();
    if (githubissue == null) {
        logger.trace("got back null github issue");
        return;
    }
    List<String> labels = popup.getGitHubLabels();
    // String title = String.format("NTR for Loinc %s:  \"%s\"", loincIdSelected, popup.retrieveSuggestedTerm());
    String title = String.format("Loinc %s:  \"%s\"", loincIdSelected, loincEntrySelected.getLongName());
    postGitHubIssue(githubissue, title, popup.getGitHubUserName(), popup.getGitHubPassWord(), labels);
}
Also used : HPO_Class_Found(org.monarchinitiative.loinc2hpo.util.HPO_Class_Found) HpoTerm(com.github.phenomics.ontolib.formats.hpo.HpoTerm) GitHubPopup(org.monarchinitiative.loinc2hpo.gui.GitHubPopup) FXML(javafx.fxml.FXML)

Example 2 with GitHubPopup

use of org.monarchinitiative.loinc2hpo.gui.GitHubPopup in project loinc2hpo by monarch-initiative.

the class AnnotateTabController method suggestNewTerm.

@FXML
private void suggestNewTerm(ActionEvent e) {
    e.consume();
    initializeGitHubLabelsIfNecessary();
    LoincEntry loincEntrySelected = loincTableView.getSelectionModel().getSelectedItem();
    if (loincEntrySelected == null) {
        logger.error("Select a loinc code before making a suggestion");
        PopUps.showInfoMessage("Please select a loinc code before creating GitHub issue", "Error: No HPO Term selected");
        return;
    }
    loincIdSelected = loincEntrySelected.getLOINC_Number();
    logger.info("Selected loinc to create github issue for: " + loincIdSelected);
    GitHubPopup popup = new GitHubPopup(loincEntrySelected);
    initializeGitHubLabelsIfNecessary();
    popup.setLabels(model.getGithublabels());
    popup.setupGithubUsernamePassword(githubUsername, githubPassword);
    popup.setBiocuratorId(model.getBiocuratorID());
    logger.debug("get biocurator id from model: " + model.getBiocuratorID());
    popup.displayWindow(Main.getPrimarystage());
    String githubissue = popup.retrieveGitHubIssue();
    if (githubissue == null) {
        logger.trace("got back null github issue");
        return;
    }
    // String label = popup.getGitHubLabel();
    List<String> labels = popup.getGitHubLabels();
    // String title = String.format("NTR for Loinc %s:  \"%s\"", loincIdSelected, popup.retrieveSuggestedTerm());
    String title = String.format("Loinc %s:  \"%s\"", loincIdSelected, loincEntrySelected.getLongName());
    postGitHubIssue(githubissue, title, popup.getGitHubUserName(), popup.getGitHubPassWord(), labels);
}
Also used : GitHubPopup(org.monarchinitiative.loinc2hpo.gui.GitHubPopup) FXML(javafx.fxml.FXML)

Aggregations

FXML (javafx.fxml.FXML)2 GitHubPopup (org.monarchinitiative.loinc2hpo.gui.GitHubPopup)2 HpoTerm (com.github.phenomics.ontolib.formats.hpo.HpoTerm)1 HPO_Class_Found (org.monarchinitiative.loinc2hpo.util.HPO_Class_Found)1