ObjectScript

Syndicate content 30 

I am still new to cache objectscript and am trying to figure out how I would go about removing the escape characters from my JSON below. When I call the $toJSON method it's adding the "\" character in the file path.

 

{"FileStatus":"P","Path":"\/somepath\/test\/test123\/filename.txt","InterchangeOID":"100458"}

My Code

Last answer 1 hour 59 min ago Last comment 1 hour 57 min ago
0   0 4
59

views

0

rating

Hi,

I have a global that holds users name and date of birth.

I would like to loop through them and check if the date of birth is more than 2 years based on todays date

so I have ^checker("under2", "Eric David", "02-05-2018")

I want to check the birthdate based on todays date to see if it is greater than 2. How do I access the birthdate in the global

Please can you advice

I tried :

set values = $order(^checker("under2"))
set td = $zdate($horolog, 3)
set ol = $p(^checker("under2"), ",", 3) // this does not work
while (values ' = "")
{
set difdays = $system.SQL.DateDiff("d", ol, td)
if difdays > 730
{    
set ^value("greater than 2")
}
}
Last answer 6 December 2018 Last comment 3 days ago
0   0 6
389

views

0

rating

We use a lot of external MS SQL calls to look up numerous things when it comes to HL7. I am running into an issue where the outbound calls are queued but the message is sent onto the next process before it gets a response. How do I get it to wait till the response gets back from the MS SQL call before sending it onto the next process?

 

Below is a screen shot of what I am trying to explain...Select Research Study executes at 8:33 the message is sent to the next process at 8:34, but the response of the MSSQL call doesn't come till 9:31.

 

Last answer 9 days ago Last comment 6 days ago
+ 1   0 4
82

views

+ 1

rating

Hello gentlemen,

 

I have to create a objectscript program that will simulate a mainframe (because it's going to be removed). For my program, I receive data from another program that is written in Delphy by TCP on a preset socket.  Here is my problem, how can I handle this? 
Which class shoud my program  extend?
Which Adapter should I use?
My program must be able to read what the delphy one is sending and i don't really know what structure it is in what it is in. So is there a class that can allow me to read it? Thanks for your future anwers.
Here is a sample of what I have thought but doesn't work.

Last comment 7 days ago
0   0 3
0

answers

140

views

0

rating

Hi Dev Community,

My team is currently working on a project where we need to post pdf documents to a 3rd party REST API.

The API specifies a field in the JSON request message to contain the 'physical content' of the file as an array of bytes, example of the JSON request as follows - data truncated for readability purposes:

{
    "CaptureSource":2,
    "RecipientID":"ID34",
    "Document": {
        "Guid":"5D847A4E9CC1485382DC4A5F5DC80D6C",
        "EventDate":"2019-01-14T13:23:46",
        "FileExtension":"pdf",
        "FileContent":"JVBERi0xLjQNCiXi48/TDQoxIDAgb2JqDQogIDw8DQogICA......"

      },
    "ActionRequired":false,

Last answer 10 days ago
0   1 2
0

comments

125

views

0

rating

I have a query that I would like to  have refreshing at certain intervals lets say every 30 seconds with out refreshing the page content using the META TAGS

refreshes the whole page but I have a jquery function that will run at those intervals that I can use the problem is getting the jquery to call my COS function or is the way to do it with pure COS

Last answer 11 days ago Last comment 11 days ago
0   0 2
48

views

0

rating

Hello gentlemen,

here is my question: I would like to delete files one by one (not all at a time because I need to check somethinkg to delete it or not) in a defined folder but how can I handle it?  I have used the extension :

EnsLib.File.PassthroughService

But it only works when a file is moved in my folder... But I want to launch my program everyday (with a planifier) in the purpose to delete file that more that 2 months old. With "PassthroughService", it won't work since the the file is not moved so it won't go in my onProcessInput...

If you can offer me a solution, I'll take it :)
Here is a sample of my code

0   0 1
0

answers

0

comments

27

views

0

rating

First, my $ZVERSION:

Cache for OpenVMS/ALPHA V7.x (Alpha) 2010.1.6 (Build 952_2 + Adhoc 17754) 3-JAN-2018 14:32:54.07

Second, my issue:

I believe my current villain is “incremental compiling.” I was able to compare early compile output with later compile output:

Compilation started on 04/10/2019 10:46:32 with qualifiers 'cuk'
Compiling class UnitTests.Task3496 incremental compile detected
Compiling routine UnitTests.Task3496.2
Compilation finished successfully in 0.800s.

... several compiles later...

Compilation started on 04/10/2019 13:35:33 with qualifiers 'cuk'
Compiling class UnitTests.Task3496
Compiling routine UnitTests.Task3496.1
Compilation finished successfully in 0.999s.

The problem that I am having today is that the %STACK is showing my code executing code that has been commented out

0   0 0
0

answers

0

comments

25

views

0

rating

I am trying to base64 encode a string with non standard characters encoded in utf-8 also tried windows 1252  and I am getting error like so 

 

ERROR <Ens>ErrException: <ILLEGAL VALUE>zEncodeStream+18^ -- logged as '-' number - @' set encString = $TRANSLATE($SYSTEM.Encryption.Base64Encode(streamString),$C(10,13))' 

any help appreciated if anyone has faced this before

 

Last answer 13 days ago
+ 1   0 2
0

comments

42

views

+ 1

rating

I use Documatic a lot to generate class documentation from comments embedded in the code. Is there a good way to create documentation for SQL views as well? Ideally I want to document each column in the view with HTML markup similar to how I document each method of a class with Documatic.

Last answer 4 April 2019 Last comment 3 April 2019
0   0 2
48

views

0

rating

At the moment I am trying to write a documentation file for a project and intend to use LaTeX for it.
Has anyone already had experience with this? I haven't found syntax highlighting with the LaTeX packages I know yet.
I found a request on Pygment but it was from 2016 and there was no reply on it since then.

Does anyone know a simple way for syntax highlighting COS in LaTeX?
Thanks for your input!
 

Martin

Last answer 2 April 2019 Last comment 2 April 2019
0   0 4
72

views

0

rating

I am having an intermittent issue that when I make a call to MSSQL from a BPL that the response does not come back in the amount of time required. Since the call from the BPL is synchronous I tried changing the timeout to 60 but it has not helped (see below). Is there anyway to guarantee that the call waits long enough for a response before continuing on?

 

Thanks

Scott Roth

Last answer 20 March 2019 Last comment 21 March 2019
0   0 3
56

views

0

rating

Is it possible to mimic what selenium does like navigating to a site and logging in  and filling out a form then logout in COS.I am trying to do that in COS using %Net.HttpRequest class or should I be using a different class the idea is to be able to call a web app login into it and fill out form and log out

Last answer 18 March 2019 Last comment 11 December 2018
0   0 3
159

views

0

rating

Hello Gentlemen,

 

My Business process connector receive a Oru_01 hl7 message with an ED segment inside (Base64 pdf). How is it possible to extract it and create a pdf file within?

Here is the sample of function I have. I know it doesn't work but if you could help me, it would be perfect. Here is my function, the goal would be it create the file where I want and return me the link of the file

Last answer 7 March 2019 Last comment 7 March 2019
0   0 3
104

views

0

rating

Hello,

I'm using ZEN report to generate a PDF file out a table.

Although, I need to display data from two tables splitted into two different namespaces.

So, I created a process that fetches all the data I need and then calls the PDF class and generates the stream out of it.

 

My question is, once I've got my list of objects. How can I transform it into a ResultSet, in order to display in the report ?

Thanks for your answer.

Last answer 5 March 2019 Last comment 6 March 2019
0   0 4
77

views

0

rating

I successfully got everything in this guide to work:  https://community.intersystems.com/post/ensemble-rabbitmq-java-client-qu...

I am now using the information I gained from this guide along side with this guide:

https://www.rabbitmq.com/tutorials/tutorial-one-spring-amqp.html

 

I am running into an issue though. In the RabbitMQ guide I just posted, they have a "Receive message" functionality. I use that alongside with the SendMsg from Ensemble method in the InterSystems guide. The issue I have is the message I receive looks like "[B@2c421093(byte[21])" instead of "Hello from Ensemble!"

Last answer 4 March 2019 Last comment 5 March 2019
0   0 2
65

views

0

rating

I have a problem,ExtentSize,Selectivity etc is stored in class definition.

I have multiple namespaces with globals maped and only one class definition for All, for example Orders.

Order definition is only one,mapped to main namespace,but in different namespaces have different ExtentSize etc.

Last answer 1 March 2019 Last comment 2 March 2019
0   0 3
54

views

0

rating

I am taking over a production system that had some HSLIB and other database routine and class files modified. However, I do not know what was modified .

I developed a routine that allows me to load each database in our production instance and compare it against a default instance using the SIZE attribute. This allowed me to generate a list of files where the .INT file size in production does not match the file size in the default instance. However, doing a spot check of the .cls or .mac files indicates that in some cases these files are identical, just the intermediate files are different. 

What I would like to do is export these files (.cls, .int, .mac) to XML, placing the files from production in one folder and the files for the default instance in another. After I can use something like BeyondCompare to better identify what has changed. 

In my code I currently use the following to get information about a routine where p = the name of the routine

Last answer 27 February 2019 Last comment 21 February 2019
0   0 5
130

views

0

rating

Hello Gentlemen,

 

As you can read on the title, my question is to know how to retranslate the hl7 message into a string and so to remove the '\E' that are inside. A example/picture worth more than a thousand word.

OBX|1|RP|ECG||CARDIO ECG^APPLICATION^PDF^^\E\\E\sitehopital.org\E\files\E\cardio\E\022018\E\GE274583.PDF|

 

As you can see, the escape character \E is used by hl7 message in the purpose to authorize a character '\' just but I don't want it in my program... Is there any function that retranslates this format into a "normal" format?

 

Faithfully,

 

Thomas

Last answer 25 February 2019 Last comment 25 February 2019
0   0 2
80

views

0

rating

I'm getting this compilation error:

Kompilieren der Klasse digi.packet
FEHLER #5002: Caché-Fehler: <FUNCTION>zLockUse+5^%ExtentMgr.GlobalRegistry.1
  > FEHLER #5030: Während der Kompilierung von Klasse 'digi.packet' ist ein Fehler aufgetreten

when importing one of my classes on the production server into one particular namespace

Last answer 22 February 2019 Last comment 24 February 2019
0   0 3
75

views

0

rating

In my routine when I call set filestream.FileName = filename, I get an error

"cn_iptcp://localhost:56773/USER/%Stream.FileBinary.1.INT" does not exist on the Server

I successfully instantiate the %Stream.FileCharacter object. 'filestream' value is '1@%Stream.FileCharacter'. But when I debug the code, the step where I try to set the file name fails. 

The port number for local host looks good for my current instance. I have tried a few variations, such as using the method FileNameSet(). But this did not work either. 

My routine exists in the USER namespace, as indicated in the error. I am very new to Cache and InterSystems, so I could be wrong, but I would expect that my call to instantiate the class would fail if I do not have access to the class property. Yet, the error message seems to indicate that FileBinary intermediate file does not exist in this namespace.

Last answer 23 February 2019 Last comment 22 February 2019
0   0 5
97

views

0

rating

Hi

I've got a string variable which I need to convert into a XML one.

My main goal here is to use the XML bit I've extracted from a HTML file in a message I need to pass over to an operation.

I'm doing the following which always errors

classMethod WriteNodes(myfile As %String)
{
    Set status=##class(%XML.TextReader).ParseString(myfile,.reader)

....

Any easy way of making this happen?

Kind regards

Last answer 22 February 2019 Last comment 22 February 2019
0   1 3
126

views

0

rating