cdac.medinfo.sdk.hl7282.baselibs

## Class CX

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

- All Implemented Interfaces:
    IDataType

      public class CX
      extends CompositeDataType

  CX - Extended Composite ID with Check Digit

  This data type type is used for specifying an identifier with its associated administrative detail.

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

  1. ID Number (ST)Required
  2. Check Digit (ST)Optional
  3. Check Digit Scheme (ID)Optional
  4. Assigning Authority (HD)Conditional
  5. Identifier Type Code (ID)Required
  6. Assigning Facility (HD)Optional
  7. Effective Date (DT)Optional
  8. Expiration Date (DT)Optional
  9. Assigning Jurisdiction (CWE)Conditional
  10. Assigning Agency or Department (CWE)Conditional

  11. Security Check or Department (ST)Optional

  12. Security Check Scheme (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 Summary

    Constructors
    Constructor and Description
    `CX()` Default Constructor for CX
    `CX(int iComponentType, IDataTypeMap objIDataTypeMap)` Constructor for CX class which takes two arguments and sets the value in the respective member variable.
    `CX(int iComponentType, int iMinLength, int iMaxLength, java.lang.String strCLength, IDataTypeMap objIDataTypeMap)` Constructor for CX class which takes five arguments and sets the value in the respective member variable.
    `CX(int iComponentType, int iMinLength, int iMaxLength, java.lang.String strCLength, int ITableNo, IDataTypeMap objIDataTypeMap)` Constructor for CX class which takes six arguments and sets the value in the respective member variable.
    `CX(int iMinLength, int iMaxLength, java.lang.String strCLength, int iComponentType)` Constructor for CX class which takes four arguments and sets the value in the respective member variable.
    `CX(int iMinLength, int iMaxLength, java.lang.String strCLength, int iTableNo, int iComponentType)` Constructor for CX 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.
    `CWE` | `getAssigningAgencyOrDepartment()` Returns Assigning Agency or Department
    `HD` | `getAssigningAuthority()` Returns Assigning Authority
    `HD` | `getAssigningFacility()` Returns Assigning Facility
    `CWE` | `getAssigningJurisdiction()` Returns Assigning Jurisdiction
    `ST` | `getCheckDigit()` Returns Check Digit
    `ID` | `getCheckDigitScheme()` Returns Check Digit Scheme
    `DT` | `getEffectiveDate()` Returns Effective Date
    `DT` | `getExpirationDate()` Returns Expiration Date
    `ID` | `getIdentifierTypeCode()` Returns Identifier Type Code
    `ST` | `getIDNumber()` Returns IDNumber
    `ST` | `getSecurityCheck()` Returns Security Check
    `ST` | `getSecurityCheckScheme()` Returns Assigning Agency or Department
    `void` | `setAssigningAgencyOrDepartment(CWE objAssigningAgencyOrDepartment)` Sets the Assigning Agency Or Department.
    `void` | `setAssigningAuthority(HD objAssigningAuthority)` Sets the Assigning Authority.
    `void` | `setAssigningFacility(HD objAssigningFacility)` Sets the Assigning Facility.
    `void` | `setAssigningJurisdiction(CWE objAssigningJurisdiction)` Sets the Assigning Jurisdiction.
    `void` | `setCheckDigit(ST objST)` Sets the Check Digit.
    `void` | `setCheckDigit(java.lang.String strCheckDigit)` Sets the Check Digit.
    `void` | `setCheckDigitScheme(ID objID)` Sets the Check Digit Scheme.
    `void` | `setCheckDigitScheme(java.lang.String strCheckDigitScheme)` Sets the Check Digit Scheme.
    `void` | `setEffectiveDate(DT objDT)` Sets the Effective Date.
    `void` | `setEffectiveDate(java.lang.String strEffectiveDate)` Sets the Effective Date.
    `void` | `setExpirationDate(DT objDT)` Sets the Expiration Date.
    `void` | `setExpirationDate(java.lang.String strExpirationDate)` Sets the Expiration Date.
    `void` | `setIdentifierTypeCode(ID objID)` Sets the Identifier Type Code.
    `void` | `setIdentifierTypeCode(java.lang.String strIdentifierTypeCode)` Sets the Identifier Type Code.
    `void` | `setIdNumber(ST objST)` Sets the Id Number.
    `void` | `setIdNumber(java.lang.String strIdNumber)` Sets the Id Number.
    `void` | `setSecurityCheck(ST objST)` Sets the Security Check.
    `void` | `setSecurityCheck(java.lang.String strSecurityCheck)` Sets the Security Check.
    `void` | `setSecurityCheckScheme(ST objST)` Sets the Security Check Scheme.
    `void` | `setSecurityCheckScheme(java.lang.String strSecurityCheckScheme)` Sets the Security Check Scheme.
    `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

    - #### CX

          public CX()

      Default Constructor for CX

    - #### CX

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

      Constructor for CX 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.

    - #### CX

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

      Constructor for CX 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.

    - #### CX

          public CX(int iComponentType,
            IDataTypeMap objIDataTypeMap)

      Constructor for CX 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.

    - #### CX

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

      Constructor for CX 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.

    - #### CX

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

      Constructor for CX 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

    - #### setIdNumber

          public void setIdNumber(java.lang.String strIdNumber)

      Sets the Id Number.
      Parameters:
        `strIdNumber` - Specifies the value of the identifier itself.

    - #### setIdNumber

          public void setIdNumber(ST objST)

      Sets the Id Number.
      Parameters:
        `objST` - Specifies the value of the identifier itself.

    - #### setCheckDigit

          public void setCheckDigit(java.lang.String strCheckDigit)

      Sets the Check Digit.
      Parameters:
        `strCheckDigit` - It is part of the identifying number used in the sending application.

    - #### setCheckDigit

          public void setCheckDigit(ST objST)

      Sets the Check Digit.
      Parameters:
        `objST` - It is part of the identifying number used in the sending application.

    - #### setCheckDigitScheme

          public void setCheckDigitScheme(java.lang.String strCheckDigitScheme)

      Sets the Check Digit Scheme.
      Parameters:
        `strCheckDigitScheme` - Contains the code identifying the check digit scheme employed. Suggested Values NP,ISO,M10,M11.[Refer table No.0061].

    - #### setCheckDigitScheme

          public void setCheckDigitScheme(ID objID)

      Sets the Check Digit Scheme.
      Parameters:
        `objID` - Contains the code identifying the check digit scheme employed. Suggested Values NP,ISO,M10,M11.[Refer table No.0061].

    - #### setAssigningAuthority

          public void setAssigningAuthority(HD objAssigningAuthority)

      Sets the Assigning Authority.
      Parameters:
        `objAssigningAuthority` - The assigning authority is a unique name of the system (or organization or agency or department) that creates the data.

    - #### setIdentifierTypeCode

          public void setIdentifierTypeCode(java.lang.String strIdentifierTypeCode)

      Sets the Identifier Type Code.
      Parameters:
        `strIdentifierTypeCode` - Specifies a code corresponding to the type of identifier.In some cases, this code may be used as a qualifier to the "Assigning authority" component.[Refer table No 0203]

    - #### setIdentifierTypeCode

          public void setIdentifierTypeCode(ID objID)

      Sets the Identifier Type Code.
      Parameters:
        `objID` - Specifies a code corresponding to the type of identifier.In some cases, this code may be used as a qualifier to the "Assigning authority" component.[Refer table No 0203]

    - #### setAssigningFacility

          public void setAssigningFacility(HD objAssigningFacility)

      Sets the Assigning Facility.
      Parameters:
        `objAssigningFacility` - Specifies the place or location identifier where the identifier was first assigned to the patient.

    - #### setEffectiveDate

          public void setEffectiveDate(java.lang.String strEffectiveDate)

      Sets the Effective Date.
      Parameters:
        `strEffectiveDate` - Specifies the first date, if known, on which the address is valid and active.

    - #### setEffectiveDate

          public void setEffectiveDate(DT objDT)

      Sets the Effective Date.
      Parameters:
        `objDT` - Specifies the first date, if known, on which the address is valid and active.

    - #### setExpirationDate

          public void setExpirationDate(java.lang.String strExpirationDate)

      Sets the Expiration Date.
      Parameters:
        `strExpirationDate` - Specifies the last date, if known, on which the address is valid and active.

    - #### setExpirationDate

          public void setExpirationDate(DT objDT)

      Sets the Expiration Date.
      Parameters:
        `objString` - Specifies the last date, if known, on which the address is valid and active.

    - #### setAssigningJurisdiction

          public void setAssigningJurisdiction(CWE objAssigningJurisdiction)

      Sets the Assigning Jurisdiction.
      Parameters:
        `objAssigningJurisdiction` - Specifies the geo-political body that assigned the identifier.

    - #### setAssigningAgencyOrDepartment

          public void setAssigningAgencyOrDepartment(CWE objAssigningAgencyOrDepartment)

      Sets the Assigning Agency Or Department.
      Parameters:
        `objAssigningAgencyOrDepartment` - Specifies agency or department that assigned the identifier.

    - #### setSecurityCheck

          public void setSecurityCheck(ST objST)

      Sets the Security Check.
      Parameters:
        `objST` - Specifies a version code.

    - #### setSecurityCheck

          public void setSecurityCheck(java.lang.String strSecurityCheck)

      Sets the Security Check.
      Parameters:
        `strSecurityCheck` - communicate a version code that may be assigned to the value given in CX.1 ID.

    - #### setSecurityCheckScheme

          public void setSecurityCheckScheme(ST objST)

      Sets the Security Check Scheme.
      Parameters:
        `objST` - Specifies the value of Supplied Identifier.

    - #### setSecurityCheckScheme

          public void setSecurityCheckScheme(java.lang.String strSecurityCheckScheme)

      Sets the Security Check Scheme.
      Parameters:
        `strSecurityCheckScheme` - is used to transmit information intended to validate the veracity of the supplied identifier or the presenter of the identifier.

    - #### getIDNumber

          public ST getIDNumber()

      Returns IDNumber
      Returns:
        ST - data type.

    - #### getCheckDigit

          public ST getCheckDigit()

      Returns Check Digit
      Returns:
        ST - data type.

    - #### getCheckDigitScheme

          public ID getCheckDigitScheme()

      Returns Check Digit Scheme
      Returns:
        ID - data type.

    - #### getAssigningAuthority

          public HD getAssigningAuthority()

      Returns Assigning Authority
      Returns:
        HD - data type.

    - #### getIdentifierTypeCode

          public ID getIdentifierTypeCode()

      Returns Identifier Type Code
      Returns:
        ID - data type.

    - #### getAssigningFacility

          public HD getAssigningFacility()

      Returns Assigning Facility
      Returns:
        HD - data type.

    - #### getEffectiveDate

          public DT getEffectiveDate()

      Returns Effective Date
      Returns:
        DT - data type.

    - #### getExpirationDate

          public DT getExpirationDate()

      Returns Expiration Date
      Returns:
        DT - data type.

    - #### getAssigningJurisdiction

          public CWE getAssigningJurisdiction()

      Returns Assigning Jurisdiction
      Returns:
        CWE - data type.

    - #### getAssigningAgencyOrDepartment

          public CWE getAssigningAgencyOrDepartment()

      Returns Assigning Agency or Department
      Returns:
        CWE - data type.

    - #### getSecurityCheck

          public ST getSecurityCheck()

      Returns Security Check
      Returns:
        ST - data type.

    - #### getSecurityCheckScheme

          public ST getSecurityCheckScheme()

      Returns Assigning Agency or Department
      Returns:
        ST - data type.

    - #### validate

          public boolean validate()
                           throws InvalidDataTypeException

      The Method validates the Input value,and if validated properly then returns true. Here the validation 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.