Announcement

Collapse
No announcement yet.

Saving a modified message

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

  • Saving a modified message

    I have just loaded version 1.2 and have been running a transform which I wrote for vers 1.1

    Under 1.1 I was able to save a transformed message with:

    hl7_xml = new_msg;

    under 1.2 it appears this no longer works. Is there another method to save a modified message under 1.2?

    Greg...

  • #2
    Re: Saving a modified message

    If you modify the "msg" XML in the transformer, Mirth will automatically use this to generate the message.encodedData value.

    hl7_xml is now "message.transformedData" (or message.getTransformedData() from JS).

    The "msg" Javascript variable is the transformed data in XML format. (Same as hl7_xml was in 1.1.x).

    Let me know if this helps!
    -Chris
    Chris Lang

    Comment


    • #3
      Re: Saving a modified message

      I have the same problem (1.1 to 1.2).

      I need more examples. I missing something.

      The explication from Chrisl is not enough for me.

      Where I can find the full description of all methods ?

      I try to change de version number, 2.4. to 2.3.
      In Transformed message, a can seen de change.
      But in Encoded message, the field is empty

      Transformer
      Code to change JS:
      msg['MSH']['MSH.12']['VID.1'] = '2.3';
      message.transformedData = msg;


      Original:
      |ADT^A31^ADT_A05|20559|P^T|2.4^^|

      Transformed message
      <MSH.12>
      <VID.1>2.3</VID.1>

      Encoded message
      |ADT^A31^ADT_A05|20559|P^T||



      Thank you.
      Gilbert.

      Comment


      • #4
        Re: Saving a modified message

        Gilbert -

        Your issue is due to the fact that HL7 v2.3 stores the version in a different field than HL7 v2.3.1, 2.4 and 2.5.

        Try:

        msg[&#039;MSH&#039;][&#039;MSH.12&#039;] = &#039;2.3&#039;;
        message.transformedData = msg;

        The VID.1 type was defined in 2.3.1 and subsequent versions.

        -Chris
        Chris Lang

        Comment


        • #5
          Re: Saving a modified message

          Thanks Chris,

          I have the transforms working again.

          Greg...

          Comment

          Working...
          X