Oliver Wilms · Sep 3, 2024 go to post

Hello, Troy. I like the idea to have a router for files. Would the operations each have one specific directory that the router can route files to? How will the router determine the destination for each file?

Oliver Wilms · Aug 30, 2024 go to post

I realize that my HTML contains references to css files. I do not yet have the css files where pandoc is running.

Oliver Wilms · Aug 30, 2024 go to post

Maybe I have not installed enough for pandoc to work properly in my container. Are there other tools for programmatically creating pdf (from html)?

Oliver Wilms · Aug 30, 2024 go to post

The first file I tried to convert to PDF displays at the source system, but it does not look exactly as expected. I copy ther pdf to csp directory and display it there. I also tried a simple html file and it works correctly end-2-end.

Oliver Wilms · Aug 30, 2024 go to post

I have seen files transferred inside JSON and I want to try it here. Before (now) I have this code to generate response object:

Set context.Response = ""
 If 1=request.%IsA("EnsLib.HTTP.GenericMessage") {
   If (context.StatusLine = "") {
      Set context.StatusLine = "HTTP/1.1 200 OK"
   }
   If (##class(%File).Exists(context.Outputfile)) {
     Set tStream = ##class(%Stream.FileBinary).%New()
     Set tSC = tStream.LinkToFile(context.Outputfile)
     If $$$ISERR(tSC) Do ##class(Oliver.Util).DebugStatus(tSC)
   }

   //Set tSC = tmp.%Save()
   Set context.Response=##class(EnsLib.HTTP.GenericMessage).%New($Get(tStream),,request.HTTPHeaders)
   Do context.Response.HTTPHeaders.SetAt("application/pdf","Content-Type")
   Do context.Response.HTTPHeaders.SetAt(context.StatusLine,"StatusLine")
   Set tSC = context.Response.%Save()
 }

Oliver Wilms · Aug 1, 2024 go to post

Does your task run as %SYSTEM?

Can you check the status returned by Prepare and Execute methods?

I wonder if this is a permission issue.

Oliver Wilms · Jun 24, 2024 go to post

I did a search for STRINGSTACK. Then I was able to solve this issue by changing Write param.%ToJSON() to Do param.%ToJSON()

This is in Docs for %ToJSON():

method %ToJSON(outstrm As %Stream.Object) as %String

Convert a %DynamicAbstractObject into a JSON string.

outstrm is optional. There are a number of possibilities:
(1) Parameter outstrm is not defined and the method is called via 'DO'. In this case the JSON string is written to the current output device.
(2) Parameter outstrm is not defined and the method is called as an expression. In this case the JSON string becomes the value of the expression.
(3) Parameter outstrm is defined. If it is %Stream object then the JSON string will be written to the stream. If outstrm is present but not an object then it is presumed to be a fully qualified file specification. In that case, a %Stream.FileCharacter stream is created, linked to that file and the JSON string is written to that stream. On completion, this stream is saved. The full path to the file must be defined. If outstrm is an object but is not an instance of %Stream.Object then an exception will be thrown.

Oliver Wilms · Jun 24, 2024 go to post

Thank you for clarifying the double encoding I was doing.

I just tested my code with a HTML document. Will it work with %Stream.FileBinary?

Oliver Wilms · Jun 24, 2024 go to post

Here is my lookFile method which gets the stream for %Set:

ClassMethod lookFile(pFile As %String = "https://jira.devops.myserver.com/my-jira/plugins/servlet/raven/attachme…", pFileNew As %String = "") As %Stream.Object

{

    Set q = """"

    Set tData = q_pFile_q

    Set tFileOutlog = "/ICS/jira/wlogDATA"

    Set tFileOutput = "/ICS/jira/wgetDATA1343.docx"

    Set tSC = ##class(Oliver.ZF).JiraGet(tData,tFileOutput,tFileOutlog)

    ;

    Set tEncodeFN = ..GetEncodeFilename(pFile)

    Set tEncodePath = "/ICS/jira/"

    Set pEncode = tEncodePath_tEncodeFN

    ;

    Set tEncodedFilename = ##class(Oliver.Base64).B64EncodeWordDoc(tFileOutput,pEncode)

    Set pStream = ..GetStream(pEncode)

    Quit pStream

Oliver Wilms · Jun 24, 2024 go to post

Why do you say the stream is typically a binary stream?

This is the method where I get the Stream:

ClassMethod GetStream(pFile As %String = "/tmp/shortObjectFile.txt") As %Stream.Object

{

    Set pStream = ##class(%Stream.FileCharacter).%New()

    Set pStream.Filename = pFile

    Quit pStream

}

The code to produce the encoded file will be in my next response.

Oliver Wilms · Jun 24, 2024 go to post

Enrico, thank you very much for your help!

I use this line of code to get a base64 encoded Stream:

Set pStream = ..lookFile(value)

I use this line to set the stream into the dynamic object:

Do obj.%Set("data",pStream,"stream>base64")

Oliver Wilms · Jun 23, 2024 go to post

IRIS for Windows (x86-64) 2022.3 (Build 606U) Mon Jan 30 2023 09:08:55 EST

It works when I use the filename

set newObject = {}.%FromJSONFile("c:\tmp\longObjectFile.txt")

Oliver Wilms · Jun 23, 2024 go to post

Thank you, Julius for the example.

I replaced set newObject = {}.%FromJSONFile(file) in my code with set newObject = {}.%FromJSON(file) to get rid of the error.

Oliver Wilms · Jun 22, 2024 go to post

Note: Base 64 encoding is not able to encode a string which contains unicode (2 byte) characters. If you need to Base 64 encode an unicode string, you should first translate the string to UTF8 format, then encode it. s BinaryText=$ZCONVERT(UnicodeText,"O","UTF8")
s Base64Encoded=$system.Encryption.Base64Encode(BinaryText)
Now to Decode it:
s BinaryText=$system.Encryption.Base64Decode(Base64Encoded)
s UnicodeText=$ZCONVERT(BinaryText,"I","UTF8")

Oliver Wilms · Apr 13, 2024 go to post

I would like to help, but I do not understand what is the data or how the data is created. Can you share sample data or the code that creates / updates the data?

Oliver Wilms · Apr 10, 2024 go to post

I also have a Business Operation that sometimes experiences failures. My Reply Code Actions setting is E=R, my Retry Interval is 60, my Failure Timeout is -1. When a message fails, it retries after 60 seconds. This Business Operation is called from a BPL.

Connect Timeout (5) and Response Timeout (30) are the default values.

We usually do not get timeout, but we sometimes receive 500 Internal Server Error. In this case I check the response in BPL and initiate a retry. 

Oliver Wilms · Mar 21, 2024 go to post

STOPALLPRODUCTIONS
Try {
Kill array
Do ##class(%SYS.Namespace).ListAll(.array)
Set ns = ""
For {
Set ns = $Order(array(ns))
If (ns = "") Quit
Kill x
Set = $$MyFunc(ns)
Write "x = ",x,!
}
Return
Catch {
Write $ZERROR,!
}
Quit
MyFunc(ns)
Try {
Write "ns = ",ns,!
ZN ns
Set sc1 = ##class(Ens.Director).StopProduction()
Write "sc1 = ",sc1,!
Catch {
Write $ZERROR,!
}
Return ns

Oliver Wilms · Feb 3, 2024 go to post

Hello,

I just completed the survey about the interactive InterSystems IRIS Digital Health Interoperability Instruqt Course. I am also missing bonus points for Video and Second Article for iris-hl7. Thank you for your attention :-)

Oliver Wilms · Jan 24, 2024 go to post

I appreciate the responses from Alexander Koblov. I wonder if @Bob Kuszewski could provide suggestion how is it possible to add mirror member outside of Kubernetes cluster. 

Oliver Wilms · Jan 16, 2024 go to post

You may or may not see it in Event Log based on what is in ^Ens.Debug global.

Oliver Wilms · Jan 16, 2024 go to post

My concern is that IKO deploys failover members with cluster local network addresses. Can an async that is located outside of the Kubernetes cluster be added to the mirror configured by IKO?

Oliver Wilms · Jan 12, 2024 go to post

Characters like \ and CR LF must be escaped.

In BPL I assign myVariable = request.RawContent

Conversion to JSON was successful with this:

Set data={}

Set data.value=myVariable

Set x=data.%ToJSON()

Oliver Wilms · Nov 28, 2023 go to post

I think you need more quotes for "proper" JSON

ineaConComasAlFinal: iris_cpu_pct{id='AUXWD'}": 0,iris_cpu_pct{id='CSPSRV'}": 0,

proper JSON is

{

"iris_cpu_pct{id='AUXWD'}": 0,"iris_cpu_pct{id='CSPSRV'}": 0,...

}