Inconsistent XLT output with @null to multiple sub-fields

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Inconsistent XLT output with @null to multiple sub-fields

  • Creator
    Topic
  • #54111
    Lawrence Nelson
    Participant

      Working on 5.8

      We have a need to do

      Lawrence Nelson
      System Architect - MaineHealth IT

    Viewing 4 reply threads
    • Author
      Replies
      • #80200
        Jim Kosloskey
        Participant

          Lawrence,

          Ususally when I wan tto null out an entire field I use PATHCOPY

          Source     Outbound

          @null       1(0).1(0).3(0).OBX(0).#22(0)   <– Note no components just the field.

          PATHCOPY will then NULL all of the components defined for the field.

          Please be aware though if your inbound has more than one occurrence of the OBX Group you will only null out the first occurrence using the above,

          If you want to null out ALL occurrences of a field in the OBX Groups then you will need an ITERATE.

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

        • #80201
          Robert Milfajt
          Participant

            It might be easier for you to null out the entire OBX segment.

            Code:

            PATHCOPY @null-> 1(0).1(0).3(0).OBX(0)

            Then just copy in the pieces you actually want.  It would probably be less code, i.e., more efficient, in the end.

            Robert Milfajt
            Northwestern Medicine
            Chicago, IL

          • #80202
            Lawrence Nelson
            Participant

              We needed a very controlled way to roll out HL7 2.5.1 LRI for MU2. We were looking to control all aspects – open up everything that currently goes out and isolate the existing fields that cause problems. So it’s very deliberate – pretty much the exact opposite of a bulkcopy.

              I have gone back and pathcopy’d and iterated where I needed to, but mostly I was looking to determine why I would experience any leaks where I had specifically @null’d things out.

              Thanks. I appreciate the responses.

              Lawrence Nelson
              System Architect - MaineHealth IT

            • #80203
              Robert Kersemakers
              Participant

                I wasn’t aware that you could indicate multiple subfields like this: 0(0).MSH(0).#4(0).[0,1]. So I tried this for myself with a simple message where MSH-4/0 and MSH-4/1 on the inbound message are filled and a PATHCOPY is used to copy the complete MSH to the outbound messages. Then I used this command:

                Code:

                COPY @null -> 0(0).MSH(0).#4(0).[0,1]


                This will only remove the first subfield of MSH-4, not the second.

                So I thought this would never work, but if you do this:

                Code:

                COPY @null -> 0(0).MSH(0).#4(0).[0,1]
                    @null


                then both subfields will be cleared.

                So this syntax can work, but you need to make sure that the number of inbound @nulls is equal to the outbound number of subfields. Or write out all outbound fields individually: one line per subfield:

                Code:

                COPY @null -> 0(0).MSH(0).#4(0).[0]
                    @null    0(0).MSH(0).#4(0).[1]

                As I’m not used to this notation and it would be easy to make a mistake (you see 3 values going in and only one going out; what is going on?) I wouldn’t recommend it.

                PS Is this an undocumented feature? I have never seen/heard of this before.

                Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

              • #80204
                Jim Kosloskey
                Participant

                  Not specifically documented but follows the association of the number of elements in the xlateInVals and the resultant number of elements in the xlateOutVals.

                  So if you can cause the number of elements to synch up you can get the multiple copies out of one COPY.

                  Like you I don’t recommend using this approach as it is prone to misinterpretation (why I suggested what I did) – but I guess it could have some usefullness under some specific circumstances.

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

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