pix query example

121 views
Skip to first unread message

Arnold

unread,
Jun 26, 2014, 10:06:25 AM6/26/14
to ipf-...@googlegroups.com
Hi !

I'm struggling with the HL7 Message creation using ipf in an external groovy script. I'm trying to create a PIX Query message but the only way I could get it working is like this:
MessageAdapter msg = new MessageAdapter( MessageUtils.makeMessage(new DefaultModelClassFactory(), 'QBP', 'Q23', '2.5'))
msg.MSH[3] = 'ARNOLD';
...


this doesn't support auto completion in eclipse and it is very complicated for someone to edit the groovy script. Which other possibilities are there to create a HL7 message in code (not from a hl7 file) which gives some sort of auto completion in eclipse ?

yours

Arnold

Dmytro Rud

unread,
Jun 26, 2014, 10:14:47 AM6/26/14
to ipf-...@googlegroups.com
Hi Arnold,

You may consider using the HAPI library instead of the Groovy HL7 DSL...

Best regards
Dmytro


--
You received this message because you are subscribed to the Google Groups "ipf-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ipf-user+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Arnold

unread,
Jun 26, 2014, 10:23:33 AM6/26/14
to ipf-...@googlegroups.com
So it's not possible with ipf to create such a message ?

Arnold

unread,
Jun 26, 2014, 10:39:25 AM6/26/14
to ipf-...@googlegroups.com
I also tried it now with the HAPI classes and I get the following error:

---------------------------------------------------------------------------------------------------------------------------------------
groovy.lang.ReadOnlyPropertyException: Cannot set readonly property: sendingApplication for class: ca.uhn.hl7v2.model.v25.segment.MSH
        at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:2548)
        at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:3465)
        at org.codehaus.groovy.runtime.InvokerHelper.setProperty(InvokerHelper.java:196)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.setProperty(ScriptBytecodeAdapter.java:480)
        at com.mycompany.PixQueryBuilder.enrichPixQuery(PixQueryBuilder.groovy:25)



my groovy script looks like this:

QBP_Q21 msg = new QBP_Q21();
msg.MSH.sendingApplication = 'ARNOLD';

Dmytro Rud

unread,
Jun 26, 2014, 10:56:21 AM6/26/14
to ipf-...@googlegroups.com
MSH-3 is of type HD, therefore:

msg.MSH.sendingApplication.getNamespaceID.value = 'ARNOLD'


or (what I prefer):

msg.MSH.msh3_sendingApplication.hd1_namespaceID.value = 'ARNOLD'

Best regards
Dmytro

Reply all
Reply to author
Forward
0 new messages