org.openmrs
Class Concept

java.lang.Object
  extended by org.openmrs.BaseOpenmrsObject
      extended by org.openmrs.Concept
All Implemented Interfaces:
java.io.Serializable, Attributable<Concept>, Auditable, OpenmrsObject, Retireable
Direct Known Subclasses:
ConceptComplex, ConceptDerived, ConceptNumeric

public class Concept
extends BaseOpenmrsObject
implements Auditable, Retireable, java.io.Serializable, Attributable<Concept>

A Concept object can represent either a question or an answer to a data point. That data point is usually an Obs.

A Concept can have multiple names and multiple descriptions within one locale and across multiple locales.

To save a Concept to the database, first build up the Concept object in java, then pass that object to the ConceptService.

To get a Concept that is stored in the database, call a method in the ConceptService to fetch an object. To get child objects off of that Concept, further calls to the ConceptService or the database are not needed. e.g. To get the list of answers that are stored to a concept, get the concept, then call getAnswers()

See Also:
ConceptName, ConceptNameTag, ConceptDescription, ConceptAnswer, ConceptSet, ConceptMap, ConceptService, Serialized Form

Field Summary
static long serialVersionUID
           
 
Constructor Summary
Concept()
          default constructor
Concept(ConceptNumeric cn)
          Deprecated.  
Concept(java.lang.Integer conceptId)
          /** Convenience constructor with conceptid to save to setConceptId(Integer).
 
Method Summary
 void addAnswer(ConceptAnswer conceptAnswer)
          Add the given ConceptAnswer to the list of answers for this Concept
 void addConceptMapping(ConceptMap newConceptMap)
          Add the given ConceptMap object to this concept's list of concept mappings.
 void addDescription(ConceptDescription description)
          Add the given description to the list of descriptions for this Concept
 void addName(ConceptName conceptName)
          Add the given ConceptName to the list of names for this Concept
 boolean equals(java.lang.Object obj)
           
 ConceptName findNameTaggedWith(ConceptNameTag conceptNameTag)
          A convenience method to get the concept-name (if any) which has a particular tag.
 java.util.List<Concept> findPossibleValues(java.lang.String searchText)
          Search for possible values of this object using the given search string
 java.util.Collection<ConceptAnswer> getAnswers()
           
 java.util.Collection<ConceptAnswer> getAnswers(boolean includeRetired)
          If includeRetired is true, then the returned object is the actual stored list of ConceptAnswers (which may be null.)
 ConceptName getBestName(java.util.Locale locale)
          Returns the best compatible name for a locale.
 ConceptName getBestShortName(java.util.Locale locale)
          Returns the best compatible short name for a locale.
 User getChangedBy()
           
 java.util.List<ConceptName> getCompatibleNames(java.util.Locale desiredLocale)
          Returns all names from compatible locales.
 ConceptClass getConceptClass()
           
 java.lang.Integer getConceptId()
           
 java.util.Collection<ConceptMap> getConceptMappings()
           
 java.util.Collection<ConceptSet> getConceptSets()
           
 User getCreator()
           
 ConceptDatatype getDatatype()
           
 java.util.Date getDateChanged()
           
 java.util.Date getDateCreated()
           
 java.util.Date getDateRetired()
           
 ConceptDescription getDescription()
          Finds the description of the concept using the current locale in Context.getLocale().
 ConceptDescription getDescription(java.util.Locale locale)
          Finds the description of the concept in the given locale.
 ConceptDescription getDescription(java.util.Locale locale, boolean exact)
          Returns the preferred description for a locale.
 java.util.Collection<ConceptDescription> getDescriptions()
           
 java.lang.String getDisplayString()
          Gets a descriptive String used for display purposes This is meant as an alternative to using the toString() to display this object to a user
 java.lang.Integer getId()
           
 ConceptName getName()
          Returns a name in the current User's chosen locale via Context.getLocale().
 ConceptName getName(java.util.Locale locale)
          Returns a name in the given locale.
 ConceptName getName(java.util.Locale locale, boolean exact)
          Returns a name in the given locale.
 java.util.Collection<ConceptName> getNames()
           
 java.util.Collection<ConceptName> getNames(boolean includeVoided)
           
 java.util.Collection<ConceptName> getNames(java.util.Locale locale)
          Returns all names available in a specific locale.
 java.util.List<Concept> getPossibleValues()
          Find all possible values of this object.
 ConceptName getPreferredName(java.util.Locale forLocale)
          Returns the name which is explicitly marked as preferred for a given locale.
 ConceptName getPreferredNameForCountry(java.lang.String country)
          Gets the explicitly preferred name for a country.
 ConceptName getPreferredNameInLanguage(java.lang.String language)
          Gets the explicitly preferred name in a language.
 java.lang.Boolean getRetired()
          Deprecated. Use the "proper" isRetired method.
 User getRetiredBy()
           
 java.lang.String getRetireReason()
           
 java.lang.Boolean getSet()
           
 ConceptName getShortestName(java.util.Locale locale, java.lang.Boolean exact)
          Returns the preferred short form name for a locale, or if none has been identified, the shortest name available in the locale.
 ConceptName getShortNameForCountry(java.lang.String country)
          Gets the explicitly specified short name for a country.
 ConceptName getShortNameInLanguage(java.lang.String language)
          Gets the explicitly specified short name in a language.
 ConceptName getShortNameInLocale(java.util.Locale locale)
          Gets the explicitly specified short name for a locale.
 java.util.Collection<ConceptAnswer> getSortedAnswers(java.util.Locale locale)
          TODO describe use cases
 java.util.Collection<ConceptName> getSynonyms(java.util.Locale locale)
          Gets the synonyms in the given locale.
 java.lang.String getVersion()
           
 int hashCode()
           
 boolean hasName(java.lang.String name, java.util.Locale locale)
          Checks whether this concept has the given string in any of the names in the given locale already.
 Concept hydrate(java.lang.String s)
          Deserialize the given string into a full object
 boolean isComplex()
          Child Class ConceptComplex overrides this method and returns true.
 boolean isNamed(java.lang.String name)
           
 boolean isNumeric()
          Whether this concept is numeric or not.
 java.lang.Boolean isRetired()
           
 java.lang.Boolean isSet()
          whether or not this concept is a set
 boolean removeAnswer(ConceptAnswer conceptAnswer)
          Remove the given answer from the list of answers for this Concept
 boolean removeConceptMapping(ConceptMap conceptMap)
          Remove the given ConceptMap from the list of mappings for this Concept
 boolean removeDescription(ConceptDescription description)
          Remove the given description from the list of descriptions for this Concept
 boolean removeName(ConceptName conceptName)
          Remove the given name from the list of names for this Concept
 java.lang.String serialize()
          Turns this concept into a very very simple serialized string
 void setAnswers(java.util.Collection<ConceptAnswer> answers)
          Set this Concept as having the given answers
 void setChangedBy(User changedBy)
           
 void setConceptClass(ConceptClass conceptClass)
           
 void setConceptId(java.lang.Integer conceptId)
           
 void setConceptMappings(java.util.Collection<ConceptMap> conceptMappings)
           
 void setConceptSets(java.util.Collection<ConceptSet> conceptSets)
           
 void setCreator(User creator)
           
 void setDatatype(ConceptDatatype conceptDatatype)
           
 void setDateChanged(java.util.Date dateChanged)
           
 void setDateCreated(java.util.Date dateCreated)
           
 void setDateRetired(java.util.Date dateRetired)
           
 void setDescriptions(java.util.Collection<ConceptDescription> descriptions)
          Sets the collection of descriptions for this Concept.
 void setId(java.lang.Integer id)
           
 void setNames(java.util.Collection<ConceptName> names)
           
 void setPreferredName(java.util.Locale locale, ConceptName preferredName)
          Sets the preferred name for a locale.
 void setRetired(java.lang.Boolean retired)
           
 void setRetiredBy(User retiredBy)
           
 void setRetireReason(java.lang.String retireReason)
           
 void setSet(java.lang.Boolean set)
           
 void setShortName(java.util.Locale locale, ConceptName shortName)
          Sets the short name for a locale.
 void setVersion(java.lang.String version)
           
 java.lang.String toString()
           
 
Methods inherited from class org.openmrs.BaseOpenmrsObject
getUuid, setUuid
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openmrs.OpenmrsObject
getUuid, setUuid
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

Concept

public Concept()
default constructor


Concept

public Concept(java.lang.Integer conceptId)
/** Convenience constructor with conceptid to save to setConceptId(Integer). This effectively creates a concept stub that can be used to make other calls. Because the equals(Object) and hashCode() methods rely on conceptId, this allows a stub to masquerade as a full concept as long as other objects like getAnswers() and getNames() are not needed/called.

Parameters:
conceptId - the concept id to set

Concept

public Concept(ConceptNumeric cn)
Deprecated. 

Possibly used for decapitating a ConceptNumeric (to remove the row in

Parameters:
cn -
Method Detail

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)
Expected behavior:
not fail if given obj has null conceptid, not fail if given obj is null, not fail if concept id is null, confirm two new concept objects are equal

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()
Expected behavior:
not fail if concept id is null

getAnswers

public java.util.Collection<ConceptAnswer> getAnswers()
Returns:
Returns the non-retired answers.
Expected behavior:
not return retired answers, not return null if no answers defined

getSortedAnswers

public java.util.Collection<ConceptAnswer> getSortedAnswers(java.util.Locale locale)
TODO describe use cases

Parameters:
locale -
Returns:
the answers for this concept sorted according to ConceptAnswerComparator

getAnswers

public java.util.Collection<ConceptAnswer> getAnswers(boolean includeRetired)
If includeRetired is true, then the returned object is the actual stored list of ConceptAnswers (which may be null.)

Parameters:
includeRetired - true/false whether to also include the retired answers
Returns:
Returns the answers for this Concept
Expected behavior:
return actual answers object if given includeRetired is true

setAnswers

public void setAnswers(java.util.Collection<ConceptAnswer> answers)
Set this Concept as having the given answers

Parameters:
answers - The answers to set.

addAnswer

public void addAnswer(ConceptAnswer conceptAnswer)
Add the given ConceptAnswer to the list of answers for this Concept

Parameters:
conceptAnswer -
Expected behavior:
add the ConceptAnswer to Concept, not fail if answers list is null, not fail if answers contains ConceptAnswer already

removeAnswer

public boolean removeAnswer(ConceptAnswer conceptAnswer)
Remove the given answer from the list of answers for this Concept

Parameters:
conceptAnswer - answer to remove
Returns:
true if the entity was removed, false otherwise
Expected behavior:
not fail if answers is empty, not fail if given answer does not exist in list

getChangedBy

public User getChangedBy()
Specified by:
getChangedBy in interface Auditable
Returns:
Returns the changedBy.

setChangedBy

public void setChangedBy(User changedBy)
Specified by:
setChangedBy in interface Auditable
Parameters:
changedBy - The changedBy to set.

getConceptClass

public ConceptClass getConceptClass()
Returns:
Returns the conceptClass.

setConceptClass

public void setConceptClass(ConceptClass conceptClass)
Parameters:
conceptClass - The conceptClass to set.

isSet

public java.lang.Boolean isSet()
whether or not this concept is a set


setSet

public void setSet(java.lang.Boolean set)
Parameters:
set - whether or not this concept is a set

getSet

public java.lang.Boolean getSet()

getDatatype

public ConceptDatatype getDatatype()
Returns:
Returns the conceptDatatype.

setDatatype

public void setDatatype(ConceptDatatype conceptDatatype)
Parameters:
conceptDatatype - The conceptDatatype to set.

getConceptId

public java.lang.Integer getConceptId()
Returns:
Returns the conceptId.

setConceptId

public void setConceptId(java.lang.Integer conceptId)
Parameters:
conceptId - The conceptId to set.

getCreator

public User getCreator()
Specified by:
getCreator in interface Auditable
Returns:
Returns the creator.

setCreator

public void setCreator(User creator)
Specified by:
setCreator in interface Auditable
Parameters:
creator - The creator to set.

getDateChanged

public java.util.Date getDateChanged()
Specified by:
getDateChanged in interface Auditable
Returns:
Returns the dateChanged.

setDateChanged

public void setDateChanged(java.util.Date dateChanged)
Specified by:
setDateChanged in interface Auditable
Parameters:
dateChanged - The dateChanged to set.

getDateCreated

public java.util.Date getDateCreated()
Specified by:
getDateCreated in interface Auditable
Returns:
Returns the dateCreated.

setDateCreated

public void setDateCreated(java.util.Date dateCreated)
Specified by:
setDateCreated in interface Auditable
Parameters:
dateCreated - The dateCreated to set.

setPreferredName

public void setPreferredName(java.util.Locale locale,
                             ConceptName preferredName)
Sets the preferred name for a locale. This sets tags on the concept name to indicate that it is preferred for the language and country. Also, the name is added to the concept. If the country is specified in the locale, then the language is considered to be only implied as preferred — it will only get set if there is not an existing preferred language name.

Parameters:
locale - the locale for which to set the preferred name
preferredName - name which is preferred in the locale
Expected behavior:
only allow one preferred name

getPreferredNameForCountry

public ConceptName getPreferredNameForCountry(java.lang.String country)
Gets the explicitly preferred name for a country.

Parameters:
country - ISO-3166 two letter country code
Returns:
the preferred name, or null if none has been explicitly set

getPreferredNameInLanguage

public ConceptName getPreferredNameInLanguage(java.lang.String language)
Gets the explicitly preferred name in a language.

Parameters:
language - ISO-639 two letter language code
Returns:
the preferred name, or null if none has been explicitly set

findNameTaggedWith

public ConceptName findNameTaggedWith(ConceptNameTag conceptNameTag)
A convenience method to get the concept-name (if any) which has a particular tag. This does not guarantee that the returned name is the only one with the tag.

Parameters:
conceptNameTag - the tag for which to look
Returns:
the tagged name, or null if no name has the tag

getName

public ConceptName getName(java.util.Locale locale)
Returns a name in the given locale. If a name isn't found with an exact match, a compatible locale match is returned. If no name is found matching either of those, the first name defined for this concept is returned.

Parameters:
locale - the locale to fetch for
Returns:
ConceptName attributed to the Concept in the given locale
Since:
1.5
See Also:
to get all the names for a locale,, for the preferred name (if any),, to get the best match for a locale.
Expected behavior:
get preferred fully specified country

getName

public ConceptName getName()
Returns a name in the current User's chosen locale via Context.getLocale(). If a name isn't found with an exact match, a compatible locale match is returned. If no name is found matching either of those, the first name defined for this concept is returned.

Returns:
ConceptName in the current locale or any locale if none found
Since:
1.5
See Also:
to get all the names for a locale, for the preferred name (if any), to get the best match for a locale

hasName

public boolean hasName(java.lang.String name,
                       java.util.Locale locale)
Checks whether this concept has the given string in any of the names in the given locale already.

Parameters:
name - the ConceptName.name to compare to
locale - the locale to look in (null to check all locales)
Returns:
true/false whether the name exists already

getName

public ConceptName getName(java.util.Locale locale,
                           boolean exact)
Returns a name in the given locale. If a name isn't found with an exact match, a compatible locale match is returned. If no name is found matching either of those, the first name defined for this concept is returned.

Parameters:
locale - the language and country in which the name is used
exact - true/false to return only exact locale (no default locale)
Returns:
the closest name in the given locale, or the first name
See Also:
to get all the names for a locale,, for the preferred name (if any),, to get the best match for a locale.
Expected behavior:
return exact name locale match given exact equals true, return loose match given exact equals false, return any name if no locale match given exact equals false, not fail if no names are defined, return null if no locale match and exact equals true, support plain preferred

getPreferredName

public ConceptName getPreferredName(java.util.Locale forLocale)
Returns the name which is explicitly marked as preferred for a given locale. If the country is specified in the locale, then the language of the name must match and the name must have a tag indicating that it is preferred in the locale's country. If no country is specified, then the name must have a tag indicating that it is preferred in the locale's language

Parameters:
forLocale - locale for which to return a preferred name
Returns:
preferred name for the locale, or null if none is tagged as such
Expected behavior:
support plain preferred, match to best name

getBestName

public ConceptName getBestName(java.util.Locale locale)
Returns the best compatible name for a locale. The names are ordered as "best" according to these rules:
  1. preferred name in matching country (for example, tagged as PREFERRED_UG for preferred in Uganda)
  2. preferred name in matching language (for example, tagged as PREFERRED_EN for preferred name in English)
  3. any name in matching country (for example, matching Uganda)
  4. any name in matching language (for example, matching English)
  5. first name in any matching language

Parameters:
locale - the language and country in which the name is used
Returns:
the best name possible ConceptName, never null
Expected behavior:
support plain preferred, always have a best name even if none match locale

getNames

public java.util.Collection<ConceptName> getNames(java.util.Locale locale)
Returns all names available in a specific locale.

This is recommended when managing the concept dictionary.

Parameters:
locale - locale for which names should be returned
Returns:
Collection of ConceptNames with the given locale

getCompatibleNames

public java.util.List<ConceptName> getCompatibleNames(java.util.Locale desiredLocale)
Returns all names from compatible locales. A locale is considered compatible if it is exactly the same locale, or if either locale has no country specified and the language matches.

This is recommended when presenting possible names to the use.

Parameters:
desiredLocale - locale with which the names should be compatible
Returns:
Collection of compatible names
Expected behavior:
exclude incompatible country locales, exclude incompatible language locales

getBestShortName

public ConceptName getBestShortName(java.util.Locale locale)
Returns the best compatible short name for a locale. The names are ordered as "best" according to these rules:
  1. preferred short name in matching country (for example, tagged as SHORT_UG for preferred short in Uganda)
  2. preferred short name in matching language (for example, tagged as SHORT_EN for preferred short name in English)
  3. any short name in matching country (for example, tagged as SHORT and matching the Uganda)
  4. any short name in matching language (for example, tagged as SHORT and matching the English)
  5. any name matching the locale

Parameters:
locale - the language and country in which the short name is used
Returns:
the best short name
Expected behavior:
always return a short name even if no names are tagged as short

setShortName

public void setShortName(java.util.Locale locale,
                         ConceptName shortName)
Sets the short name for a locale. This sets tags on the concept name to indicate that it is short for the language and country. Also, the name is added to the concept (if needed).

If the country is specified in the locale, then the language is considered to be only implied — it will only get set if there is not an existing short language name.

If the country is not specified in the locale, then the language is considered an explicit designation and the call is the equivalent of calling getShortNameInLanguage(String) .

Parameters:
locale - the locale for which to set the short name
shortName - name which is preferred in the locale

getShortNameForCountry

public ConceptName getShortNameForCountry(java.lang.String country)
Gets the explicitly specified short name for a country.

Parameters:
country - ISO-3166 two letter country code
Returns:
the short name, or null if none has been explicitly set

getShortNameInLanguage

public ConceptName getShortNameInLanguage(java.lang.String language)
Gets the explicitly specified short name in a language.

Parameters:
language - ISO-639 two letter language code
Returns:
the short name, or null if none has been explicitly set

getShortNameInLocale

public ConceptName getShortNameInLocale(java.util.Locale locale)
Gets the explicitly specified short name for a locale. The name returned depends on the specificity of the locale. If country is indicated, then the name must be tagged as short in that country, otherwise the name must be tagged as short in that language.

Parameters:
locale - locale for which to return a short name
Returns:
the short name, or null if none has been explicitly set

getShortestName

public ConceptName getShortestName(java.util.Locale locale,
                                   java.lang.Boolean exact)
Returns the preferred short form name for a locale, or if none has been identified, the shortest name available in the locale.

Parameters:
locale - the language and country in which the short name is used
exact - true/false to return only exact locale (no default locale)
Returns:
the appropriate short name, or null if not found

isNamed

public boolean isNamed(java.lang.String name)
Parameters:
name - A name
Returns:
whether this concept has the given name in any locale

getNames

public java.util.Collection<ConceptName> getNames()
Returns:
Returns the names.

getNames

public java.util.Collection<ConceptName> getNames(boolean includeVoided)
Parameters:
includeVoided - Include voided ConceptNames if true.
Returns:
Returns the names.

setNames

public void setNames(java.util.Collection<ConceptName> names)
Parameters:
names - The names to set.

addName

public void addName(ConceptName conceptName)
Add the given ConceptName to the list of names for this Concept

Parameters:
conceptName -

removeName

public boolean removeName(ConceptName conceptName)
Remove the given name from the list of names for this Concept

Parameters:
conceptName -
Returns:
true if the entity was removed, false otherwise

getDescription

public ConceptDescription getDescription()
Finds the description of the concept using the current locale in Context.getLocale(). Returns null if none found.

Returns:
ConceptDescription attributed to the Concept in the given locale

getDescription

public ConceptDescription getDescription(java.util.Locale locale)
Finds the description of the concept in the given locale. Returns null if none found.

Parameters:
locale -
Returns:
ConceptDescription attributed to the Concept in the given locale

getDescription

public ConceptDescription getDescription(java.util.Locale locale,
                                         boolean exact)
Returns the preferred description for a locale.

Parameters:
locale - the language and country in which the description is used
exact - true/false to return only exact locale (no default locale)
Returns:
the appropriate description, or null if not found
Expected behavior:
return match on locale exactly, return match on language only, not return match on language only if exact match exists, not return language only match for exact matches

getRetiredBy

public User getRetiredBy()
Specified by:
getRetiredBy in interface Retireable
Returns:
the retiredBy

setRetiredBy

public void setRetiredBy(User retiredBy)
Specified by:
setRetiredBy in interface Retireable
Parameters:
retiredBy - the retiredBy to set

getDateRetired

public java.util.Date getDateRetired()
Specified by:
getDateRetired in interface Retireable
Returns:
the dateRetired

setDateRetired

public void setDateRetired(java.util.Date dateRetired)
Specified by:
setDateRetired in interface Retireable
Parameters:
dateRetired - the dateRetired to set

getRetireReason

public java.lang.String getRetireReason()
Specified by:
getRetireReason in interface Retireable
Returns:
the retireReason

setRetireReason

public void setRetireReason(java.lang.String retireReason)
Specified by:
setRetireReason in interface Retireable
Parameters:
retireReason - the retireReason to set

getDescriptions

public java.util.Collection<ConceptDescription> getDescriptions()
Returns:
Returns the descriptions.

setDescriptions

public void setDescriptions(java.util.Collection<ConceptDescription> descriptions)
Sets the collection of descriptions for this Concept.

Parameters:
descriptions - the collection of descriptions

addDescription

public void addDescription(ConceptDescription description)
Add the given description to the list of descriptions for this Concept

Parameters:
description - the description to add

removeDescription

public boolean removeDescription(ConceptDescription description)
Remove the given description from the list of descriptions for this Concept

Parameters:
description - the description to remove
Returns:
true if the entity was removed, false otherwise

isRetired

public java.lang.Boolean isRetired()
Specified by:
isRetired in interface Retireable
Returns:
Returns the retired.

getRetired

public java.lang.Boolean getRetired()
Deprecated. Use the "proper" isRetired method.

This method exists to satisfy spring and hibernates slightly bung use of Boolean object getters and setters.

See Also:
isRetired()

setRetired

public void setRetired(java.lang.Boolean retired)
Specified by:
setRetired in interface Retireable
Parameters:
retired - The retired to set.

getSynonyms

public java.util.Collection<ConceptName> getSynonyms(java.util.Locale locale)
Gets the synonyms in the given locale. Returns a list of names from the same language, or an empty list if none found.

Parameters:
locale -
Returns:
Collection of ConceptNames which are synonyms for the Concept in the given locale

getVersion

public java.lang.String getVersion()
Returns:
Returns the version.

setVersion

public void setVersion(java.lang.String version)
Parameters:
version - The version to set.

getConceptSets

public java.util.Collection<ConceptSet> getConceptSets()
Returns:
Returns the conceptSets.

setConceptSets

public void setConceptSets(java.util.Collection<ConceptSet> conceptSets)
Parameters:
conceptSets - The conceptSets to set.

isNumeric

public boolean isNumeric()
Whether this concept is numeric or not. This will always return false for concept objects. ConceptNumeric.isNumeric() will then always return true.

Returns:
false

getConceptMappings

public java.util.Collection<ConceptMap> getConceptMappings()
Returns:
the conceptMappings for this concept

setConceptMappings

public void setConceptMappings(java.util.Collection<ConceptMap> conceptMappings)
Parameters:
conceptMappings - the conceptMappings to set

addConceptMapping

public void addConceptMapping(ConceptMap newConceptMap)
Add the given ConceptMap object to this concept's list of concept mappings. If there is already a corresponding ConceptMap object for this concept already, this one will not be added.

Parameters:
newConceptMap -

isComplex

public boolean isComplex()
Child Class ConceptComplex overrides this method and returns true. See ConceptComplex.isComplex(). Otherwise this method returns false.

Returns:
false
Since:
1.5

removeConceptMapping

public boolean removeConceptMapping(ConceptMap conceptMap)
Remove the given ConceptMap from the list of mappings for this Concept

Parameters:
conceptMap -
Returns:
true if the entity was removed, false otherwise

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

findPossibleValues

public java.util.List<Concept> findPossibleValues(java.lang.String searchText)
Description copied from interface: Attributable
Search for possible values of this object using the given search string

Specified by:
findPossibleValues in interface Attributable<Concept>
Parameters:
searchText - String to search on
Returns:
List of possible objects that can be assigned
See Also:
Attributable.findPossibleValues(java.lang.String)

getPossibleValues

public java.util.List<Concept> getPossibleValues()
Description copied from interface: Attributable
Find all possible values of this object. For example, if this object is a Location, the database is delved into and all Location objects should be returned

Specified by:
getPossibleValues in interface Attributable<Concept>
Returns:
List of objects that can be assigned
See Also:
Attributable.getPossibleValues()

hydrate

public Concept hydrate(java.lang.String s)
Description copied from interface: Attributable
Deserialize the given string into a full object

Specified by:
hydrate in interface Attributable<Concept>
Parameters:
s - String to deserialize
Returns:
hydrated object
See Also:
Attributable.hydrate(java.lang.String)

serialize

public java.lang.String serialize()
Turns this concept into a very very simple serialized string

Specified by:
serialize in interface Attributable<Concept>
Returns:
String representing this object (Usually an identifier or primary key)
See Also:
Attributable.serialize()

getDisplayString

public java.lang.String getDisplayString()
Description copied from interface: Attributable
Gets a descriptive String used for display purposes This is meant as an alternative to using the toString() to display this object to a user

Specified by:
getDisplayString in interface Attributable<Concept>
Returns:
String acceptable to display on a page
See Also:
Attributable.getDisplayString()

getId

public java.lang.Integer getId()
Specified by:
getId in interface OpenmrsObject
Returns:
id - The unique Identifier for the object
Since:
1.5
See Also:
OpenmrsObject.getId()

setId

public void setId(java.lang.Integer id)
Specified by:
setId in interface OpenmrsObject
Parameters:
id - - The unique Identifier for the object
Since:
1.5
See Also:
OpenmrsObject.setId(java.lang.Integer)

OpenMRS-trunk

Generated Mar 15 2010 10:02 PM. NOTE - these libraries are in active development and subject to change