go to post Kurro Lopez · Dec 21, 2020 A new interface to export production, select several class at the same time. Export MAC in the same file, add default value by environment, etc... By this way, you can create a export file (xml) that you can load using implemetation menu option.
go to post Kurro Lopez · Sep 18, 2020 if you want to use the DTL programmatically.... ClassMethod Clone(pRequest As EnsLib.HL7.Message) As EnsLib.HL7.Message [ Final ] { set sc=##class(Kurro.DTL.EDCoder).Transform(pRequest,.request) if $$$ISERR(sc) {do $system.Status.DisplayError(sc)} Quit request }
go to post Kurro Lopez · Sep 18, 2020 I think the best approach to your goal is create a DTL and clone the message directly, then check the value of DG1:4.1 and set the value in target that you want. See below You can call to the DTL and you'll have your new message. Regards,Kurro Lopez
go to post Kurro Lopez · Sep 18, 2020 Hi, One question... the third line is using ind variable, but you are evaluating ind2 variable, is it a mistake? Regards, Kurro Lopez
go to post Kurro Lopez · Sep 17, 2020 This is the transformation code (if you want). In my example, I was transforming OUL^R22 to OUL^R22 Class Kurro.DTL.test Extends Ens.DataTransformDTL [ DependsOn = EnsLib.HL7.Message ] { Parameter IGNOREMISSINGSOURCE = 1; Parameter REPORTERRORS = 1; Parameter TREATEMPTYREPEATINGFIELDASNULL = 0; XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl" ] { <transform sourceClass='EnsLib.HL7.Message' targetClass='EnsLib.HL7.Message' sourceDocType='2.7:OUL_R22' targetDocType='2.7:OUL_R22' create='new' language='objectscript' > <assign value='source.{PIDgrp.PID}' property='target.{PIDgrp.PID}' action='set' /> <if condition='..Length(source.{PIDgrp.PID:11(1).8})>0' > <true> <assign value='source.{PIDgrp.PID:11(1).1}_" "_source.{PIDgrp.PID:11(1).2}' property='target.{PIDgrp.PID:11(1).1}' action='set' /> <assign value='source.{PIDgrp.PID:11(1).8}' property='target.{PIDgrp.PID:11(1).2}' action='set' /> <assign value='""' property='target.{PIDgrp.PID:11(1).8}' action='set' /> </true> <false> <assign value='""' property='target.{PIDgrp.PID:11(1).8}' action='set' /> </false> </if> </transform> } } Regards, Kurro Lopez
go to post Kurro Lopez · Sep 17, 2020 Hi, if you read your requirements, that is that you have to write in your DTL The first line copy all your PID in the new destination (green box) the condition, check if the 11(1).8 has value, in this case, concatenate PID:11(1).1_PID:11(1).2 to new PID:11(1).1 I understand, when you say "move 11(1).8 to 11(1).2 means that the value in 11(1).8 will be empty (red box), if it is not the case, don't use this line. For other case (step 7). remove the value of the PID:11(1).8 The DTL conditions are executed in order, It means, that the value in PID:11(1).2 in step 3 is the original then it is replaced by PID:11(1).8 in the following step. This is the test result: I hope it helps you, Regards, Kurro Lopez
go to post Kurro Lopez · Sep 10, 2020 Welcome Kevin, To get badges, you should to participate in Global Master, please add a replay to this link and welcome to Global Master https://community.intersystems.com/post/join-intersystems-global-masters... Regards,Kurro
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 I think the user _purges has the same privileges than the other task that is working, isn't it?
go to post Kurro Lopez · Sep 4, 2020 Hi, Have you configure your SMTP configuration? System Administration -> Configuration -> Additional settings -> Task manager email The SSL configurate (SSL Dummy) is a empty certificate to use HTTPS instead. Best 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 · Sep 3, 2020 I've found the solution. ClassMethod CreateTask() As %Status { Set task=##class(%SYS.Task).%New() Set task.Name = "Check laboratory process" Set task.NameSpace=$Namespace Set task.TimePeriod=0 // Daily Set task.TimePeriodEvery=1 // Every 1 day Set task.DailyFrequency=0 // Run once Set taskdef = ##class(MyTasks.LabsTask).%New() Do task.AssignSettings(taskdef) Set task.TaskClass=$classname(taskdef) Set task.Settings=$lb("Laboratory","LABS1") Set st = task.%Save() Return:$$$ISERR(st) st Return ##class(%SYS.Task).RunNow(task.%Id()) }
go to post Kurro Lopez · Sep 3, 2020 One question, If my %SYS.Task.Definition class needs a parameter, how to add it in the %SYS.Task definition? this is my task Class MyTasks.LabsTask Extends %SYS.Task.Definition { Parameter PROPERTYVALIDATION = 1; Parameter BPDOPROCESS= "MyLabs.BS.Process"; Parameter TaskName = "Check process of labs"; Property Laboratory As %String [ Required ]; Method OnTask() As %Status { #Dim tService As Service.class set tSC = $$$OK set message = ##class(Ens.StringContainer).%New(..Laboratory) $$$ThrowOnError(##class(Ens.Director).CreateBusinessService(..#BPDOPROCESS, .tService)) If ($IsObject(tService)) { Set tSC = tService.ProcessInput(message,.output) } Quit tSC } } Regards,Francisco Lopez
go to post Kurro Lopez · Sep 2, 2020 You can use DATEDIFF function to check the days between both date set date1 = $zdate($horolog,3) set date2 = $zdate($zdateh("2020-09-01",3),3) write $SYSTEM.SQL.DATEDIFF("dd",date2,date1) // 1 In your scenario it could be like this: $SYSTEM.SQL.DATEDIFF("dd",$ZDATE($ZDATEH(HL7.{PID.7},3),3),$ZDATE($HOROLOG,3)) <= 3 This is a boolean condition, so your rule only have that condition UPDATE Rules only accept functions from functions class, so you should create a new class with that function: Class MyFunctions Extends Ens.Rule.FunctionSet { ClassMethod DaysDobHL7(pDob As %String) As %Integer { set date1 = $zdate($horolog,3) set date2 = $zdate($zdateh(pDob,3),3) quit $SYSTEM.SQL.DATEDIFF("dd",date2,date1) } then, your new function should be visible in rules function Regards,Francisco Lopez
go to post Kurro Lopez · Aug 26, 2020 Finally, I've added the following method in request class Method Find(item As LabCenter) { for i=1:1:..ListCenter.Count(){ set tmp=..ListCenter.GetAt(i) if tmp.LabId=item.LabId, tmp.Center=item.Center, tmp.Code=item.Code return i } quit 0 } By this way, I find my Lab-Center > set obj=##class(ListLabCenter).%OpenId(1) > zw obj obj=<OBJECT REFERENCE>[2@ListLabCenter] +----------------- general information --------------- | oref value: 2 | class name: ListLabCenter | %%OID: $lb("1","ListLabCenter") | reference count: 2 +----------------- attribute values ------------------ | %Concurrency = 1 <Set> +----------------- swizzled references --------------- | i%ListCenter = "" | i%ListCenter(1) = $lb($lb("A08829848","A088298480001","")) | i%ListCenter(2) = $lb($lb("A08829848","A088298480002","")) | i%ListCenter(3) = $lb($lb("A08829848","A088298480003","")) | i%ListCenter(4) = $lb($lb("U66700196","U667001960002","")) | i%ListCenter(5) = $lb($lb("U66700196","U667001960003","")) | r%ListCenter = "1@%Collection.ListOfObj" | r%ListCenter(1) = "3@LabCenter" +----------------------------------------------------- > set objFind = ##class(LabCenter).%New() > set objFind.LabId="A08829848" > set objFind.Center="A088298480003" > zw objFind objFind=<OBJECT REFERENCE>[5@LabCenter] +----------------- general information --------------- | oref value: 5 | class name: LabCenter | reference count: 2 +----------------- attribute values ------------------ | Center = "A088298480003" | Code = "" | LabId = "A08829848" +----------------------------------------------------- > w obj.Find(objFind) 3 > set objFindFake = ##class(LabCenter).%New() > set objFindFake.LabId="FAKE" > set objFindFake.Center="A088298480003" > w obj.Find(objFindFake) 0 Thanks for your help. Best regards,Francisco López