Thanks Christian,

That solved my problem but I'm still curious about overriding the default 
validation, is it possible to override the predicate that is set in the 
DefaultValidationWithoutTNBuilder?  For example, for a specific segment, if I 
am interested in allowing a space in the TN field using the predicate 
matches(String), I find that the compiler continues to complain at the calling 
of the super.  Eg.

<code>
public class newValidation extends DefaultValidationWithoutTNBuilder{
@Override
        protected void configure(){
            super.configure();
            forAllVersions().message("ADT","A01").terser("MSH-6",matches(".*"));
}}
</code>

I get a compile time error about failing a primitive for date-time.

Is there an easy way to override the default primitive?

Many thanks for your help.

Andrew

From: Christian Ohr [mailto:christian....@gmail.com]
Sent: Monday, 23 September 2013 5:22 PM
To: Andrew Bowden
Cc: hl7api-devel@lists.sourceforge.net
Subject: Re: [HAPI-devel] HAPI 2.1 and overriding validation

Hi Andrew,
note that there is only a (primitive) validation for TN, not for XTN, in 
DefaultValidationBuilder.
And, there is the DefaultValidationWithoutTNBuilder for exactly the reason you 
mentioned. So subclass this builder instead.
Hope this helps
Christian

2013/9/23 Andrew Bowden 
<andrew.bow...@rch.org.au<mailto:andrew.bow...@rch.org.au>>
Hi there,

I have recently started using HAPI and am impressed by the amount of function 
in the toolkit.  I have been struggling for about a week with the correct way 
to override the validation and am hoping that someone on this list can help me.

I have a segment that fails validation for an XTN type (as I am out of the US), 
I would like to keep validation on but change the validation for this segment.  
I realize that I can turn off validation for the message but am curious as to 
the best way to approach this problem.

I have tried the HAPI by example method of extending the 
DefaultValidationBuilder and overriding the configure method, however the first 
call to super overrides the rule that I have provided to the method.  I have 
also seen an example of extending the ValidationContextImpl 
(http://osdir.com/ml/medical.hl7/2008-07/msg00003.html), but this appears to be 
an older approach to the problem.

I would appreciate any help that can be provided to point me in the right 
direction.

Andrew

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net<mailto:Hl7api-devel@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to