xlate Help

  • Creator
    Topic
  • #50753
    Alka Sharma
    Participant

    Hi,

    I have lab systems which sends OBRNTE’s and the receiving system which does not accept OBRNTE but accept an ADD segment after an OBX. I am having trouble with my iterate.

    0000000503MSH|^`&||L|IDX||200903181517||ORU|00035054|P|2.2

    PID|1||I99700013||ZZZZPUP^BERGINH||19650101|M||||||||||I10001644

    PV1|||119^119X^01||||8369^PILLAI^OMPRAKASH

    ORC|||F9180009||||||20090318151704|||10994^ALFORD^TODD

    OBR|1||F9180009|NA^LAB01262^Sodium|||200903181028|200903181028||JPASM||||200903181030||10994^ALFORD^TODD||||||20090318151704|||F|||||||EHK||EHK

    NTE|1|| THESE ARE COMMENTS; JEFF PYZYNSKI; ESTER KING

    OBX|1|NM|NA^LAB01262^Sodium||145|meq/L|137-144|H|||F

    NTE|1||analyzed on hemolyzed specimen.

    This is the output I am trying to achieve using iterate

    0000000503MSH|^`&||L|IDX||200903181517||ORU|00035054|P|2.2

    PID|1||I99700013||ZZZZPUP^BERGINH||19650101|M||||||||||I10001644

    PV1|||119^119X^01||||8369^PILLAI^OMPRAKASH

    ORC|||F9180009||||||20090318151704|||10994^ALFORD^TODD

    OBR|1||F9180009|NA^LAB01262^Sodium|||200903181028|200903181028||JPASM||||200903181030||10994^ALFORD^TODD||||||20090318151704|||F|||||||EHK||EHK

    OBX|1|NM|NA^LAB01262^Sodium||145|meq/L|137-144|H|||F

    ADD|1||analyzed on hemolyzed specimen.

    ADD|1|| THESE ARE COMMENTS; JEFF PYZYNSKI; ESTER KING

Viewing 6 reply threads
  • Author
    Replies
    • #67380
      Robert Milfajt
      Participant

      What are you trying to accomplish?  Can you give an example of what it would look like if it worked?  Can there be multiple OBR, OBX or NTE segments?  If so, can you provide an example of how it would work with the multiples?

      Robert Milfajt
      Northwestern Medicine
      Chicago, IL

    • #67381
      Alka Sharma
      Participant

      There will be multiple OBR NTE’s that needs to be changed to ADD segments at the end of the each OBX.

    • #67382
      Amol Kulkarni
      Participant

      Alka,

      From the example input, should the final OUTPUT be:

      OBX|1|NM|NA^LAB01262^Sodium||145|meq/L|137-144|H|||F

      ADD|1||analyzed on hemolyzed specimen

      OBX|2|NM|NA^LAB01262^Sodium||145|meq/L|137-144|H|||F

      ADD|2||analyzed on hemolyzed specimen

    • #67383
      Alka Sharma
      Participant

      No, it should add the obrnte at the bottom of the obx segment as ADD segment. If OBX has an NTE, I am able to change the OBXNTE to ADD but not the OBRNTE’s

    • #67384
      Alka Sharma
      Participant

      This is the output I am trying to achieve using iterate

      0000000503MSH|^`&||L|IDX||200903181517||ORU|00035054|P|2.2

      PID|1||I99700013||ZZZZPUP^BERGINH||19650101|M||||||||||I10001644

      PV1|||119^119X^01||||8369^PILLAI^OMPRAKASH

      ORC|||F9180009||||||20090318151704|||10994^ALFORD^TODD

      OBR|1||F9180009|NA^LAB01262^Sodium|||200903181028|200903181028||JPASM||||200903181030||10994^ALFORD^TODD||||||20090318151704|||F|||||||EHK||EHK

      OBX|1|NM|NA^LAB01262^Sodium||145|meq/L|137-144|H|||F

      ADD|1||analyzed on hemolyzed specimen.

      ADD|2|| THESE ARE COMMENTS; JEFF PYZYNSKI; ESTER KING

    • #67385
      Robert Kersemakers
      Participant

      Hi Alka,

      The ADDs from the OBRNTE are overwritten again by the ADDs from the OBXNTE.

      You will need to define your own counter; say %s9. Before any iteration, initialize it to zero:

      COPY =0 -> $%s9

      Then iterate over OBRNTE, using %s9 for the ADD and then increasing %s9 by 1:

      PATHCOPY NTE(%s1) -> ADD(%s9)

      MATH ADD $%s9 =1 -> $%s9

      After that, do the same with the OBXNTE. That should do the trick.

      One more observation: in the highlighted PATHCOPY in your Xlate, you are using two variables: %s1 and %g1. But there is only one ITERATION. So one of these two variable (I guess %g1) will always be 0.

      Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

    • #67386
      Alka Sharma
      Participant

      Thanks Robert! I will try your suggestion and also Jim K’s solution today. Since this was an emergency Mike H helped me write a post tcl which converts Obrnte into ADD in post proc.

      thanks everyone

      Alka…

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

Forum Statistics

Registered Users
5,127
Forums
28
Topics
9,300
Replies
34,445
Topic Tags
288
Empty Topic Tags
10