Referencing subcomponents in an xlate

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Referencing subcomponents in an xlate

  • Creator
    Topic
  • #53416
    George Kulz
    Participant

      Hi all

      I want to be able to search for a value in a particular subcomponent within a component within a field. So, if the data is formatted like this in a field:

      |Name&Value^AnotherName&AnotherValue|

      I want to be able to reference the subcomponent that “Value” is sitting in. Does anyone know how to do this in an xlate?

      Thank you.

      George Kulz

      Senior Java Programmer

      Information Services

      Memorial Hospital of Rhode Island

    Viewing 2 reply threads
    • Author
      Replies
      • #77620
        Levy Lazarre
        Participant

          Hi George,

          It’s usually easy to determine the addressing path of a subcomponent if you have a sample message.

          Just run the sample message through your Xlate using the GUI Testing Tool. Make sure to turn the Detail level to 4 (most) and run the test. The Result pane will display the path for all subcomponents, including the one you are looking for.

          Example: I accessed a subcomponent of OBR.4 the following way:

          2(0).1(0).0(0).OBR(0).00238(0).[0].[1]

          I hope this helps.

        • #77621
          George Kulz
          Participant

            Thank you Levy. This seems to do the trick, although I’ve found through some experimentation that it’s the “” character that denotes a subcomponent, not “&”. “&” doesn’t seem to do anything at all.

            -George

          • #77622
            Jim Kosloskey
            Participant

              George,

              In HL/7 the character that is used for separation of a sub-component is defined in the MSH segment (MSH-2) of the message.

              There are multiple characters in that field. The standard is ^~&.

              However, your sending system may be using a different character set (may have even transposed some of the standard characters – I have seen that before). So it is wise for each integration to identify what the sending and receiving systems use for MSH-1 and MSH-2 before proceeding.

              email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

          Viewing 2 reply threads
          • The forum ‘Cloverleaf’ is closed to new topics and replies.