cdac.medinfo.sdk.hl7282.baselibs.segments

## Class PSG

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

- All Implemented Interfaces:
    ISegment

      public class PSG
      extends Segment

  PSG - Product/Service Group Segment The Product/Service Group segment is used to form a logical grouping of Product/Service Line Items, Patients and Response Summaries for a particular Invoice.

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

  PSG-1 : Provider Product/Service Group Number (EI) Required
  PSG-2 : Payer Product/Service Group Number (EI) Optional
  PSG-3 : Product/Service Group Sequence Number (SI) Required
  PSG-4 : Adjudicate as Group (ID) Required
  PSG-5 : Product/Service Group Billed Amount (CP) Required
  PSG-6 : Product/Service Group Description (ST) 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
    `PSG()` Constructs the PSG segment.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ID` | `getAdjudicateAsGroup()` Retrieve Adjudicate as Group (ID) Adjudicate all Product/Service Line Items together as a group (IPRs will be reported against the Product/Service Group).
    `EI` | `getPayerProductOrServiceGroupNumber()` Retrieve Payer Product/Service Group Number (EI) This field is used to define Unique Product/Service Group Number assigned by the Payer Application
    `CP` | `getProductOrServiceGroupBilledAmount()` Retrieve Product/Service Group Billed Amount (CP) This field is about Sum of all Product/Service Billed Amounts for all Product/Service Line Items for this Product/Service Group.
    `ST` | `getProductOrServiceGroupDescription()` Retrieve Product/Service Group Description (ST) This field is about Product/Service Group description or heading.
    `SI` | `getProductOrServiceGroupSequenceNumber()` Retrieve Product/Service Group Sequence Number (SI) This field tell about : Unique sequence number for the Product/Service Group (3) – starts with 1, then 2, etc.
    `EI` | `getProviderProductOrServiceGroupNumber()` Retrieve PSG-1 Provider Product/Service Group Number (EI) This field is used to Unique Product/Service Group Number assigned by the Provider Application.
    `void` | `setAdjudicateAsGroup(ID objAdjudicateAsGroup)` Retrieve Adjudicate as Group (ID) Adjudicate all Product/Service Line Items together as a group (IPRs will be reported against the Product/Service Group).
    `void` | `setAdjudicateAsGroup(java.lang.String strAdjudicateAsGroup)` Retrieve Adjudicate as Group (ID) Adjudicate all Product/Service Line Items together as a group (IPRs will be reported against the Product/Service Group).
    `void` | `setPayerProductOrServiceGroupNumber(EI objPayerProductOrServiceGroupNumber)` Set Payer Product/Service Group Number (EI) This field is used to define Unique Product/Service Group Number assigned by the Payer Application.
    `void` | `setPayerProductOrServiceGroupNumber(java.lang.String strEntityIdentifier, java.lang.String strNamespaceID, java.lang.String strUniversalID, java.lang.String strUniversalIDType)` Set Payer Product/Service Group Number (EI) This field is used to defineUnique Product/Service Group Number assigned by the Payer Application
    `void` | `setProductOrServiceGroupBilledAmount(CP objProductOrServiceGroupBilledAmount)` Set Product/Service Group Billed Amount (CP) This field is about Sum of all Product/Service Billed Amounts for all Product/Service Line Items for this Product/Service Group.
    `void` | `setProductOrServiceGroupBilledAmount(MO objPrice, java.lang.String strPriceType, java.lang.String strFormValue, java.lang.String strToValue, CWE objRangeUnits, java.lang.String strRangeType)` Set Product/Service Group Billed Amount (CP) This field is about Sum of all Product/Service Billed Amounts for all Product/Service Line Items for this Product/Service Group.
    `void` | `setProductOrServiceGroupDescription(ST objProductOrServiceGroupDescription)` Retrieve Product/Service Group Description (ST) This field is about Product/Service Group description or heading.
    `void` | `setProductOrServiceGroupDescription(java.lang.String strProductOrServiceGrouoDescription)` Retrieve Product/Service Group Description (ST) This field is about Product/Service Group description or heading.
    `void` | `setProductOrServiceGroupSequenceNumber(SI objProductOrServiceGroupSequenceNumber)` Retrieve Product/Service Group Sequence Number (SI) This field tell about : Unique sequence number for the Product/Service Group (3) – starts with 1, then 2, etc.
    `void` | `setProductOrServiceGroupSequenceNumber(java.lang.String strProductOrServiceGroupSequenceNumber)` Retrieve Product/Service Group Sequence Number (SI) This field tell about : Unique sequence number for the Product/Service Group (3) – starts with 1, then 2, etc.
    `void` | `setProviderProductOrServiceGroupNumber(EI objProviderProductOrServiceGroupNumber)` Set PSG-1 Provider Product/Service Group Number (EI) This field is used to Unique Product/Service Group Number assigned by the Provider Application.
    `void` | `setProviderProductOrServiceGroupNumber(java.lang.String strEntityIdentifier, java.lang.String strNamespaceID, java.lang.String strUniversalID, java.lang.String strUniversalIDType)` Set PSG-1 Provider Product/Service Group Number (EI) This field is used to Unique Product/Service Group Number assigned by the Provider Application.
    `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

    - #### PSG

          public PSG()

      Constructs the PSG segment.

  - ### Method Detail

    - #### getProviderProductOrServiceGroupNumber

          public EI getProviderProductOrServiceGroupNumber()

      Retrieve PSG-1 Provider Product/Service Group Number (EI) This field is used to Unique Product/Service Group Number assigned by the Provider Application.
      Returns:
        EI - object of Provider product or service group number.

    - #### setProviderProductOrServiceGroupNumber

          public void setProviderProductOrServiceGroupNumber(java.lang.String strEntityIdentifier,
                                                    java.lang.String strNamespaceID,
                                                    java.lang.String strUniversalID,
                                                    java.lang.String strUniversalIDType)

      Set PSG-1 Provider Product/Service Group Number (EI) This field is used to Unique Product/Service Group Number assigned by the Provider Application.
      Parameters:
        `strEntityIdentifier` - - string of character use to identify the entity.
        `strNamespaceID` - - Use to identify the name space id..
        `strUniversalID` - - Use to identify the name space identity.
        `strUniversalIDType` - - String of characters describe Universal Id Type.

    - #### setProviderProductOrServiceGroupNumber

          public void setProviderProductOrServiceGroupNumber(EI objProviderProductOrServiceGroupNumber)

      Set PSG-1 Provider Product/Service Group Number (EI) This field is used to Unique Product/Service Group Number assigned by the Provider Application.
      Parameters:
        `EI` - - object of Provider product or service group number.

    - #### getPayerProductOrServiceGroupNumber

          public EI getPayerProductOrServiceGroupNumber()

      Retrieve Payer Product/Service Group Number (EI) This field is used to define Unique Product/Service Group Number assigned by the Payer Application
      Returns:
        EI - object of Payer product or service group number.

    - #### setPayerProductOrServiceGroupNumber

          public void setPayerProductOrServiceGroupNumber(java.lang.String strEntityIdentifier,
                                                 java.lang.String strNamespaceID,
                                                 java.lang.String strUniversalID,
                                                 java.lang.String strUniversalIDType)

      Set Payer Product/Service Group Number (EI) This field is used to defineUnique Product/Service Group Number assigned by the Payer Application
      Parameters:
        `strEntityIdentifier` - - string of character use to identify the entity.
        `strNamespaceID` - - Use to identify the name space id..
        `strUniversalID` - - Use to identify the name space identity.
        `strUniversalIDType` - - String of characters describe Universal Id Type.

    - #### setPayerProductOrServiceGroupNumber

          public void setPayerProductOrServiceGroupNumber(EI objPayerProductOrServiceGroupNumber)

      Set Payer Product/Service Group Number (EI) This field is used to define Unique Product/Service Group Number assigned by the Payer Application.
      Parameters:
        `EI` - - object of Payer product or service group number.

    - #### getProductOrServiceGroupSequenceNumber

          public SI getProductOrServiceGroupSequenceNumber()

      Retrieve Product/Service Group Sequence Number (SI) This field tell about : Unique sequence number for the Product/Service Group (3) – starts with 1, then 2, etc. for each unique Product/Service Group in this Invoice.
      Returns:
        SI - object of Product or service group sequence number.

    - #### setProductOrServiceGroupSequenceNumber

          public void setProductOrServiceGroupSequenceNumber(java.lang.String strProductOrServiceGroupSequenceNumber)

      Retrieve Product/Service Group Sequence Number (SI) This field tell about : Unique sequence number for the Product/Service Group (3) – starts with 1, then 2, etc. for each unique Product/Service Group in this Invoice.
      Parameters:
        `strProductOrServiceGroupSequenceNumber` - - string of provide or service group sequence number.

    - #### setProductOrServiceGroupSequenceNumber

          public void setProductOrServiceGroupSequenceNumber(SI objProductOrServiceGroupSequenceNumber)

      Retrieve Product/Service Group Sequence Number (SI) This field tell about : Unique sequence number for the Product/Service Group (3) – starts with 1, then 2, etc. for each unique Product/Service Group in this Invoice.
      Parameters:
        `SI` - - object of provide or service group sequence number.

    - #### getAdjudicateAsGroup

          public ID getAdjudicateAsGroup()

      Retrieve Adjudicate as Group (ID) Adjudicate all Product/Service Line Items together as a group (IPRs will be reported against the Product/Service Group).
      Returns:
        ID - object of Adjudicate as Group.

    - #### setAdjudicateAsGroup

          public void setAdjudicateAsGroup(java.lang.String strAdjudicateAsGroup)

      Retrieve Adjudicate as Group (ID) Adjudicate all Product/Service Line Items together as a group (IPRs will be reported against the Product/Service Group).
      Parameters:
        `strAdjudicateAsGroup` - - string of Adjudicate as Group.

    - #### setAdjudicateAsGroup

          public void setAdjudicateAsGroup(ID objAdjudicateAsGroup)

      Retrieve Adjudicate as Group (ID) Adjudicate all Product/Service Line Items together as a group (IPRs will be reported against the Product/Service Group).
      Parameters:
        `ID` - - object of Adjudicate as Group.

    - #### getProductOrServiceGroupBilledAmount

          public CP getProductOrServiceGroupBilledAmount()

      Retrieve Product/Service Group Billed Amount (CP) This field is about Sum of all Product/Service Billed Amounts for all Product/Service Line Items for this Product/Service Group.
      Returns:
        CP - object of Product or service group billed amount

    - #### setProductOrServiceGroupBilledAmount

          public void setProductOrServiceGroupBilledAmount(MO objPrice,
                                                  java.lang.String strPriceType,
                                                  java.lang.String strFormValue,
                                                  java.lang.String strToValue,
                                                  CWE objRangeUnits,
                                                  java.lang.String strRangeType)

      Set Product/Service Group Billed Amount (CP) This field is about Sum of all Product/Service Billed Amounts for all Product/Service Line Items for this Product/Service Group.
      Parameters:
        `objPrice` - - Gives information about the Price.
        `strPriceType` - - Gives information about Type of Price.
        `strFormValue` - - Gives information about Form Value.
        `strToValue` - - Tell about the To value.
        `objRangeUnits` - - Specifies about the range of the units.
        `strRangeType` - - Specifies obut the Type of range.

    - #### setProductOrServiceGroupBilledAmount

          public void setProductOrServiceGroupBilledAmount(CP objProductOrServiceGroupBilledAmount)

      Set Product/Service Group Billed Amount (CP) This field is about Sum of all Product/Service Billed Amounts for all Product/Service Line Items for this Product/Service Group.
      Parameters:
        `CP` - - object of Product Or Service Group Billed Number.

    - #### getProductOrServiceGroupDescription

          public ST getProductOrServiceGroupDescription()

      Retrieve Product/Service Group Description (ST) This field is about Product/Service Group description or heading.
      Returns:
        ST - return object of Product or Service Group description

    - #### setProductOrServiceGroupDescription

          public void setProductOrServiceGroupDescription(java.lang.String strProductOrServiceGrouoDescription)

      Retrieve Product/Service Group Description (ST) This field is about Product/Service Group description or heading.
      Parameters:
        `String` - - string of Product or service group description.

    - #### setProductOrServiceGroupDescription

          public void setProductOrServiceGroupDescription(ST objProductOrServiceGroupDescription)

      Retrieve Product/Service Group Description (ST) This field is about Product/Service Group description or heading.
      Parameters:
        `objProductOrServiceGroupDescription-` - object of Product or service group description.

    - #### 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 {PSG} while parsing PSG segment validate method will check for its mandatory presence. [PSG] in this case validate will throw exception if one tries to enter more than one PSG segment.
      Specified by:
        `validate` in interface `ISegment`
      Overrides:
        `validate` in class `Segment`
      Returns:
        boolean - true or false.
      Throws:
        `InvalidSegmentException` - Throws when Segment Validation fails.