go to post Enrico Parisi · Jul 25, 2024 The RoutineList query in %Routine class does offer ranges, try this: Set Query=##class(%Routine).RoutineListFunc("%D:%E")Do Query.%Display() EnricoP.S.: Tested in latest IRIS, I'm not sure that the "Func" query method is available in 2017, but you can use your old %ResultSet with same parameters.
go to post Enrico Parisi · Jul 18, 2024 It has happened to me a few time not having access to terminal (OS or IRIS). For this situation I developed a quick and dirty CSP class to allow me to execute IRIS or OS commands. Class SomePackege.Cmd Extends %CSP.Page { ClassMethod OnPage() As %Status { &html<<html> <head> </head> <body> <form> <input type="text" name="cmdOS" size="150" value='#(%request.Get("cmdOS"))#'> <input type="submit" value="runOS" onclick="this.form.submitted.value=this.value;" > <br/> <input type="text" name="cmd" size="150" value='#(%request.Get("cmd"))#'> <input type="submit" value="runCMD" onclick="this.form.submitted.value=this.value;" > <input type="hidden" name="submitted"> </form> > If (%request.Get("submitted")="runOS") && (%request.Get("cmdOS")'="") { Set cmdOS=%request.Get("cmdOS") Set io=$io Open cmdOS:"QR" Write "<tt>" Try { For Use cmdOS Read line Use io Write $replace(..EscapeHTML(line)," "," "),"<br>" } Catch CatchError { Set sc=CatchError.AsStatus() } Use io Write "</tt>" Close cmdOS Use io } ElseIf (%request.Get("submitted")="runCMD") && (%request.Get("cmd")'="") { Set cmd=%request.Get("cmd") Write "<pre>" x cmd Write "</pre>" } &html<</body> </html>> Quit $$$OK } } Once the class is loaded (say, from Studio or VS code) in one namespace, just call it from the default csp/web application, for example: http://yourhost:57772/csp/user/SomePackage.Cmd.cls Please note that the UI is very, very, VERY rudimental (ugly), but gets the job done in case of need.
go to post Enrico Parisi · Jul 4, 2024 I'm puzzled by the fact that the two $$$LOGINFO() are present in the trace when an exception should have raised BEFORE the $$$LOGINFO(). The code posted is not the code that generated that trace. And this is very confusing. Maybe the code was modified without restarting the Business Operation?
go to post Enrico Parisi · Jul 4, 2024 ..Adapter.Credentials.Username and ..Adapter.Credentials.Password Credentials property of EnsLib.FTP.InboundAdapter is %String, so I expect an <INVALID OREF> error. In general, I'd suggest to put your code inside a Try/Catch, something like: Set sc=$$$OK Try { ; your code here } Catch CatchError { #dim CatchError as %Exception.SystemException Set sc=CatchError.AsStatus() } Quit sc
go to post Enrico Parisi · Jul 2, 2024 Just tested using IRIS for Health 2022.2 installed in a temp VM and it works fine. Can you share the terminal output when you run that code?
go to post Enrico Parisi · Jul 2, 2024 Did you try from terminal using the EXACT code I posted? What product are you using? You mention "IRIS 2022.2" is it IRIS for Health?
go to post Enrico Parisi · Jul 2, 2024 Using your code (simplified by me) from terminal it works fine using a sample CCDA from here. set ccdaStream = ##class(%Stream.FileBinary).%OpenId("c:\temp\CCDA_CCD_b1_Ambulatory_v2.xml") write "Size of CCDA Stream: ", ccdaStream.Size,! set xsltTransform = "SDA3/CCDA-to-SDA.xsl" set tTransformer = ##class(HS.Util.XSLTTransformer).%New() set tSC = tTransformer.Transform(ccdaStream, xsltTransform, .sdaStream) if 'tSC write "Transformation to SDA3 failed with error ",$system.Status.GetErrorText(tSC),! set fhirStream = ##class(%Stream.TmpBinary).%New() set SDA3ToFHIRObject = ##class(HS.FHIR.DTL.Util.API.Transform.SDA3ToFHIR).TransformStream(sdaStream, "HS.SDA3.Container", "R4") if '$isobject(SDA3ToFHIRObject.bundle) write "Failed to transform SDA3 to FHIR",! do SDA3ToFHIRObject.bundle.%ToJSON() The result/output is a pretty long JSON FHIR bundle with CCDA data (I didn't check the content!) Does your code works with that sample CCDA? If not, then maybe there is something wrong in your CCDA. For my test I used: IRIS for Windows (x86-64) 2024.1 (Build 267_2U) Tue Apr 30 2024 16:35:10 EDT
go to post Enrico Parisi · Jun 30, 2024 From %ResultSet.SQL Class Reference: This class has been superseded. It will remain for compatibility with existing code and samples. We recommend using %SQL.Statement.
go to post Enrico Parisi · Jun 30, 2024 To lock a persistent object (in different modes) use the second argument of the %OpenId() method as described in Object Concurrency Options documentation.
go to post Enrico Parisi · Jun 28, 2024 You need to pass each argument separately, this will work: d $ZF(-100,"/logcmd", "qpdf", "--encrypt", "test123", "test123", "256", "--", "C:\test\basement.pdf", "c:\test\basementenc.pdf")
go to post Enrico Parisi · Jun 28, 2024 I don't think the upgrade runs $System.OBJ.CompileAll() "automatically", it's your responsibility to recompile, if necessary.
go to post Enrico Parisi · Jun 27, 2024 To my knowledge and (more importantly 😁) according to the documentation, it's not possible. The types of the arguments in the subclass method must be consistent with the types of the arguments in the original method. Specifically, any given argument must be either the same as the original type or a subclass of the original type. The method in the subclass can have more arguments than the method in the superclass. Note that in your case the problem is not the number of parameters/arguments, it's the type of the arguments that does not match the superclass %OnNew() (implemented in %Exception.AbstractException) arguments type: Method %OnNew(pName As %String = "", pCode As %String = "", pLocation As %String = "", pData As %String = "", pInnerException As %Exception.AbstractException = {$$$NULLOREF}) As %Status [ Private ] One option could be: Class test.Foo Extends %Exception.AbstractException { Method %OnNew(arg1 As %String, arg2 As %String, arg3 As %String, arg4 As %String, pInnerException As %Exception.AbstractException = {$$$NULLOREF}, arg5 As %String) As %Status { quit ##super("some message") } }
go to post Enrico Parisi · Jun 27, 2024 %SYS>s db=##class(SYS.Database).%OpenId("C:\InterSystems\IRIS\mgr\user") %SYS>w db.SFN8%SYS>
go to post Enrico Parisi · Jun 27, 2024 Your question is too vague to answer, I'd suggest to start reading the documentation, a good starting point can be Communication Protocols in Interoperability Productions. Then, after reading the documentation you can ask a more specific question.
go to post Enrico Parisi · Jun 27, 2024 Have you read the chapter "Purpose of System Default Settings" in the RIS documentationpage that @Vic Sun I linked in his post? After reading the documentation, have you found the info you were looking for?