From: <Fre...@cl...> - 2003-10-21 08:46:10
|
Hi, Calling value.setValue("\"\""); do work, except for date/time/telephone datatypes which do format=20 checking. I've made the following modifications, all in package=20 ca.uhn.hl7v2.model.primitive (I still use release 0.3): In CommonDT.java, method setValue (line 88): if (val!=3Dnull && !val.equals("") && !val.equals("\"\"")){ In CommonTM.java, methods setValue (line 117): if (val!=3Dnull && !val.equals("") && !val.equals("\"\"")){ and getValue (line 479): if (value!=3Dnull && !value.equals("") && !value.equals("\"\"")){ In CommonTS.java, methods setValue (line 121): if (val!=3Dnull && !val.equals("") && !val.equals("\"\"")){ ... if (val!=3Dnull && (val.equals("") || val.equals("\"\""))){ dt =3D new CommonDT(); dt.setValue(val); tm =3D new CommonTM(); tm.setValue(val); }//end if and getValue: if(tm!=3Dnull && value!=3Dnull && !value.equals("") &&=20 !value.equals("\"\"")){ In CommonTN.java (line 110; not tested yet!): if (value!=3Dnull && !value.equals("") && !value.equals("\"\"")){ ... } else{ if (value.equals("\"\"")){ countryCode =3D ""; areaCode =3D ""; phnNumber =3D value.trim(); extension =3D ""; beeper =3D ""; comment =3D ""; } else{ //set the private value field to null or empty space. countryCode =3D value; areaCode =3D value; phnNumber =3D value; extension =3D value; beeper =3D value; comment =3D value; } }//end else =20 By the way, there is a little bug in this method setValue: if the phone=20 number starts with an hyphen (-), an IndexOutOfBoundsException occurs.=20 I've changed like this (line 171): // if (hyphen =3D=3D -1){ if (hyphen < 3){ String msg =3D "The phone number component must be=20 supplied and should " + "be in the following format [999-9999]"; Yours, > >--__--__-- > >Message: 2 >From: "Tripp, Bryan" <Bry...@uh...> >To: "'Ackley, Keith A'" <kei...@ed...>,=20 > "'hl7...@li...'" > <hl7...@li...> >Subject: RE: [HAPI-devel] How to get null in the generated message? >Date: Mon, 20 Oct 2003 17:15:04 -0400 > >Hi Keith, > >It should be this:=20 > >value.setValue("\"\""); > >... (i.e. a sting with two double-quotes in it). This differentiates it >from an empty value which as you know has a different meaning in HL7. I= f >that doesn't work please let me know. =20 > >Bryan=20 > > =20 > >>-----Original Message----- >>From: Ackley, Keith A [mailto:kei...@ed...] >>Sent: October 20, 2003 2:35 PM >>To: 'hl7...@li...' >>Subject: [HAPI-devel] How to get null in the generated message? >> >> >>Hi, >> >>I'm trying to send a null value, which should be transmitted=20 >>as two double >>quote marks (""). I have tried calling setValue with null and=20 >>with "". It >>does not appear to work for any type. For example, I have tried >> >>ca.uhn.hl7v2.model.v24.datatype.NM value =3D new >>ca.uhn.hl7v2.model.v24.datatype.NM() >>value.setValue(null); >> >>And=20 >> >>ca.uhn.hl7v2.model.v24.datatype.NM value =3D new >>ca.uhn.hl7v2.model.v24.datatype.NM() >>value.setValue(""); >> >>Both approaches result in the value being omitted from the generated >>message. How do I get the parser to produce ""? >> >>Thanks, >>Keith >> >> >> >>------------------------------------------------------- >>This SF.net email is sponsored by OSDN developer relations >>Here's your chance to show off your extensive product knowledge >>We want to know what you know. Tell us and you have a chance=20 >>to win $100 >>http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54 >>_______________________________________________ >>Hl7api-devel mailing list >>Hl7...@li... >>https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> >> =20 >> > > >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 th= e >sender and >delete all copies. Opinions, conclusions or other information contained = in >this e-mail may not be that of the organization. > > > > >--__--__-- > >_______________________________________________ >Hl7api-devel mailing list >Hl7...@li... >https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > >End of Hl7api-devel Digest > =20 > --=20 Fr=E9d=E9ric Dubru Cliniques universitaires Saint-Luc 10, avenue Hippocrate B-1200 Bruxelles +32 2 764 36 43 http://www.saintluc.be |