Hi all,

I am new in this community. So nice to meet you !
Thanks for developing HAPI which is so useful for me.

I have one question. I want to manage different version of HL7, so I use
the CanonicalModelClassFactory.  I The documentation seems to tell me that a
higher version model can be used to parse a lower one. I don't understand
why I have a parse error when I try this :

      CanonicalModelClassFactory factory = new CanonicalModelClassFactory(
"2.4");

factory.reloadPackages();

PipeParser parser = new PipeParser(factory);


   String msgHl7 = ... // a 2.2 HL7 message;

   Message hapiMsg = parser.parse(msgHl7);


--> HL7 exception "Failed validation ..."


It works if I instantiate the factory with "2.2" or "2.3".


---------------

Remarks : I do not understand the constructor of the GenericParser :


   public GenericParser(ModelClassFactory theFactory) {

        super(theFactory);



        pipeParser = new PipeParser();

        xmlParser = new DefaultXMLParser();

        setPipeParserAsPrimary();

}



Should not be (??):




public GenericParser(ModelClassFactory theFactory) {

        pipeParser = new PipeParser(theFactory);

        xmlParser = new DefaultXMLParser(theFactory);

        setPipeParserAsPrimary();

}


-- 
Stéphane Cambon
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Hl7api-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to