cdac.medinfo.sdk.hl7282.baselibs

## Class ED

- java.lang.Object
- - cdac.medinfo.sdk.hl7282.baselibs.CompositeDataType
  - - cdac.medinfo.sdk.hl7282.baselibs.ED

- All Implemented Interfaces:
    IDataType

      public class ED
      extends CompositeDataType

  ED - Encapsulated Data

  This data type transmits encapsulated data from a source system to a destination system. It contains the identity of the source system, the type of data, the encoding method of the data, and the data itself

  Represents an HL7 ED data type. This data type has the following attributes:

  1. Source Application (HD)Optional
  2. Type of Data (ID)Required
  3. Data Subtype (ID)Optional
  4. Encoding (ID)Required
  5. Data (TX)Required

  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 Summary

    Constructors
    Constructor and Description
    `ED()` Default Constructor for ED
    `ED(int iComponentType, IDataTypeMap objIDataTypeMap)` Constructor for ED class which takes two arguments and sets the value in the respective member variable.
    `ED(int iComponentType, int iMinLength, int iMaxLength, java.lang.String strCLength, IDataTypeMap objIDataTypeMap)` Constructor for ED class which takes five arguments and sets the value in the respective member variable.
    `ED(int iComponentType, int iMinLength, int iMaxLength, java.lang.String strCLength, int ITableNo, IDataTypeMap objIDataTypeMap)` Constructor for ED class which takes six arguments and sets the value in the respective member variable.
    `ED(int iMinLength, int iMaxLength, java.lang.String strCLength, int iComponentType)` Constructor for ED class which takes four arguments and sets the value in the respective member variable.
    `ED(int iMinLength, int iMaxLength, java.lang.String strCLength, int iTableNo, int iComponentType)` Constructor for ED class which takes five arguments and sets the value in the respective member variable.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object objObject)` This method checks the equality of Object.
    `TX` | `getData()` Returns Data
    `ID` | `getDataSubtype()` Returns Data Subtype
    `ID` | `getEncoding()` Returns Encoding
    `HD` | `getSourceApplication()` Returns Source Application
    `ID` | `getTypeOfData()` Returns Type of Data
    `void` | `setData(java.lang.String strData)` Sets the Data.
    `void` | `setData(TX objTX)` Sets the Data.
    `void` | `setDataSubtype(ID objID)` Sets the DataSubtype.
    `void` | `setDataSubtype(java.lang.String strDataSubtype)` Sets the DataSubtype.
    `void` | `setEncoding(ID objID)` Sets the Encoding.
    `void` | `setEncoding(java.lang.String strEncoding)` Sets the Encoding.
    `void` | `setSourceApplication(HD objSourceApplication)` Sets the SourceApplication.
    `void` | `setTypeOfData(ID objID)` Sets the TypeOfData.
    `void` | `setTypeOfData(java.lang.String strTypeOfData)` Sets the TypeOfData.
    `boolean` | `validate()` The Method validates the Input value,and if validated properly then returns true.

    - ### Methods inherited from class cdac.medinfo.sdk.hl7282.baselibs.CompositeDataType

      `copy, dumpDataType, getAttributes, getDataTypeName, getLength, getValue, isPrimitive, read, setValue, write, writeToXML`

    - ### Methods inherited from class java.lang.Object

      `getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ED

          public ED()

      Default Constructor for ED

    - #### ED

          public ED(int iMinLength,
            int iMaxLength,
            java.lang.String strCLength,
            int iComponentType)
             throws InvalidComponentTypeException

      Constructor for ED class which takes four arguments and sets the value in the respective member variable.
      Parameters:
        `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.
      Throws:
        `InvalidComponentTypeException` - - if Component Type is not specified or valid.

    - #### ED

          public ED(int iMinLength,
            int iMaxLength,
            java.lang.String strCLength,
            int iTableNo,
            int iComponentType)
             throws InvalidComponentTypeException

      Constructor for ED class which takes five arguments and sets the value in the respective member variable.
      Parameters:
        `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.
      Throws:
        `InvalidComponentTypeException` - - if Component Type is not specified or valid.

    - #### ED

          public ED(int iComponentType,
            IDataTypeMap objIDataTypeMap)

      Constructor for ED class which takes two arguments and sets the value in the respective member variable.
      Parameters:
        `objIDataTypeMap` - object of Data Type Map.
        `iComponentType` - The Type of the component i.e Component or a subcomponent.
      Throws:
        `InvalidComponentTypeException` - - if Component Type is not specified or valid.

    - #### ED

          public ED(int iComponentType,
            int iMinLength,
            int iMaxLength,
            java.lang.String strCLength,
            IDataTypeMap objIDataTypeMap)

      Constructor for ED class which takes five arguments and sets the value in the respective member variable.
      Parameters:
        `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.
      Throws:
        `InvalidComponentTypeException` - - if Component Type is not specified or valid.

    - #### ED

          public ED(int iComponentType,
            int iMinLength,
            int iMaxLength,
            java.lang.String strCLength,
            int ITableNo,
            IDataTypeMap objIDataTypeMap)

      Constructor for ED class which takes six arguments and sets the value in the respective member variable.
      Parameters:
        `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.
      Throws:
        `InvalidComponentTypeException` - - if Component Type is not specified or valid.

  - ### Method Detail

    - #### setSourceApplication

          public void setSourceApplication(HD objSourceApplication)

      Sets the SourceApplication.
      Parameters:
        `objSourceApplication` - Specifies A unique name that identifies the system which was the source of the data.

    - #### setTypeOfData

          public void setTypeOfData(java.lang.String strTypeOfData)

      Sets the TypeOfData.
      Parameters:
        `strTypeOfData` - Specifies an ID data type that declares the general type of data.

    - #### setTypeOfData

          public void setTypeOfData(ID objID)

      Sets the TypeOfData.
      Parameters:
        `objID` - Specifies an ID data type that declares the general type of data.

    - #### setDataSubtype

          public void setDataSubtype(java.lang.String strDataSubtype)

      Sets the DataSubtype.
      Parameters:
        `strDataSubtype` - Specifies an ID data type declaring the format for the data of subcomponent
        .

    - #### setDataSubtype

          public void setDataSubtype(ID objID)

      Sets the DataSubtype.
      Parameters:
        `objID` - Specifies an ID data type declaring the format for the data of subcomponent
        .

    - #### setEncoding

          public void setEncoding(java.lang.String strEncoding)

      Sets the Encoding.
      Parameters:
        `strEncoding` - Specifies the type of encoding used to represent successive octets of binary data as displayable ASCII characters. [Refer to HL7 Table 0299 - Encoding] Valid values A,Hex,Base64.

    - #### setEncoding

          public void setEncoding(ID objID)

      Sets the Encoding.
      Parameters:
        `objID` - Specifies the type of encoding used to represent successive octets of binary data as displayable ASCII characters. [Refer to HL7 Table 0299 - Encoding] Valid values A,Hex,Base64.

    - #### setData

          public void setData(java.lang.String strData)

      Sets the Data.
      Parameters:
        `strData` - Specifies displayable ASCII characters which constitute the data to be sent from source application to destination application.

    - #### setData

          public void setData(TX objTX)

      Sets the Data.
      Parameters:
        `objTX` - Specifies displayable ASCII characters which constitute the data to be sent from source application to destination application.

    - #### getSourceApplication

          public HD getSourceApplication()

      Returns Source Application
      Returns:
        HD - data type.

    - #### getTypeOfData

          public ID getTypeOfData()

      Returns Type of Data
      Returns:
        ID - data type.

    - #### getDataSubtype

          public ID getDataSubtype()

      Returns Data Subtype
      Returns:
        ID - data type.

    - #### getEncoding

          public ID getEncoding()

      Returns Encoding
      Returns:
        ID - data type.

    - #### getData

          public TX getData()

      Returns Data
      Returns:
        TX - data type.

    - #### validate

          public boolean validate()
                           throws InvalidDataTypeException

      The Method validates the Input value,and if validated properly then returns true. Here the validetion is based on the compulsory fields for the Datatype.
      Specified by:
        `validate` in interface `IDataType`
      Overrides:
        `validate` in class `CompositeDataType`
      Returns:
        boolean - true or false.
      Throws:
        `InvalidDataTypeException` - - if Invalid values is entered or Mandatory field is missing.

    - #### equals

          public boolean equals(java.lang.Object objObject)

      This method checks the equality of Object.
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `objObject` - object of Object class.
      Returns:
        boolean - shows success or failure of the comparison.