need to use a table for a list of codes that have ^ in them

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf need to use a table for a list of codes that have ^ in them

  • Creator
    Topic
  • #53098
    derek march
    Participant

    I have a site that sends us facility codes in the format xx^xxxx.  Of course since the ^ is the sub-field delimiter this is proving trickier than i had hoped.

    as it stands i get eh^ehmp in msh-4 and I get a unique, more specific code in PV1-3.1 like EHHCTDIH.  In the xlate when the code in PV1-3.1 matches the if statement than the code is run through a table.  The table takes whatever code is in PV1-3.1 and replaces it with a new code that is then supposed to be placed in MSH-4.  For example one of the output codes would be eh^ehmp1

    Unfortunately after running the xlate/table i tend to get something like this…

    MSH-4: eh^ehmp1^ehmp

    This isn’t altogether shocking.  At the suggestion of a friend I tried to set the table t convert like this…

    source:

    0(0).PV1(0).#3(0).[0]

    @null

    @null

    destination:

    0(0).MSH(0).#4(0).[0]

    0(0).MSH(0).#4(0).[1]

    0(0).MSH(0).#4(0).[2]

    This, oddly, got me the output of eh^ehmp1^ehsudneork.  the last piece is the first code on the source side of the table.  Why the xlate decides that @null should become that code is beyond me.

    Does anyone know a good way to blank out MSH-4 so that the table can place the eh^ehmp1 code in without adding extra sub-fields?

    Let me know if I need to clarify any of this or post the xlate/table and a test encounter.

    Thanks

Viewing 3 reply threads
  • Author
    Replies
    • #76554
      Austin Adams
      Participant

      Although this suggestion requires a few extra lines, try this :

      1.  Null out MSH.4 first on a COPY by itself.

      source:

      @null

      @null

      @null

      destination:

      0(0).MSH(0).#4(0).[0]

      0(0).MSH(0).#4(0).[1]

      0(0).MSH(0).#4(0).[2]

      2. Store your table answer to a variable

      0(0).PV1(0).#3(0).[0] -> tableLookup -> @pv1_tbl_value

      3. Assign the variable to MSH.4

      Source:

      @pv1_tbl_value

      Destination:

      MSH.4

      I know there is a more efficient way of doing this but I remind myself that I will have other people behind  me who will be looking at my work.

    • #76555
      John Hamilton
      Participant

      Or simple use a Pathcopy.

      In @null

      out 0(0).MSH(0).#4(0)

      I have had unexplained issue, or I was to lazy to figure out with using just the copy command.  I have always had good luch with pathcopy to null out fields and segments.

    • #76556
      derek march
      Participant

      Looks like the pathcopy fixed it, seems so simple in retrospect.

      Thanks for the responses!

    • #76557
      Austin Adams
      Participant

      Good tip! I’ll use it next time.

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

Forum Statistics

Registered Users
5,117
Forums
28
Topics
9,292
Replies
34,432
Topic Tags
286
Empty Topic Tags
10