From: Yuki Y. <nie...@ya...> - 2006-11-08 15:22:06
|
Thanks for your message. I appreciate your comments and I will definitely post a log asap. However in the meantime I'd like to suggest the following: My problem is that a message like MSH|^~\&|... PID|||... PV1||... SPM||... ORC|NW|... OBR||... ORC|NW|... OBR|| ORC|NW|... OBR||... Gets parsed as OML_O33_ORDER(rep0) -->OML_O33_OBSERVATION_REQUEST(rep0) ---->OBR ---->OML_O33_PRIOR_RESULT(rep0) ------->OML_O33_ORDER_PRIOR(rep0) ------->OML_O33_ORDER_PRIOR(rep1) However, following your reasoning, shouldn't one tend to think that the tricky flag may well be the "required" flag OML_O33_PRIOR_RESULT instead? this.add(OML_O33_PRIOR_RESULT.class, true, false); As far as I understand from the HL7 static definition for OML O33(in fact I am more interested in the IHE definition), prior results are not mandatory. public class OML_O33_OBSERVATION_REQUEST extends AbstractGroup { /** * Creates a new OML_O33_OBSERVATION_REQUEST Group. */ public OML_O33_OBSERVATION_REQUEST(Group parent, ModelClassFactory factory) { super(parent, factory); try { this.add(OBR.class, true, false); this.add(TCD.class, false, false); this.add(NTE.class, false, true); this.add(DG1.class, false, true); this.add(OML_O33_OBSERVATION.class, true, false); this.add(OML_O33_PRIOR_RESULT.class, true, false); } catch(HL7Exception e) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating OML_O33_OBSERVATION_REQUEST - this is probably a bug in the source code generator.", e); } } I would deeply appreciate further appreciations this subject. Thanks --- Torben Greiser <tor...@fi...> escribió: > Hi Yuki, > > the first thing you should to is enable debug > logging for > ca.uhn.hl7v2.parser so you can see what groups and > segments the parser > is looking at. > > I suppose you are using version 2.5 of the hl7 > specification. I don't > have it (only until 2.4) so I have to make guesses > upon the hapi source > code for version 2.5. > > > I am trying to parse OML^O33 messages with hapi > 0.5, > > but I am not able to do so for messages including > more > > than 1 OBR-ORC block. > > The OML_O33_SPECIMEN group contains a repeating > OML_O33_ORDER group > which itself contains a _non_ repeating > OML_O33_OBSERVATION_REQUEST group. > > Inside the OML_O33_OBSERVATION_REQUEST group is your > OBR segment and > another non-repeating group OML_O33_PRIOR_RESULT > which contains the > repeating group OML_O33_ORDER_PRIOR and finally > there is the ORC :-) > > If I am correct this means, that only one OBR-ORC is > allowed. > > > I think that after the first OBR-ORC the parser > thinks > > that the following OBR-ORC blocks are > > OML_O33_ORDER_PRIOR instead of OML_O33_ORDERs. > > Yes the parser seems to "think" correct. > > But inside the OML_O33_ORDER is no OBR segment, only > an ORC segment. > > Could you please post your message you are trying to > parse (maybe a bit > simplified if possible) so we can trace it down. > > Maybe a possible solution is to change the boolean > "required" of the ORC > segment to "false" and the boolean "repeating" value > of the > OML_O33_OBSERVATION_REQUEST to "true" in the > OML_O33_ORDER group > constructor in the source code. > > This would allow multiple ORC-OBR's inside your > message. > > public class OML_O33_ORDER extends AbstractGroup { > > /** > * Creates a new OML_O33_ORDER Group. > */ > public OML_O33_ORDER(Group parent, > ModelClassFactory factory) { > super(parent, factory); > try { > // changed "required" to false > this.add(ORC.class, false, false); > this.add(OML_O33_TIIMING.class, true, false); > // changed "repeating" to true > this.add(OML_O33_OBSERVATION_REQUEST.class, > false, true); > this.add(FT1.class, false, true); > this.add(CTI.class, false, true); > this.add(BLG.class, false, false); > } catch(HL7Exception e) { > > HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected > > error creating OML_O33_ORDER - this is probably a > bug in the source code > generator.", e); > } > } > [...] > > > Greets > > Torben > > > > I feel I must be missing something obvious. Can I > > someway force the parser to parse all OBR-ORC as > > observation orders instead of prior observation > > orders? > > > > Is there a generic/trick/workaround way to > instruct > > the parser to follow an specific route of parsing? > > > > Thank you very much > > > > > > > > > > ______________________________________________ > > LLama Gratis a cualquier PC del Mundo. > > Llamadas a fijos y móviles desde 1 céntimo por > minuto. > > http://es.voice.yahoo.com > > > > > ------------------------------------------------------------------------- > > Using Tomcat but need to do more? Need to support > web services, security? > > Get stuff done quickly with pre-integrated > technology to make your job easier > > Download IBM WebSphere Application Server v.1.0.1 > based on Apache Geronimo > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > _______________________________________________ > > Hl7api-devel mailing list > > Hl7...@li... > > > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > ______________________________________________ LLama Gratis a cualquier PC del Mundo. Llamadas a fijos y móviles desde 1 céntimo por minuto. http://es.voice.yahoo.com |