Replacing Double Quotes with NULL

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Replacing Double Quotes with NULL

  • Creator
    Topic
  • #52063
    Greg Tataryn
    Participant

      We are using McKesson STAR for patient registration and financials.  We have several downstream systems that have issues with the fact that STAR sends out “” in fields that have been left blank even on a new registration even though it is supposed to note that a field that once contained data is now blank.

      One system in particular needs the insurance and guarantor information but because during the registration process STAR sends out “” in the GT1 and IN1 segments in A08 messages before the final A04 or A01 goes out, it messes up the downstream system.

      I am trying to find a way, either in an XLT or with TCL, to check the GT1 and IN1 segments for “” and change them to @null only if it is not a technically legitimate “”.  In other words I need to find a field that should never have “” (I am thinking IN1:1 and GT1:1) to check and if it contains “” copy @null to the entire segment.  So far I have had no luck with checking for the double quotes, they just seem to get ignored.  Any help and suggestions are greatly appreciated.

    Viewing 7 reply threads
    • Author
      Replies
      • #72918
        Jim Kosloskey
        Participant

          Greg,

          In a xltp type proc (Xlate) you need to check the data type of the field for null.

          I have a proc that does this – if you want it as an example, email me and I will send it along with the user doc.

          email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

        • #72919
          Greg Tataryn
          Participant

            Jim Kosloskey wrote:

            Greg,

            In a xltp type proc (Xlate) you need to check the data type of the field for null.

            I have a proc that does this – if you want it as an example, email me and I will send it along with the user doc.

            The problem is the field is not null, it has the quotes in it. I need it to be nulll.

          • #72920
            Jim Kosloskey
            Participant

              Greg,

              In the Xlate a field that has an HL/7 ‘Active’ null (“”) has a xlateInType of null and that is what needs to be checked.

              If you get the example proc and doc it should become clearer.

              email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

            • #72921

              I would think this would be as simple as doing a regsub on “” in a pre-proc. You could even limit the search to the proper segments if you wanted to.

              Code:

              regsub -all {””} $seg “” seg

              It is my understanding that the double quotes (aka active nulls) in HL7 mean that the receiving system should clear out the field in their database. Where an empty field in HL7 means no change.

              -- Max Drown (Infor)

            • #72922
              Greg Tataryn
              Participant

                Max Drown wrote:

                It is my understanding that the double quotes (aka active nulls) in HL7 mean that the receiving system should clear out the field in their database. Where an empty field in HL7 means no change.

                That is the norm for HL7, however McKesson STAR is far from normal sometimes.  They send out active nulls all over the place when fields are left blank even on a brand new registration.  They don’t use standard delimiters either, they use : and ; rather than | and ^

                The script Jim supplied worked like a charm for the active nulls.

              • #72923
                Jim Kosloskey
                Participant

                  Greg,

                  I think Max was pointing out that if you did not care if EVERY “” was replaced with null in a segment (or the entire message for that matter) then a pre-xlate Tcl proc using string map (or regsub) would do.

                  If you cared to write enough Tcl, you could drive down to the field or component level.

                  If on the other hand you are already in an Xlate and only want certain fields in given segments to be converted, the method I gave you will do.

                  As with most things, Cloverleaf is a powerful tool that gives you more than one way to resolve an ‘opportunity’.

                  email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

                • #72924
                  Anonymous

                    Jim provided the critical piece of information that I was missing. I

                  • #72925
                    Anonymous

                      Sorry, I should have noted that each component has its own xlateInTypes, so this would be better:

                      if { [string equal [lindex $xlateInTypes 0] {null}] } {

                       set xlateOutTypes

                        }

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