ca.infoway.messagebuilder.xml
Class Relationship

Package class diagram package Relationship
java.lang.Object
  extended by ca.infoway.messagebuilder.xml.ChoiceSupport
      extended by ca.infoway.messagebuilder.xml.Relationship
All Implemented Interfaces:
Named, NamedAndTyped, Typed, Documentable, HasDifferences

public class Relationship
extends ChoiceSupport
implements Documentable, HasDifferences, NamedAndTyped

A message part relationship (either an attribute or an association).

Fundamentally, we think of there being four types of relationships:

  1. Attributes
  2. Simple associations
  3. Choice associations
  4. Template associations

Author:
Intelliware Development

Constructor Summary
Relationship()
          Default constructor.
Relationship(String name, String type, Cardinality cardinality)
          Standard constructor.
 
Method Summary
 void addDifference(Difference difference)
           
 Cardinality getCardinality()
          Get the cardinality.
 List<Relationship> getChoices()
          Get a list of all choices.
 CodingStrength getCodingStrength()
          Get the coding strength.
 ConformanceLevel getConformance()
          Get the conformance level.
 String getDefaultValue()
          Get the default value.
 List<Difference> getDifferences()
          Records the differences between relationships of different release versions during regen.
 Documentation getDocumentation()
          Get the documentation.
 DomainSource getDomainSource()
          Get the vocabulary source.
 String getDomainType()
          The domain type.
 String getFixedValue()
          Get the fixed value.
 Integer getLength()
          Get the maximum string length.
 String getName()
          Get the relationship name.
 String getParentType()
          The type containing this relationship
 int getSortOrder()
          Get the sort order.
 String getTemplateParameterName()
          Get the template parameter name.
 String getType()
          Get the relationship type.
 UpdateMode getUpdateMode()
          Gets the update mode information that may be used for this element.
 boolean hasFixedValue()
          Checks if has fixed value.
 boolean isAssociation()
          Get a flag indicating whether or not the relationship is an association.
 boolean isAttribute()
          Get a flag indicating whether or not the relationship is an attribute.
 boolean isChoice()
          Get a flag indicating whether or not the relationship is a choice association.
 boolean isCodedType()
          Get a flag indicating whether or not the relationship is a coded type.
 boolean isFixed()
          Get a flag indicating whether or not the relationship is a fixed value and is mandatory.
 boolean isMandatory()
          Get a flag indicating whether or not the relationship is mandatory.
 boolean isPopulated()
          Get a flag indicating whether or not the relationship is populated.
 boolean isStructural()
          Get the structural flag.
 boolean isTemplateRelationship()
          Get a flag indicating whether or not the relationship is a template relationship.
 void setCardinality(Cardinality cardinality)
          Set the cardinality.
 void setCodingStrength(CodingStrength codingStrength)
          Set the codeing strength.
 void setConformance(ConformanceLevel conformance)
          Set the conformance level.
 void setDefaultValue(String defaultValue)
          Set the default value.
 void setDifferences(List<Difference> differences)
           
 void setDocumentation(Documentation documentation)
          Set the documentation.
 void setDomainSource(DomainSource domainSource)
          Set the vocabulary source.
 void setDomainType(String domainType)
          Set the domain type.
 void setFixedValue(String fixedValue)
          Set the fixed value.
 void setLength(Integer length)
          Set the maximum string length.
 void setName(String name)
          Set the name.
 void setParentType(String parentType)
          The type containing this relationship
 void setSortOrder(int sortOrder)
          Set the sort order.
 void setStructural(boolean structural)
          Set the structural flag.
 void setTemplateParameterName(String templateParameterName)
          Set the template parameter name.
 void setType(String type)
          Set the type.
 void setUpdateMode(UpdateMode updateMode)
          Gets the update mode information that may be used for this element.
 String toString()
          Standard toString method.
 
Methods inherited from class ca.infoway.messagebuilder.xml.ChoiceSupport
choiceOptionNamePredicate, choiceOptionTypePredicate, findChoiceOption
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Relationship

public Relationship()

Default constructor.


Relationship

public Relationship(String name,
                    String type,
                    Cardinality cardinality)

Standard constructor.

Parameters:
name - - the relationship name
type - - the relationship type
cardinality - - the cardinality.
Method Detail

getName

public String getName()

Get the relationship name.

Specified by:
getName in interface Named
Returns:
the name

setName

public void setName(String name)

Set the name.

Parameters:
name - - the new value.

getType

public String getType()

Get the relationship type.

Typical types for an attribute might be "II.OID", "LIST<TS.FULLDATE>" or "ST".

Typical types for an association might be "PRPA_MT101103CA.PatientBirthTime". This property is blank if the relationship represents a template relationship.

Specified by:
getType in interface Typed
Returns:
the type

setType

public void setType(String type)

Set the type.

Parameters:
type - - the new value

isStructural

public boolean isStructural()

Get the structural flag.

Returns:
- the structural flag

setStructural

public void setStructural(boolean structural)

Set the structural flag.

Parameters:
structural - - the new value

getDomainType

public String getDomainType()

The domain type. If a relationship is an attribute and the type is a coded type (e.g. "CD"), then the domain type represents the domain information (e.g. "ProcessingMode").

Returns:
the domain type.

setDomainType

public void setDomainType(String domainType)

Set the domain type.

Parameters:
domainType - - the new value

getConformance

public ConformanceLevel getConformance()

Get the conformance level.

Returns:
the conformance level.

setConformance

public void setConformance(ConformanceLevel conformance)

Set the conformance level.

Parameters:
conformance - the conformance level.

getCardinality

public Cardinality getCardinality()

Get the cardinality.

Returns:
the cardinality

setCardinality

public void setCardinality(Cardinality cardinality)

Set the cardinality.

Parameters:
cardinality - - the new value

getSortOrder

public int getSortOrder()

Get the sort order. The sort order represents the order that the XML elements appear in.

Returns:
- the sort order

setSortOrder

public void setSortOrder(int sortOrder)

Set the sort order.

Parameters:
sortOrder - - the new value

getFixedValue

public String getFixedValue()

Get the fixed value. Only attributes can have fixed values. Typically, fixed values are either code values (e.g. classCode="SBJ") or booleans ("true" or "false").

Returns:
- the string representation of the fixed value

hasFixedValue

public boolean hasFixedValue()

Checks if has fixed value. Only attributes can have fixed values. Typically, fixed values are either code values (e.g. classCode="SBJ") or booleans ("true" or "false").

Returns:
- whether this relationship has a fixed value

setFixedValue

public void setFixedValue(String fixedValue)

Set the fixed value.

Parameters:
fixedValue - - the new value

getDocumentation

public Documentation getDocumentation()

Get the documentation.

Specified by:
getDocumentation in interface Documentable
Returns:
the documentation.

setDocumentation

public void setDocumentation(Documentation documentation)

Set the documentation.

Specified by:
setDocumentation in interface Documentable
Parameters:
documentation - - the new value

isAttribute

public boolean isAttribute()

Get a flag indicating whether or not the relationship is an attribute.

Returns:
true if the relationship is an attribute; false otherwise.

isChoice

public boolean isChoice()

Get a flag indicating whether or not the relationship is a choice association.

Returns:
true if the relationship is a choice association; false otherwise

isFixed

public boolean isFixed()

Get a flag indicating whether or not the relationship is a fixed value and is mandatory.

Returns:
true if the relationship has a fixed value and is mandatory; false otherwise

isAssociation

public boolean isAssociation()

Get a flag indicating whether or not the relationship is an association.

Returns:
true if the relationship is an association; false otherwise.

isMandatory

public boolean isMandatory()

Get a flag indicating whether or not the relationship is mandatory.

Returns:
true if the relationship is mandatory; false otherwise.

isPopulated

public boolean isPopulated()

Get a flag indicating whether or not the relationship is populated.

Returns:
true if the relationship is populated; false otherwise.

isCodedType

public boolean isCodedType()

Get a flag indicating whether or not the relationship is a coded type.

Returns:
true if the relationship is a coded type; false otherwise.

isTemplateRelationship

public boolean isTemplateRelationship()

Get a flag indicating whether or not the relationship is a template relationship.

The implementation of this method is based on knowledge that sometimes message sets have been complete. In a perfect world, a relationship would be a template relationship if there is a template parameter name. In fact, some XSD-generated message set files are missing the type of the choice.

Returns:
true if the relationship is a template relationship; false otherwise.

getChoices

public List<Relationship> getChoices()

Get a list of all choices.

Specified by:
getChoices in class ChoiceSupport
Returns:
the list of choice relationships

getTemplateParameterName

public String getTemplateParameterName()

Get the template parameter name. Only template associations should have a template parameter name.

Returns:
the template parameter name.

setTemplateParameterName

public void setTemplateParameterName(String templateParameterName)

Set the template parameter name.

Parameters:
templateParameterName - - the new value.

getLength

public Integer getLength()

Get the maximum string length.

Returns:
the length

setLength

public void setLength(Integer length)

Set the maximum string length.

Parameters:
length - - the new value

getCodingStrength

public CodingStrength getCodingStrength()

Get the coding strength.

Returns:
the coding strength

setCodingStrength

public void setCodingStrength(CodingStrength codingStrength)

Set the codeing strength.

Parameters:
codingStrength - - the new value.

getDefaultValue

public String getDefaultValue()

Get the default value. Typically, only boolean fields have default values.

Returns:
- the default value.

setDefaultValue

public void setDefaultValue(String defaultValue)

Set the default value.

Parameters:
defaultValue - - the new value

toString

public String toString()

Standard toString method.

Overrides:
toString in class Object
Returns:
a debug string.

getDifferences

public List<Difference> getDifferences()
Records the differences between relationships of different release versions during regen.

Specified by:
getDifferences in interface HasDifferences
Returns:
list of differences

setDifferences

public void setDifferences(List<Difference> differences)

addDifference

public void addDifference(Difference difference)
Specified by:
addDifference in interface HasDifferences

getDomainSource

public DomainSource getDomainSource()

Get the vocabulary source.

Returns:
the vocabulary source

setDomainSource

public void setDomainSource(DomainSource domainSource)

Set the vocabulary source.

Parameters:
vocabulary - source - the new value.

getUpdateMode

public UpdateMode getUpdateMode()

Gets the update mode information that may be used for this element.

Returns:
updateMode;

setUpdateMode

public void setUpdateMode(UpdateMode updateMode)

Gets the update mode information that may be used for this element.

Parameters:
updateMode -

getParentType

public String getParentType()
The type containing this relationship

Returns:
parent type

setParentType

public void setParentType(String parentType)
The type containing this relationship

Parameters:
parentType -


Copyright © 2013. All Rights Reserved.