Sub Field breaks

  • Creator
    Topic
  • #52279
    Chris Wethey
    Participant

    What is a Tilde (~) within a HL7 record

    example ||724^^^^^^^99DOC~7777^^^^^^^99DOC||

    I know the “|” is field breaks OBR 3.1 to 3.2 but like the example above, is it the subfield break within say OBR 3.3

    Thanks

Viewing 5 reply threads
  • Author
    Replies
    • #73671
      Robert Milfajt
      Participant

      A tilde is for repeating fields, i.e., multiple values for a field.

      You can think of it as an array, so in your example,

      field1(1)=724^^^^^^^99DOC

      field1(2)=7777^^^^^^^99DOC

      Hope this helps,

      Robert Milfajt
      Northwestern Medicine
      Chicago, IL

    • #73672
      Jim Kosloskey
      Participant

      Chris,

      Well that depends on what the tilde in the MSH-2 means but typically that is the repeating field separator.

      So it means this field for this mesage has multiple occurrences.

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

    • #73673
      Chris Wethey
      Participant

      The tilde is the repetitive separator – so when i am performing a lookup using the tblqualify_kill_default within qdx5.5 GUI screen and using this command within the edit of the command for the table view

      “”SEGNAME OBR} {FIELDNUM 28} {SUBFIELDNUM 1}”” – would the subfieldnum be the repetitive within that segname so “0” is the first and “1” is the second and so on down the line.

    • #73674
      Jim Kosloskey
      Participant

      Chris,

      I don’t recognize that as a Cloverleaf distributed proc so you will probably need to look into that proc to see what it does with those keyed lists (at least they look like they are keyed lists).

      If it is a distributed Cloverleaf proc, let me know.

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

    • #73675
      Chris Wethey
      Participant

      Jim,

      It is a tcl that is part of the install on our server from either mckesson or quovadx.

      Here is the coding of that tcl.

      ######################################################################

      # Name:         tblqualify

      # Purpose:      Qualify on a field

      # UPoC type:    tps

      # Args:         tps keyedlist containing the following keys:

      #               MODE    run mode (“start”, “run” or “time”)

      #               MSGID   message handle

      #               ARGS    user-supplied arguments:

      #                       TBLNAME         Table Lookup name

      #                       ERRCOND         Literal that is set as DEFAULT in the table lookup

      #                       SEGNAME         Segment to check

      #                       FIELDNUM        Field number to check within the segment

      #                       SUBFIELDNUM     Subfield to check within the field

      #

      # Args (Example ENTRY): To qualify on the patient location field (PV1 3):

      # the arguments would be:

      # {TBLNAME

      } {ERRCOND
      } {SEGNAME PV1} {FIELDNUM 3} {SUBFIELDNUM 0}

      #

      # Returns: tps disposition list:

      #          $CONTINUE

      #

      proc tblqualify_kill_default { args } {

         keylget args MODE mode                                      ;# Fetch mode

         set dispList {}                                             ;# Nothing to return

         switch -exact — $mode {

             start {

                 # Perform special init functions

                 # N.B.: there may or may not be a MSGID key in args

             }

             run {

                 # ‘run’ mode always has a MSGID; fetch and process it

                 keylget args MSGID mh

                 set msg [msgget $mh]                                ;# Get message

      #          

      # Get arguments

      #          

                 set tblname {}

                 keylget args ARGS.TBLNAME tblname                   ;# Fetch the table name

                 set errcond {}

                 keylget args ARGS.ERRCOND errcond                   ;# Fetch the error literal

                 set segname {}

                 keylget args ARGS.SEGNAME segname                   ;# Fetch the segment

                 set fieldnum {}

                 keylget args ARGS.FIELDNUM fieldnum                 ;# Fetch the fieldnum

                 set subfielnum {}

                 keylget args ARGS.SUBFIELDNUM subfieldnum           ;# Fetch the subfieldnum

                 

                         #

                         # Split the message and get fields to check

                         # First set up some constants

                         #

                 set sep [csubstr $msg 3 1]                          ;# HL7 field separator      

                 set sub [csubstr $msg 4 1]                          ;# HL7 subfield separator          

                 set segments [split $msg r]                        ;# Get segments

                         #

                         # LOOP through and make changes

                         #

                 foreach seg $segments {

                     if [cequal $seg “”] { continue }                ;# Just in case

                     set segtype [csubstr $seg 0 3]                  ;# segment type

                     if [cequal $segtype $segname] {                 ;# MSH?

                         set fields [split $seg $sep]                ;# Fields

                         set checkfield [lindex $fields $fieldnum]   ;# field to check

                         set subfields [split $checkfield $sub]      ;# subfields

                         set checkvalue [lindex $subfields $subfieldnum]

                         #

                         # do table lookup

                         #

                         echo “Table=$tblname  Value to check=$checkvaluen”

                         set tblvalue [tbllookup $tblname $checkvalue]

                         echo “Table value=$tblvaluen”

                         #

                         # if the default value is returned, KILL the message”

                         #

                         if [cequal $tblvalue $errcond] {

                            lappend dispList “KILL $mh”

                         } else {

                            lappend dispList “CONTINUE $mh”

                         }

                         echo “dispList=$dispList”

                     }

                 }

             }

             time {

                 # Timer-based processing

                 # N.B.: there may or may not be a MSGID key in args

             }

      shutdown {

         # Doing some clean-up work

      }

             default {

                 error “Unknown mode ‘$mode’ in tblqualify”

             }

         }

         return $dispList

      }

      *******

      I need to read the Repetitive information in one of the OBR fields since it could have multiple physician numbers in there and if one of them match’s then i would send the record onto the receiving interface.

    • #73676
      Jim Kosloskey
      Participant

      Chris,

      I am betting this is from McKesson.

      Anyway from just a cursory glance it appears this proc does not do what you want – so you either need to modify this proc or create a copy with your mods.

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

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

Forum Statistics

Registered Users
5,117
Forums
28
Topics
9,292
Replies
34,435
Topic Tags
286
Empty Topic Tags
10