Announcement

Collapse
No announcement yet.

Manage RSP_ZV2 response

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

  • Manage RSP_ZV2 response

    Hi,
    I've a problem with a response transformation from XML to HL7v2.x when the response message has a RSP_ZA2 structure. I think this is a particular message structure, defined by IHE, to answer to a query message (QBP^ZV1).
    I manage the response with a javascript writer, using the XML features, but the final response that I've to send back to the client is a MLLP. My XML is perfect and it has the following structure:
    MSH
    MSA
    QAK
    QPD
    [
    PID
    PV1
    ]

    The problem is the final MLLP that changes the PIDs and PV1s segments order, putting all PIDs and then all PV1s segment.
    Where is my fault?
    Thank you!
    Attached Files
    Last edited by mpichinelli; 03-31-2020, 06:37 AM.

  • #2
    Where is the code or channel itself?
    Mirth 3.8.0 / PostgreSQL 11 / Ubuntu 18.04
    Diridium Technologies, Inc.
    https://diridium.com

    Comment


    • #3
      Originally posted by pacmano View Post
      Where is the code or channel itself?
      The channel export in attachment
      Attached Files

      Comment


      • #4
        I was worried about "manage the response with a javascript writer" that is why I asked for your code. I am ducking this one since your are writing the entire destination in javascript rather than using Mirth's native tools to message build. It will take me too long to decipher that code.
        Mirth 3.8.0 / PostgreSQL 11 / Ubuntu 18.04
        Diridium Technologies, Inc.
        https://diridium.com

        Comment


        • #5
          Originally posted by pacmano View Post
          I was worried about "manage the response with a javascript writer" that is why I asked for your code. I am ducking this one since your are writing the entire destination in javascript rather than using Mirth's native tools to message build. It will take me too long to decipher that code.
          Hi, unfortunately I don't know all the Mirth native features. In attachment you can find the channel without all the elaboration, just the static XML response. The problem is always the final transformation. Can you help me? Thank you
          Attached Files

          Comment


          • #6
            Originally posted by pacmano
            Code:
            tmp = SerializerFactory.getSerializer('HL7V2').fromXML(msg);
            And it returns:

            Code:
            MSH|^~\&|NBS|||NBS||||FENIX|||||ELCO||||||20200331154824|||||||||RSP|ZV2|RSP_ZV2||||||||345dd9bb-c240-4900-b7ec-0bdf9829abdc|P||||||||||||2.5|||||||||||||||NE|NE|ITA|ASCII
            MSA|AA|20200327125227987
            QAK|AAAA|OK|IHE PDQ Query||||2|2|0
            QPD|IHE PDQ Query||AAAA|@PV1.50.1|0000227|
            PID|||null|||PK|PK|||1932105|F||||||||||AT00000000004326
            PV1||I|PR0101||||||||U.O. CHIRURGIA GENERALE|||||||||||2008107260|||||||||||||||||||||||||||||||0000227
            PID|||null|||PK|PK|||1932105|F||||||||||AT00000000004326
            PV1||I|REP.09CH1||||||||CHIRURGIA GENERALE 1|||||||||||2008107260|||||||||||||||||||||||||||||||0000227
            How did you changed the channel? I haven't the same result

            Comment


            • #7
              I deleted my last post, agermano pointed out it did not serialize correctly.
              Mirth 3.8.0 / PostgreSQL 11 / Ubuntu 18.04
              Diridium Technologies, Inc.
              https://diridium.com

              Comment


              • #8
                I see several issues here.
                1. I don't see how your response.xml was produced by your code. I think you perhaps stripped out some necessary parts? I do not see where the PIPPO groupings are coming from.
                2. You have a variable named "resultGroup" in your javascript writer that is not defined.
                3. You aren't using the default mirth xml structure for hl7v2. The way you are building it (real hl7 xml) must be processed by the "strict parser" option which uses the hapi library rather than the mirth parser. However, the hapi parser does not recognize the RSP_ZV2 message type.
                4. When I modify the javascript writer to return the exact contents of your response.xml I do not get the same results. When using the default hl7 serializer in the response transformer it results in the entire message on a single line/segment. When I turn on the strict parser it drops the PID and PV1 segments completely. I do not understand how you have reordered segments in your result from what you have shared.


                I see two options here.
                1. Build your message as a different type and then modify it after serializing. It looks like RSP_Z82 will work if you add extra segments and groupings.
                2. Build mirth xml, which will require you to rebuild the QPD segment instead of including it from the original message.
                Last edited by agermano; 04-01-2020, 03:15 PM.

                Comment


                • #9
                  Originally posted by agermano View Post
                  I see several issues here.
                  1. I don't see how your response.xml was produced by your code. I think you perhaps stripped out some necessary parts? I do not see where the PIPPO groupings are coming from.
                  2. You have a variable named "resultGroup" in your javascript writer that is not defined.
                  3. You aren't using the default mirth xml structure for hl7v2. The way you are building it (real hl7 xml) must be processed by the "strict parser" option which uses the hapi library rather than the mirth parser. However, the hapi parser does not recognize the RSP_ZV2 message type.
                  4. When I modify the javascript writer to return the exact contents of your response.xml I do not get the same results. When using the default hl7 serializer in the response transformer it results in the entire message on a single line/segment. When I turn on the strict parser it drops the PID and PV1 segments completely. I do not understand how you have reordered segments in your result from what you have shared.


                  I see two options here.
                  1. Build your message as a different type and then modify it after serializing. It looks like RSP_Z82 will work if you add extra segments and groupings.
                  2. Build mirth xml, which will require you to rebuild the QPD segment instead of including it from the original message.
                  Hi, thank you for the reply.
                  I posted the channel two times. The second version is simplified, because the method that I used to produce the response is not cause of the problem. It contains only the final response that creates the problem. I attach newly the channel, the response and the processed response.
                  As you said, without using the strict parser, the MLLP is right but not contains any line feed.
                  As I said initially, RSP_ZV2 is a strange message type. The IHE raccommend to use it, but I don't find it in the HL7 standard structures, and I think that is the problem...
                  Unfortunately RSP_Z82 doesn't fit the structure that I need because requests some extra mandatory segments (AL1, ORC, etc.).
                  Thank you
                  Attached Files

                  Comment

                  Working...
                  X