User bio
404 bio not found
Member since Jul 24, 2017
Posts:
Stylianos has not published any posts yet.
Replies:

Hi

You can set a timeout for async calls by calling the SetTimer() method.

See below an example with an async call where the OnTimeout gets called:

 Method OnRequest(pRequest As Ens.Request, Output pResponse As Ens.Response) As %Status
{
  SET t=$$$OK
  SET t=..SendRequestAsync("BOout",pRequest,1,"RequestCompletionKeyOne",)
  Set tSC = ..SetTimer("PT10S")
  Quit t
}

 
Method OnResponse(request As %Library.Persistent, ByRef response As %Library.Persistent, callrequest As %Library.Persistent, callresponse As %Library.Persistent, pCompletionKey As %String) As %Status
{
  if pCompletionKey="RequestCompletionKeyOne"
  {
    $$$TRACE("Response for request with CompletionKey RequestCompletionKeyOne has been received")
  }
  Quit $$$OK
} 



Method OnTimeout(request As %Library.Persistent, ByRef response As %Library.Persistent, callrequest As %Library.Persistent, pCompletionKey As %String) As %Status
{
// Subclass responsibility
  $$$LOGWARNING(" Timeout Occurred")
  Quit $$$OK
}

Regards

Stelios

After you receive the K21 response you could get the patient identifier that you need by looping through all the identifiers that are included in the K21 PID:3(X).1  field and extract the id that you want only if the PID:3(x).4 has a specific value.

Then you could create clone of the ORU message and you can set the value of the PID using the identifier extracted from the K21 response.

 

For example:

If your business process is receiving the ORU message then an example OnRequest method could be like the following one:

 

Method OnRequest(pRequest As EnsLib.HL7.Message, Output pResponse As Ens.Response) As %Status
{
                SET sc=$$$OK
                //assumes that you have created the Q21 here…
                SET sc=..SendRequestSync("PASSystem", Q21msg,.K21Resp)
                IF sc
                {                                             
                                For i=1:1:K21Resp.GetValueAt("PIDgrp.PID:3(*)")
                                {                                             
                                                IF K21Resp.GetValueAt("PIDgrp.PID:3("_i_").4.1")="5"
                                                {
                                                                SET PatID=K21Resp.GetValueAt("PIDgrp.PID:3("_i_").1")
                                                }                                             
                                }
                                SET newORU=pRequest.%ConstructClone()
                                IF $GET(PatID)'="" SET sc=newORU.SetValueAt(PatID,"PIDgrpgrp(1).PIDgrp.PID:3(1).1")
                                //now here you can set the pResponse to be the newORU or you can send it to another Business Host.
                                SET sc=..SendRequestSync("DestinationOfTheFinalORU", newORU ,. newORUResp)
                                SET pResponse=newORUResp
                }
                Quit sc
}

Hi

One approach to handle files in Ensemble without storing them in the database  could be to store the file to an external directory and pass the file path as a string message property instead of the stream between the business hosts.

When you finish what you need to do with the file, then using the file path you can delete the file.

 If you follow this approach and depending on what you need to do with your interface, you have to consider that you may not be able to resend messages or view the files because your files may not exist when you resend your messages, unless your interface is retrieving the files every time you resend a message. In this case, the purge tasks will not have to delete the  external files, but deleting the external files has to be handled properly by your code.

I hope it helps.

Regards

Stelios

Certifications & Credly badges:
Stylianos has no Certifications & Credly badges yet.
Global Masters badges:
Followers:
Stylianos has no followers yet.
Following:
Stylianos has not followed anybody yet.