ca.uhn.hl7v2.model.v26.segment.PSS Maven / Gradle / Ivy
/*
* This class is an auto-generated source file for a HAPI
* HL7 v2.x standard structure class.
*
* For more information, visit: http://hl7api.sourceforge.net/
*/
package ca.uhn.hl7v2.model.v26.segment;
// import ca.uhn.hl7v2.model.v26.group.*;
import ca.uhn.hl7v2.model.v26.datatype.*;
import ca.uhn.log.HapiLogFactory;
import ca.uhn.hl7v2.HL7Exception;
import ca.uhn.hl7v2.parser.ModelClassFactory;
import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
import ca.uhn.hl7v2.model.AbstractMessage;
import ca.uhn.hl7v2.model.Group;
import ca.uhn.hl7v2.model.Type;
import ca.uhn.hl7v2.model.AbstractSegment;
import ca.uhn.hl7v2.model.Varies;
/**
*Represents an HL7 PSS message segment (Product/Service Section).
* This segment has the following fields:
*
* - PSS-1: Provider Product/Service Section Number (EI)
*
- PSS-2: Payer Product/Service Section Number (EI) optional
*
- PSS-3: Product/Service Section Sequence Number (SI)
*
- PSS-4: Billed Amount (CP)
*
- PSS-5: Section Description or Heading (ST)
*
*/
public class PSS extends AbstractSegment {
/**
* Creates a new PSS segment
*/
public PSS(Group parent, ModelClassFactory factory) {
super(parent, factory);
init(factory);
}
private void init(ModelClassFactory factory) {
try {
this.add(EI.class, true, 1, 73, new Object[]{ getMessage(), new Integer(0) }, "Provider Product/Service Section Number");
this.add(EI.class, false, 1, 73, new Object[]{ getMessage(), new Integer(0) }, "Payer Product/Service Section Number");
this.add(SI.class, true, 1, 4, new Object[]{ getMessage(), new Integer(0) }, "Product/Service Section Sequence Number");
this.add(CP.class, true, 1, 254, new Object[]{ getMessage(), new Integer(0) }, "Billed Amount");
this.add(ST.class, true, 1, 254, new Object[]{ getMessage(), new Integer(0) }, "Section Description or Heading");
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating PSS - this is probably a bug in the source code generator.", e);
}
}
/**
* Returns
* PSS-1: "Provider Product/Service Section Number" - creates it if necessary
*/
public EI getProviderProductServiceSectionNumber() {
EI ret = null;
try {
Type t = this.getField(1, 0);
ret = (EI)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSS-1: "Provider Product/Service Section Number" - creates it if necessary
*/
public EI getPss1_ProviderProductServiceSectionNumber() {
EI ret = null;
try {
Type t = this.getField(1, 0);
ret = (EI)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSS-2: "Payer Product/Service Section Number" - creates it if necessary
*/
public EI getPayerProductServiceSectionNumber() {
EI ret = null;
try {
Type t = this.getField(2, 0);
ret = (EI)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSS-2: "Payer Product/Service Section Number" - creates it if necessary
*/
public EI getPss2_PayerProductServiceSectionNumber() {
EI ret = null;
try {
Type t = this.getField(2, 0);
ret = (EI)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSS-3: "Product/Service Section Sequence Number" - creates it if necessary
*/
public SI getProductServiceSectionSequenceNumber() {
SI ret = null;
try {
Type t = this.getField(3, 0);
ret = (SI)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSS-3: "Product/Service Section Sequence Number" - creates it if necessary
*/
public SI getPss3_ProductServiceSectionSequenceNumber() {
SI ret = null;
try {
Type t = this.getField(3, 0);
ret = (SI)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSS-4: "Billed Amount" - creates it if necessary
*/
public CP getBilledAmount() {
CP ret = null;
try {
Type t = this.getField(4, 0);
ret = (CP)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSS-4: "Billed Amount" - creates it if necessary
*/
public CP getPss4_BilledAmount() {
CP ret = null;
try {
Type t = this.getField(4, 0);
ret = (CP)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSS-5: "Section Description or Heading" - creates it if necessary
*/
public ST getSectionDescriptionOrHeading() {
ST ret = null;
try {
Type t = this.getField(5, 0);
ret = (ST)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSS-5: "Section Description or Heading" - creates it if necessary
*/
public ST getPss5_SectionDescriptionOrHeading() {
ST ret = null;
try {
Type t = this.getField(5, 0);
ret = (ST)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/** {@inheritDoc} */
protected Type createNewTypeWithoutReflection(int field) {
switch (field) {
case 0: return new EI(getMessage());
case 1: return new EI(getMessage());
case 2: return new SI(getMessage());
case 3: return new CP(getMessage());
case 4: return new ST(getMessage());
default: return null;
}
}
}