HL7 translation question regarding field length

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf HL7 translation question regarding field length

  • Creator
    Topic
  • #51063
    Mike Campbell
    Participant

    Just completed Level 1 training last week.  A new interface is taking RDE messages from source to destination.  Both sides HL7.  The inbound PID-2 is sent with leading zeros removed.  How can I check the length of the field to insure it is 7 in length on the outbound side, padding with zeros if shorter?

    Thanks.

Viewing 2 reply threads
  • Author
    Replies
    • #68647
      Gary Atkinson
      Participant

      Use ~ in front of your inbound and check in an IF statement.  There is some len logic built into the IF command.  Add another IF with tcl proc to pad in the zeros if length is less than 7.

    • #68648
      James Cobane
      Participant

      On your COPY command, you can simply add a tcl statement (in the proc window) to format the MRN with leading zeros:

         set xlateOutVals

        ]]

        If the number coming in is 1234, it will be sent out as 0001234.

        Hope this helps.

        Jim Cobane

        Henry Ford Health

      1. #68649
        Sam Craig
        Participant

        Or, in the xlate, use a field copy with a Pre TCL Proc with code similar to this ……

        set pid2_in [lindex $xlateInVals 0]

        set xlateOutVals [format “%07s” $pid2_in]

        This will always make the field 7 characters long and pad with zeroes if needed.

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

    Forum Statistics

    Registered Users
    5,127
    Forums
    28
    Topics
    9,300
    Replies
    34,445
    Topic Tags
    288
    Empty Topic Tags
    10