Announcement

Collapse
No announcement yet.

Receive multiple OBX segments

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Receive multiple OBX segments

    What is the standard way to receive multiple OBX segments. E.g. (ORU^R01) pathology results.

    I can see how the one to one mapping works, but what happens when there are unknown number of results being returned.

  • #2
    Re:Receive multiple OBX segments

    In Javascript step:

    Code:
    for (obx in msg..OBX){
      output+=obx['OBX.5'].toString();
    }
    Chris Lang

    Comment


    • #3
      Re:Receive multiple OBX segments

      Chris thankyou for the quick reply.

      What would you recommend as the best way to go about saving each OBX result as a seperate row in a table? Could you provide an example. Thanks!

      Comment


      • #4
        Re:Receive multiple OBX segments

        I just want to make sure I understand correctly here before I move on..

        if I have a message that looks like:
        Code:
        MSH|^~\&|IATRIC|XRAD.EMG|EMAGEON||200811070721||ORU^R01|RPT905325688.01|P|2.3|||
        PID|||M0462081||NAME^PATIENT^^CFNP||19201015|F||||||||||N017935297||||
        ORC|RE|2169591.003|MMN000388666||S|||||||SOMEDOC^Doctor^Some^J||||
        OBR||2169591.003|MMN000388666|RAD.CH1^CHEST 1 VIEW AP 71010|||200811062058|||||||||SOMEDOC^Doctor^Some^J|||RAD|SOMERAD|HIM.PSCRIB|^|20081107^0254|^|S|||200811062107||||SOMERAD^RAD^SOME|SOMERAD|
        OBX|1|ST|1:RPT^Radiology Report||MMN000388666  RAD  CHEST 1 VIEW AP 71010||||||P|
        OBX|2|ST|1:RPT^Radiology Report|| ||||||P|
        OBX|3|ST|1:RPT^Radiology Report||Exam: Portable chest.||||||P|
        OBX|4|ST|1:RPT^Radiology Report|| ||||||P|
        OBX|5|ST|1:RPT^Radiology Report||Comparison: None available.||||||P|
        OBX|6|ST|1:RPT^Radiology Report|| ||||||P|
        OBX|7|ST|1:RPT^Radiology Report||History: Patient found down.||||||P|
        OBX|8|ST|1:RPT^Radiology Report|| ||||||P|
        OBX|9|ST|1:RPT^Radiology Report||Findings: The patient is diffusely and severely osteopenic. There is||||||P|
        OBX|10|ST|1:RPT^Radiology Report||a transverse fracture through the surgical neck of the right humerus.||||||P|
        OBX|11|ST|1:RPT^Radiology Report||Evaluation of the chest is limited secondary to lung hypoexpansion||||||P|
        OBX|12|ST|1:RPT^Radiology Report||and kyphotic positioning. The cardiomediastinal silhouette is not||||||P|
        OBX|13|ST|1:RPT^Radiology Report||well visualized. There is bibasilar atelectasis, and there is poorly||||||P|
        OBX|14|ST|1:RPT^Radiology Report||defined ground glass opacity throughout much of the right lung which||||||P|
        OBX|15|ST|1:RPT^Radiology Report||could represent atelectasis, aspiration, or pneumonia. Repeat||||||P|
        OBX|16|ST|1:RPT^Radiology Report||radiographs with improved positioning and inspiration would be useful||||||P|
        OBX|17|ST|1:RPT^Radiology Report||for better evaluation.||||||P|
        OBX|18|ST|1:RPT^Radiology Report|| ||||||P|
        OBX|19|ST|1:RPT^Radiology Report|| ||||||P|
        OBX|20|ST|1:RPT^Radiology Report||Impression:||||||P|
        OBX|21|ST|1:RPT^Radiology Report|| ||||||P|
        OBX|22|ST|1:RPT^Radiology Report||1. Transverse fracture of the right humeral surgical neck.||||||P|
        OBX|23|ST|1:RPT^Radiology Report|| ||||||P|
        OBX|24|ST|1:RPT^Radiology Report||2. Diffuse, severe osteopenia.||||||P|
        OBX|25|ST|1:RPT^Radiology Report|| ||||||P|
        OBX|26|ST|1:RPT^Radiology Report||3. Marked hypoexpansion with bibasal atelectasis.||||||P|
        OBX|27|ST|1:RPT^Radiology Report|| ||||||P|
        OBX|28|ST|1:RPT^Radiology Report||3. Groundglass opacity throughout much of the right lung could||||||P|
        OBX|29|ST|1:RPT^Radiology Report||represent atelectasis, aspiration, or pneumonia. Repeat radiographs||||||P|
        OBX|30|ST|1:RPT^Radiology Report||with improved positioning and inspiration could help better evaluate.||||||P|
        would this basicaly write:

        Code:
        MMN000388666  RAD  CHEST 1 VIEW AP 71010
        Exam: Portable chest.
        Comparison: None available.
        History: Patient found down.
        Findings: The patient is diffusely and severely osteopenic. There is
        a transverse fracture through the surgical neck of the right humerus.
        Evaluation of the chest is limited secondary to lung hypoexpansion
        and kyphotic positioning. The cardiomediastinal silhouette is not
        well visualized. There is bibasilar atelectasis, and there is poorly
        .........................
        ...............................
        ....................................
        .........................................
        To a single record in the DB?

        Comment


        • #5
          Re:Receive multiple OBX segments

          Hi all,

          sorry for my sudden appearance!. jasonlan, depending in how you manage "for each" loop is possible to concatenate all strings in order to generate only one record in database, or generate one record for each text.

          If you concatenate al OBX segments in a var called report and when exiting the loop record the data in database, you will obtain one report. Otherwise, if you read all OBX segments and put the INSERT statement inside the loop, you will generate one record for each OBX.

          It's your choice!

          HTH,

          Ricard Bernat

          Comment


          • #6
            Re:Receive multiple OBX segments

            Thanks for your sudden appearance, I really appreciate it. :-)

            would you happen to have a code example to help a slow person like me? ;-)

            Comment


            • #7
              Re:Receive multiple OBX segments

              Hi jasonslan,

              search 'for each' in forum search and you will find many examples about, is really easy!.

              Ricard Bernat

              Comment


              • #8
                Re:Receive multiple OBX segments

                you know, I really don't know what I'm doing, I tried adding the example ChrisL supplied above as a javascript step in my transformer, but it always errors out with "ReferenceError: "output" is not defined."

                can anybody help point me in the right direction.. (like I stated, I really don't know what i'm doing, but I can follow directions.. :-)


                --Jason

                Comment


                • #9
                  Re:Receive multiple OBX segments

                  Hi jasonlan,

                  maybe if you send your channel or javascript code that you re using we could help you.

                  Ricard Bernat

                  Comment


                  • #10
                    Re:Receive multiple OBX segments

                    I have the same problem. I tried using the script that Chris posted higher in this post and get the same output error. No one ever answered, is that code missing something like a variable definition or something? Unfortunatly like the original poster, I'm new to this and don't know any Java.

                    Comment


                    • #11
                      Re:Receive multiple OBX segments

                      Hi Jason,

                      did you solved your problem?. Really is very difficult to help you without a code to comment.

                      Waiting your news,

                      Ricard Bernat

                      Comment


                      • #12
                        Re:Receive multiple OBX segments

                        Adding the output={}; prior to the code seems to have gotten rid of the error, but it didn't actually output anything to my transformer / destination. Could someone tell me how to map a transformer java script step to my FileWriter template?

                        I tried adding ${output} to my template but that doesn't work. I also tried ${Reportoutput} which is the name of the Transformer step that is assigned to the javascript. Can anyone enlighten me?

                        Post edited by: bstevens, at: 03/13/2009 09:14

                        JAVA CODE:
                        output={};
                        for each(obx in msg..OBX){
                        output+=obx['OBX.5'].toString();
                        }

                        This is in Step 8 of my Transformer Named "Reportoutput" of type JavaScript.
                        In my FileWriter Template I have some mapped one to one variables (steps 1 through 7 of the transformer), and I need all these OBX fields after the other steps. Please help.

                        -Brad

                        Post edited by: bstevens, at: 03/13/2009 11:08

                        Comment


                        • #13
                          Re:Receive multiple OBX segments

                          If you are using version 1.8 as I am, it seems that the code earlier in this thread will not work for you.

                          you need:
                          Code:
                          var output = {}
                          for(obx in msg..OBX)
                          {
                            output+= msg['OBX'][obx]['OBX.5']['OBX.5.1'].toString();		
                          
                          }
                          for(obx in msg..OBX) does not seem to iterate across the objects. It iterates across their indexes. The type(as much as a js variable can have a type) of obx is integer. A call to obx['OBX.5'].toString() throws an exception for trying to call a method that is undefined.

                          I am curious to see how I am going to work out mapping multiple OBX segments with multiple OBR segments...

                          Comment


                          • #14
                            declare output as var Output
                            and use in code
                            if u want to use it over channel then decalre channelMap.put('VArname',output);

                            Comment


                            • #15
                              Hi all,

                              I'm using this code below to create a string from all the OBR.4.1 values but the result of the variable is: [object Object]MG BSE ANNE DIFF KR NAK TSH KR CA. Where does the [object Object] piece is coming from? I want to get rid of this...

                              var output = {}
                              for(obr in msg..OBR)
                              {
                              output+= msg['OBR'][obr]['OBR.4']['OBR.4.1'].toString() + "\r\n";
                              channelMap.put('testcodes',output);
                              }

                              Comment

                              Working...
                              X