Maximum Length of an HL7 Message in Ensemble DB

165 views
Skip to first unread message

Jim Dolson

unread,
Mar 31, 2008, 10:35:04 AM3/31/08
to Ensemble-in...@googlegroups.com
Hi.

While looking for something else, I noticed that the MaxLen column of the RawContent row in the EnsLib_HL7.Message table is set to 10,000.

Is this going to limit the size of HL7 messages that can be processed to 10,000 bytes?

Thanks,

Jim Dolson
Holland Hospital

Weinger, Daniel

unread,
Mar 31, 2008, 10:41:53 AM3/31/08
to Ensemble-in...@googlegroups.com

Jim,

 

RawContent is just a property to be used for SQL queries, and inspection.  Here is the documentation on the property:

 

/// The raw text content of the document. Note that this is a truncated version suitable for use in SQL results and visual inspection,
/// but not a complete or definitive representation of the document.
Property RawContent As %String(MAXLEN = 10000) [ Calculated, ReadOnly, SqlComputeCode = { Set {RawContent}=##class({%%CLASSNAME}).getSegsAsString({ID}) }, SqlComputed, Transient ];

 

 

Regards,

 

Dan


Jim Dolson

unread,
Mar 31, 2008, 11:06:07 AM3/31/08
to Ensemble-in...@googlegroups.com
Hi Dan.

Thank you for that information.

We're wondering though, that if we want to do a query and we want to query the entire message, where is it stored?

Thanks!

Jim & Joel
Holland Hospital

Weinger, Daniel

unread,
Mar 31, 2008, 11:30:25 AM3/31/08
to Ensemble-in...@googlegroups.com

Jim,

 

The data (segments) for HL7 messages is stored in the ^EnsHL7.Segment global.  EnsLib.HL7.Segment has no SQL view to it (it is not a persistent class).

 

RawContent is generated using this method:

 

/// This method is for use from the RawContent property's SQL Compute invocation
ClassMethod getSegsAsString(pId As %CacheString, pMaxLen As %Integer = 10000, pStartOffset As %Integer = 1) As %String
{
            #; Use delimiters from first segment, translate all subsequent delims to those
            Set str="" For index=1:1:+$G($$$vaExtentGbl(pId,"segs")) { Set data=$$$vaSegmentGbl($$$vaExtentGbl(pId,"segs",index))
                        Set:index=1 tSeparators=$E(data,1,5)
                        Set:tSeparators'=$E(data,1,5) data=##class(EnsLib.HL7.Segment).replaceSeparators(data, tSeparators)
                        If pStartOffset>1 {
                                    If pStartOffset>($L(data)-5+1) { Set pStartOffset=pStartOffset-($L(data)-5+1) }
                                    Else { Set pStartOffset=1, data=$E(data,pStartOffset,*) }
                        }
                        If pMaxLen-$L(str)>=($L(data)-5+1) { Set str=str_$E(data,6,*)_$C($$$HL7DefSegTerminatorAscii) }
                        Else { Set str=str_$E(data_$C($$$HL7DefSegTerminatorAscii),6,5+pMaxLen-$L(str)) }
                        Quit:$L(str)>=pMaxLen
            }
            Quit str
}

 

 

So, you can see that it quits the loop once the string of data is greater than 10,000.  I do not know how much deeper into this topic I want to go.  What is the end game here?  Are you just trying to see messages in the portal using the SQL browser?

Jim Dolson

unread,
Mar 31, 2008, 1:31:32 PM3/31/08
to Ensemble-in...@googlegroups.com
Dan,

> What is the end game here?  Are you just trying to see messages in the portal using the SQL browser?

Yes, I'm trying to figure out how to do a SQL query and retrieve the messages for a specific Business Server or Business Operation.  I have six years experience in eGate and understand how it works and how to get it to jump through hoops.  Now I'm in the "Here's how I do it in eGate - how do I do it in Ensemble?" stage.

Thanks much!  I do appreciate your answers.  If this is something that you think wouldn't interest the list then we can take it off-line.

Jim

Ted Peck

unread,
Mar 31, 2008, 2:56:54 PM3/31/08
to Ensemble-in...@googlegroups.com
In order to get the full content you need to instantiate an object and use one of its OutputTo... methods to send the full content where you want it to go.
 
Doing SQL against the raw content of a message would be highly inefficient, even if you could get access to the complete content via SQL. That's why we don't bother to make it fully available that way.
 
However you can do highly efficient SQL queries using the indexed fields of the Ens.MessageHeader class, and then get the MessageBodyId for the matching messages and  use them as you like.  Ordinarily the Message Browser UI page is intended for this purpose, but it is certainly possible to do it in SQL as well.
 
When you say "retrieve the messages" what is it you need to do with them?
 
I understand that users of eGate often grep in the journal file for a particular interface, looking for particular message attributes. That is not the model we ordinarily use in Ensemble. The message Browser page is intended as the "Ensemble way" of doing that.  As we discussed on this forum recently, these searches are sometimes not as fast as we feel they should be, depending on the terms of the search you construct.
 
I think if you can share a bit more detail about your needs, we will be able to guide you in the best approach in Ensemble.
 
Best,
Ted Peck
Reply all
Reply to author
Forward
0 new messages