go to post Enrico Parisi · Jun 24 In my opinion, if you need to encode a file/stream "as is", without any conversion, so that the counterpart receiver get EXACTLY what your source file/stream is/was, then use %Stream.FileBinary. If you need some character conversion (say, Unicode/UTF8 or others), then use %Stream.FileCharacter (with appropriate parameters...) that can handle the conversion.
go to post Enrico Parisi · Jun 24 Why do you say the stream is typically a binary stream? Because a Charecter Stream may introduce additional character set conversion.In your case it seems your stream is a MS Word docx document file, that's a binary file (it's a zip file) and no character set conversion is needed nor wanted, you just take the "raw" content (i.e. binary content) and encode it in base64 when included in JSON/Dynamic Object. Please note that the code:Do obj.%Set("data",pStream,"stream>base64") already encode the pStream content to base64! If you pass a base64 encoded stream, you'll end up with double base64 encoding! Its' my understanding that all you need is to load a docx file into json/dynamiy object, then all you need is: Set obj = {} Set pFile = "/ICS/jira/wgetDATA1343.docx" Set pStream = ##class(%Stream.FileBinary).%OpenId(pFile) Do obj.%Set("data",pStream,"stream>base64") The base64 encoding is performed using the "stream>base64" type parameter, here is the class reference documentation for the %Set() method.This is much more efficient and easier to read.
go to post Enrico Parisi · Jun 24 Well...I did not read the AI answer with attention, there are a few mistakes in the answer. Base64Stream should be a stream (typically a binary stream), not a string as in the AI sample, let alone the fact that in the sample code Base64Stream is NOT base64 encoded. But.....almost correct. 😊
go to post Enrico Parisi · Jun 23 I'm afraid there are no Python wheel in WRC OnlineDistribution (where is it supposed to be? Not in Components...), but is indeed in the dev/python directory after you install IRIS. So, I believe that to get the latest wheel, you need to install the latest IRIS and go to the dev/python directory of your IRIS installation.
go to post Enrico Parisi · Jun 23 I'm a little puzzled, according to documentation the method %FromJSONFile() it's not implemented in version 2022.3, it has been implemented in 2024.1, so I don't understand why you get that error, I'd expect a <METHOD DOES NOT EXISTS> error, but I don't have version 2022.3 at hand to test. In any case, for IRIS versions that implement the %FromJSONFile() method, please note that the parameter to pass is the filename, not a %File object instance. Form class reference of the %Library.DynamicAbstractObject class the first parameter is documented as: filename A file URI where the source can be read. So, the code should be: set newObject = {}.%FromJSONFile("/tmp/longObjectFile.txt")
go to post Enrico Parisi · Jun 21 As @Jon Willeke wrote in his post: 2023.1.2 shipped with the 3.2.0 and 4.1.0 wheels in the dev/python directory It's in the dev/python directory of your IRIS installation. It's in your system.
go to post Enrico Parisi · Jun 18 Yes, I think it is, that's why I proposed to change the DEFAULT view to list view.
go to post Enrico Parisi · Jun 18 THIS causes the ![CDATA[ in a string field! This causes the CDATA in the visualization of a string field in the Management Portal.The string field does not contain any CDATA (unless assigned in the string property content).
go to post Enrico Parisi · Jun 17 I don't understand your problem, in fact, are you having a problem or you just think there is a problem? The purpose is to avoid the huge amount of source-target DTL processes while working with several hundreds of Rules First, rules do not modify messages, only DTL may modify a message.Did you measured and verified this supposed "huge amount" or you think/guess this is actually happening? Please note that HL7 storage is complex/advanced and very efficient, only changed segments are actually duplicated in storage, even from different HL7 messages.Did you actually checked what is actually stored in your scenario? I feel and believe that you are looking for a solution to a non existent problem.
go to post Enrico Parisi · Jun 17 Sorry but, again, you are missing important context and details.With some imagination, fantasy and creativity I can guess the missing info.... What class does your AthenaChangeDataSubscription class exstends?I guess Ens.Request or %Persistent and %XML.Adaptor and possibly others, this is crucial info. Where do you see the ![CDATA[ ? (I asked, you did not answer)I guess from the picture you post you see it in the Contents viewer in Visual Trace, again, this is crucial info. Now, to your original question:What causes the ![CDATA[ in a string field? The CDATA is not in your string property, it is only in the visualization in the portal of the content of your class/property. Here is a sample request that, I imagine, is similar to your class: Class Community.msg.AthenaChangeDataSubscription Extends Ens.Request { Property QueryParameters As %String; } Here is what the IRIS Interoperability portal is using to display the content: EPTEST>Set msg=##class(Community.msg.AthenaChangeDataSubscription).%New() EPTEST>Set msg.QueryParameters="showportalonly=1&leaveunprocessed=0&limit=5000" EPTEST>Set sc=##class(EnsPortal.MessageContents).writewithoutNonXMLChars(,msg) <AthenaChangeDataSubscription xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><QueryParameters><![CDATA[showportalonly=1&leaveunprocessed=0&limit=5000]]></QueryParameters></AthenaChangeDataSubscription> EPTEST>w msg.QueryParameters showportalonly=1&leaveunprocessed=0&limit=5000 EPTEST> As you can see the ACTUAL CONTENT of your QueryParameters property does not have any CDATA, the XML VISUALIZATION of your property content does have CDATA, and that's because it is required by XML to properly display the real/actual content.The IRIS interoperability portal display the XML representation of your class and does it in the proper/correct XML representation. If your property contains simple text that can be properly (correctly) "rendered" in XML without CDATA, then: EPTEST>Set msg=##class(Community.msg.AthenaChangeDataSubscription).%New() EPTEST>Set msg.QueryParameters="this is a simple content" EPTEST>Set sc=##class(EnsPortal.MessageContents).writewithoutNonXMLChars(,msg) <AthenaChangeDataSubscription xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><QueryParameters>this is a simple content</QueryParameters></AthenaChangeDataSubscription> As you can see there is no CDATA. Please, please, in the future, provide details of the context.Imagination, fantasy and creativity should not be a requirement to understand a question.
go to post Enrico Parisi · Jun 17 Why define and reference an outbound adaptor when you don't use it in your code?I'd suggest to have a look to the documentation Using the HTTP Outbound Adapter. Anyway, given your code, you don't need a stream, it's just waste of resources and make your code more complicated for no reason, you can simply: ....Set httpRequest.ContentType = "application/xml"Do httpRequest.EntityBody.Write("<?xml version=""1.0"" encoding=""UTF-8""?><getURL>"_pRequest.getURL_"</getURL>")Set sc = httpRequest.Post("", 2).... Note that I assume that <Url1></Url1> is contained in the getURL string property content, as your first post suggest.
go to post Enrico Parisi · Jun 17 Where do you see the ![CDATA[ ? CDATA it's part of an XML document, "a CDATA section is a piece of element content that is marked up to be interpreted literally, as textual data, not as marked-up content" (from wikipedia). If it's contained in a string property (is this that you mean by field?), then evidently that value was assigned to the string value. But I suspect your question is missing the context......
go to post Enrico Parisi · Jun 17 I like the list view so much that I suggest to make it default view! 😀 I'm afraid that most people won't realize that's available and what they miss in readability.
go to post Enrico Parisi · Jun 17 I think I don't understand the question or the answer is simple. Implement your routing rules as needed, with or without transformation as needed, and send the message from Rule1 to Rule2 and Rule3 according to your needs. Otherwise, please provide more details or better explanation on what you need to do.
go to post Enrico Parisi · Jun 17 What class is pRequest? If it's a custom class, can you post the class definition?
go to post Enrico Parisi · Jun 17 I don't understand your question in the context of the original question: "I work with a legacy that most screens are built using only CLS" If you want to rewrite using modern approach, then use your favorite front-end framework and implement a REST API in the Caché backend.......and maybe move from legacy Caché/Ensemble to modern IRIS as well...
go to post Enrico Parisi · Jun 17 I'm not a python expert, but I'd try with: imptask = dbnative.classMethodValue('%SYS.Task','ImportTasks',"F:\\Zbackup\\LISBackupTask.xml","ck")
go to post Enrico Parisi · Jun 16 ImportTasks() method returns a %Status that probably contains the answer you are looking for. I'd suggest to check that.