Hi,
One way, but perhaps not the best (???), could be this:

String[] segNames = hapiMessage.getNames();


Then jsut browse your string array to find if your seg exists

Hope it helps

Bye



clarksonpj a écrit :
Great question, I would also like to know if there is a way of doing this. Right now I need to check each element for null.



Lansdale Redmond wrote:
How can I check if a segment is present in a message..when I do the
following code it always returns a value then if I read a field the vlue
is null..very similar to if it was there...how do you know the
difference

PID seg = (PID) hapiMessage.get("PID");

        if ( seg == null)

            return false;

        else

        return true;


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Hl7api-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hl7api-devel


:-)

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Hl7api-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to