Varies is a Type used as a placeholder for another Type in cases where the appropriate Type is not known until run-time (e.g. OBX-5). Parsers and validators may have logic that enforces restrictions on the Type based on other features of a segment.
If you want to set both the type and the values of a Varies object, you should set the type first by calling setData(Type t), keeping a reference to your Type, and then set values by calling methods on the Type. Here is an example:
CN cn = new CN();
variesObject.setData(cn);
cn.getIDNumber().setValue("foo");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|