go to post Stylianos Chalkiotis · Mar 4, 2020 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
go to post Stylianos Chalkiotis · Nov 4, 2019 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}
go to post Stylianos Chalkiotis · May 5, 2019 HiOne 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.RegardsStelios
go to post Stylianos Chalkiotis · Apr 9, 2019 Hi Could you please check if you are using the correct adapter? I can see in your code this: Parameter ADAPTER = "EnsLib.TCP.PassthroughService" which is not an adapter but a business service.Maybe you want to use the EnsLib.TCP.CountedInboundAdapter or probably the EnsLib.TCP.TextLineInboundAdapter ?RegardsStelios
go to post Stylianos Chalkiotis · Jan 8, 2019 Hi JamesYou could try see if you could get the job status of your Business Operation by querying the Enumerate() class query of the Ens.Job class.SET JobStatus=""&sql(SELECT Status into :JobStatus FROM Ens.Job_Enumerate() WHERE ConfigName='YourBusinessOperation')The jobstatus should be "running" or "dequeuing". I hope it helps.Stelios
go to post Stylianos Chalkiotis · Dec 20, 2018 HiIf the Ens package is available to you, then I find very useful the ConvertDateTime() method of the Ens.Util.Time class. For example, if I want to convert this date: “20181220” to “20-12-2018”, then I use the ConvertDateTime() method like this: SET ConvertedDt =##class(Ens.Util.Time).ConvertDateTime("20181220","%Y%m%d","%d-%m-%Y")The patterns that I use more frequently are:%Y year including the century, as a 4-digit number (0000-9999)%y year within a century as a number (00-99)%m month as a 2-digit number (01-12)%#m month as a number (1-12) without leading zeros %d day of the month as a 2-digit number (01-31)%#d day of the month as a number (1-31) without leading zero%H hour in 24-hour format as a 2-digit number (00-23)%M minute as a 2-digit number (00-59)%S second as a 2-digit number (00-60) (60 for leap seconds)%N fractional second in milliseconds as number (000-999)You can read more details about the Ens.Util.Time class including the full list of the supported patterns here: https://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=ENSLIB&CLASSNAME=Ens.Util.TimeI hope it helps.RegardsStelios
go to post Stylianos Chalkiotis · Dec 19, 2018 Hi LassiProbably you are getting "AA" because the Ack mode of the Business Service is set to "Immediate". One way to do this, is to configure your business Service to send the incoming HL7 message to a business process that constructs the acknowledgement according to your requirements ,and sends the acknowledgement back to the business service as response. In this case, your Business Service Ack mode has to be "Application".Here is a sample Business Process that could do something like this. Class dev.process.ackProc Extends Ens.BusinessProcess [ ClassType = persistent ]{Method OnRequest(pRequest As EnsLib.HL7.Message, Output Ack As EnsLib.HL7.Message) As %Status{SET sc=$$$OKSET Ack=##class(EnsLib.HL7.Message).%New()SET Ack.DocType="2.5:ACK"SET sc=Ack.SetValueAt("ENSEMBLE","MSH:3")SET sc=Ack.SetValueAt(pRequest.FindSegmentValues("MSH:3"),"MSH:6")SET sc=Ack.SetValueAt("ACK","MSH:9.1")SET sc=Ack.SetValueAt(pRequest.FindSegmentValues("MSH:9.2"),"MSH:9.2")SET sc=Ack.SetValueAt($REPLACE($ZTIMESTAMP,",",""),"MSH:10")SET sc=Ack.SetValueAt("CE","MSA:1") Quit sc}}I hope it helps.RegardsStelios
go to post Stylianos Chalkiotis · Nov 15, 2018 Hi Scott, What errors do you see in the Gateway services in the production?Stelios
go to post Stylianos Chalkiotis · Feb 24, 2018 HiIf you want to get the username and password that is stored in the Ensemble credentials list that is accessible via the management portal Ensemble>Credentials, and if you know the credential id,then you can get the username and password via the Ens.Config.Credentials class:SET cr=##class(Ens.Config.Credentials).%OpenId("yourCredentialID")SET UserName=cr.UsernameSET Password=cr.Passwordsee here the class reference:http://docs.intersystems.com/latest/csp/docbook/%25CSP.Documatic.cls?AGE...I hope it helpsStelios
go to post Stylianos Chalkiotis · Feb 8, 2018 I had the same question, and after doing some further reading, I believe that the certificate that the client sends to the server depend on the list of the “Acceptable client certificate CA names” that the server presents to the client. This list is part of the “Client Certificate Request Message” that the server sends to the client during the SSL handshake.So it looks like that the client is using this information to search for the appropriate certificates in the windows certificate store.You can read here about the Client Certificate Request Message: https://technet.microsoft.com/en-gb/library/cc783349(v=ws.10).aspx(Optional) Client Certificate Request MessageThe server must always present its certificates to the client, but the client is not always required to authenticate itself. Therefore, the client is not always required to send its certificates to the server. If the server does not require client authentication, then this message is not sent.This step might be used for Web sites such as a banking Web site, where the server must confirm the identity of the client before providing sensitive information. If the application requires mutual authentication, the server sends a Client Certificate Request. The Client Certificate Request message includes:The type of certificate required (typically RSA or DSS)A list of acceptable CAs If I try to connect to the LDAPs server using OpenSSL:Openssl s_client -connect ldapServername.com:636 –statethen I can see the “Acceptable client certificate CA names”I hope it helpsStelios