Announcement

Collapse
No announcement yet.

Parsing OBX message

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

  • Parsing OBX message

    Need some help to find a solution ...

    I have an incoming channel that receives lab reports. The OBX records in the message looks like this:

    OBX|1|NM|2000330^SEGS^SEGMENTED NEUTROPHIL||88|%|^32^66|H|||F|||20061002121200|ABC ^DEF, GHI|ABC^DEF, GHI

    The obx.7 is the reference range which in the above example is ^32^66, and it's not showing up on the hl7 tree when I copy the sample message in the hl7 message template.

    It seems like the parser can recognize obx.7 value if it is a string, e.g. 32-66, but treat ^32^66 as no value.

    What options do I have to be able to parse this value?

    Thanks, Dave.


  • #2
    Re: Parsing OBX message

    Can you paste the full record? By default, HL7 specifies the ^ character as a field seperator, so in the OBX.7 case it is pulling out an empty field.

    -Chris
    Chris Lang

    Comment


    • #3
      Re: Parsing OBX message

      Here is a sanitized sample:

      MSH|^~\&|AAA999|ABC|AAA|ABC_AA|20060901120000||ORU ^R01|11111-111111111111|T|2.2
      PID|1||000099999^^^00000||ABC^ABC^ABC||19181010|M| |W||||||||0099999|999999999
      PV1|1||BMT^BSEC^01||||||11111^A, ABC~22222^B, ABC~33333^C, ABC|TS|||||||99999^ABC, ABC|O||||||||||||||||||||||||||20060901090000
      ORC|RE||099999999^MN||CM||||20060901120000|||| BMT
      OBR|1||099999999^MN|2000001^DIFF^DIFFERENTIAL|||20 060901120000|||ABC||U||20060901120000||99999^ABC, ABC||00000000|999999||0000999999999|20060901120000 ||MN|F||^^^20060901120000^^RN~^^^^^RT
      OBX|1|NM|2000002^SEGS^SEGMENTED NEUTROPHIL||78|%|^32^66|H|||F|||20060901120000|ABC ^ABC, ABC|ABC^ABC, ABC
      OBX|2|NM|2000003^BANDS^BANDS||0|%|^0^2|N|||F|||200 60901120000|ABC^ABC, ABC|ABC^ABC, ABC
      OBX|3|NM|2000004^LYMPHOCYTE^LYMPHOCYTES||20|%|^24^ 58|L|||F|||20060901120000|ABC^ABC, ABC|ABC^ABC, ABC


      Yes, in the obx.7 case it is pulling out as an empty field, but this is the message we'll receive, so I need to find a way to get the range values.

      Thanks for your help Chris!

      Comment


      • #4
        Re: Parsing OBX message

        Yes, the problem is that it is parsing the '^' to be a field seperator. There's not much that can be done in 1.1, however 1.2 is scheduled to include a pre-processor that you can run on the message to fix-up any encoding issues before it is passed to the HL7 processor.

        (http://www.mirthproject.org/communit...rowse/MIRTH-32)


        Sorry about that!
        -Chris
        Chris Lang

        Comment


        • #5
          Re: Parsing OBX message

          Yeah ... I agree that we should have a pre-processor. I was hoping that in 1.1 we can have a way to access the raw message data before it is converted to xml.

          I think this is a very important feature to be more flexible to deal with not so perfect encoding in the real world.

          When will 1.2 to be released? I still need to find a solution for this issue really fast ...

          Dave.


          Comment


          • #6
            Re: Parsing OBX message

            1.2 is scheduled for Oct 25th. You might be able to kludge a solution by accessing the hl7_er7 value from the js.

            Do a logger.error(hl7_er7);

            In your javascript - is the value retained there?

            -Chris
            Chris Lang

            Comment


            • #7
              Re: Parsing OBX message

              I did the log on the hl7_er7 object in my javascript and those values are not retained there. I set log4j on debug and from the log it shows that in

              com.webreach.mirth.server.mule.util.ER7Util before encoding ER7 message to XML, the raw message still having those values.

              after ER7 transforms to XML, those reference range value is gone.

              I guess the hl7_er7 is constructed from the converted XML.

              Is the raw message data still an accessible object in my javascript? Or, Can I write my own java class to plug-in the mule config, for example in the transformer before com.webreach.mirth.server.mule.transformers.ER7toX ML?

              Glad to hear that 1.2 is scheduled for Oct 25th. Hope the pre-processor is in this release.

              Thanks Chris! Dave.

              Comment


              • #8
                Re: Parsing OBX message

                Try using the 'message' or 'incomingMessage' variable in your JS. logger.error(message.toString());

                Any luck there?

                -Chris
                Chris Lang

                Comment


                • #9
                  Re: Parsing OBX message

                  Hi Chris, I tried both message and incomingMessage, and those values are not there.

                  Dave.

                  Comment

                  Working...
                  X