From: Martin F. <mar...@po...> - 2004-05-26 15:12:37
|
Tripp, Bryan wrote: >5. The above steps are enough to allow you create and encode messages in the >custom format. If you also want to parse them, follow the instructions in >the JavaDocs for Parser.packageList() to register your message class with >the parsers. >Let me know if any of the above is unclear. > > Hi, I am also using my own messages, but registering the class doesn't seem to work. What am I doing wrong? I have messages like nl.portavita.hl7messages.model.v1.message.PVL_PV1 (extends abstractmessage) and message segments like nl.portavita.hl7messages.model.v1.segment.LGA (extends AbstractSegment). In my userdir I have created the directory 'custom_packages' with the file '2.2'. The contents of the file are: 'nl.portavita.hl7messages.model.v1' calling Parser.packageList results only in {'ca.uhn.hl7v2.model.v22.'} if I do (in processmessage(Message in)) LGA lga = (LGA)in.get("LGA"); I get a classcastexception. (the 'get-method' returns an abstractSegement, and if I inspect it, i can find the complete original message somewhere inside) I have decided to put the messages under '.message', as happens in the HAPI, but the JavaDoc has an example with '.messages'. Do I need to place all messages under '.messages' instead? Or do I have to place the file somewehere else, or do I need to load the file somehow? Regards, Martin |