public class CP extends CompositeDataType
This data type is often used to define a repeating field within a given segment.
Represents an HL7 CP data type. This data type has the following attributes:
1. Price (MO)Required
2. Price Type (ID)Optional
3. From Value (NM)Optional
4. To Value (NM)Optional
5. Range Units (CWE)Conditional
6. Range Type (ID)Optional
This class provides accessors & mutators for the elements mentioned above. This class override the equal method, to check whether some other object is "equal to" this one.
User can also create Data Type through DataElementFactory
| Constructor and Description |
|---|
CP()
Default Constructor for CP
|
CP(int iComponentType,
IDataTypeMap objIDataTypeMap)
Constructor for CP class which takes two arguments and
sets the value in the respective member variable.
|
CP(int iComponentType,
int iMinLength,
int iMaxLength,
java.lang.String strCLength,
IDataTypeMap objIDataTypeMap)
Constructor for CP class which takes five arguments and
sets the value in the respective member variable.
|
CP(int iComponentType,
int iMinLength,
int iMaxLength,
java.lang.String strCLength,
int ITableNo,
IDataTypeMap objIDataTypeMap)
Constructor for CP class which takes six arguments and
sets the value in the respective member variable.
|
CP(int iMinLength,
int iMaxLength,
java.lang.String strCLength,
int iComponentType)
Constructor for CP class which takes four arguments and
sets the value in the respective member variable.
|
CP(int iMinLength,
int iMaxLength,
java.lang.String strCLength,
int iTableNo,
int iComponentType)
Constructor for CP class which takes five arguments and
sets the value in the respective member variable.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object objObject)
This method checks the equality of Object.
|
NM |
getFromValue()
Returns From Value
|
MO |
getPrice()
Returns Price
|
ID |
getPriceType()
Returns Price Type
|
ID |
getRangeType()
Returns Range Type
|
CWE |
getRangeUnits()
Returns Range Units
|
NM |
getToValue()
Returns To Value
|
void |
setFromValue(NM objNM)
Sets the From Value.
|
void |
setFromValue(java.lang.String strFromValue)
Sets the From Value.
|
void |
setPrice(MO objPrice)
Sets the Price
|
void |
setPriceType(ID objID)
Sets the Price Type.
|
void |
setPriceType(java.lang.String strPriceType)
Sets the Price Type.
|
void |
setRangeType(ID objID)
Sets the Range Type.
|
void |
setRangeType(java.lang.String strRangeType)
Sets the Range Type.
|
void |
setRangeUnits(CWE objRangeUnits)
Sets the Range Units.
|
void |
setToValue(NM objNM)
Sets the To Value.
|
void |
setToValue(java.lang.String strToValue)
Sets the To Value.
|
boolean |
validate()
The Method validates the Input value,and if validated properly then returns true.
|
copy, dumpDataType, getAttributes, getDataTypeName, getLength, getValue, isPrimitive, read, setValue, write, writeToXMLpublic CP()
public CP(int iMinLength, int iMaxLength, java.lang.String strCLength, int iComponentType) throws InvalidComponentTypeException
iMinLength - The Minimum length the DataType can have.iMaxLength - The Maximum length the DataType can have.iCLength - The Conformance length the DataType can have.iComponentType - The Type of the component i.e Component or a subcomponent.InvalidComponentTypeException - - if Component Type is not specified or valid.public CP(int iMinLength, int iMaxLength, java.lang.String strCLength, int iTableNo, int iComponentType) throws InvalidComponentTypeException
iMinLength - The Minimum length the DataType can have.iMaxLength - The Maximum length the DataType can have.iCLength - The Conformance length the DataType can have.iTableNo - The Table number to which the value for the component is specified.iComponentType - The Type of the component i.e Component or a subcomponent.InvalidComponentTypeException - - if Component Type is not specified or valid.public CP(int iComponentType, IDataTypeMap objIDataTypeMap)
objIDataTypeMap - object of Data Type Map.iComponentType - The Type of the component i.e Component or a subcomponent.InvalidComponentTypeException - - if Component Type is not specified or valid.public CP(int iComponentType, int iMinLength, int iMaxLength, java.lang.String strCLength, IDataTypeMap objIDataTypeMap)
objIDataTypeMap - object of Data Type Map.iComponentType - The Type of the component i.e Component or a subcomponent.iMinLength - The Minimum length the DataType can have.iMaxLength - The Maximum length the DataType can have.iCLength - The Conformance length the DataType can have.InvalidComponentTypeException - - if Component Type is not specified or valid.public CP(int iComponentType, int iMinLength, int iMaxLength, java.lang.String strCLength, int ITableNo, IDataTypeMap objIDataTypeMap)
objIDataTypeMap - object of Data Type Map.iComponentType - The Type of the component i.e Component or a subcomponent.iMinLength - The Minimum length the DataType can have.iMaxLength - The Maximum length the DataType can have.iCLength - The Conformance length the DataType can have.iTableNo - The Table number to which the value for the component is specified.InvalidComponentTypeException - - if Component Type is not specified or valid.public void setPrice(MO objPrice)
objPrice - Specifies an amount of money and the denomination in which it is expressed.public void setPriceType(java.lang.String strPriceType)
strPriceType - Specifies a coded value, data type ID.[Refer to HL7 Table 0205]
Suggested Values AP,DC,IC,PF,TF,TP,UP.public void setPriceType(ID objID)
objID - Specifies a coded value, data type ID.[Refer to HL7 Table 0205]
Suggested Values AP,DC,IC,PF,TF,TP,UP.public void setFromValue(java.lang.String strFromValue)
strFromValue - Spefies the "range" alongwith strToValue.public void setFromValue(NM objNM)
objNM - Spefies the "range" alongwith strToValue.public void setToValue(java.lang.String strToValue)
strToValue - Spefies the "range" alongwith strFromValue.public void setToValue(NM objNM)
objNM - Spefies the "range" alongwith strFromValue.public void setRangeUnits(CWE objRangeUnits)
objRangeUnits - Specifies This describes the units associated with the range, e.g., seconds, minutespublic void setRangeType(java.lang.String strRangeType)
strRangeType - Refer to HL7 Table 0298 - CP range type for valid values.(P,F)public void setRangeType(ID objID)
objID - Refer to HL7 Table 0298 - CP range type for valid values.(P,F)public MO getPrice()
public ID getPriceType()
public NM getFromValue()
public NM getToValue()
public CWE getRangeUnits()
public ID getRangeType()
public boolean validate()
throws InvalidDataTypeException
validate in interface IDataTypevalidate in class CompositeDataTypeInvalidDataTypeException - - if Invalid values is entered or Mandatory field is missing.public boolean equals(java.lang.Object objObject)
equals in class java.lang.ObjectobjObject - object of Object class.