cdac.medinfo.sdk.hl7282.baselibs.segments

## Class NCK

- java.lang.Object
- - cdac.medinfo.sdk.hl7282.baselibs.segments.Segment
  - - cdac.medinfo.sdk.hl7282.baselibs.segments.NCK

- All Implemented Interfaces:
    ISegment

      public class NCK
      extends Segment

  NCK - System Clock Segment.

  The NCK segment is used to allow the various applications on the network to synchronize their system clocks (system date and time).

  Represents an HL7 NCK message segment. This segment has the following fields:

  NCK-1: System Date/Time (DTM)Required

  This class provides mechanism to validate message against HL7 v 2.8.2 standard. The class provides accessors & mutators for the elements mentioned above. The class has validate method which validates Message against HL7 v 2.8.2 standard.

  User can also create Segment through `SegmentFactory`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NCK()` Constructs the NCK segment.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `DTM` | `getSystemDateTime()` Retrieves the System Date Time.
    `void` | `setSystemDateTime(DTM systemDate_Time)` Set the System Date Time.
    `void` | `setSystemDateTime(java.lang.String strDate)` Set the System Date Time.
    `boolean` | `validate()` Validates HL7 Message objects .

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

      `addUnRecognizedField, dumpSegment, getFields, getName, getUnrecognizedFields, moveToNextSegment, parse, removeDataElement, removeDataElement, serialize, setName, setUnRecognizedField, updateDataElement, updateDataElement, writeToXML`

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

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

- - ### Constructor Detail

    - #### NCK

          public NCK()

      Constructs the NCK segment.

  - ### Method Detail

    - #### setSystemDateTime

          public void setSystemDateTime(java.lang.String strDate)

      Set the System Date Time. This field contains an HL7 time stamp.
      Parameters:
        `strDate` - Specifies a point in time using a 24-hour clock notation.

    - #### setSystemDateTime

          public void setSystemDateTime(DTM systemDate_Time)

      Set the System Date Time. This field contains an HL7 time stamp.
      Parameters:
        `systemDate_Time` - System Date Time

    - #### getSystemDateTime

          public DTM getSystemDateTime()

      Retrieves the System Date Time. This field contains an HL7 time stamp.
      Returns:
        DTM - systemDate_Time

    - #### validate

          public boolean validate()
                           throws InvalidSegmentException

      Validates HL7 Message objects . Validate method checks for validation each and every segments in side the Message object against specified message Structure. Validation chcecks include optionality of segment or group. It also verifies the number of times segment or group is repeated in message. e.g {PSH} while parsing PSH segment validate method will check for its mandatory presence. [PSH] in this case validate will throw exception if one tries to enter more than one PSH segment.
      Specified by:
        `validate` in interface `ISegment`
      Overrides:
        `validate` in class `Segment`
      Returns:
        boolean - true or false.
      Throws:
        `InvalidSegmentException` - Throws when Segment Validation fails