Question
Rick Prichett · Feb 10, 2021

Return Clone of message

Hi everyone, I am trying to return a cloned version of my ADT that I have made changes to in a Business Process.  So far I have the following in my process.  

&sql(Select MemberId INTO :pMemberIDval from CDSM_MemberAPI.MemberInfo where MemDOB = :ptDOB and MemLname = :ptLname and MemFname = :ptFname)

set newrequest = pRequest.%ConstructClone()

set MemberIDPID4 = newrequest.SetValueAt(pMemberIDval, "PID:4.1")

The following does return the value I am populating the clone with to the log

  set newrequestPID4 = newrequest.GetValueAt("PID:4.1")
  $$$LOGINFO("newrequestPID4DB " _newrequestPID4)

So then I try to set the old request with the new but, I get nothing sent back out the trace.  Any Ideas where I am going wrong

set pRequest = newrequest

return newrequest

 

Product version:
IRIS 2020.2
00
1 0 3 78

Replies

If it's an ObjectScript process, you would use ..SendRequestSync() or ..SendRequestAsync(), with newrequest as the request argument and the name of the downstream process or operation as the target argument. Whether you would send it asynchronously or synchronously would depend on your needs. For healthcare integration, synchronous is generally required as it maintains FIFO.

You can't modify an inbound message from a service as it will have the immutable property set; that's why you have to clone it to make changes.

Now that I have my cloned message being sent to my destination.  Is there a way to set the target argument in the Business Process settings so that the user can pick it vs hard coding?

set tSC = ..SendRequestSync("HL7FileOperation", newrequest)

You sure can. You can find the documentation for adding settings to business hosts here.