Re: [HAPI-devel] How to check if a segmen tis present in a message

2008-05-13 Thread [EMAIL PROTECTED]
I have a method: public boolean isFieldPresent(String pathToField, Terser terser) { try { String value = terser.get(pathToField); if (value!=null && value.length()>0) return true; } catch (ca.uhn.hl7v2.HL7Excep

Re: [HAPI-devel] How to check if a segmen tis present in a message

2008-05-13 Thread VIOT Yves
Okay... i don't know if it's a side effect but i have personnal classes like ADT_A05_FR which are just a copies with other segment for the French impl. I change the trigger by adding "_FR" on it and then i do an encode/parse and it result a GenericMessage$V25. that's the full design that wor

Re: [HAPI-devel] How to check if a segmen tis present in a message

2008-05-13 Thread Lansdale Redmond
Still didn't work for me. After parsing the message, I call getNames() and it returns all the segments..If I don't parse the message then how would it know which message structure to use? Below is a sample of what Im doing.. Here is my method parser = new GenericParser() ; hapiMes

Re: [HAPI-devel] How to check if a segmen tis present in a message

2008-05-13 Thread VIOT Yves
That's very stange because it works very well for me... Do you apply the getNames() on a ca.uhn.hl7v2.model.Message or on a for example : ca.uhn.hl7v2.model.v25.message.ADT_A09 Maybe, as the message structure is known, in the second one, it returns the segments that should be found in the mes