Format NTE

  • Creator
    Topic
  • #52655
    Anonymous
    Participant

      I have a single NTE that comes in and multiple NTE’s going out but for some reason I cant get the columns to line up.

      EXAMPLE:

      IN:

      NTE|1|ID|Serological diagnosis of EBV infection:.br\.br                                   EA-D IgM    EA-D IgG    VCA IgM    VCA IgG    EBNA IgM    EBNA IgG.br\.brSuscept/Seroneg                 NEG           NEG           NEG          NEG            NEG             NEG.brAcute/Current                     POS            POS            POS          POS              POS             NEG.brConval/Transit                    NEG           POS            P/N           POS              P/N              P/N.brPast Infection                      NEG           NEG           NEG          POS             NEG            POS.brReactivated                         NEG           POS            NEG          POS             NEG            POS

      OUT SO FAR:

      NTE|1|ID|Serological diagnosis of EBV infection:

      NTE|2|ID

      NTE|3|ID|                                   EA-D IgM    EA-D IgG    VCA IgM    VCA IgG    EBNA IgM    EBNA IgG

      NTE|4|ID

      NTE|5|ID|Suscept/Seroneg                 NEG           NEG           NEG          NEG            NEG             NEG

      NTE|6|ID|Acute/Current                     POS            POS            POS          POS              POS             NEG

      NTE|7|ID|Conval/Transit                    NEG           POS            P/N           POS              P/N              P/N

      NTE|8|ID|Past Infection                      NEG           NEG           NEG          POS             NEG            POS

      NTE|9|ID|Reactivated                         NEG           POS            NEG          POS             NEG            POS

    Viewing 3 reply threads
    • Author
      Replies
      • #75013
        Chris Williams
        Participant

          Could it be something as simple as the difference between a variable width versus a mono-spaced typeface?

        • #75014
          Russ Ross
          Participant

            I copied what you showed coming inbound into my text editor and replaced the .br with a newline and see it matches what you show going out.

            My thought is what you are getting from the source system inbound to Cloverleaf isn’t lined up as desired.

            Russ Ross
            RussRoss318@gmail.com

          • #75015
            Anonymous
            Participant

              The allignment needs to be done in the engine, the “IN” comes in with the .br, the downstreem system does not like the .br and needs the text to be alligned by the engine. Here is what I have as a preproc so far.

              foreach seg $segments {

                           if [cequal $seg “”] { continue }    

                           set segtype [csubstr $seg 0 3]    

                           if {[cequal $segtype OBX]} {

                               set LOBX [split $seg $sep]    

                               set LOBX [string map {\.br\ ” “} $LOBX]  

                               set seg [join $LOBX $sep]          ;# Concatenate list back to msg

                             }

                   if {[cequal $segtype NTE]} {

                               set LNTE [split $seg $sep]  

                               set LNTE [string map {\.br\ ~} $LNTE]

                               set seg [join $LNTE $sep]          ;# Concatenate list back to msg

            • #75016
              John Lichtenberger
              Participant

                There are a couple of factors that need to be taken into consideration.  The system it’s coming from – what font does it use fixed or proportional.  The data in the entry does not line up, so I assume it would be proportional.  The other factor is where the data is going to – is it proportional or fixed fonts?

                If fixed for the destination, do the following steps:

                1. Break down into lines like what you currently do

                2. Take each line and break it down to a list by each data element (two or more spaces)

                3. Join the lines back together after fixing each element in the list to a specific length (column width)

                If proportional – you can do a similar method but would need to add in coding to accumulate the width of each character.

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