/** * Modify this function to add more version types. * * @return Map of all the version types. Each entry becomes an object in the patient record. */ public Map<String, String> getOntologiesVersions() { Map<String, String> result = new HashMap<>(); for (Entry<String, Vocabulary> ontology : this.ontologies.entrySet()) { String version = ontology.getValue().getVersion(); if (StringUtils.isNotBlank(version)) { result.put(ontology.getKey(), version); } } return result; } }
final JSONObject responseMeta = new JSONObject().put(VERSION, vocabulary.getVersion()); result = Response.ok(responseMeta, MediaType.APPLICATION_JSON_TYPE).build(); } else if (reindexStatus == 1) {
@Override public org.phenotips.vocabularies.rest.model.Vocabulary createVocabularyRepresentation(Vocabulary vocabulary) { org.phenotips.vocabularies.rest.model.Vocabulary result = new org.phenotips.vocabularies.rest.model.Vocabulary(); result .withIdentifier(vocabulary.getIdentifier()) .withName(vocabulary.getName()) .withAliases(vocabulary.getAliases()) .withSize(vocabulary.size()) .withVersion(vocabulary.getVersion()); try { result.withDefaultSourceLocation(vocabulary.getDefaultSourceLocation()); } catch (UnsupportedOperationException e) { // Don't do anything and leave source empty } return result; }
@Override public org.phenotips.vocabularies.rest.model.Vocabulary createVocabularyRepresentation(Vocabulary vocabulary) { org.phenotips.vocabularies.rest.model.Vocabulary result = new org.phenotips.vocabularies.rest.model.Vocabulary(); result .withIdentifier(vocabulary.getIdentifier()) .withName(vocabulary.getName()) .withAliases(vocabulary.getAliases()) .withSize(vocabulary.size()) .withVersion(vocabulary.getVersion()); try { result.withDefaultSourceLocation(vocabulary.getDefaultSourceLocation()); } catch (UnsupportedOperationException e) { // Don't do anything and leave source empty } return result; }