Article
· Sep 7, 2022 7m read
REST JSON webservices presentation

Hello Community!

This article gives an overview of the REST JSON webservices developed for TrakCare.

These webservices allow users to access TrakCare data from outside of the software, mainly through external apps.

They are developed in REST with ObjectScript, and they allow data access in four modes:

3 0
1 407

Hi There,

I'm fairly new to ObjectScript/Ensemble and I'm sure I may be fundamentally misunderstanding how the %JSONImport/%JSONExport and XDATA mapping work and I was hoping you good folks could help me out. I'm essentially trying to create an object that I can use to translate from one JSON schema to another.

First my class:

0 3
0 317

Hello community,

I'd like to briefly announce three new packages, available on the Open Exchange / through ZPM, that can really help accelerate modern full-stack application development on IRIS. I announced all of these in a Global Summit session last week, but you may have missed it - and I hear there's a full-stack application development contest coming up!

4 0
1 291

Hi there,

I'm passing a JSON object to the server as such:

{"key":"value","key":"value","key":"value"}

From the client:

- Build object

object=JSON.stringify(object)

-pass to server side method as %String

On the server:

s object={}.FromJSON(object)

Instead of getting something like

object=<OBJECT REFERENCE>[2@%Library.DynamicObject]

I get

object="991@%Library.DynamicObject"

I can't access that object using %Get as if says invalid OREF.

0 5
0 292
Question
· Apr 11, 2022
MAXSTRING limit issue

MAXSTRING (longstring) is enabled.

We have a Class containing a property definition

Property SettingsJSON As %Text(MAXLEN = 3600000)

The property is used for storing a string of JSON data however in some cases we get a Cache error: %SaveData error when trying to save a string of JSON a lot less than maximum "allowed" length, any ideas anyone?

0 14
0 1K
Question
· Mar 22, 2022
Time handling and Json

I am having trouble formatting %Time to a JSON format. I have tried configuring the parameter "FORMAT" of my property but that didn't work. For some reason, it keeps putting a Z and the end of the time.

Property:

Property TimeCollected As %Time(FORMAT = "2");

0 2
0 183
Article
· Feb 8, 2022 1m read
GlobalToJSON-embeddedPython-pure

I have created a package to export a Global into JSON object file and to re-create it by reloading from this file
embeddedPython refers to the new available technologies. It should be understood as a learning exercise of
how to handle the language interfaces. Only Global nodes containing data are presented in the generated JSON file.
Differently from the previous example, this one is using embedded Python only, no ObjectScript. Therefore PURE

8 2
0 464
Article
· Feb 7, 2022 1m read
GlobalToJSON-embeddedPython

I have created a package to export a Global into JSON object file and to re-create it by reloading from this file
embeddedPython refers to the new available technologies. It should be understood as a learning exercise of
how to handle the language interfaces. Only Global nodes containing data are presented in the generated JSON file.

1 2
0 330

Hi Community,

I have json equivalent persistent object in pjsonObj variable. Final JSON example below.

{
"Document": {
"FileExtension": "pdf",
"FileContent": "JVBERi0xLjUNCiW1tbW1DQo...(very large bsae64 string)"
}
}

Here FileContent field in json will contain converted base64 string of very large pdf(10pages). I need to submit this json as a payload to REST endpoint.

below code is working fine.

2 1
0 352

I have defined a class with a dynamic object property:

My class

The issue I encounter is that if a length of a serialized json property is more than 3641144 symbols, the object fails to save with the following error (either MAXSTRING or STRINGSTACK):

Length: 100 Result: OK
Length: 3641143 Result: OK
Length: 3641144 Result: OK
Length: 3641145 Result: ERROR #5002: ObjectScript error: <MAXSTRING>%GetSerial+1^%Library.DynamicAbstractObject.1
Length: 7282288 Result: ERROR #5002: ObjectScript error: <STRINGSTACK>%GetSerial+1^%Library.DynamicAbstractObject.1

Is there a workaround? I need to store moderately large jsons (10-15 Mb) and dynamic object properties allow for a very convenient access.

$ZSTORAGE is set to -1.

2 6
0 767
Article
· Jan 24, 2022 1m read
GlobalToJSON-Compact

I have created a package that offers a utility to load a Global into JSON object and reverse
to create a Global from this type of JSON object. Compact refers to the structure created.
Globals nodes are included with data for a fast data load.
But also the related code is quite compact.

5 3
0 314
Article
· Jan 24, 2022 2m read
GlobalToJSON-Efficient

I have created a package that offers a utility to load a Global into JSON object and reverse
to create a Global from this type of JSON object. Efficient refers to the structure created.
Only Globals nodes containing data are presented in the generated JSON object.

4 2
0 301
Article
· Jan 24, 2022 1m read
GlobalToJSON-Academic

I have created a package that offers a utility to load a Global into JSON object and reverse
to create a Global from this type of JSON object. Academic refers to the structure created.
Each logical node of the Global is presented separately with all its descendants.
Even if they don't contain any stored data.

2 1
0 255
Question
· Jan 18, 2022
FHIR Bulk Data and ndjson

Hi all,

I am testing asynchronous Bulk Data retrieve with a large EHR vendor. When I retrieve the bulk data, they are returning ndjson (CONTENT-TYPE of "application/fhir+ndjson; charset=utf-8"). If I attempt to process that content using JSON functions - I get

ERROR #5035: General exception Name 'Parsing error' Code '3' Data ''

For example, the following generates the error

s objArray={}.%FromJSON(quickStreamOut)

The error makes sense in that ndjson is not a valid json format (I assume at least).

0 1
0 371
Article
· Jan 12, 2022 12m read
JSON Schema applied to InterSystems IRIS

The JSON is a data document free of types and validation rules. However, in some scenarios it is important that the JSON document has type and business rules validation, especially in interoperability scenarios. This article demonstrates how you can leverage a market-defined JSONSchema technology that is open for everyone to use and do advanced validations.

8 3
2 891
Question
· Jan 3, 2022
JSON - NULL Properties

So I've been reviewing a lot of questions posted in the InterSystems community regarding NULL properties in JSON. I've also been reviewing the JSON documentation. None of these things have been able to help me so far.

1. We don't seem to have the %JSON.Adaptor class available for us to use in our system.

2. I'm not really confident enough to create JSON Type classes or backporting code, etc.

0 2
0 484

Hi All,

I am working in Heath Share Heath Connect Integration.

I have a requirement to change SOAP call to REST call in integration. For SOAP call already payload is ready in XML string. and Working fine.

Now I need to make REST API call instead of existing SOAP call.

I have created REST Business Operation and ready to Call it from Business Process.

Here I should not change any Transformation in Business Process , only change in Operation invocation

2 5
0 629

I have an issue where a Windows Reserved word, in my case CON, is causing an error when used as part of a JSON Get operation. In this case CON is the user identifier (the full identifier is CON.SURNAME) of a person and I am trying to read the employee record using a web service provided by the payroll system.

Is there a way I can get around this, some sort of encoding that would enable the inclusion of this identifier. I can't just change the identifier has it is used extensively across systems.

0 3
0 181
Question
· Jun 11, 2021
Parsing null values in JSON

Hello everyone,

I'm creating a REST API with InterSystems Ensemble.

I already have a POST route that parses JSON content into an object defined in a class.

To parse the JSON content, I'm using the JSONStreamToObject method in the Ens.Util.JSON class

Here is how I use it:

0 1
0 1.3K

Hi all, I am new to IS Objectscript and I would appreciate some assistance regarding this.

I am trying to find out how to count the number of elements within a dynamic abstract object and I am having some trouble using the size method.

Here is the code below:

The key value pairs are originally in JSON and I would have converted it in to an object for use.

0 7
0 284