Hi All,

I have a class method, this can be any cache expression to execute (usually a class / method and args) and and args stored in a variable, for example;

set aa = "##Class(Utils.Test).Run(1,2,3)"

do aa

I tried using $classmethod(class,method,args..), by extracting the values but sometimes there can be no arguments, or arguments such as ;

("2019-01-01","1,2,3,4")

which causes issues while running the $classmethod, (i am using $P to extract the Class, Method and args).

Is there any simpler way of doing this?

0 4
0 284

Hello,

We have a tranformation where we would like to convert a date from the following format:

"'dd/mm/yyyy' 'hh:mm'" (double quotes are just visual to indicate this is a string)

to date and time separated:

date: dd/mm/yyyy

time: hh:mm

We have already splitted the datetime into date and hour as follows:

0 1
0 327
Question
· Jul 7, 2020
DTL vs. ObjectScript

As I've become a little more familiar with HealthShare, I'd like to start exploring different ways of doing things. To date, the bulk of my data transformations have been using DTL; only using ObjectScript for a few operations that write to external SQL tables that were largely based on examples provided by my sales engineer.

0 4
0 305

I have java language experence. If I need parse a binary tcp packet . like following format

encoded string and send it to peer by tcp

1byte msg type + 4 byte(unsigned int) + raw byte(body)

To parse this package , Some Java code like this:

byte[] data = new byte[1024];

Bytebuf buf = new ByteBuf(data)

byte type = buf.read()

int len = buf.ReadInt()

0 1
0 283

Hey everyone.

I have a process where I create a new %Stream.FileCharacter object, specify the filename (including it's path), write data to the stream, and then save. However for some reason, if the user account does not have write access to the directory, the %Save method is still returning true even though it was unable to actually write the file to the folder.

The location is a UNC path, and I'm wondering if this is tripping me up?

0 3
0 285

Hey I am very new to Intersystems Objectscript and I am trying to find a way of extract 4 digit numbers from a stream.

I have a stream full of results

2334

3434

5543

4334

And I am trying to remove each 4 digit grouping from the stream.

I have tried the following for loop

for i=1:1:$length(result) {

set curr = $extract(result, i)

write !, curr

set count(curr) = $get(count(curr)) + 1

}

Unfortunately the loop extracts one digit.

0 6
0 333
Question
· Jul 28, 2021
%XML.Reader Limitations

Hi all,

Are there limitations to the size of a file or stream that %XML.Reader will parse?

I am trying to parse a large, 573MB, XML file using either the 'OpenFile' or 'OpenStream' methods, but both return errors.

When I try to use the 'OpenStream' method I get a 'ERROR #6301: SAX XML Parser Error: input ended before all started tags were ended' error',

and when I try the 'OpenFile' method I get a 'ERROR #6301: SAX XML Parser Error: <STORE>'.

0 2
0 336

I have a terminal script that queries sys.process' and then parses the results writing to a logfile. As part of the processing of the results, each row of the result set includes an element from the static string. But I am not clear on the scoping of the static string. The write statement sees the static string as undefined. What I want is something to the affect:

set statStr = "aa|bb|.."

set sqlStatement = xxx

set tState = ##class(%SQL.Statement).%New()

set qStat = tState.%Prepare(< sql statement> )

0 2
0 198

I'm trying to write a method that runs an OS command with $zf(-100,"/ASYNC") and then waits for it to finish before returning, but I can't figure out how to check if the child process (in $zchild) is still running. $System.Process.State($zchild) always returns "RUN" even once the child process is gone. Is there some better way to check this, short of running another OS-specific command and processing the output (which is just really annoying and unelegant)?

0 8
0 363

Hello everybody.

My question originated when trying to help a coworker...

There is a system module, specifically a ClassMethod that inserts records into a table as per the pseudocode below:

set Obj = ##class(FooSchema.FooTable).%New()
set Obj.fooProp = fooValue
// Other Foo properties //
set status = Obj.%Save()

From time to time, when trying to save the object, an error , informing that it was not possible to obtain the exclusive lock on the table instance

0 2
0 194

Hi all.

I have a scenario where I am receiving NACKs and I'd like to adjust the error handing of the operation based on the content of the NACK.

For example, I could receive the following and want to move onto the next message:

MSH| ^~\&|||||20221025083135.489+0100||ACK ^A02^ACK|9271|D|2.5.1
MSA|AE|1664378390234
ERR|||207 ^Application internal error ^HL70357^^^^^^Cannot transfer patient, encounter is cancelled.|E

However, I could also receive the following and want to keep retrying:

0 1
0 214

Any ideas on how this can be solved?

I need to use it with some Unicode text, in Docker image. And get this error. And documentation says nothing about it.

USER>do $zf(-100, "/SHELL", "echo", "test")
test

USER>do $zf(-100, "/SHELL", "echo", "test тест")

DO $ZF(-100, "/SHELL", "echo", "test тест")
^
<TRANSLATE>

I know that it works in some Linux environments without Docker, but no idea where is the difference.

0 2
0 145

Hey all,

I have been creating a class to handle file encryption by using GPG keys. I pushed my code out today and my encrypt and decrypt methods weren't working. About a half an hour later in troubleshooting I found out that it needed to be a syntax change. My method has three parameters to it. Examples below:

This is how I was calling it in the test system with no issues:

do gpg.Encrypt()

This is how I was having to call it in my production system to work with no issues:

do gpg.Encrypt("","","")

0 6
0 229

Hello Guys,

Our cache application uses REST web services and handles single API request perfectly with response (response status and related data). But sometimes user sends multiple requests to the same API simultaneously ( ie, without waiting for the first to respond ), where one request will succeed (not necessarily the first) and the others will fail.

So, I need to handle the requests one by one after completing and sending the response for first request in the queue then process the next request and so on.

0 4
0 120

Using VECTOR_COSINE() in SQL query to perform a text similarity search on existing embeddings in a %VECTOR column.

Code is below.

Commented out sql query returns this error: SQLCODE: -29 Field 'NEW_EMBEDDING_STR' not found in the applicable tables^ SELECT TOP ? maxID , activity , outcome FROMMain .AITest ORDER BY VECTOR_COSINE ( new_embedding_str ,

Sql query as written returns ERROR #5002: ObjectScript error: <PYTHON EXCEPTION> *<class 'OSError'>: isc_stdout_write: PyArg_ParseTuple failed!

0 10
0 87