hex CR

  • Creator
    Topic
  • #51549
    Mark Perschbacher
    Participant

      I am so so with interpreting hex data, and am trying to figure out how to code a hard carriage return into some HL7 data.  I edited a text file of the data and inserted a carriage return using the keyboard.  Here is the hex and text for what I edited, and the same data for the original.  I have an append with r in the tcl code, but how do you code a hard carriage return like this.

      0000080: 7c7c 3230 3130 3031 3034 7c46 494e 414c  ||20100104|FINAL

      0000090: 2044 4941 474e 4f53 4953 3a0a 2031 292e   DIAGNOSIS:. 1).

      00000a0: 2044 756f 6465 6e75 6d2c 2062 696f 7073   Duodenum, biops

      00000b0: 793a 20a0 a0a0 a0a0 a0a0 a0a0 a053 6d61  y: ……….Sma

      5|SPECIMEN: 1: Duodenum, Biopsy 2: Colon, Biopsy||20100104|FINAL DIAGNOSIS:

      1). Duodenum, biopsy:

    Viewing 11 reply threads
    • Author
      Replies
      • #70731
        Keith McLeod
        Participant

          Would n work for you?

        • #70732
          Keith McLeod
          Participant

            Actually it would depend on the receiving system.  In most cases the ~ or repetition character is interpreted by the receiving system as a hard return.  If you insert the actual hex characters for r or n it might cause problems from an HL7 perspective.

          • #70733
            Mark Perschbacher
            Participant

              Keith, that is sort of the issue.  I am taking a string of data out of several OBX-5 fields, and copying it into a single field on a vrl.  I sent across the data that I had edited with the keyboard CR, and the recieving system displayed it fine.

            • #70734
              Jim Kosloskey
              Participant

                Try x0a if that is the target system’s CR (I think it is based on the hex dump you provided).

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

              • #70735
                Chris Williams
                Participant

                  What you do depends on what the receiving system expects to receive to accomplish what you want. In your first example you have a n following the colon. In the second example you have a space. The method for inserting control characters into text rather than having the control character acted upon by the editor itself depends on the editor. In vi, for example, to insert a control character you must precede it with a Control-V

                  Generally speaking, you want to insert whatever the receiving system will interpret as a Line Break. They might even be looking for something different like an HL7 .br or an HTML
                  . Ask them.

                  We have a lot of people here on CloverTech who come from a clinical rather than programming background. Let me try to shed some light on a few terms for them.

                  CARRIAGE RETURN (strict usage: just like a typewriter, it sends the cursor to the leftmost position on the same line) can be represented in several ways:

                  r, CR, ^M, Control-M, x0d, 13 (decimal), 015 (octal), 0d (hex), ASCII 13

                  LINE FEED (strict usage: moves the cursor down one line at the same column position) is also known as:

                  n, LF, ^J, Control-J, x0a, 10 (decimal), 012 (octal), 0a (hex), ASCII 10

                  LINE TERMINATORS are made up of one or more characters, defined first by the operating system and may be redefined by the application:

                  UNIX/LINUX: Line Feed (n)

                  WINDOWS/DOS: Carriage Return Line Feed Pair (rn)

                  MAC: Carriage Return (r)

                • #70736
                  Mark Perschbacher
                  Participant

                    Chris, I would qualify as one of those forum users who comes from a clinical background.  Thanks for your explanation.  Right now, I am waiting for the vendor to get back to me regarding what their system will interpret as a line feed.

                  • #70737
                    Mark Perschbacher
                    Participant

                      Well the vendor says they are looking for embedded crlf, which doesn’t tell me a whole lot.

                    • #70738
                      Chris Williams
                      Participant

                        If your VRL will allow an embedded CRLF sequence (which might be possible if they don’t use those characters for delimiting the message), then you can just put the CRLF where you want. The common way to code it would be “rn”, but if it were in an HL7 message, you would want to use “x0d\x0a” so it would not affect message parsing.

                      • #70739
                        Mark Perschbacher
                        Participant

                          Chris, thanks for your attention to detail here.  So if I send across somehting like this

                          |SPECIMEN: 1: Duodenum, Biopsy 2: Colon, Biopsy||20100104|FINAL DIAGNOSIS: x0d\x0a1). Duodenum, biopsy:

                        • #70740
                          Chris Williams
                          Participant

                            Yes, it might work, but it’s the vendor who needs to confirm that this string of ASCII characters in the message is acceptable to them.

                          • #70741
                            Mark Perschbacher
                            Participant

                              Tried inserting x0d\x0a, and the characters just showed up as text.  I’m thinking that to code theses CR’s, I am going to have to format the results before it hits the vendor system.  I just don’t seem to be able to get the HL7 data to respond as required.

                            • #70742
                              Mark Perschbacher
                              Participant

                                What I have discovered, and this is probably common knowledge with the Cloverleaf experts, is that if I try and insert the x0a within the proc I have to pull out the specific fields from the OBX, it doesn’t work.  If I insert them before the message hits the proc, it works.  My theory is that once the message handle is built within the proc, tcl ignores the x0a.  It looks like I will need to insert them before they hit the extraction proc.

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