go to post Kurro Lopez · Sep 10, 2020 Hi Kurt, Check if you are using ODBC 32 or 64 bits. Maybe there are two applications (one for each configuration) and not all ODBC connection are displayed. I'm using ODBC 64 bits and my connections are availables Also, check if your ADO .Net driver is for 32 or 64 bits compatible. I hope it is help for you, Regards,Kurro
go to post Kurro Lopez · Sep 7, 2020 Hi Tim, I know that is a old question, and I don't know if you have resolved your problem. I have something like you are asking in a process. Maybe it could help you. I created a persistent class with theses properties, also add a Query to retrieve info from a ProcessId: Class FtpFileReport Extends %Persistent { /// ProcessId Property ProcessId As %String; /// Filename Property FileName As %String; /// Retrieve records of a ProcessId Query GetRecordsByProcessId(pProcessId As %String) As %SQLQuery { SELECT ProcessId, FileName FROM FtpFileReport WHERE ProcessId = :pProcessId } } Then, when my process start to grabs the file, create a ProcessId, for example, using a combination of horolog and cryptotoken, to create an unique Id. set pProcessId = "ID"_$PIECE($HOROLOG,",")_$PIECE($HOROLOG,",",*)_$SYSTEM.Encryption.GenCryptToken() For each file grabbed, you save a record in your persistent class set obj=##class(FtpFileReport).%New() set obj.ProcessId = pProcessId ;pProcessId is the variable with the Id created previously set obj.FileName = pFileName ;if you are using retrieveFile method, it is the name the file that is grabbing do obj.%Save() Afterward, create a message to a BO that send the email with the ID of the process and create the message body based on ProcessId files: Class SendEmail Extends Ens.BusinessOperation { Parameter ADAPTER = "EnsLib.EMail.OutboundAdapter"; Parameter INVOCATION = "Queue"; /// Send email of FTP Report Method SendFtpReport(pRequest As Ens.StringRequest, Output pResponse As Ens.StringResponse) As %Status { #dim myList As %Library.ListOfObjects set report = ##class(FtpFileReport).%New() set myList = ##class(%Library.ListOfObjects).%New() set resultset = report.GetRecordsByProcessId(pRequest.StringValue) set data = ##class(%Stream.GlobalCharacter).%New() while resultset.%Next() { set fileNum = $Increment(fileNum) do data.Write("<b>"_fileNum_":</b><p>"_resultset.%Get("FileName")_"</p><hr>") do myList.Insert(data) } set msg = ##class(%Net.MailMessage).%New() set msg.IsHTML = 1 do msg.TextData.WriteLine("<h1>FileReport</h1><br><h2>This is the FTP report: <h2><br><br>") ; This is the body of the email for pos=1:1:myList.Size { do msg.TextData.Write(myList.GetAt(pos).Read()) } set msg.To = ##class(%Library.ListOfObjects).%New() ;Destinations address do msg.To.Insert("destination@mydomain.com") set msg.Subject= "File report" do ..Adapter.SendMail(msg) set pResponse = ##Class(Ens.StringResponse).%New("Ok") quit $$$OK } XData MessageMap { <MapItems> <MapItem MessageType="Ens.StringRequest"> <Method>SendFtpReport</Method> </MapItem> </MapItems> } } I hope helps you. Regards,Francisco Lopez
go to post Kurro Lopez · Sep 4, 2020 Hi, Please, use English in this community. If you want find information about SHA256 or other encrypt methods, you can find in community https://community.intersystems.com/tags/encryption https://cedocs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cl... Regards,Francisco Lopez
go to post Kurro Lopez · Sep 3, 2020 Indeed. The parameter 3 in $ZDATE and $ZDATEH is the format of the date YYYY-MM-DD ODBC format $HOROLOG retrieves the system datetime, so $ZDATE($HOROLOG,3) gives the current sytem date Usually, HL7.{PID.7} uses the format YYYY-MM-DD, so it converts the string into a datetime variable ($ZDATEH(dob,3)) Please, find out the info in $ZDATE and $ZDATEH documentation. Best regards,Francisco Lopez P.S. Don't forget mark the answer as accepted
go to post Kurro Lopez · Jul 13, 2020 In this environment, bear in mind that you can use ESC instruction using the same way that I've told you. You can use in both. Have a look this link about ansi ESC sequences http://ascii-table.com/ansi-escape-sequences.php Good luck Regards,Kurro López
go to post Kurro Lopez · Jul 13, 2020 In deed, The problem is in the backspace ($ c (8, ......)) because that character is not recognized in an HTML simulation. Please, try to change this line: f r v#1 q:(v?.1n) w " !no number", $c(27,91)_12_"D" This is the ESC [12D statement which is the same than $c(8) but the WebTerminal is able to interpret it I hope it helps you Best regards, Kurro López
go to post Kurro Lopez · Sep 5, 2019 Last time, we have a value of 10 and the error increases more frequently, even when I was loading files.So, the idea is to put a value like 30 seconds to allow that time the TCP disconnection. If I change the value to 30 (or 60), can the process open the TCP connection automatically and try to connect to FTP? If I leave it indefinitely (-1), is there a way to make the connection again?
go to post Kurro Lopez · Jul 17, 2019 Hi Vikram,Have you checked if you have granted privileges?Best regards,Francisco Lopez
go to post Kurro Lopez · May 10, 2019 Well, next time I need to read the documentation in depth.There is a base method to check if a class extends of other one set obj = ##class(MyLibrary.ChildClass01).%New() ## this retrieves 1 w obj.%Extends("MyLibrary.ParentClass") ## this retrieves 0 w obj.%Extends("MyLibrary.ParentClassFake") This has been a "Rubber duck", this is a sample of guide-book of rubber duck. More info Clase %Library.SystemBase Best regards, Francisco López
go to post Kurro Lopez · May 3, 2019 Hi,Try the following code. It only works if the class parent is Ens.DataTransformDTL // Create a query to get only my class (in MyClass and sub folders) set query="SELECT ID FROM %Dictionary.ClassDefinition WHERE ID LIKE 'MyClass.%' AND super='Ens.DataTransformDTL'" set tStatement = ##class(%SQL.Statement).%New() set qStatus=tStatement.%Prepare(query) set tResult = tStatement.%Execute() while tResult.%Next() { set dtlName = tResult.%Get("ID") set classObject = $CLASSMETHOD(dtlName ,"%New") write !,"DTL: "_dtlName write !,"Source type: "_classObject.GetSourceType() write !,"Target type: "_classObject.GetTargetType() write ! } Remember: It works only if the class inherits from Ens.DataTransformDTL , if you know which class is the one that inherits the DTL you want to examine, change the name of the value of 'Super' in the previous query Best regards, Francisco Lopez