Need to swap the PID3 field to MDM file

Clovertech Forums Cloverleaf Need to swap the PID3 field to MDM file

  • Creator
    Topic
  • #122004
    petitPadawan
    Participant

      Hello everyone,
      I receive an MDM format from a publisher with two values ​​in the PID 3 field.
      When there are two values ​​in this field, I need to retrieve the value 2 in position 1.
      Is there a script or manipulation that allows this?

      example transform 1 to 2:

      message type 1:
      PID|||22222222^^^&1.2.34.8&ISO^INS~100456789^^^^PI||aa^bb^bb aa^^^^L~bb^aa^^^^^D||1966|F|||^^^^^^B^^75||||||||||||||||||||||V
      message type 2:
      PID|||100456789^^^^PI||aa^bb^bb aa^^^^L~bb^aa^^^^^D||1966|F|||^^^^^^B^^75||||||||||||||||||||||V

       

      I also have a problem with the formalism not being respected.
      There is an OBR line between PV1 and TXA. For this publisher, however, OBR is in the MDM format, which is as follows:

      MSH
      EVN
      PID
      [ PV1 ]
      [ OBR ]
      [ TXA ]
      [ OBX ]

      Is there a way to retrieve the standard format?

      • This topic was modified 1 day, 10 hours ago by petitPadawan.
    Viewing 1 reply thread
    • Author
      Replies
      • #122006
        Jim Kosloskey
        Participant

          For the PID-3 issue, there is a subcomponent expressed (the & is the standard HL/7 subcomponent separator). Assuming those are there because there really are subcomponents and not erroneously placed text, one would use subcomponent notation to get at those items. It appears the subcomponents are to the 4th component so your copy would look something like this: …PID#3.(0).[5][0] and PID#3.(0).[5].[1].

          However, PID-3.6 is usually Mother’s Maiden Name and so I am not sure those are not ampersands erroneously entered into the text rather than subcomponents. If that is the case, the source system should have escaped them like this: \T\ (assuming \ is what is specified in MSH-2 escape character – \ is the standard).

          As for the message structure, I am not sure I fully understand your question but if you want the standard structure for a ive HL/7 2 version Message/Event Type, use the HL/7 Configurator. That defaults to the standard message structure.

          email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

          • #122007
            Jim Kosloskey
            Participant

              Sorry, I mis-read the message. It is PID-3.5 but if you want the subcomponents the method remains the same.

              I see in the first message there are repeating fields (missed that – eyes getting old). Is that what you want to know how to get to?

              If so, I see 2 choices:

              1. use the field repetition position in the address Path like this: …PID#3.(0) and PID#3.(1).
              2. Use the ITERATE Action to work through the repetitions.

              I do not think there is a need for Tcl here.

              email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

          • #122008
            Charlie Bursell
            Participant

              What you really seem to want is the second iteration of the PID.3 field, not the second value.
              Is it always this way?  If so, simply copy the second iteration of PID.3 to PID.3.
              If not you need some method to ascertain if there is a second iteration.  What do you do then?

          Viewing 1 reply thread
          • You must be logged in to reply to this topic.