On Tuesday 04 August 2009 05:32:25 pm Serbulent Unsal wrote:
> Hi,
>
> I'm trying Hapi's message validation example [1] but I couldn't get regex
> rule exception as far as I change field values to non-valid ones. i.e in
> the example I change the validMessage as below;
>
> String validMessage = "MSH|^~\\&|MedSeries|CAISI_1-2|PLS|3910|something
> wrong here ||ADT^A31^ADT_A05|75535037-1237815294895|P^T|2.4\r\n"
> + "EVN|A31|200903230934\r\n"
> + "PID|1||29^^CAISI_1-2^PI~\"\"||Test300^Leticia^^^^^L||19770202|
> M||||||||||||||||||||||";
>
>
> and parser can still parse the message and give me the output as
> "Successfully parsed valid message"
>
>
> Can anyone repeat this ? And any ideas about situation ?
>
> Regards,

I can finally solve the situation with a small fix in 
"ca.uhn.hl7v2.model.v24.datatype.TS.java"

The problem was define of TS's first component as a ST value. Because of this 
situation validator does not apply regex matching rule "datetime" ( which is 
defined in ca.uhn.hl7v2.validation.impl.DefaultValidation )  on the "Date/Time 
Of Message" field.

So I change type of first component of TS class ( ST to TSComponentOne ) in  
"ca.uhn.hl7v2.model.v24.datatype.TS.java" as below

//              data[0] = new ST(message);
                data[0] = new TSComponentOne(message);

I know that this classes are produced automatically by source-generator but I 
can't find a better way to fix this bug. ( I hope it a bug not a feature :) )

James would u think fix this issue in the mainstream ? Or is there a better way 
to do this ?


-- 
Serbulent Unsal | Software Expert 
GSM : +90 555 697 50 46 | Tel : +90.312.478 48 00 
Akgun Softwares & Services Pvt. Ltd. 
Çetin Emeç Bulv. 4. Cad. No:5/3 
06460 A.Öveçler / ANKARA 

This e-mail and its attachments are private and confidential to the exclusive 
use of the individual or entity to whom it is addressed. It may also be 
legally confidential. Any disclosure, distribution or other dissemination of 
this message to any third party is strictly prohibited. If you are not the 
intended recipient, you may not copy, forward, send or use any part of it. If 
you are not the intended recipient or the person who is responsible to 
transmit to the intended recipient, please contact the sender by reply e-mail 
and destroy all copies of the original message and its attachments.

------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to