/** * Convenience constructor that calls the other constructor [ArchetypeTerm(String code)] * and then adds two items to the hashmap using the keys described in parameters below. * @param code not null or empty (atNNNN or acNNNN codes depending on usage context) * @param text the String that will be stored in the item map under the key "text" * @param description the String that will be stored in the item map under the key "description" */ public ArchetypeTerm(String code, String text, String description){ this(code); addItem(TEXT, text); addItem(DESCRIPTION, description); }
/** * Term definition for a code, in a specified language. * * @param language * @param code * @return null if not found */ public ArchetypeTerm termDefinition(String language, String code) { return definition(language, code, termDefinitionMap); }
/** * Convenience method to fetch the text of the archetype term. * * @return the text of the archetype term */ public String getText() { return this.getItem(ArchetypeTerm.TEXT); }
private void checkOntologyDefinitions(List<OntologyDefinitions> defList, List<ValidationError> errors, int level) { ValidationError error = null; for (OntologyDefinitions defs : defList) { for (ArchetypeTerm term : defs.getDefinitions()) { if (hasGreaterSpecialisationLevel(term.getCode(), level)) { error = new ValidationError(ErrorType.VONSD, null, term.getCode(), level); errors.add(error); } } } }
String retrieveArchetypeTermText(String nodeId, Archetype archetype) throws Exception { String language = archetype.getOriginalLanguage().getCodeString(); ArchetypeTerm term = archetype.getOntology().termDefinition(language, nodeId); if(term == null) { throw new Exception("term of given code: " + nodeId + ", language: " + language + " not found.."); } return term.getText(); }
/** * The concept name of the archetype in language * language; corresponds to the term definition of * the concept attribute in the archetype ontology. * * @param language the language of the concept name * @return concept name in the requested language or * null if the language as a whole or the concept * in that language does not exist. */ public String getConceptName(String language) { ArchetypeTerm term = null; String conceptCode = this.getConcept(); term = this.getOntology().termDefinition(language, conceptCode); if (term == null) { return null; } return term.getItem(ArchetypeTerm.TEXT); }
final public QueryBindingItem query_binding_item() throws ParseException { String code; Token t; jj_consume_token(SYM_L_BRACKET); code = local_code_value(); jj_consume_token(SYM_R_BRACKET); jj_consume_token(SYM_EQ); jj_consume_token(SYM_LT); t = jj_consume_token(URL); jj_consume_token(SYM_GT); {if (true) return new QueryBindingItem(code, new Query(t.image));} throw new Error("Missing return statement in function"); }
/** * Return a hash code of this object * * @return hash code */ @Override public int hashCode() { return new HashCodeBuilder(21, 51) .appendSuper(super.hashCode()) .append(terms) .toHashCode(); }
/** * Convenience constructor that calls the other constructor [ArchetypeTerm(String code)] * and then adds two items to the hashmap using the keys described in parameters below. * @param code not null or empty (atNNNN or acNNNN codes depending on usage context) * @param text the String that will be stored in the item map under the key "text" * @param description the String that will be stored in the item map under the key "description" */ public ArchetypeTerm(String code, String text, String description){ this(code); addItem(TEXT, text); addItem(DESCRIPTION, description); }
final public QueryBindingItem query_binding_item() throws ParseException { String code; Token t; jj_consume_token(SYM_L_BRACKET); code = local_code_value(); jj_consume_token(SYM_R_BRACKET); jj_consume_token(SYM_EQ); jj_consume_token(SYM_LT); t = jj_consume_token(URL); jj_consume_token(SYM_GT); {if (true) return new QueryBindingItem(code, new Query(t.image));} throw new Error("Missing return statement in function"); }
/** * Constraint definition for a code, in a specified language. * * @param language * @param code * @return null if not found */ public ArchetypeTerm constraintDefinition(String language, String code) { return definition(language, code, constraintDefinitionMap); }
/** Convenience method to fetch the description of the archetype term. * * @return the description of the archetype term */ public String getDescription() { return this.getItem(ArchetypeTerm.DESCRIPTION); }
/** * Return a hash code of this object * * @return hash code */ @Override public int hashCode() { return new HashCodeBuilder(19, 49) .appendSuper(super.hashCode()) .append(query) .toHashCode(); }
/** * Constraint definition for a code, in a specified language. * * @param language * @param code * @return null if not found */ public ArchetypeTerm constraintDefinition(String language, String code) { return definition(language, code, constraintDefinitionMap); }
/** * Convenience method to fetch the text of the archetype term. * * @return the text of the archetype term */ public String getText() { return this.getItem(ArchetypeTerm.TEXT); }
/** * Return a hash code of this object * * @return hash code */ @Override public int hashCode() { return new HashCodeBuilder(21, 51) .appendSuper(super.hashCode()) .append(terms) .toHashCode(); }
/** * Term definition for a code, in a specified language. * * @param language * @param code * @return null if not found */ public ArchetypeTerm termDefinition(String language, String code) { return definition(language, code, termDefinitionMap); }
/** Convenience method to fetch the description of the archetype term. * * @return the description of the archetype term */ public String getDescription() { return this.getItem(ArchetypeTerm.DESCRIPTION); }
/** * Term definition for a code in the primary language. * * @param code * @return not null */ public ArchetypeTerm termDefinition(String code) { return definition(primaryLanguage, code, termDefinitionMap); }
/** * Term definition for a code in the primary language. * * @param code * @return not null */ public ArchetypeTerm termDefinition(String code) { return definition(primaryLanguage, code, termDefinitionMap); }