Hi, seems like you are trying to construct a IHE PDQ Query. There are a some issues, which are related to the standard definition of QPD-3.
1. There is no QBP^Q22^QBP_K21 message. Did you mean QBP^Q22^QBP_Q21 ? 2. The HL7 v2.5 standard defines QPD-3 as a non-repeatable field of variable type (HAPI: Varies). HL7 wants you to pass each query parameter in QPD-3, QPD-4 etc., respectively. PDQ, however, wants all the query parameters in a repeatable QPD-3 field, which obviously contradicts with the standard. Oh well. So, for this purpose you can define a custom QBP_Q21 message structure class that defines a custom QPD segment having QPD-3 as a repeatable field of type QIP - see http://hl7api.sourceforge.net/base/apidocs/index.html for some guidelines. If you instantiate an instance of your custom QBP_Q21 class, you can use the Terser and just write terser.set("/QPD-3(0)-1", "@PID.5.1") terser.set("/QPD-3(0)-2", "SMITH") terser.set("/QPD-3(1)-1", "@PID.5.1") terser.set("/QPD-3(1)-2", "JOHN") 3. Concerning your second question: Even when using the Terser correctly with VARIES types, this results in creating GenericPrimitives or GenericComposite objects that don't render very well in XML encoding. Better create your field first and add it to the segment. You are not required to use Terser, of course: QIP qip = new QIP(msg) msg.getQPD().getUserParametersInsuccessivefields().setData(qip) // not defined repeatable here! qip.getSegmentFieldName().setValue("@PID.5.1") qip.getValues().setValue("SMITH") // ... Hope this helps regards Christian Ohr Open eHealth Integration Platform (IPF) - http://gforge.openehealth.org/gf/project/ipf/ Courvoisier, Loic (EXT) wrote: > > Hi, > > In a QBP^Q22^QBP_K21 message, I am trying to construct the QPD.3 field, > DemographicsFields. This field contains as many QIP elements as > demographics fields. > I tried to use the terser to set the values : > > terser.set("/QPD-3(0)/QIP-1", "@PID.5.1"); > terser.set("/QPD-3(0)/QIP-2", "SMITH"); > > terser.set("/QPD-3(1)/QIP-1", "@PID.5.2"); > terser.set("/QPD-3(1)/QIP-2", "JOHN"); > > This set the values in the correct place, but when I use the > DefaultXMLParser to encode the message, I have some "UNKNOWN" element > names instead of QIP. > > Furthemore, is there a way not to use the terser to set these values ? E.g > : qpd.getUserParametersInSuccessivefields().XXXXXXXXXXXXXXXXXX. > > Any help welcome ! > > Thanks, > > Loïc Courvoisier > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > 30-Day > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Hl7api-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > -- View this message in context: http://old.nabble.com/How-to-build-the-QBP_K22-demographic-fields---tp26236748p26258127.html Sent from the hl7api-devel mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Hl7api-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/hl7api-devel

