Announcement

Collapse
No announcement yet.

Iterate Over Destination

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Iterate Over Destination

    Hello,

    I have a channel in which I need to execute a webservice call for each provider in the message, using the same webservice method for each call. Is there a way I can iterate over a destination or do I need to have a separate webservice destination for each possible provider field.

    Here's an example using PV1:

    PV1|1|OUTPATIENT|A1CBDI^A1453OR^A1453OR^10^DIRTY^^ ^^^353252&6152^|ROUTINE ELECTIVE||A1CBDI^A1AYA22^A1AYA22^10^^^^^^535462&64 79^|034405^SPOONER^STEPHEN^A.^^^^^PROV^^^^PROV|000 638^COTTON^ROBERT^A.^^^^^PROV^^^^PROV|

    What I need to do is grab the id (.1) from PV1.7, send it to a webservice which will give me a national provider ID for the physician. Then I need to do the exact same thing on PV1.8. I'm looking to consolidate this into a single destination which I can call multiple times. Unfortunately the webservice does accept collections.

    Thanks
    Steve

  • #2
    Would it be possible for you to create one channel to receive the message, then use a transformer to route the message(s) to a second channel which has the web service call?

    I think that would be much simpler than trying to have a dynamic number of destinations.

    -= Jack Haines : Founder/CEO of Healthcare Integrations, LLC
    -= [email protected]
    -= Mirth Connect (Advanced)-certified
    -= Gold member of HL7.org
    -= Available for Mirth Connect channel development and consultation! Schedule a FREE call with me at https://calendly.com/jackhaines

    Comment


    • #3
      Thanks Jack. The problem is that I have to use the webservice responses to supplement the current message (in flight).

      Comment


      • #4
        You would still have the entire message for each send. For example, "Channel A" would be where the original message comes in, with a Dr in PV1.7, PV1.8, and PV1.9. The transformer would check each location for those fields and place them in an array. Then, you would have a For Each loop that would use router.routeMessage to route the message to "Channel B" (with the webservice destination) for each PV1.7, 8, and 9.

        I would say this though, if you KNOW that it will always only be say, at most three values, PV1.7, PV1.8, PV1.9, the simple solution may just be to duplicate the web service destination x3 (with filters to only submit to it if it's not "")
        Last edited by jackwhaines; 03-11-2016, 11:05 AM.

        -= Jack Haines : Founder/CEO of Healthcare Integrations, LLC
        -= [email protected]
        -= Mirth Connect (Advanced)-certified
        -= Gold member of HL7.org
        -= Available for Mirth Connect channel development and consultation! Schedule a FREE call with me at https://calendly.com/jackhaines

        Comment

        Working...
        X