Hi Christian,

Thanks for your response. I obvioulsly meant QBP^Q22^QBP_Q21, the K21 was a 
mistake (and I realize there was another in the subject...). And yes, I wish to 
build an IHE PDQ query.
The idea of defining a custom QBP_Q21 message structure seems good, but it 
leads to new questions :
The DefaultModelClassFactory's javadoc says that if you create custom classes  
for messages, segments, etc. their names must correspond exactly to their name 
in the message text. It also says that there can only be one implementation of 
a particular message structure. So a new question : what should I do if I need 
to use my custom structure for the QBP_Q21 message, and the standard one ?

Another question : would you think worth in a future release of HAPI to allow 
to give the terser a datatype' object, instead of just a String ?
In my example, it would allow to write :

QIP qip1 = new QIP(msg)
// ...
terser.set("/QPD-3(0)", qip1)
// ...
QIP qip2 = new QIP(msg)
terser.set("/QPD-3(1)", qip2)

To finish, in the 3rd point, you give a piece of code that sets a sigle 
instance of a  QIP object in the QPD-3 segment, but to be clear, there is no 
way to set multiple values with this syntax ?

Best regards,

Loïc Courvoisier



-----Message d'origine-----
De : christian ohr [mailto:[email protected]] 
Envoyé : lundi 9 novembre 2009 09:09
À : [email protected]
Objet : Re: [HAPI-devel] How to build the QBP_K22 demographic fields ?


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

------------------------------------------------------------------------------
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

Reply via email to