Announcement

Collapse
No announcement yet.

How to implement ACK with File writer (.ok file)

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

  • How to implement ACK with File writer (.ok file)

    Hello,

    I've a channel processing HL7 messages to multiple HPRIM (french format) messages, using FTP writers.

    On the outbound side, my receiving application only processes message that come with a .ok file as an ACK.
    So to be processed, a message 123456.xml fil needs to have its 123456.ok file.

    First, is it possible to generate this .ok file natively with the File wirter using FTP protocol ?

    If not, I already did it using a second File Writer and testing if the status of the first writer is SENT. But this strategy is not viable when we have several outbound connectors, because it doubles its number.

    The third idea I have is to use a response javascript transformer to send this .ok file on response (If status is sent for sure). Is it a good strategy ? Better than the second one ?

    Thank for your help.

    Lionel

  • #2
    Originally posted by lionelroux View Post
    Hello,

    I've a channel processing HL7 messages to multiple HPRIM (french format) messages, using FTP writers.

    On the outbound side, my receiving application only processes message that come with a .ok file as an ACK.
    So to be processed, a message 123456.xml fil needs to have its 123456.ok file.

    First, is it possible to generate this .ok file natively with the File wirter using FTP protocol ?

    If not, I already did it using a second File Writer and testing if the status of the first writer is SENT. But this strategy is not viable when we have several outbound connectors, because it doubles its number.

    The third idea I have is to use a response javascript transformer to send this .ok file on response (If status is sent for sure). Is it a good strategy ? Better than the second one ?

    Thank for your help.

    Lionel
    I agree that if there are a lot of destinations, using a subsequent File Writer may not be ideal because it can be a hassle to manage, and because you would be needlessly storing extra content. The response transformer idea would certainly work, but you would have to invoke Apache Commons FTP manually, rather than letting the File Writer handle it.

    Another option is to have a separate downstream channel to handle the actual FTP writing. It could take in an XML message with metadata about where the message is supposed to go (IP/directory/etc.) as well as the actual message. Then it could use a File Writer with Velocity variable replacements to actually dispatch the message. The File connectors keep an internal pool of connection objects, so they are already semi-intelligently reusing connections as needed.

    Then in your upstream channel, you can use a single destination, and manually route two messages downstream to the other channel. You would just have to build up the XML containing the metadata and message content, and then use router.routeMessage.
    Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

    Nicholas Rupley
    Work: 949-237-6069
    Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


    - How do I foo?
    - You just bar.

    Comment

    Working...
    X