Hello

I am creating an import tool to convert a client's JSON data into IRIS classes.   The sample file is over half a gig.   I am copying the data into an instance of %Stream.FileCharacter;.    My first few attempts worked fine.   However I started getting an error thrown when I try to create a DynamicAbstractObject using the  %FromJSON method.     See the code below.   The error code given is not in the documentation, at least not the doc that I was searching.   

00
0 3 83

I had a challenge recently where I was asked to parse and iterate JSON to find a patient that has a forename = "Bill" and try to make the function that iterates through the code re-usable.

Being working in Healthcare there isn't much experience or demand for parsing JSON, as most of my work is HL7.

I took this on using the documentation and worked out a way to parse the JSON (see posts below for code and source data).

00
0 6 95
Article
Chris Stewart · Feb 18, 2021 2m read
Basic JSON Compare

Hi Dev Community

I thought i would share a little method I knocked together to traverse and compare 2 JSON objects for basic equivilance.   I'm currently working on some data migration, and wanted a basic sanity check to validate that the JSON output is basically equivliant between the old and new, excluding a few things like timestamps.  

It's a basic little recurvsive method, that will bubble up any differences over a nested structure.   It's very low tech, as that's all I need it to do, but I thought it might be useful for others?

10
0 5 138

Hello fellow community members,

I would like to offer my services as an Intersystems Professional and am available to work on projects. 

I have more than a decade experience into  Intersystems stack of technologies including IRIS, Ensemble, Healthshare, Healthconnect, Cache Objectscript, Mumps, Zen, Analytics etc. with companies spread over US and UK  involved in multiple domains.

10
0 0 115
Question
Mike Yackanich · Jan 11, 2021
How to use HS.JSON.Path

Has anyone used the ##class(HS.JSON.Path).%Evaluate() classmethod interrogate JSON and return a specific object value? I need to extract the MessageHeader.destination.endpoint value from a FHIR bundle and can't seem to get that XPath-like method to work.

00
0 2 53

There are couple of options to do this.

1. You can extend your class &JSON.Adaptor, it will do it for you with inbuilt logicaldtodisplay methods

2. Create another request class and do your transformations

3. Before calling the json convert to stream methods, transform the object's field with a ZDT.

---------------------------------------------------------------------------------------------------------------------------------------

 

I have an extremely simple example where there is a class with 3 properties

00
0 1 104

Hello,

We are working with a vendor who only accepts JSON as payload. We are currently still on Cache/HealthShare, not IRIS. Since we have to send Continuity of Care Documents, this raises issues with Long Strings (some CCDs can be quite large and in addition to that, they have to be b64-encoded which increases their size even more).

My question is: if we were to go on IRIS and use %JSON.Adapter, storing the encoded Stream in an object's Stream property, would calling %JSONExport() on this object produce the desired JSON? Or would we have to call %JSONExportToStream()?

00
0 3 141

QEWD is assumed by most people to only integrate with IRIS (or Cache) via a connection through IRIS's high-performance C interface.  This requires QEWD (and its Node.js environment) to be installed and configured on the same machine as IRIS.

I'm frequently asked if QEWD can run on a separate server (or servers), and access IRIS (or Cache) over a network connection.  The answer is yes it can, but the information on how to set it up in this way has been admittedly a bit tricky to discover.

00
0 0 64

Over the past year or so, my team (Application Services at InterSystems - tasked with building and maintaining many of our internal applications, and providing tools and best practices for other departmental applications) has embarked on a journey toward building Angular/REST-based user interfaces to existing applications originally built using CSP and/or Zen. This has presented an interesting challenge that may be familiar to many of you - building out new REST APIs to existing data models and business logic.

110
6 33 881

What is the best way to create an HL7 message from JSON input file?

We have JSON file available with data required for building the HL7 message . I am trying to use a standard file/FTP Business service to pick up the file and convert the input %FileCharacterStream into a dynamic Object and use the stand JSON features to read /process the data and build the HL7 message. 

Is there any other better way to do this? or any standard built-in functionality available in HealthShare? 

Thanks you for your help

Mary

00
0 2 132
Question
Sabit Issakhan · Nov 26, 2020
Set null

Hello! 

How to set null in variable? 

I need to create JSON like below:

{

"id":"1",

"Code": null

}

 

00
0 3 117

Hey Intersystems Community,

I have a Problem with the Session Handling in .csp.

I wrote all my Web Services in .csp-Pages and do the work for example in the OnPreHttp Method for to get some data.

After that the Web Service response is in JSON.

I call These Web Services via fetch in my react Single Page application, also Many request parallel. The react App is Rolled out as index.html.
Everything Works Fine with the session Handling via Cookie.

00
0 3 122

Let's imagine if you would like to write some real web application, for instance, some simple clone of medium.com. Such sort of application can be written using any different language on the backend side, or with any framework on the frontend side. So many ways to do the same application, and you can look at this project. Which offers a bunch of frontends and backends realizations for exactly the same application. And you can easily mix them, any chosen frontend should work with any backend.

Let me introduce the same application realization for InterSystems IRIS on a backend side.

60
0 0 225

Doing a new project with %JSON.Adaptor, unexpectedly realized that %JSON.Adaptor does not support export to native JSON. %JSONExport just outputs directly to the current device, and there are two more methods %JSONExportToString, and %JSONExportToStream.

In conjunction with generating REST from swagger specification, where any generated method accepts as a result %DynamicObject, which is good. 

I have multiple places in my REST where I have to return JSON for an object, but I have to modify the result a bit, just extend it with some other way.

10
0 6 205

Hi,

How do I generate JSON strings instead of integers, as follows:

{ "MyProperty":"1"}

all we seem to be able to generate is 

{ "MyProperty":1}

Its for an api that requires the former and as the former is valid JSON I'm surprised I am having so much trouble.

(Obviously I'm new, please be kind :D

00
0 7 175

Hello Intersystems-Community,

I build an API and there I use $order to get the Data from my Globals.
When I first time use that API it's get an error (504 Gateway-Timout > 60 Sec.).

After 2 reloads it works with a loading time of 2 Sec.! Sounds for me like the $order is cached and it works faster. Is it true $order will be cached?

When it works, I only get the error at the next day. So it's very hard to reproduce that error. Is it possible to delete the cache for $order?

Example:

 

00
0 8 162
This is a coding example working on Caché 2018.1.3 and IRIS 2020.2 
It will not be kept in sync with new versions 
It is also NOT serviced by InterSystems Support !

This  an example of a customized SystemFunction extension (ZZISJSON) in Caché & IRIS
This time it is  to be included in %ZLANGF00.mac

A JSON string is mostly imported from a file or over REST.
You rely on a clean and compatible structure. This is the check.

80
0 0 195
This is a coding example working on Caché 2018.1.3 and IRIS 2020.2 
It will not be kept in sync with new versions 
It is also NOT serviced by InterSystems Support !

It is also an example of a customized command extension (ZZJSN) in Caché / Ensemble & IRIS

This is the Caché version for fast JSON formatting. But iIt also works in IRIS .  
To allow parallel existence in IRIS with the previous example this is named ZZJSN

50
0 0 128