org.openmrs
Class ConceptName

java.lang.Object
  extended by org.openmrs.BaseOpenmrsObject
      extended by org.openmrs.ConceptName
All Implemented Interfaces:
java.io.Serializable, Auditable, OpenmrsObject, Voidable

public class ConceptName
extends BaseOpenmrsObject
implements Auditable, Voidable, java.io.Serializable

ConceptName is the real world term used to express a Concept within the idiom of a particular locale.

See Also:
Serialized Form

Field Summary
static long serialVersionUID
           
 
Constructor Summary
ConceptName()
          default constructor
ConceptName(java.lang.Integer conceptNameId)
          Convenience constructor to create a ConceptName object by primary key
ConceptName(java.lang.String name, java.util.Locale locale)
           
ConceptName(java.lang.String name, java.lang.String shortName, java.lang.String description, java.util.Locale locale)
          Deprecated.  
 
Method Summary
 void addTag(ConceptNameTag tag)
          Attaches a tag to the concept name.
 void addTag(java.lang.String tag)
          Adds a tag to the concept name.
 void addTag(java.lang.String tag, java.lang.String description)
          Adds a tag to the concept name.
 boolean equals(java.lang.Object obj)
           
 User getChangedBy()
          Not currently used.
 Concept getConcept()
           
 java.lang.Integer getConceptNameId()
           
 ConceptNameType getConceptNameType()
           
 User getCreator()
           
 java.util.Date getDateChanged()
          Not currently used.
 java.util.Date getDateCreated()
           
 java.util.Date getDateVoided()
          Returns the Date this ConceptName was voided.
 java.lang.String getDescription()
          Deprecated.  
 java.lang.Integer getId()
           
 java.util.Locale getLocale()
           
 java.lang.Boolean getLocalePreferred()
          Getter to be used by spring, developers should use isLocalePreferred()
 java.lang.String getName()
           
 java.lang.String getShortestName()
          Deprecated. Use Concept.getShortestName(Locale, Boolean) instead.
 java.lang.String getShortName()
          Deprecated.  
 java.util.Collection<ConceptNameTag> getTags()
          Returns the tags which have been attached to this ConceptName.
 java.lang.Boolean getVoided()
          Returns whether the ConceptName has been voided.
 User getVoidedBy()
          Returns the User who voided this ConceptName.
 java.lang.String getVoidReason()
          Returns the reason this ConceptName was voided.
 int hashCode()
           
 java.lang.Boolean hasTag(ConceptNameTag tagToFind)
          Checks whether the name has a particular tag.
 java.lang.Boolean hasTag(java.lang.String tagToFind)
          Checks whether the name has a particular tag.
 java.lang.Boolean isFullySpecifiedName()
          Checks whether the concept name is explicitly marked as fully specified
 java.lang.Boolean isIndexTerm()
          Convenience method for checking whether this is an index Term.
 java.lang.Boolean isIndexTermInLocale(java.util.Locale locale)
          Convenience method for determining whether this is an index Term for a given locale.
 java.lang.Boolean isLocalePreferred()
          Getter for localePreferred
 java.lang.Boolean isPreferred()
          Checks whether the name is explicitly marked as preferred for any locale.
 java.lang.Boolean isPreferredForLocale(java.util.Locale locale)
          Checks whether the name is explicitly marked as preferred for the given locale
 java.lang.Boolean isPreferredInCountry(java.lang.String country)
          Checks whether the name is explicitly marked as preferred in a locale with a matching country code E.g 'fr_RW' and 'en_RW' for country RW
 java.lang.Boolean isPreferredInLanguage(java.lang.String language)
          Checks whether the name is explicitly marked as preferred in a locale with a matching language.
 java.lang.Boolean isPreferredShortInCountry(java.lang.String country)
          Deprecated. since version 1.7
 java.lang.Boolean isPreferredShortInLanguage(java.lang.String language)
          Deprecated. as of version 1.7
 java.lang.Boolean isShort()
          Convenience method for determining whether this is a short name.
 java.lang.Boolean isSynonym()
          Convenience method for checking whether this is a a synonym.
 java.lang.Boolean isSynonymInLocale(java.util.Locale locale)
          Convenience method for determining whether this is a synonym in a given locale.
 java.lang.Boolean isVoided()
          Returns whether the ConceptName has been voided.
 void removeTag(ConceptNameTag tag)
          Removes a tag from the concept name.
 void setChangedBy(User changedBy)
          Not currently used.
 void setConcept(Concept concept)
           
 void setConceptNameId(java.lang.Integer conceptNameId)
           
 void setConceptNameType(ConceptNameType conceptNameType)
           
 void setCreator(User creator)
           
 void setDateChanged(java.util.Date dateChanged)
          Not currently used.
 void setDateCreated(java.util.Date dateCreated)
           
 void setDateVoided(java.util.Date dateVoided)
          Sets the Data this ConceptName was voided.
 void setId(java.lang.Integer id)
           
 void setLocale(java.util.Locale locale)
           
 void setLocalePreferred(java.lang.Boolean localePreferred)
           
 void setName(java.lang.String name)
           
 void setTags(java.util.Collection<ConceptNameTag> tags)
          Set the tags which are attached to this ConceptName.
 void setVoided(java.lang.Boolean voided)
          Sets the voided status of this ConceptName.
 void setVoidedBy(User voidedBy)
          Sets the User who voided this ConceptName.
 void setVoidReason(java.lang.String voidReason)
          Sets the reason this ConceptName was voided.
 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

ConceptName

public ConceptName()
default constructor


ConceptName

public ConceptName(java.lang.Integer conceptNameId)
Convenience constructor to create a ConceptName object by primary key

Parameters:
conceptNameId -

ConceptName

public ConceptName(java.lang.String name,
                   java.util.Locale locale)

ConceptName

@Deprecated
public ConceptName(java.lang.String name,
                              java.lang.String shortName,
                              java.lang.String description,
                              java.util.Locale locale)
Deprecated. 

Short name and description are no longer attributes of ConceptName.

Parameters:
name -
shortName -
description -
locale -
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:
compare on conceptNameId if non null, not return true with different objects and null ids, default to object equality

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

getShortestName

@Deprecated
public java.lang.String getShortestName()
Deprecated. Use Concept.getShortestName(Locale, Boolean) instead.

Returns:
Returns the appropriate short name

getConceptNameId

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

setConceptNameId

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

getConcept

public Concept getConcept()

setConcept

public void setConcept(Concept concept)

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getLocale

public java.util.Locale getLocale()

setLocale

public void setLocale(java.util.Locale locale)

getShortName

@Deprecated
public java.lang.String getShortName()
Deprecated. 

Returns:
Returns the shortName.

getDescription

@Deprecated
public java.lang.String getDescription()
Deprecated. 

Returns:
Returns the description.

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.

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.

isVoided

public java.lang.Boolean isVoided()
Returns whether the ConceptName has been voided.

Specified by:
isVoided in interface Voidable
Returns:
true if the ConceptName has been voided, false otherwise.

getVoided

public java.lang.Boolean getVoided()
Returns whether the ConceptName has been voided.

Returns:
true if the ConceptName has been voided, false otherwise.

setVoided

public void setVoided(java.lang.Boolean voided)
Sets the voided status of this ConceptName.

Specified by:
setVoided in interface Voidable
Parameters:
voided - the voided status to set.

getVoidedBy

public User getVoidedBy()
Returns the User who voided this ConceptName.

Specified by:
getVoidedBy in interface Voidable
Returns:
the User who voided this ConceptName, or null if not set

setVoidedBy

public void setVoidedBy(User voidedBy)
Sets the User who voided this ConceptName.

Specified by:
setVoidedBy in interface Voidable
Parameters:
voidedBy - the user who voided this ConceptName.

getDateVoided

public java.util.Date getDateVoided()
Returns the Date this ConceptName was voided.

Specified by:
getDateVoided in interface Voidable
Returns:
the Date this ConceptName was voided.

setDateVoided

public void setDateVoided(java.util.Date dateVoided)
Sets the Data this ConceptName was voided.

Specified by:
setDateVoided in interface Voidable
Parameters:
dateVoided - the date the ConceptName was voided.

getVoidReason

public java.lang.String getVoidReason()
Returns the reason this ConceptName was voided.

Specified by:
getVoidReason in interface Voidable
Returns:
the reason this ConceptName was voided

setVoidReason

public void setVoidReason(java.lang.String voidReason)
Sets the reason this ConceptName was voided.

Specified by:
setVoidReason in interface Voidable
Parameters:
voidReason - the reason this ConceptName was voided

getTags

public java.util.Collection<ConceptNameTag> getTags()
Returns the tags which have been attached to this ConceptName.

Returns:
the tags.

setTags

public void setTags(java.util.Collection<ConceptNameTag> tags)
Set the tags which are attached to this ConceptName.

Parameters:
tags - the tags to set.
See Also:
Concept.setPreferredName(ConceptName), Concept.setFullySpecifiedName(ConceptName), Concept.setShortName(ConceptName)

getConceptNameType

public ConceptNameType getConceptNameType()
Returns:
the conceptNameType

setConceptNameType

public void setConceptNameType(ConceptNameType conceptNameType)
Parameters:
conceptNameType - the conceptNameType to set

isLocalePreferred

public java.lang.Boolean isLocalePreferred()
Getter for localePreferred

Returns:
localPreferred

getLocalePreferred

public java.lang.Boolean getLocalePreferred()
Getter to be used by spring, developers should use isLocalePreferred()

Returns:
true if it is the localePreferred name otherwise false

setLocalePreferred

public void setLocalePreferred(java.lang.Boolean localePreferred)
Parameters:
localePreferred - the localePreferred to set

addTag

public void addTag(java.lang.String tag)
Adds a tag to the concept name. If the tag is new (has no existing occurrences) a new ConceptNameTag will be created with a blank description.

Parameters:
tag - human-readable text string for the tag
See Also:
Concept.setPreferredName(ConceptName), Concept.setFullySpecifiedName(ConceptName), Concept.setShortName(ConceptName)

addTag

public void addTag(java.lang.String tag,
                   java.lang.String description)
Adds a tag to the concept name. If the tag is new (has no existing occurrences) a new ConceptNameTag will be created with the given description.

Parameters:
tag - human-readable text string for the tag
description - description of the tag's purpose
See Also:
Concept.setPreferredName(ConceptName), Concept.setFullySpecifiedName(ConceptName), Concept.setShortName(ConceptName)

addTag

public void addTag(ConceptNameTag tag)
Attaches a tag to the concept name.

Parameters:
tag - the tag to add
See Also:
Concept.setPreferredName(ConceptName), Concept.setFullySpecifiedName(ConceptName), Concept.setShortName(ConceptName)

removeTag

public void removeTag(ConceptNameTag tag)
Removes a tag from the concept name.

Parameters:
tag - the tag to remove
See Also:
Concept.setPreferredName(ConceptName), Concept.setFullySpecifiedName(ConceptName), Concept.setShortName(ConceptName)

hasTag

public java.lang.Boolean hasTag(ConceptNameTag tagToFind)
Checks whether the name has a particular tag.

Parameters:
tagToFind - the tag for which to check
Returns:
true if the tags include the specified tag, false otherwise
See Also:
isPreferred(), isFullySpecifiedName(), isIndexTerm(), isSynonym(), isShort()

hasTag

public java.lang.Boolean hasTag(java.lang.String tagToFind)
Checks whether the name has a particular tag.

Parameters:
tagToFind - the string of the tag for which to check
Returns:
true if the tags include the specified tag, false otherwise
See Also:
isPreferred(), isFullySpecifiedName(), isIndexTerm(), isSynonym(), isShort()

isPreferredInLanguage

public java.lang.Boolean isPreferredInLanguage(java.lang.String language)
Checks whether the name is explicitly marked as preferred in a locale with a matching language. E.g 'en_US' and 'en_UK' for language en

Parameters:
language - ISO 639 2-letter code for a language
Returns:
true if the name is preferred in a locale with a matching language code, otherwise false
See Also:
#isPreferredForLocale(Locale)}

isPreferredInCountry

public java.lang.Boolean isPreferredInCountry(java.lang.String country)
Checks whether the name is explicitly marked as preferred in a locale with a matching country code E.g 'fr_RW' and 'en_RW' for country RW

Parameters:
country - ISO 3166 2-letter code for a country
Returns:
true if the name is preferred in a locale with a matching country code, otherwise false
See Also:
#isPreferredForLocale(Locale)}

isPreferred

public java.lang.Boolean isPreferred()
Checks whether the name is explicitly marked as preferred for any locale. Note that this method is different from isPreferredForLocale(Locale) in that it checks if the given name is marked as preferred irrespective of the locale in which it is preferred.

See Also:
#isPreferredForLocale(Locale)}

isPreferredForLocale

public java.lang.Boolean isPreferredForLocale(java.util.Locale locale)
Checks whether the name is explicitly marked as preferred for the given locale

Parameters:
locale - the locale in which the name is preferred
Returns:
true if the name is marked as preferred for the given locale otherwise false.

isFullySpecifiedName

public java.lang.Boolean isFullySpecifiedName()
Checks whether the concept name is explicitly marked as fully specified

Returns:
true if the name is marked as 'fully specified' otherwise false
Since:
Version 1.7

isShort

public java.lang.Boolean isShort()
Convenience method for determining whether this is a short name.

Returns:
true if the name is marked as a short name, otherwise false

isIndexTerm

public java.lang.Boolean isIndexTerm()
Convenience method for checking whether this is an index Term.

Returns:
true if the name is marked as an index term, otherwise false
Since:
Version 1.7

isIndexTermInLocale

public java.lang.Boolean isIndexTermInLocale(java.util.Locale locale)
Convenience method for determining whether this is an index Term for a given locale.

Parameters:
locale - The locale in which this concept name should belong as an index term
Returns:
true if the name is marked as an index term, otherwise false

isSynonymInLocale

public java.lang.Boolean isSynonymInLocale(java.util.Locale locale)
Convenience method for determining whether this is a synonym in a given locale.

Parameters:
locale - The locale in which this synonym should belong
Returns:
true if the concept name is marked as a synonym in the given locale, otherwise false

isSynonym

public java.lang.Boolean isSynonym()
Convenience method for checking whether this is a a synonym.

Returns:
true if the name is tagged as a synonym, false otherwise
Since:
Version 1.7

isPreferredShortInLanguage

@Deprecated
public java.lang.Boolean isPreferredShortInLanguage(java.lang.String language)
Deprecated. as of version 1.7

Checks if this conceptName is a short name in a locale with a matching language

Parameters:
language - ISO 639 2-letter code for a language
Returns:
true if the name is a short name in a locale with a matching language code, otherwise false
See Also:
Concept.getShortNameInLocale(Locale), Concept.getShortestName(Locale, Boolean)

isPreferredShortInCountry

@Deprecated
public java.lang.Boolean isPreferredShortInCountry(java.lang.String country)
Deprecated. since version 1.7

Checks if this conceptName is a short name in a locale with a matching country

Parameters:
country - ISO 639 2-letter code for a country
Returns:
true if the name is a short name in a locale with a matching country code, otherwise false
See Also:
Concept.getShortNameInLocale(Locale), Concept.getShortestName(Locale, Boolean)

toString

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

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)

getChangedBy

public User getChangedBy()
Not currently used. Always returns null.

Specified by:
getChangedBy in interface Auditable
Returns:
User - the user who last changed the object
See Also:
Auditable.getChangedBy()

getDateChanged

public java.util.Date getDateChanged()
Not currently used. Always returns null.

Specified by:
getDateChanged in interface Auditable
Returns:
Date - the date the object was last changed
See Also:
Auditable.getDateChanged()

setChangedBy

public void setChangedBy(User changedBy)
Not currently used.

Specified by:
setChangedBy in interface Auditable
Parameters:
changedBy - - the user who last changed the object
See Also:
Auditable.setChangedBy(org.openmrs.User)

setDateChanged

public void setDateChanged(java.util.Date dateChanged)
Not currently used.

Specified by:
setDateChanged in interface Auditable
Parameters:
dateChanged - - the date the object was last changed
See Also:
Auditable.setDateChanged(java.util.Date)

OpenMRS-1.7.x

Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change