HI Alessandro, I see in later emails that you have found a work-around. But, in case it's useful:
By default, HAPI's parser enforces a set of validation rules that ensure that messages being parsed conform to some basic data type requirements (such as no spaces in numeric types, which is what is getting you). You can turn this off by changing the validation context associated with the parser. E.g.: parser.setValidationContext(new ValidationContextImpl()); Message m = parser.parse(....); Cheers, James On Wed, May 5, 2010 at 11:52 AM, alessandro <[email protected]>wrote: > Hi all > > It is possible to parse a message who arrive with this error inside: > ... > OBR| |............... a space inside the OBR-1 > > > I tried to override the Pipe Parser in this way: > > // parser that replace 'OBR|_' with 'OBR|' > Parser parser = new PipeParser() { > > // We override the parse method to correct issues > public Message parse(String theMessage) throws > HL7Exception, EncodingNotSupportedException { > theMessage = theMessage.replace("OBR| ", "OBR|"); > return super.parse(theMessage); > }}; > > but: > > Unexpected Message Received: > MSH|^&~\|||||20100505154105.494-0100||ACK|85|P|2.4^MMSA|AE|8813|Failed > validation rule for value " ": Matches the regular expres > sion ~T~d*: Segme^MERR|^^^207\Application Internal Error\HL70357 > > Do you have a suggest? > Thanks in advance > Alessandro Del Prete > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Hl7api-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/hl7api-devel >
------------------------------------------------------------------------------
_______________________________________________ Hl7api-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/hl7api-devel

