From: Tripp, B. <Bry...@uh...> - 2003-04-22 18:42:33
|
Hi Chris, Yep, this is definitely a bug. Hopefully not too hard to fix. Parser.findClass() could easily be extended to support Types. Then in fixOBX5(), findClass could be called like this: findClass(obx2.getValue(), segment.getMessage().getVersion(), "type"). I can do this, unless you or Alexei have already started. Let me know. Bryan > -----Original Message----- > From: Naylor, Chris [mailto:Chr...@uh...] > Sent: April 22, 2003 2:23 PM > To: HAPI Developers (E-mail) > Subject: [HAPI-devel] Custom OBX Segment Problem > > > Hello all, > > I'm using version 0.3 with Alexei's default class patch and > primarily 2.2 > messages. I'm trying to parse a custom message that includes a custom > segment and am having one problem. I'm still getting my feet > wet here, so > please forgive any indiscretions. > > My custom message type is working fine except for an > exception on the one > custom segment. I've setup the custom segment the same way > as the custom > message - within my custom_packages files. So my custom message is in > org.project.server.message and segment is in > org.project.server.segment. > Instead of creating a new segment type, I am just overriding > the OBX type. > All of this is according to the instructions in Parser, and I > am pretty sure > it is all working fine. > > The problem comes because I am processing an OBX segment. At > the end of > PipeParser's (and other parser's?) parse function, it calls > Varies.fixOBX5 > in order to set the datatype of the 5th field. This function > tries to set > the field type using the name of the segment class name. > > In my case, the custom segment class is > org.project.server.sgement.OBX. The > function then looks for the datatype by cutting the first > part of the class > name and adding the datatype to the end. So it takes > org.project.server and > adds the datatype, for example ST, to the end. > > String className = segment.getClass().getName(); > String versionPackageName = className.substring(0, > className.indexOf(".segment.OBX")); > String newClassName = versionPackageName + ".datatype." + > obx2.getValue(); > > Because I am not making any changes to the datatypes, I don't > even have a > package called org.project.server.datatype, and so I get a > classNotFound > exception. > > If I wanted this to work, I would have to copy all the > datatypes from the > standard version types into a custom datatype package. I've > tried this and > it works, but doesn't seem right. Similar to the way the > custom segments > are setup, I would think that when looking for a datatype, > the custom ones > should be searched first, and if a match is not found, should > proceed to the > standard datatypes. > > From talking with Alexei, it sounds like a patch is required, > but I wasn't > sure whether to post this as a bug or just to the list. Hope > the above is > clear. > > Thanks! > Chris > > > 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. > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Hl7api-devel mailing list > Hl7...@li... > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > 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. |