Discussion:
[HAPI-devel] How to build the QBP_K22 demographic fields ?
Courvoisier, Loic (EXT)
2009-11-06 18:40:26 UTC
Permalink
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
christian ohr
2009-11-09 08:08:33 UTC
Permalink
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/
Post by Courvoisier, Loic (EXT)
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.
terser.set("/QPD-3(0)/QIP-2", "SMITH");
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
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.
Courvoisier, Loic (EXT)
2009-11-09 09:21:44 UTC
Permalink
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:***@icw.de]
Envoyé : lundi 9 novembre 2009 09:09
À : hl7api-***@lists.sourceforge.net
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/
Post by Courvoisier, Loic (EXT)
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.
terser.set("/QPD-3(0)/QIP-2", "SMITH");
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
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.
christian ohr
2009-11-09 09:41:14 UTC
Permalink
Good point. There's a feature request
(http://sourceforge.net/tracker/?func=detail&aid=2793060&group_id=38899&atid=423838)
that addresses this problem.
The Terser currently only supports accessing primitives. I'm not a HAPI
committer, but you can use the sourceforge tracker of the HAPI project to
file a feature request, of course.

regards
Christian


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
--
View this message in context: http://old.nabble.com/How-to-build-the-QBP_K22-demographic-fields---tp26236748p26263507.html
Sent from the hl7api-devel mailing list archive at Nabble.com.
Loading...