Best way to edit test messages?

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Best way to edit test messages?

  • Creator
    Topic
  • #49258
    Carter Harrison
    Participant

    Alright, my frustration has peaked and I’ve decided it best to throw in the towel and ask for some advice on this one.  I’m trying to test an xlate and i’ve been trying to edit my test file to see setup a proper test case and then run it through my xlate using the testing tool.  I had a properly formatted and working test file.  I opened it up in the IDE’s script editor (thinking that this would be a perfectly acceptable way to edit a plain text file) and changed just one character in PID-3.4 (changed it from “SFHG” to “SFGA”) and when I try to test it I’m now getting this output:

    MESSAGE 1

    0(0).MSH(0)  :  >|^~&|RAD|SFHG||SFHG|20070502105100.0000-0400||ORU^R01|RMS|P|2.3||<0xa>PID|1|05|00< This is not at all what my previous output looked like.  Now I’m getting this strange “<0xa>” at the end of my MSH and it is not correctly parsing the PID segment or the OBR and OBX segments that appear later in the file.  Now I know that there are some issues with line breaks between the UNIX and Windows world.  I used hcihd on my test file and there is a “0a” at the end of each segment as I believe there should.  The file looks to be formatted well still.  How could this change have caused this?  

    Thank you in advance – any help would be GREATLY appreciated!  My test file is attached.

Viewing 12 reply threads
  • Author
    Replies
    • #61279
      Russ Ross
      Participant

      Some editors try to be too smart and get in the way.

      Ever get mad at MS Word because it keeps formating something you don’t want; it is sort of the same thing.

      I suspect that happend to you.

      Your explanation is not clear enough for me to be certain.

      Assuming you are running on UNIX do the following steps and post the output for us to look at

      hcihd

      Russ Ross
      RussRoss318@gmail.com

    • #61280
      Levy Lazarre
      Participant

      Carter,

      I edit test files with the PSPad editor, a free programmer’s editor you can download on the Internet (http://www.pspad.com). HL7 segments are separated by carriage returns, so when you open a file in an editor, the format to choose is not Unix (LF) or DOS (CR + LF) but MacIntosh (CR). Using PsPad, you would simply click on the file format on the status bar until the format becomes Mac (or you can use the Format menu item to make the conversion). You can then edit the file as you please and just save it.

      Your test file was in Unix (LF) format. I converted it to Mac format with PSPad, made the change you indicated, and saved the file. I was able to run it through a test Xlate with no problem whatsoever.

      Hope this helps,

      Levy

    • #61281
      Carter Harrison
      Participant

      Thanks for the answers folks.  I’ll give it a shot today and see if I can make some headway.  I’m really kind of surprised by this whole thing.  I actually use a Macintosh, and I was unaware that it uses a carriage return to end lines, especially since OS X is just another flavor of Unix.  I’m also dissappointed that the editor within the Cloverleaf IDE cannot properly edit HL7 files – I know that it is meant for editing TCL procs, but it sure would have been handy if they made it a little more versatile.  I’m going to read up more on text file encoding on the various operating systems and I think that will give me the information I need to get this problem sorted out for good.  Thanks.

    • #61282
      Rich Durkee
      Participant

      I FTP the file to my Windows workstation and use a product named Hex Ediitor from HHD Software to edit the file. This allows me to view exactly what is in the file in both character and hex format and make any changes necessary. Then I FTP the file back. It might seem like a little more work, but it’s worth it to me since the editors on AIX are all garbage.

    • #61283
      Charlie Bursell
      Participant

      Someone earlier spoke of the psPad editor.  As far as I am concerned there is no better editor for what we do.  It is completely license free,

      It will allow you to edit files in hex and ASCII locally, via FTP or even via the web.  I would strongly sugeest you take a look at it.

      http://www.pspad.com/

    • #61284
      Russ Ross
      Participant

      You guys have me curious to take a look at the PSPad editor.

      The editor I’ve been using (Ultra-Edit) came from this type of clovertech post many years ago.

      Ultra-Edit has a free trial period which can be made permanent buy purchasing a license key.

      http://www.ultraedit.com/” class=”bbcode_url”>http://www.ultraedit.com/

      Ultra-Edit is smart enough to get you in the sort of trouble we’ve been talking about but you can stay out of trouble if you understand the various conversion from UNIX, DOS, & MAC.

      I have found if it is configured to save the file in the same format of the original file then most problems are avoided.

      I have found the FTP/edit feature to be nice becuase you can edit file(s) on different platforms across the world as if they were integrated on your local PC.

      It also has a HEX edit function.

      I originally got Ultra-Edit so new team members did not have to learn something like vi right away and could edit UNIX files from their comfy MS Windows world.

      I like Ultra-Edit enough that I bought my own copy for my home computer.

      Russ Ross
      RussRoss318@gmail.com

    • #61285
      Tina Quinn
      Participant

      I also use Ultra Edit and have found it to be a wonderful tool that is worth the small fee. I personally found the Ultra compare and Hex edit functions to be extremely useful.

    • #61286
      Gary Atkinson
      Participant

      Thanks for tip on PSPAD! I used it to edit some test messages and it worked great.  Better than using vi  8)

    • #61287

      The greatest editor ever is vi/vim. If you take the time to learn how to use it, you will never regret it.

      gVim For Windows: http://www.vim.org/download.php#pc

      -- Max Drown (Infor)

    • #61288
      Roy Harwell
      Participant

      Hi all,  I have to put my vote in for Interface Explorer at

       http://www.laconic-designs.com” class=”bbcode_url”>http://www.laconic-designs.com

      If you are editing HL7, it is great.  I am also a fan of UltraEdit and vi, but they pale in comparison to this IF you are editing HL7 messages.

      BTW, I am not affiliated in any way with Laconic Designs, but I have used their editor for almost 4 years now.

    • #61289

      Roy Harwell wrote:

      Hi all,  I have to put my vote in for Interface Explorer at http://www.laconic-designs.com” class=”bbcode_url”>http://www.laconic-designs.com. If you are editing HL7, it is great.  I am also a fan of UltraEdit and vi, but they pale in comparison to this IF you are editing HL7 messages.

      That editor is $300/user? You can do everything it does for free with unix tools like perl, vi, grep, sort, cut, etc. These tools give incredible power and flexibility to HL7 parsing and data parsing of any type.

      -- Max Drown (Infor)

    • #61290
      Robert Milfajt
      Participant

      Do it old school.

      perl -pi.bak -e “s/|xxxx|/|yyyy|/g” file

      8)

      Robert Milfajt
      Northwestern Medicine
      Chicago, IL

    • #61291
      Richard Hart
      Participant

      This is an example of how I have tested  the trx code we use.

      Note that this uses TCL and mimics the engine!

      In this trx, messages are routed depending on three fields within a message: the account number, requesting and performing department.

      AIX 5.3 CL5.4.1

      #!/usr/bin/ksh

      # this line to escape the next line from the tcl interpreter

      exec hcitcl “$0” “$@”

      global HciConnName

      set HciConnName gen_smat_ai_gen_rcv

      proc msgget {aId {aAction NONE}} {

         global gMsg

         if {[string equal $aAction S]} {

             set gMsg $aId

             return

         }

         return $gMsg

      }

      set myMsg {MSH|^~&|HL7LAB||CLOVERLEAF|qdxi01p|200510131611||ORU^R01|4139137|D|2.1|||||^MPID|||A9994292||A^A||19850108|M|||A^^F|||||||||||^MPV1||O|INFD||||||||||||||||$myAcct||||||||||||||||||||||||||

      |||||^MOBR|1||11|MSYPH^SYPHILUS^L||200510181408|200510181359|||||||200510181408||034020CW^M&L|||$myReq@OBR19|FTH^|112703C|200510131611||$myPerf@OBR24|F|||||||||||^MOBX|1|FT|Y29JSY^^L|| TEST RESULTS|||

      |||F|||||^M}

      foreach myAcct {FH@123456789012 F123 AA@123456789012 {} } {

         foreach myReq {FH RP WO AA XX {}} {

             foreach myPerf {FH RP WO AA XX {}} {

                 echo “Acct >$myAcct<"            echo “Req  >$myReq<"            echo “Perf >$myPerf<"            msgget “[subst -nobackslashes -nocommands $myMsg]” S            echo “tReturn [ris_code_trx_id 1]”        }    } } exit

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

Forum Statistics

Registered Users
5,129
Forums
28
Topics
9,301
Replies
34,447
Topic Tags
288
Empty Topic Tags
10