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);
}
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);
}
Aggregations