using business process to parse hl7 message

204 views
Skip to first unread message

Atkinson, Gary

unread,
May 10, 2012, 8:13:12 AM5/10/12
to ensemble-in...@googlegroups.com

Anyone that has used a business process to parse out an hl7 message be willing to share their code?  There are no examples of this any of the guides I have looked through.  I am trying to teach myself ensemble.

Thx,

Gary Atkinson MS, BS MT (ASCP)

Integration Programmer

Information Technology Department

Baltimore Washington Medical Center

University of Maryland Medical System

BWMC Office:410-787-6777

Cell:443-883-5785

gatk...@bwmc.umms.org

This email may contain protected health information about an identifable patient.  State and federal law protect the confidentiality of this information.  If you are not the intended receipient, you are prohibited from using, disclosing, reproducing, or distributing this information.  You should immediately notify the sender by telephone or email, and delete this document.

Gary

unread,
May 10, 2012, 10:12:41 AM5/10/12
to InterSystems: Ensemble in Healthcare
Hi Gary,

I'm not sure exactly what you need but if it's any help we do
something like this:

For the BPL set the Request type to be EnsLib.HL7.Message

Then we use code activities to get some info from the message and
store these in the context, i.e.

set context.MsgType = request.Name
set context.HospitalNumber =
request.GetValueAt("PID:PatientIDInternalID(1).ID")

etc.

Further on down the process we map the HL7 message to messages of our
own type i.e. for telephone numbers etc. and then use the created
message and do something with that within the code of the BPL (in our
case we create instances of classes we have defined using the .%New()
populate the values and .%Save()

Does that help?

Cheers,
Gary

On May 10, 1:13 pm, "Atkinson, Gary" <GAtkin...@bwmc.umms.org> wrote:
> Anyone that has used a business process to parse out an hl7 message be
> willing to share their code?  There are no examples of this any of the
> guides I have looked through.  I am trying to teach myself ensemble.
>
> Thx,
>
> Gary Atkinson MS, BS MT (ASCP)
> Integration Programmer
> Information Technology Department
> Baltimore Washington Medical Center
> University of Maryland Medical System
> BWMC Office:410-787-6777
> Cell:443-883-5785
> gatkin...@bwmc.umms.org <mailto:%3cgatkin...@bwmc.umms.org>

Atkinson, Gary

unread,
May 10, 2012, 10:17:10 AM5/10/12
to ensemble-in...@googlegroups.com
Its a start :) i come from Cloverleaf world so i am use to scripting and not object languages. How do you split message into segments and fields in cache world?

Gary


-----Original message-----
From: Gary <fail...@googlemail.com>
To:
"InterSystems: Ensemble in Healthcare" <Ensemble-in...@googlegroups.com>
Sent:
Thu, May 10, 2012 10:12:41 EDT
Subject:
[InterSystems-EnsHlth] Re: using business process to parse hl7 message

Hi Gary,

I'm not sure exactly what you need but if it's any help we do
something like this:

For the BPL set the Request type to be EnsLib.HL7.Message

Then we use code activities to get some info from the message and
store these in the context, i.e.

set context.MsgType = request.Name
set context.HospitalNumber =
request.GetValueAt("PID:PatientIDInternalID(1).ID")

etc.

Further on down the process we map the HL7 message to messages of our
own type i.e. for telephone numbers etc. and then use the created
message and do something with that within the code of the BPL (in our
case we create instances of classes we have defined using the .%New()
populate the values and .%Save()

Does that help?

Cheers,
Gary

On May 10, 1:13 pm, "Atkinson, Gary" wrote:
> Anyone that has used a business process to parse out an hl7 message be
> willing to share their code?  There are no examples of this any of the
> guides I have looked through.  I am trying to teach myself ensemble.
>
> Thx,
>
> Gary Atkinson MS, BS MT (ASCP)
> Integration Programmer
> Information Technology Department
> Baltimore Washington Medical Center
> University of Maryland Medical System
> BWMC Office:410-787-6777
> Cell:443-883-5785
> gatkin...@bwmc.umms.org
> This email may contain protected health information about an identifable
> patient.  State and federal law protect the confidentiality of this
> information.  If you are not the intended receipient, you are prohibited
> from using, disclosing, reproducing, or distributing this information.
> You should immediately notify the sender by telephone or email, and
> delete this document.

--
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare Community" group.
To post to this group, send email to Ensemble-in...@googlegroups.com
To unsubscribe from this group, send email to Ensemble-in-Healt...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/Ensemble-in-Healthcare?hl=en

Gary

unread,
May 10, 2012, 10:26:49 AM5/10/12
to InterSystems: Ensemble in Healthcare
There are probably various ways to do it, I know the
EnsLib.HL7.Message object has methods like getSegmentByPath and the
EnsLib.HL7.Segment object has methods like GetValueAt. I have never
had a real need to use these though so couldn't really advise either
way.

I guess your need would depend on what you are trying to do within
your Business Process.
> On May 10, 1:13 pm, "Atkinson, Gary" <GAtkin...@bwmc.umms.org> wrote:
> > Anyone that has used a business process to parse out an hl7 message be
> > willing to share their code?  There are no examples of this any of the
> > guides I have looked through.  I am trying to teach myself ensemble.
>
> > Thx,
>
> > Gary Atkinson MS, BS MT (ASCP)
> > Integration Programmer
> > Information Technology Department
> > Baltimore Washington Medical Center
> > University of Maryland Medical System
> > BWMC Office:410-787-6777
> > Cell:443-883-5785
> > gatkin...@bwmc.umms.org <mailto:%3cgatkin...@bwmc.umms.org>
> > This email may contain protected health information about an identifable
> > patient.  State and federal law protect the confidentiality of this
> > information.  If you are not the intended receipient, you are prohibited
> > from using, disclosing, reproducing, or distributing this information.
> > You should immediately notify the sender by telephone or email, and
> > delete this document.
>
> --
> You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare Community" group.
> To post to this group, send email to Ensemble-in...@googlegroups.com
> To unsubscribe from this group, send email to Ensemble-in-Healt...@googlegroups.com
> For more options, visit this group athttp://groups.google.com/group/Ensemble-in-Healthcare?hl=en- Hide quoted text -
>
> - Show quoted text -

Dale du Preez

unread,
May 10, 2012, 10:49:06 AM5/10/12
to ensemble-in...@googlegroups.com
Hi Gary,

I think it may be best to start with your overall goal here. The word
"parse" could mean a few different things here, depending on the exact
message data you are trying to process. In general, Ensemble normally
does an initial parse of incoming HL7 messages in a Business Service,
which is primarily focused on persisting each segment to disk and
mapping the set of received segments to a schema map to simplify access
to the raw segment data. So in your case, does your use of the term
"parse" mean "How do I parse a file or stream containing HL7 data?", or
"How do I get information from an HL7 message object in a BP?".

Once we can narrow down what you are looking for, I am sure we can get
you some more detailed information.

Thanks,
Dale

Atkinson, Gary

unread,
May 10, 2012, 10:45:54 AM5/10/12
to ensemble-in...@googlegroups.com
Can u use straight cache and split message by /r?

Gary


-----Original message-----
From: Gary <fail...@googlemail.com>
To:
"InterSystems: Ensemble in Healthcare" <Ensemble-in...@googlegroups.com>
Sent:
Thu, May 10, 2012 10:26:49 EDT
Subject:
[InterSystems-EnsHlth] Re: using business process to parse hl7 message

There are probably various ways to do it, I know the
EnsLib.HL7.Message object has methods like getSegmentByPath and the
EnsLib.HL7.Segment object has methods like GetValueAt. I have never
had a real need to use these though so couldn't really advise either
way.

I guess your need would depend on what you are trying to do within
your Business Process.

> On May 10, 1:13 pm, "Atkinson, Gary" wrote:
> > Anyone that has used a business process to parse out an hl7 message be
> > willing to share their code?  There are no examples of this any of the
> > guides I have looked through.  I am trying to teach myself ensemble.
>
> > Thx,
>
> > Gary Atkinson MS, BS MT (ASCP)
> > Integration Programmer
> > Information Technology Department
> > Baltimore Washington Medical Center
> > University of Maryland Medical System
> > BWMC Office:410-787-6777
> > Cell:443-883-5785
> > gatkin...@bwmc.umms.org

Atkinson, Gary

unread,
May 10, 2012, 10:52:31 AM5/10/12
to ensemble-in...@googlegroups.com
I guess it would be a stream of data that came over a bs via tcp ip.

Gary


-----Original message-----
From: Dale du Preez <dale.d...@intersystems.com>
To:
ensemble-in...@googlegroups.com
Sent:
Thu, May 10, 2012 10:49:06 EDT
Subject:
Re: [InterSystems-EnsHlth] Re: using business process to parse hl7 message

Hi Gary,

I think it may be best to start with your overall goal here. The word "parse" could mean a few different things here, depending on the exact message data you are trying to process. In general, Ensemble normally does an initial parse of incoming HL7 messages in a Business Service, which is primarily focused on persisting each segment to disk and mapping the set of received segments to a schema map to simplify access to the raw segment data. So in your case, does your use of the term "parse" mean "How do I parse a file or stream containing HL7 data?", or "How do I get information from an HL7 message object in a BP?".

Once we can narrow down what you are looking for, I am sure we can get you some more detailed information.

Thanks,
Dale

On 5/10/2012 10:26 AM, Gary wrote:
> There are probably various ways to do it, I know the
> EnsLib.HL7.Message object has methods like getSegmentByPath and the
> EnsLib.HL7.Segment object has methods like GetValueAt. I have never
> had a real need to use these though so couldn't really advise either
> way.
>
> I guess your need would depend on what you are trying to do within
> your Business Process.
>

Dale du Preez

unread,
May 10, 2012, 11:06:11 AM5/10/12
to ensemble-in...@googlegroups.com
Hi Gary,

So if the data is being sent in as a normal HL7 message via TCP/IP, is there a particular reason you want to manually parse the message rather than using an HL7 TCP service to do the parsing for you? I ask because we have a good portion of code that is dedicated to parsing HL7 messages, and I would like to understand why you are looking to bypass that code so I can give more constructive advice about how to implement your interface. I am asking all the simple questions now so that I don't suggest a time-consuming approach that isn't necessary! So before I start suggesting things, it would really help me to know what your overall message flow is (or needs to be), so I can try to suggest an overall solution rather than a code sample that just makes more work for us all. ;) I definitely want to make sure we don't miss the forest for the trees!

Thanks,
Dale

Atkinson, Gary

unread,
May 10, 2012, 11:14:50 AM5/10/12
to ensemble-in...@googlegroups.com
Right now my cloverleaf engine manipulate the adt hl7 messages as they come into engine. I do std manipulation here because i can easily parse out the hl7 message on code regardless of an schema or message type restrains. Also only need on of piece of code. Trying to reproduce this in ensemble.  Can be done in dtl but want to know other ways using straight code.

Gary

Dale du Preez

unread,
May 10, 2012, 11:56:03 AM5/10/12
to Ensemble-in...@googlegroups.com
Hi Gary,

Thanks for clarifying that. From your perspective, it sounds like there is no real need to use a schema mapping, so you don't need to apply this in your business service. Your BP can receive an HL7 message and then use code something like the following to iterate through all the segments and get various values:
    // for clarity I am assuming pRequest is of type EnsLib.HL7.Message
    Set tHL7 = pRequest
    // iterate over all segments
    For i=1:1:tHL7.SegCount {
        // Get the entire segment as a raw string (note that our default string limit is 32K) - this may be enough for your purposes, but I will illustrate some further options below
        Set tSegmentAsString = tHL7.GetValueAt(i)
        // Get a reference to the segment wrapper object
        Set tSegmentObject = tHL7.GetSegmentAt(i)
        Set tSegName = tSegmentObject.Name

        // Use the segment object to get specific field values
        // Get the value of a field by numeric index
        Set tSegField = tSegmentObject.GetValueAt("3")
        // Get the value of a field that repeats
        // Assume the segment is a PID segment with the following content: PID|1||000654321^^^myAA^MR~005432198^^^^PI|...
        // Get the full content of PID:3(2), should be 005432198^^^^PI
        Set tPatientID2 = tSegmentObject.GetValueAt("3(2)")
        // Get the number of repetitions using "*" syntax
        Set tRepCount = tSegementObject.GetValueAt("3(*)")
        // Get the type and ID separately from the second ID value
        Set tIDType = tSegmentObject.GetValueAt("3(2).5")
        Set tIDNumber = tSegmentObject.GetValueAt("3(2).1")
    }

Is that the level of access you are looking for?

Dale

Atkinson, Gary

unread,
May 10, 2012, 12:57:49 PM5/10/12
to ensemble-in...@googlegroups.com

Yes this is good start.  I need to get use to using object oriented cache and learning how the classes work in ensemble.

 

Thanks,
Gary


Reply all
Reply to author
Forward
0 new messages