public class SSAListHelper
extends java.lang.Object
SSAListHelper
class is used to construct a segment search argument (SSA) qualification statement
string. You can set DL/I command codes for the SSAs, with the exception of lock classes and the C command code.
The following code example shows how to set the SSA qualification statement string using the
SSAListHelper
to return return the last patient admitted to all of the
wards with more than five doctors and less than three nurses in hospital "ALEXANDRIA"):
SSAListHelper sh = new SSAListHelper();
sh.addInitialQualification("Hospital", "HospName", SSAListHelper.EQUALS, "ALEXANDRIA");
sh.appendQualification("Ward", SSAListHelper.AND, "Doccount", SSAListHelper.GREATER_THAN, 5);
sh.appendQualification("Ward", SSAListHelper.OR, "Nurcount", SSAListHelper.LESS_THAN, 3);
sh.addCommandCode("Patient", SSAListHelper.CC_L);
iSpec.setSSAList(sh.toString());
Modifier and Type | Field and Description |
---|---|
static byte |
AND
Constant indicating the boolean operator
AND in an SSA qualification statement |
static byte |
CC_D
Constant indicating the D command code (path call)
|
static byte |
CC_L
Constant indicating the L command code (last occurrence)
|
static short |
EQUALS
Constant indicating the relational operator for equals (=) in an SSA qualification statement
|
static short |
GREATER_OR_EQUAL
Constant indicating the relational operator for greater than or equal to (>=) in an SSA qualification statement
|
static short |
GREATER_THAN
Constant indicating the relational operator for greater than (>) in an SSA qualification statement
|
static byte |
INDEPENDENT_AND
Constant indicating the boolean operator
INDEPENDENT AND in an SSA qualification statement |
static short |
LESS_OR_EQUAL
Constant indicating the relational operator for less than or equal to (<=) in an SSA qualification statement
|
static short |
LESS_THAN
Constant indicating the relational operator for less than (<) in an SSA qualification statement
|
static short |
NOT_EQUAL
Constant indicating the relational operator for not equal to (!=) in an SSA qualification statement
|
static byte |
OR
Constant indicating the boolean operator
OR in an SSA qualification statement |
Constructor and Description |
---|
SSAListHelper() |
Modifier and Type | Method and Description |
---|---|
void |
addCommandCode(java.lang.String segmentName,
byte commandCode)
Add a command code to the
SSAList . |
void |
addInitialQualification(java.lang.String segmentName,
java.lang.String fieldName,
short relationalOp,
java.lang.String value)
Add the initial qualification statement to the
SSAList . |
void |
addSSA(java.lang.String segmentName)
Add an initial unqualified statement to the
SSAList . |
void |
appendQualification(java.lang.String segmentName,
byte booleanOp,
java.lang.String fieldName,
short relationalOp,
java.lang.String value)
Append a qualification statement to the specified SSA in the
SSAList . |
java.lang.String |
toString()
Returns the
SSAList in the form of a string. |
public static final short EQUALS
public static final short GREATER_OR_EQUAL
public static final short LESS_OR_EQUAL
public static final short GREATER_THAN
public static final short LESS_THAN
public static final short NOT_EQUAL
public static final byte AND
AND
in an SSA qualification statementpublic static final byte OR
OR
in an SSA qualification statementpublic static final byte INDEPENDENT_AND
INDEPENDENT AND
in an SSA qualification statementpublic static final byte CC_D
public static final byte CC_L
public void addCommandCode(java.lang.String segmentName, byte commandCode) throws javax.resource.ResourceException
SSAList
.segmentName
- the name of the segment in the SSAList
commandCode
- the command code to addjavax.resource.ResourceException
- if an error occurs during processingpublic void addInitialQualification(java.lang.String segmentName, java.lang.String fieldName, short relationalOp, java.lang.String value) throws javax.resource.ResourceException
SSAList
.segmentName
- the name of the segment in the SSAList
to add the qualification tofieldName
- the name of the fieldrelationalOp
- the relational operator to use - one of the SSAList
constantsvalue
- the value of the field as a Stringjavax.resource.ResourceException
- if an error occurs during processingpublic void appendQualification(java.lang.String segmentName, byte booleanOp, java.lang.String fieldName, short relationalOp, java.lang.String value) throws javax.resource.ResourceException
SSAList
.segmentName
- the name of the segment in the SSAList
to add the qualification tobooleanOp
- the boolean operator to use to connect this qualification to the previous - one of the
SSAList
constantsfieldName
- the name of the fieldrelationalOp
- the relational operator to use - one of the SSAList
constantsvalue
- the value of the field as a Stringjavax.resource.ResourceException
- if an error occurs during processingpublic void addSSA(java.lang.String segmentName) throws javax.resource.ResourceException
SSAList
.segmentName
- the name of the segment in the SSAList
to add the qualification tojavax.resource.ResourceException
public java.lang.String toString()
SSAList
in the form of a string.toString
in class java.lang.Object
String
.