cdac.medinfo.sdk.hl7282.baselibs.segments

## Class LRL

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

- All Implemented Interfaces:
    ISegment

      public class LRL
      extends Segment

  LRL - Location Relationship Segment

  The Technical Steward for the LRL segment is PA.The LRL segment is used to identify one location's relationship to another location, the nearest lab, pharmacy, etc.

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

  LRL-1: Primary Key Value - LRL (PL)Required
  LRL-2: Segment Action Code (ID)Optional
  LRL-3: Segment Unique Key (EI)Optional
  LRL-4: Location Relationship ID (CWE)Required
  LRL-5: Organizational Location Relationship Value (XON)Conditional
  LRL-6: Patient Location Relationship Value (PL)Conditional

  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
    `LRL()` Constructs the LRL segment.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addOrganizationalLocationRelationshipValue(java.lang.String strOrganizationName, CWE objOrganizationNameTypeCode, HD objAssigningAuthority, java.lang.String strIdentifierTypeCode, HD objAssigningFacility, java.lang.String strNameRepresentationCode, java.lang.String strOrganizationIdentifier)` Add the Organizational Location Relationship Value.
    `void` | `addOrganizationalLocationRelationshipValue(XON objorganizationalLocationRelationshipValue)` Add the Organizational Location Relationship Value.
    `CWE` | `getLocationRelationshipID()` Retrieves the Location Relationship ID.
    `ISingleCollection<XON>` | `getOrganizationalLocationRelationshipValue()` Retrieves the Organizational Location Relationship Value.
    `PL` | `getPatientLocationRelationshipValue()` Retrieves the Patient Location Relationship Value.
    `PL` | `getPrimaryKeyValueLRL()` Retrieves the Primary Key Value LRL.
    `ID` | `getSegmentActionCode()` Retrieves the Segment Action Code.
    `EI` | `getSegmentUniqueKey()` Retrieves the Segment Unique Key.
    `void` | `setLocationRelationshipID(CWE objlocationRelationshipID)` Set the Location Relationship ID.
    `void` | `setLocationRelationshipID(java.lang.String strIdentifier, java.lang.String strText, java.lang.String strNameOfCodingSystem, java.lang.String strAlternateIdentifier, java.lang.String strAlternateText, java.lang.String strNameOfAlternateCodingSystem, java.lang.String strCodingSystemVersionID, java.lang.String strAlternateCodingSystemVersionId, java.lang.String strOriginalText, java.lang.String strSecondAlternateIdentifier, java.lang.String strSecondAlternateText, java.lang.String strNameofSecondAlternateCodingSystem, java.lang.String strSecondAlternateCodingSystemVersionID, java.lang.String strCodingSystemOID, java.lang.String strValueSetOID, java.lang.String strValueSetVersionID, java.lang.String strAlternateCodingSystemOID, java.lang.String strAlternateValueSetOID, java.lang.String strAlternateValueSetVersionID, java.lang.String strSecondAlternateCodingSystemOID, java.lang.String strSecondAlternateValueSetOID, java.lang.String strSecondAlternateValueSetVersionID)` Set the Location Relationship ID.
    `void` | `setOrganizationalLocationRelationshipValue(ISingleCollection<XON> objorganizationalLocationRelationshipValueList)` Set the Organizational Location Relationship Value.
    `void` | `setPatientLocationRelationshipValue(HD objPointOfCare, HD objRoom, HD objBed, HD objFacility, java.lang.String strLocationStatus, java.lang.String strPersonLocationType, HD objBuilding, HD objFloor, java.lang.String strLocationDescription, EI objComprehensiveLocationIdentifier, HD objAssigningAuthorityForLocation)` Set the Patient Location Relationship Value.
    `void` | `setPatientLocationRelationshipValue(PL objpatientLocationRelationshipValue)` Set the Patient Location Relationship Value.
    `void` | `setPrimaryKeyValueLRL(HD objPointOfCare, HD objRoom, HD objBed, HD objFacility, java.lang.String strLocationStatus, java.lang.String strPersonLocationType, HD objBuilding, HD objFloor, java.lang.String strLocationDescription, EI objComprehensiveLocationIdentifier, HD objAssigningAuthorityForLocation)` Set the Primary Key Value LRL.
    `void` | `setPrimaryKeyValueLRL(PL objprimaryKeyValueLRL)` Set the Primary Key Value LRL.
    `void` | `setSegmentActionCode(ID objsegmentActionCode)` Set the Segment Action Code.
    `void` | `setSegmentActionCode(java.lang.String strBPstatus)` Set the Segment Action Code.
    `void` | `setSegmentUniqueKey(EI objsegmentUniqueKey)` Set the Segment Unique Key.
    `void` | `setSegmentUniqueKey(java.lang.String strEntityIdentifier, java.lang.String strNamespaceId, java.lang.String strUniversalId, java.lang.String strUniversalIdType)` Set the Segment Unique Key.
    `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

    - #### LRL

          public LRL()

      Constructs the LRL segment.

  - ### Method Detail

    - #### getLocationRelationshipID

          public CWE getLocationRelationshipID()

      Retrieves the Location Relationship ID. This field contains an identifier code to show WHICH relationship is being communicated with this segment.
      Returns:
        CWE - locationRelationshipID

    - #### getOrganizationalLocationRelationshipValue

          public ISingleCollection<XON> getOrganizationalLocationRelationshipValue()

      Retrieves the Organizational Location Relationship Value. This field holds that organization's extended name i.e., the value of this field is conditional on the value of LRL-4 - Location Relationship ID.
      Returns:
        ISingleCollection - organizationalLocationRelationshipValue

    - #### getPatientLocationRelationshipValue

          public PL getPatientLocationRelationshipValue()

      Retrieves the Patient Location Relationship Value. This field is conditional on the value of LRL-4 - Location Relationship ID.
      Returns:
        PL - patientLocationRelationshipValue

    - #### getPrimaryKeyValueLRL

          public PL getPrimaryKeyValueLRL()

      Retrieves the Primary Key Value LRL. This field contains the institution's identification code for the location.
      Returns:
        PL - primaryKeyValueLRL

    - #### getSegmentActionCode

          public ID getSegmentActionCode()

      Retrieves the Segment Action Code. This field indicates whether this repetition of the segment is being added, changed or deleted.
      Returns:
        ID - segmentActionCode

    - #### getSegmentUniqueKey

          public EI getSegmentUniqueKey()

      Retrieves the Segment Unique Key. This field contains a unique identifier for one of the multiple repetitions of this segment, to be used in conjunction with the preceding field.
      Returns:
        EI - segmentUniqueKey

    - #### setLocationRelationshipID

          public void setLocationRelationshipID(java.lang.String strIdentifier,
                                       java.lang.String strText,
                                       java.lang.String strNameOfCodingSystem,
                                       java.lang.String strAlternateIdentifier,
                                       java.lang.String strAlternateText,
                                       java.lang.String strNameOfAlternateCodingSystem,
                                       java.lang.String strCodingSystemVersionID,
                                       java.lang.String strAlternateCodingSystemVersionId,
                                       java.lang.String strOriginalText,
                                       java.lang.String strSecondAlternateIdentifier,
                                       java.lang.String strSecondAlternateText,
                                       java.lang.String strNameofSecondAlternateCodingSystem,
                                       java.lang.String strSecondAlternateCodingSystemVersionID,
                                       java.lang.String strCodingSystemOID,
                                       java.lang.String strValueSetOID,
                                       java.lang.String strValueSetVersionID,
                                       java.lang.String strAlternateCodingSystemOID,
                                       java.lang.String strAlternateValueSetOID,
                                       java.lang.String strAlternateValueSetVersionID,
                                       java.lang.String strSecondAlternateCodingSystemOID,
                                       java.lang.String strSecondAlternateValueSetOID,
                                       java.lang.String strSecondAlternateValueSetVersionID)

      Set the Location Relationship ID. This field contains an identifier code to show WHICH relationship is being communicated with this segment.
      Parameters:
        `strIdentifier` - Specifies of characters (the code) that uniquely identifies the item being referenced.
        `strText` - Specifies The descriptive or textual name of the identifier, e.g., myocardial infarction.
        `strNameOfCodingSystem` - Identifies the coding scheme being used in the identifier component.
        `strAlternateIdentifier` - Specifies an alternate sequence of characters (the code) that uniquely identifies the item being referenced.
        `strAlternateText` - Specifies the descriptive or textual name of the alternate identifier. See usage note in section introduction.
        `strNameOfAlternateCodingSystem` - Identifies the coding scheme being used in the alternate identifier component.
        `strCodingSystemVersionID` - A sequence of characters that uniquely identifies a second alternate code.
        `strAlternateCodingSystemVersionId` - This component carries the version for the coding system identified by components 4-6.
        `strOriginalText` - The text as seen and/or selected by the user who entered the data.
        `strSecondAlternateIdentifier` - A sequence of characters that uniquely identifies a second alternate code.
        `strSecondAlternateText` - The descriptive or textual name of the alternate identifier.
        `strNameofSecondAlternateCodingSystem` - Identifies the coding scheme being used in the alternate identifier component.
        `strSecondAlternateCodingSystemVersionID` - This component carries the version for the coding system identified by components 10-12.
        `strCodingSystemOID` - This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.3.
        `strValueSetOID` - This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.1 is obtained.
        `strValueSetVersionID` - This component carries the version for the value set identified by CWE.15. The version is a date. The date is the date/time that the value set being used was published.
        `strAlternateCodingSystemOID` - This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.6.
        `strAlternateValueSetOID` - This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.4 is obtained.
        `strAlternateValueSetVersionID` - This component carries the version for the value set identified by CWE.18. The version is a date.
        `strSecondAlternateCodingSystemOID` - This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.12.
        `strSecondAlternateValueSetOID` - This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.10 is obtained.
        `strSecondAlternateValueSetVersionID` - This component carries the version for the value set identified by CWE.21. The version is a date.

    - #### setLocationRelationshipID

          public void setLocationRelationshipID(CWE objlocationRelationshipID)

      Set the Location Relationship ID. This field contains an identifier code to show WHICH relationship is being communicated with this segment.
      Parameters:
        `objlocationRelationshipID` - Object of Location Relationship ID.

    - #### addOrganizationalLocationRelationshipValue

          public void addOrganizationalLocationRelationshipValue(java.lang.String strOrganizationName,
                                                        CWE objOrganizationNameTypeCode,
                                                        HD objAssigningAuthority,
                                                        java.lang.String strIdentifierTypeCode,
                                                        HD objAssigningFacility,
                                                        java.lang.String strNameRepresentationCode,
                                                        java.lang.String strOrganizationIdentifier)

      Add the Organizational Location Relationship Value. This field holds that organization's extended name i.e., the value of this field is conditional on the value of LRL-4 - Location Relationship ID.
      Parameters:
        `strOrganizationName` - Specifies name of the specified organization.
        `objOrganizationNameTypeCode` - Specifies a code that represents the type of name i.e., legal name, display name. Suggested Values A,L,D,SL.[Refer to table No.0204]
        `objAssigningAuthority` - Specifies The assigning authority is a unique identifier of the system (or organization or agency or department) that creates the data.
        `strIdentifierTypeCode` - Specifies a code corresponding to the type of identifier.
        `objAssigningFacility` - Specifies The place or location identifier where the identifier was first assigned to the person.
        `strNameRepresentationCode` - Specifies representations of the same name/address Suggested values are I,A,P [Refer table 0465]
        `strOrganizationIdentifier` - This component contains the sequence of characters (the code) that uniquely identifies the item being referenced by XON.1 Organization Name. This component replaces XON.3 ID Number as of v 2.5.

    - #### addOrganizationalLocationRelationshipValue

          public void addOrganizationalLocationRelationshipValue(XON objorganizationalLocationRelationshipValue)

      Add the Organizational Location Relationship Value. This field holds that organization's extended name i.e., the value of this field is conditional on the value of LRL-4 - Location Relationship ID.
      Parameters:
        `objorganizationalLocationRelationshipValue` - Object of Organizational Location Relationship Value.

    - #### setOrganizationalLocationRelationshipValue

          public void setOrganizationalLocationRelationshipValue(ISingleCollection<XON> objorganizationalLocationRelationshipValueList)

      Set the Organizational Location Relationship Value. This field holds that organization's extended name i.e., the value of this field is conditional on the value of LRL-4 - Location Relationship ID.
      Parameters:
        `objorganizationalLocationRelationshipValueList` - List of Organizational Location Relationship Value.

    - #### setPatientLocationRelationshipValue

          public void setPatientLocationRelationshipValue(HD objPointOfCare,
                                                 HD objRoom,
                                                 HD objBed,
                                                 HD objFacility,
                                                 java.lang.String strLocationStatus,
                                                 java.lang.String strPersonLocationType,
                                                 HD objBuilding,
                                                 HD objFloor,
                                                 java.lang.String strLocationDescription,
                                                 EI objComprehensiveLocationIdentifier,
                                                 HD objAssigningAuthorityForLocation)

      Set the Patient Location Relationship Value. This field is conditional on the value of LRL-4 - Location Relationship ID.
      Parameters:
        `objPointOfCare` - Specifies the code for the point where patient care is administered.
        `objRoom` - Specifies the code for the patient's room.
        `objBed` - Specifies the code for the patient's bed.
        `objFacility` - Specifies to site interpretation but generally describes the highest level physical designation of an institution, medical center or enterprise.
        `strLocationStatus` - Specifies the code for the status or availability of the location.
        `strPersonLocationType` - Specifies the categorization of the person's location defined by facility, building, floor, point of care, room or bed.
        `objBuilding` - Specifies code for the building where the person is located.
        `objFloor` - Specifies the code for the floor where the person is located.
        `strLocationDescription` - Specifies describes the location in free text.
        `objComprehensiveLocationIdentifier` - Specifies represents the physical location as a whole without regard for the individual components.
        `objAssigningAuthorityForLocation` - Specifies the entity that creates the data for the individual physical location components.

    - #### setPatientLocationRelationshipValue

          public void setPatientLocationRelationshipValue(PL objpatientLocationRelationshipValue)

      Set the Patient Location Relationship Value. This field is conditional on the value of LRL-4 - Location Relationship ID.
      Parameters:
        `objpatientLocationRelationshipValue` - Object of Patient Location Relationship Value.

    - #### setPrimaryKeyValueLRL

          public void setPrimaryKeyValueLRL(HD objPointOfCare,
                                   HD objRoom,
                                   HD objBed,
                                   HD objFacility,
                                   java.lang.String strLocationStatus,
                                   java.lang.String strPersonLocationType,
                                   HD objBuilding,
                                   HD objFloor,
                                   java.lang.String strLocationDescription,
                                   EI objComprehensiveLocationIdentifier,
                                   HD objAssigningAuthorityForLocation)

      Set the Primary Key Value LRL. This field contains the institution's identification code for the location.
      Parameters:
        `objPointOfCare` - Specifies the code for the point where patient care is administered.
        `objRoom` - Specifies the code for the patient's room.
        `objBed` - Specifies the code for the patient's bed.
        `objFacility` - Specifies to site interpretation but generally describes the highest level physical designation of an institution, medical center or enterprise.
        `strLocationStatus` - Specifies the code for the status or availability of the location.
        `strPersonLocationType` - Specifies the categorization of the person's location defined by facility, building, floor, point of care, room or bed.
        `objBuilding` - Specifies code for the building where the person is located.
        `objFloor` - Specifies the code for the floor where the person is located.
        `strLocationDescription` - Specifies describes the location in free text.
        `objComprehensiveLocationIdentifier` - Specifies represents the physical location as a whole without regard for the individual components.
        `objAssigningAuthorityForLocation` - Specifies the entity that creates the data for the individual physical location components.

    - #### setPrimaryKeyValueLRL

          public void setPrimaryKeyValueLRL(PL objprimaryKeyValueLRL)

      Set the Primary Key Value LRL. This field contains the institution's identification code for the location.
      Parameters:
        `objprimaryKeyValueLRL` - Object of Primary Key Value LRL.

    - #### setSegmentActionCode

          public void setSegmentActionCode(java.lang.String strBPstatus)

      Set the Segment Action Code. This field indicates whether this repetition of the segment is being added, changed or deleted.
      Parameters:
        `strBPstatus` - - String which to set as BP Status

    - #### setSegmentActionCode

          public void setSegmentActionCode(ID objsegmentActionCode)

      Set the Segment Action Code. This field indicates whether this repetition of the segment is being added, changed or deleted.
      Parameters:
        `objsegmentActionCode` - Object of Segment Action Code.

    - #### setSegmentUniqueKey

          public void setSegmentUniqueKey(java.lang.String strEntityIdentifier,
                                 java.lang.String strNamespaceId,
                                 java.lang.String strUniversalId,
                                 java.lang.String strUniversalIdType)

      Set the Segment Unique Key. This field contains a unique identifier for one of the multiple repetitions of this segment, to be used in conjunction with the preceding field.
      Parameters:
        `strEntityIdentifier` - Specifies defined by a hierarchic designator, represented by components 2 through 4. [Reference Section 2.A.33, "HD - hierarchic designator".]
        `strNamespaceId` - Specifies the HL7 identifier for the user-defined table of values for this component. [Refer to User-defined Table 0363 - Assigning authority]
        `strUniversalId` - Specifies string formatted according to the scheme defined by the component, (UID type).
        `strUniversalIdType` - Specifies the interpretation of the second component of the HD.

    - #### setSegmentUniqueKey

          public void setSegmentUniqueKey(EI objsegmentUniqueKey)

      Set the Segment Unique Key. This field contains a unique identifier for one of the multiple repetitions of this segment, to be used in conjunction with the preceding field.
      Parameters:
        `objsegmentUniqueKey` - Object of Segment Unique Key.

    - #### 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 checks 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