Question
Farhad Ahmad · Jul 27, 2017

Business Processor: Unable to reference a property in the 'request' object

I am creating a BPL using the Management Portal instead of creating a custom class. 

As per the documentations 'request object' contains properties those were in the original request message object or primary request and can be reference using the dot syntax. 

So if the primary request was an HL7 message, i should be able to pull the value MSH:9.2 as  follow 

request.{MSH:9.2} and assign it to a context property

attached image is a screen shot of my configuration, set  context.X  to request.{MSH.MessageType.triggerevent} i have also tried referencing the object property by number instead of name set  context.X  to request.{MSH.9.2} 

But i am getting this error 

18:17:50.204:Ens.Actor: ERROR <Ens>ErrBPTerminated: Terminating BP ProcessPIDSegment # due to error: ERROR <Ens>ErrException: <PROPERTY DOES NOT EXIST>zS1+2^TestFarhad.BlastAMessageBasedOnPID3.Thread1.1 *source,EnsLib.HL7.Message -- logged as '-' number - @' Set status=1,context.X=request.source.GetValueAt("MSH:MessageType.triggerevent")'

17:54:26.384:Ens.Actor: ERROR <Ens>ErrBPTerminated: Terminating BP ProcessPIDSegment # due to error: ERROR <Ens>ErrException: <INVALID OREF>zS1+2^TestFarhad.BlastAMessageBasedOnPID3.Thread1.1 -- logged as '-' number - @' Set status=1,context.X=request.GetValueAt("MSH:9.2")'

I have verified message contain a value in MSH:9.2, sample message is below

MSH|^~\&|QCPR|JA|||201707251356||ADT^A31|6960|T|2.3||||||pt updt (no visit)|
EVN|A31|201707251356||||
PID|1||111111^^^^MR^JA~2222^^^^MR^NO||Novus^Inpatient^^^||19720418|M||Black or African American|99 Nightfall Avenue^63^Bronx^NY^10457^U.S.A.|Bronx||^^^||Divorced|Catholic|||||||||||||
PD1||||||||||||N||

just for concept testing i have assigned the context.X property to a string and then displayed the string and it does populate. 

Can you please assist with how should i reference any property in the HL7 messages using the request object. 

Thank You

 

 

 

00
1 0 5 1,258
Log in or sign up to continue

The problem is that your syntax doesn't really describe  a property; it's shorthand that works in the routing rule and DTL editors.

Try, instead, set context.X = request.GetValueAt("MSH:9.2").

EDIT: Looking at the log you included, it appears as though you are using the correct syntax at some point. Is context.X defined as a %String in the BPL context variable definitions?

Thank You for pointing it out, data type of the property was the issue. Now the property is set to %string ,  and i am able to assign the request.{MSH:9.2} value to context.x property. 

Hi Farhad,

Are you still having this problem?

The error message is complaining about the source property being undefined. I've been able to reproduce exactly your error message by using request.source.{MSH:9.2} rather than correct syntax request.{MSH:9.2}

I hope this helps.

David

Thank you, data type of the context property i was trying to assign the value returned by GetValueAt() method was wrong. I had it as EnsLib.HL7.Message. 

Yeah, error message was a bit confusing, it was pointing to Source property as undefined, but if i reference the source property as request.{MSH:9.2}  which was translated by Ensemble code generator as  

set (whatever the property or variable) = request.GetValueAt("MSH:9.2")

i was pretty confident request object does contain this property, and as per documentation it can be referenced by the above code, but when it was not generating the expected results, i got confused and thought maybe i am reference it incorrectly. 

 

Please if you or anyone has some additional documentations on BPLs, please share.

Thank you, data type of the context property i was trying to assign the value returned by GetValueAt() method was wrong. I had it as EnsLib.HL7.Message. 

Yeah, error message was a bit confusing, it was pointing to Source property as undefined, but if i reference the source property as request.{MSH:9.2}  which was translated by Ensemble code generator as  

set (whatever the property or variable) = request.GetValueAt("MSH:9.2")

i was pretty confident request object does contain this property, and as per documentation it can be referenced by the above code, but when it was not generating the expected results, i got confused and thought maybe i am reference it incorrectly. 

Please if you or anyone has some additional documentations on BPLs, please share.