From: Tripp, B. <Bry...@uh...> - 2004-07-14 16:17:43
|
Hi Iouri, Oops, sorry about that. It looks like we have to fix something. Let me take a look at it tonight and get back to you. Bryan -----Original Message----- From: Iouri Leonov To: Tripp, Bryan Cc: hl7...@li... Sent: 14/07/2004 12:00 PM Subject: RE: [HAPI-devel] How to use XML-binding to generate library class es for hapi parser? Hi Bryan, I am trying your idea of making hapi-compliant classes from an xml version of a conformance profile made by a Messaging Workbench. So I created IVLTest.mwb with standard A01 message with a twist - a custom ZVL segment. Then I created IVLTest.xml which among other things has a tag describing that ZVL custom segment. Next step - create classes using CongGen classes generator bundled in hapi-0.4.2.jar. Classes generator runs fine till it hits reference in A01 to my custom ZVL segment. This is what I am getting in the output: Generating Primitive: com.iouri.parser.generated.DG1children.DiagnosingClinician children.CompDegreeEgMD Generating Primitive: com.iouri.parser.generated.DG1children.DiagnosingClinician children.CompSourceTableId Generating Segment: com.iouri.parser.generated.SegDG1 ConformanceError: ca.uhn.hl7v2.conf.classes.exceptions.ConformanceError: Underlying HAPI class "ca .uhn.hl7v2.model.v22.message.ADT_A01" does not have accessor "getZVL()". This is probably a bug. Done. Hm!? I am wondering why it's happening. Are my settings are somehow wrong or classes generator has its own mind towards custom segments (he doesn't like the name of the segment I came up with ;)? Should you have five minutes to spare, may I ask you to have a look inside testPackage.zip where I put files mentioned in this message. Cheers, Iouri --- "Tripp, Bryan" <Bry...@uh...> wrote: > Hi Iouri, > > The instructions for making conformance classes are > here: > http://hl7api.sourceforge.net/conf/compiler.html > Conformance profiles are > normally written with the Messaging Workbench. Once > you have one, you can > use the HAPI tool to make corresponding classes. > > Alexei's suggestion is good though. If you go ahead > with that, conformance > profiles would also be a good source for these > transforms. > > HAPI uses the HL7 database to generate the code that > you download in the > source_vXX.zip files, i.e. most of what is under > ca.uhn.hl7v2.model.vXX. If > you have this database it's very easy to make the > classes (run the generate > and compile-gen Ant tasks). It's an access DB, and > it comes with forms for > adding segments, etc. The problem is that it is > expensive, so not many > people have it. It's for sale at > https://www.hl7.org/library/bookstore/ > > If there is interest, I'll ask the database creator > (Frank Oemig) whether we > could distribute an empty DB with the same structure > for free. I don't know > if the structure is considered intellectual property > or just the contents. > > Bryan > > > -----Original Message----- > > From: Iouri Leonov [mailto:iou...@ya...] > > Sent: July 13, 2004 1:23 AM > > To: hl7...@li... > > Subject: RE: [HAPI-devel] How to use XML-binding > to generate library > > class es for hapi parser? > > > > > > Hi Bryan, > > > > Thank you for your prompt and informative reply. > > > > Regarding the tool for generating Java classes > from > > HL7 conformance profiles. I am wondering what > tool is > > that? Is it available? Where could I see some docs > to > > figure out how to handle the tool? Is that tool > > somehow related to WHA Office of Information > Messaging > > Workbench? > > > > The same 'how-to' song with HL7 database. You > said > > that 'the message classes are normally generated > from > > the HL7 database'. Do those classes relate somehow > to > > classes in ca.uhn.hl7v2.model.vxx.message package? > > Well, I am very green both with hapi framework and > > with HL7 in general. Hence I do not have much of > an > > idea about that database schema nor about > > tools/techniques for generating from HL7 database > > records hapi-compliant Java classes (messages, > > segments, datatypes). Is there a way to provide > me > > with a link to info about this 'database HL7 > record - > > Java class' technique. > > > > Thanks again Bryan, > > > > Cheers, > > > > Iouri > > > > > > --- "Tripp, Bryan" <Bry...@uh...> wrote: > > > Hi Iouri, > > > > > > No, we don't have that. We do have a tool that > > > generates Java classes from > > > HL7 conformance profiles. These aren't message > > > classes, but wrappers that > > > further constrain underlying message classes to > > > agree with the profile. But > > > depending on how you want to use it this might > work > > > just as well for you. > > > > > > I should also point out that HAPI handles > unexpected > > > segments and fields > > > automatically, so normally you don't need to > make > > > corresponding custom > > > classes (although it does make some things more > > > convenient). > > > > > > Also, the message classes are normally generated > > > from the HL7 database, so > > > if you have access to that, it's just a matter > of > > > adding some entries to it. > > > I guess you could also make your own database > with > > > the same structure, if > > > you didn't have the standard one and wanted to > make > > > a lot of custom message > > > classes. > > > > > > Are any of the above satisfactory? > > > > > > Bryan > > > > > > -----Original Message----- > > > From: Iouri Leonov > > > To: hl7...@li... > > > Sent: 12/07/2004 2:17 PM > > > Subject: [HAPI-devel] How to use XML-binding to > > > generate library classes for > > > hapi parser? > > > > > > Good day developers. > > > > > > Recently I've started playing with hapi > framework. I > > > have a question > > > relating to configuration of messages. > > > > > > Let' say we have a very common scenario - a user > > > wants his custom > > > segment > > > ZUSER with some custom datatype MY_DT. I see the > > > only way to do it - > > > make > > > new Java files. I have to create a new > ZUSER.java in > > > segment package > > > and a > > > new MY_DT.java in datatype package. Then I have > to > > > go to message package > > > and > > > change message ADT_x.java file in order to make > it > > > work with these new > > > segment and datatype. Job that definitely > requires > > > skills of a Java > > > programmer. > > > > > > My question relates to ways of descriptive > > > programming. Is there a way > > > in > > > the current hapi implementations to describe the > > > content of my new > > > segment > > > and datatype not in .java file but rather in > some > > > XML file or in w3 XML > > > Schema file then run that xml instance through a > > > binding parser which > > > will > > > generate classes ZUSER.class and MY_DT.class > which > > > can be used directly > > > by > > > Pipe parser? Something in line with JAXB - XML > > > binding. If there is a > > > way, > > > then how to do it, if there's none - any idea > how to > > > make it happen? > > > > > > Cheers, > > > > > > Iouri Leonov > > > XML Developer > > > > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.Net email sponsored by Black Hat > Briefings & > > > Training. > > > Attend Black Hat Briefings & Training, Las Vegas > > > July 24-29 - > === message truncated === __________________________________ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail <<testPackage.zip>> This e-mail may contain confidential and/or privileged information for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies. Opinions, conclusions or other information contained in this e-mail may not be that of the organization. |