HL7 variant Compare.

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf HL7 variant Compare.

  • Creator
    Topic
  • #50748
    Anonymous
    Participant

    Has anyone come up with a neat way to compare two variants.  

    What has happened, I hope I’m not the only one this has happened to.

    Is someone changes a variant in production. Then we move something new from test to prod using that variant. So I copy the variant up.  The problem is they did not make that same change in test so we over write the original change.

    This does not happen often. But it is always in the back of my mind to watch out for.   I know that change control can contain this problem. But it sure would be nice to compare two variants.

    Any Ideas ?

Viewing 4 reply threads
  • Author
    Replies
    • #67370
      Robert Milfajt
      Participant

      Here is a little something I scribbled up using korn shell.  I am sorry if you are not UNIX.

      Hope this helps,

      Robert Milfajt
      Northwestern Medicine
      Chicago, IL

    • #67371
      Robert Milfajt
      Participant

      For some reason when I click on the download, I lost my returns.  Here is the code in case you have the same problem.

      Code:


      #!/bin/ksh
      #
      # Script to check for differences in Cloverleaf variants.
      #
      # Created: 03/24/09 – RFM/NMFF
      #
      usage()
      {
             echo “format_diff.ksh ”
      }

      [[ ! -d $1 ]] && usage && exit 1
      [[ ! -d $2 ]] && usage && exit 2
      cd $1
      DIR1=$(find .)
      cd $2
      DIR2=$(find .)
      cd
      echo “FILES not in $2″
      for FILE1 in $DIR1
      do
             FOUND=0
             for FILE2 in $DIR2
             do
                     [[ $FILE1 == $FILE2 ]] && FOUND=1
             done
             [[ $FOUND == 0 ]] && echo ”    $FILE1″
      done

      echo
      echo “FILES not in $1″
      for FILE2 in $DIR2
      do
             FOUND=0
             for FILE1 in $DIR1
             do
                     [[ $FILE1 == $FILE2 ]] && FOUND=1
             done
             [[ $FOUND == 0 ]] && echo ”    $FILE2″
      done

      echo
      echo “FILES that are not the same”
      for FILE2 in $DIR2
      do
             if [[ ! -d $2/$FILE2 ]] then
                     FOUND=0
                     for FILE1 in $DIR1
                     do
                             [[ $FILE1 == $FILE2 ]] && [[ -z $(diff $1/$FILE1 $2/$FILE2) ]] && FOUND=1
                     done
                     [[ $FOUND == 0 ]] && echo ”    $FILE2″
             fi
      done

      exit 0

      Robert Milfajt
      Northwestern Medicine
      Chicago, IL

    • #67372
      Tom Rioux
      Participant

      I am at a loss.  I run the script and everything looks like it is processing normally and I get the expected echos until I reach this error:

      FILES that are not the same

      format_diff[42]: 0403-057 Syntax error at line 52 : `fi’ is not expected.

      I can’t seem to get around this and keep getting this error over and over, no matter what I try.  I have the script exactly as you have it.  

      Thanks….

    • #67373
      Anonymous
      Participant

      I was able to download this fine.

      I had to make sure and correct the nl cr feed stuff when I moved it over to my AIX box.

    • #67374
      Robert Milfajt
      Participant

      Tom, does your script look like my second reply.  I wonder if you do not have the proper structure.  Try cutting and pasting from the second reply into vi and see if that fixes the problem.  I hate FTP’ing from AIX to Windows, because I keep forgetting the stuff.

      Bob

      Robert Milfajt
      Northwestern Medicine
      Chicago, IL

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

Forum Statistics

Registered Users
5,126
Forums
28
Topics
9,296
Replies
34,439
Topic Tags
287
Empty Topic Tags
10