weird regex validation error

View: New views
3 Messages — Rating Filter:   Alert me  

weird regex validation error

by tim.jones :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

I am newbie. I have a wierd issue. I am using HAPI 0.5.1 version.

I have a hl7 message template where in VALUE_TO_REPLACE field is changed each time but rest of the fields are constant (Please see the hl7 message example below).

VALUE_TO_REPLACE is replaced by the same length of chars each time programatically and validated using ca.uhn.hl7v2.parser.PipeParser.parse method.

Issue - The validation of only a particular hl7 message is always failing at ca.uhn.hl7v2.parser.PipeParser.parse method. I am not sure as which fields of the hl7 message is causing the validation error.

Your input/pointers is highly appreciated. Thanks in advance for your valuable time and interest.

The hl7 msg:

MSH^~|\&^XXX^XXX^XY^XYZ^20000220122222.582-0200~D^^QBP~Z99~QRY_Q01^1111188888888^T^2.4
QPD^ZZ^^ZZ^VALUE_TO_REPLACE^20000101^20100101^
RCP^I^100~RD^B

The exception:

ca.uhn.hl7v2.model.DataTypeException: Failed validation rule: Matches the regular expression (\+|\-)?\d*\.?\d*

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@...
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Re: weird regex validation error

by Michael Litherland :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Tim,

Are you using the normal carriage return delim between segments?  I  
hadn't seen carets as the field delim before so I tested it by loading  
it into my hl7 browser, saving it to ensure the seg delims were right  
and reopening after I confirmed they were.  It uses hapi 0.5.1 (I need  
to investigate upgrading one of these days) to provide very basic  
message validation and it seemed to pass just fine.

Mike

On Aug 20, 2009, at 1:10 PM, tim jones wrote:

> Hi all,
>
> I am newbie. I have a wierd issue. I am using HAPI 0.5.1 version.
>
> I have a hl7 message template where in VALUE_TO_REPLACE field is  
> changed each time but rest of the fields are constant (Please see  
> the hl7 message example below).
>
> VALUE_TO_REPLACE is replaced by the same length of chars each time  
> programatically and validated using  
> ca.uhn.hl7v2.parser.PipeParser.parse method.
>
> Issue - The validation of only a particular hl7 message is always  
> failing at ca.uhn.hl7v2.parser.PipeParser.parse method. I am not  
> sure as which fields of the hl7 message is causing the validation  
> error.
>
> Your input/pointers is highly appreciated. Thanks in advance for  
> your valuable time and interest.
>
> The hl7 msg:
>
> MSH^~|
> \&^
> XXX
> ^
> XXX
> ^XY^XYZ^20000220122222.582-0200~D^^QBP~Z99~QRY_Q01^1111188888888^T^2.4
> QPD^ZZ^^ZZ^VALUE_TO_REPLACE^20000101^20100101^
> RCP^I^100~RD^B
>
> The exception:
>
> ca.uhn.hl7v2.model.DataTypeException: Failed validation rule:  
> Matches the regular expression (\+|\-)?\d*\.?\d*
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008  
> 30-Day
> trial. Simplify your report design, integration and deployment - and  
> focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july_______________________________________________
> Hl7api-devel mailing list
> Hl7api-devel@...
> https://lists.sourceforge.net/lists/listinfo/hl7api-devel


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@...
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Re: weird regex validation error

by joe robles :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I programatically replace any new line after each segment with carriage return.

I am still having this weird issue.

I wonder if any one encountered this issue.

Thanks in advance.


Michael Litherland wrote:
Hi Tim,

Are you using the normal carriage return delim between segments?  I  
hadn't seen carets as the field delim before so I tested it by loading  
it into my hl7 browser, saving it to ensure the seg delims were right  
and reopening after I confirmed they were.  It uses hapi 0.5.1 (I need  
to investigate upgrading one of these days) to provide very basic  
message validation and it seemed to pass just fine.

Mike

On Aug 20, 2009, at 1:10 PM, tim jones wrote:

> Hi all,
>
> I am newbie. I have a wierd issue. I am using HAPI 0.5.1 version.
>
> I have a hl7 message template where in VALUE_TO_REPLACE field is  
> changed each time but rest of the fields are constant (Please see  
> the hl7 message example below).
>
> VALUE_TO_REPLACE is replaced by the same length of chars each time  
> programatically and validated using  
> ca.uhn.hl7v2.parser.PipeParser.parse method.
>
> Issue - The validation of only a particular hl7 message is always  
> failing at ca.uhn.hl7v2.parser.PipeParser.parse method. I am not  
> sure as which fields of the hl7 message is causing the validation  
> error.
>
> Your input/pointers is highly appreciated. Thanks in advance for  
> your valuable time and interest.
>
> The hl7 msg:
>
> MSH^~|
> \&^
> XXX
> ^
> XXX
> ^XY^XYZ^20000220122222.582-0200~D^^QBP~Z99~QRY_Q01^1111188888888^T^2.4
> QPD^ZZ^^ZZ^VALUE_TO_REPLACE^20000101^20100101^
> RCP^I^100~RD^B
>
> The exception:
>
> ca.uhn.hl7v2.model.DataTypeException: Failed validation rule:  
> Matches the regular expression (\+|\-)?\d*\.?\d*
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008  
> 30-Day
> trial. Simplify your report design, integration and deployment - and  
> focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july_______________________________________________
> Hl7api-devel mailing list
> Hl7api-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/hl7api-devel


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel