9 Followers · 445 Posts

JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write.

Article Oliver Wilms · Jan 31, 2024 2m read

An App that converts HL7 messages to JSON objects. About a year ago I started a GitHub repo for collecting stuff related to HL7. Recently my team added an HL7 interface to our Interoperability Production and we were asked to persist HL7 messages. We created a Kafka topic to receive HL7 messages. We use Kafka Bridges to send messages to Kafka topics. Kafka messages are sent to the Kafka Bridge in JSON format.

0
0 280
Question Kevin B Lavallee · Sep 30, 2022

Hello,

I am trying to use the %ToJSON method on my dynamic object, calling it with a "DO" and not passing in outstrm parameter.

We are trying to avoid MAXSTRING errors that we get with some of our abnormally large messages.  In order to do this, I am trying to update my code to not call the socket's "Write" method after converting the dynamic object to a JSON string using the %ToString method's output.  Per the documentation on the %ToJSON method:
    If outstrm is not specified and the method is called via DO, the JSON string is written to the current output device

10
0 447
Question Oliver Wilms · Jan 11, 2024

Hello, I tried to convert HL7 message to JSON in a business process and I got errors. Has anybody converted HL7 to JSON? Are certain characters not allowed in JSON?

I just tried to set a property to quote request.RAWContent and quote. I will try to put example in GitHub and share here later.

5
0 1245
Question Emil Odobasic · Dec 14, 2023

Hello everyone!
I have to build a REST service that receives a POST HTTP-request, collect a file from that request in the Form data and then send it in another HTTP Post request through Form Data. However I can't really seem to send the file, and I do not know where it has gone wrong. All I am getting told is that no file is being received from my HTTP Post request. I am reaching the REST Service I am supposed to send the request to, but nothing is being sent.
I would be really thankful if someone could give some insight why nothing is being sent in my request. Thanks beforehand! :)

6
0 995
Question David Hickman · Dec 12, 2023

I'm receiving a JSON payload via a REST API, I'd like to %JSONImport this stream into a class which extends %JSON.Adaptor. The problem is that the JSON is an array whose elements have no key (as you can see in the example JSON below). Right now I'm having to do some manipulations to convert the stream into a dynamic object and do a %Set which inserts a made up key "record" so "thingone" and "thingtwo" have an associated key that I can use when referencing "thingone" and "thingtwo"...such as record.GetAt(1).thingone

3
0 369
Question Sapan Parikh · Dec 5, 2023

What changes are to be made while customizing a FHIR server package when adding a new field. As provided in the documentation, we have a sample JSON package of favorite color and it is added in the table, but when we are adding a new field 'Insurance', it does not imports the package and says package already exists. We have three files of JSON 

1) Package.JSON

2) SearchParameter.JSON

3) StructureDefination.JSON 

What should we have to change for adding new field.

2
0 259
Announcement Ronnie Hershkovitz · Nov 19, 2023

Hi Community,

We're pleased to invite you to the upcoming webinar in Hebrew: 

👉Advanced JSON & DocDB👈

📅 Date & time: November 29th, 3:00 PM IDT

JSON has become the leading language in interfaces in recent years. 

In this Webinar we will learn about the use of JSON Adapter and its mappings,

How to convert information from SQL to JSON in a single command, 

And how can information be saved as raw JSON without saving as an object in DocDB.

 Presenter:

@Keren Skubach, Senior Sales Engineer, InterSystems 

 ➡ Register today! 

1
0 329
Question Yone Moreno · Nov 28, 2023

Hello,

First of all thanks for your help, time, and answers.

We would like to know what are we doing wrong and how could we improve it and fix it.

We need to convert the Api Monitor Metrics which are a String with this format:

iris_cache_efficiency 13449.122
iris_cpu_pct{id="CSPDMN"} 0
iris_cpu_pct{id="ECPWorker"} 0

[...]

iris_wdwij_time 11
iris_wd_write_time 8
iris_wij_writes_per_sec 0

To JSON.

We would expect them to look like a normal JSON as follows:

{
"iris_cache_efficiency": "13449.122",
"iris_cpu_pct{id='CSPDMN'}": "0",

[...]
"iris_wij_writes_per_sec": 0
}

4
1 252
Article Zacchaeus Chok · Nov 28, 2023 3m read

Overview

In our previous post, we discussed the motivation for developing a chatbot agent with access to FHIR resources. In this post, we will dive into the high-level design aspects of integrating a Streamlit-based chat interface with a Java SpringBoot backend, and enabling a LangChain agent with access to FHIR (Fast Healthcare Interoperability Resources) via APIs.


1
0 387
Article Niels Genne · Nov 24, 2023 4m read

How can IRIS productions be deployed more quickly and with greater peace of mind?

The aim of interoperability productions is to enable you to connect systems in order to transform and route messages between them. To connect systems, you develop, configure, deploy and manage productions that integrate several software systems.

That’s what the InterSystems documentation on its reference website tells us, but what do you actually have to do to deploy a production ?

1
0 344
Question Yone Moreno · Nov 24, 2023

Hello,

First of all thanks for your time, thoughts, teaching and help:

We wonder how could we get the metrics from http://[Ip]:[Port]/api/monitor/metrics and use them in Kibana to chart statistics.

We would like to ask you how do you use the api monitor metrics, and as a second question, how would you suggest to utilize them in a third party software as Kibana to chart them.
 

We have thought to do the following:

0
1 209
Article Iryna Mykhailova · Mar 31, 2023 3m read

Saw the other day an article with the usage of the %ZEN package when working with JSON and decided to write an article describing a more modern approach. At some recent point, there was a big switch from using %ZEN.Auxiliary.* to dedicated JSON classes. This allowed to work with JSONs more organically.

Thus, at this point there are basically 3 main classes to work with JSON:

  • %Library.DynamicObject - provides a simple and efficient way to encapsulate and work with standard JSON documents. Also, there is a possibility instead of writing the usual code for creating an instance of a class like
set obj = ##class(%Library.DynamicObject).%New()

it is possible to use the following syntax

set obj = {}
  • %Library.DynamicArray - provides a simple yet efficient way to encapsulate and work with standard JSON  arrays. With arrays you can use the same approach as with objects, meaning that yu can either create an instance of the class
set array = ##class(%DynamicArray).%New()

or you can do it by using brackets []

set array = []
  • %JSON.Adaptor is a means for mapping ObjectScript objects (registered, serial or persistent) to JSON text or dynamic entities.
5
2 1974
Question Gautam Rishi · Oct 4, 2023

Hi all,
I am trying to compile my swagger class file with swagger JSON which is a valid JSON as I created it and verified from swagger.io 2.0 spec.
But getting below error. I am not very clear with the error message. Please help me resolve the same.
ObjectScript error: <CLASS DOES NOT EXIST>removeprj+7^%occClass *SwaggerClass

> ERROR #5091: An error has occurred while removing projection SwaggerClass:Reference.

> ERROR #5030: An error occurred while compiling class 'SwaggerClass'

1
0 283
Question Sebastian Thiele · Oct 6, 2023

Hi community,

I am looking for an implementation strategy to create/update organizations in a local ISC based FHIR server. Thoase organizations do have a certain dependancy to one another. For Organization resources the "partOf" property symbolizes that. It is planned, that a Interoperability Production (supporting FHIR Server) receives a bundle which contains a batch export of all organizations of a customer (Hospital). The task is to bring those data into the FHIR server create and/or update organization.

I was looking at conditional create/update since there a two major challanges.

9
1 498
Question Pietro Di Leo · Oct 8, 2023

Hello everyone,

Is there a way to prettify the JSON streams in the incoming HTTP messages so that they are more readable in Visual Trace?

The HTTP messages sent by many software aren't prettified and are displayed like this in the Visual Trace:

On the other hand, other software like Postman prettify the messages and they are displayed in this way:

I know there is a JSON Formatter class, however what I would like is an automatic setting that automatically prettifies the JSON displayed in the Visual Trace without having to go through code.

Is there anything similar? 

3
0 445
Article Ward De Backer · Apr 22, 2017 14m read

Developing a Full-Stack JavaScript web app with Caché requires you to bring together the right building blocks. In the previous part, we created a basic front-end React application. In the second part of this article series I will show how to choose the right back-end technology for your application. You will see Caché allows you to use many different approaches to link your front-end to your Caché server, depending on your application's needs. In this part we will set up a back-end with Node.js/QEWD and CSP/REST. In the next part we will enhance our basic web app and connect it to Caché using these technologies.

12
1 3420
Article Robert Cemper · Sep 26, 2023 1m read

The related package avoids adding %JSONAdaptor to each class but uses  instead   
SQL functions JSON_OBJECT() to create my JSON objects. With this approach, you can   
add JSON to any class - even deployed ones - without any need for change or recompiling.

The trigger was the Export of M:N relationships  as JSON  objects or arrays.

0
0 453
Question Ashok Kumar T · Sep 24, 2023

I have created a FHIR endpoint and send the FHIR resource to FHIR Interoperability production class which is HS.FHIRServer.Interop.Service through the the created endpoint(/r4). I can able to see/get the HS.SDA3.QuickStream(It use CacheTemp.HS.Stream temporary globalon the fly(In between the process). I'm unable to get the FHIR resource from the QuickStream once the process completed. Is this HS.SDA3.QuickStream is wiped out from the system once process completed?

Executed the below code. Even tried with zwrite of ^CacheTemp.HS.Stream is also empty. Tried with IRSITMEP database as well.

1
0 444
Question Dmitry Maslennikov · Sep 21, 2020

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.

7
2 1014
Question Scott Roth · Aug 9, 2023

Still working on my first External REST API call, and I am struggling to find the exact answer I am looking for... I get a JSON response from my API call but I am not quite sure how to dynamically get the JSON response into the Ens.Response Object with its lists of Arrays that I have defined.

  set tSC = ..Adapter.SendFormDataArray(.tHTTPResposne,"POST",tHTTPRequest,,,tURL)

  set pResponse = ##class(User.REST.Epic.Msg.GetPatientLocationResponse).%New()

  set dynObject = {}.%FromJSON(tHTTPResposne.Data)

  set iter = dynObject.%GetIterator()

  while iter.%GetNext(.key,.value){

10
0 732
Article Mihoko Iijima · Sep 7, 2023 1m read

InterSystems FAQ rubric

You can avoid the error by specifying a stream object as the argument of %ToJSON() used when generating a JSON string from a dynamic object.

A code example is below.

USER>set temp=##class(%Stream.TmpCharacter).%New()

USER>set jsonobj={}

USER>set jsonobj.pro1=["a","b","c","d"]

USER>set jsonobj.pro2=["あ","い","う","え"]

USER>do jsonobj.%ToJSON(temp)

USER>write temp.Size
51
USER>write temp.Read()
{"pro1":["a","b","c","d"],"pro2":["あ","い","う","え"]}

See also the documentation for details.

[IRIS] Serializing large dynamic entities to streams

1
0 649
Question Phil Burkhalter · Aug 29, 2023

I am trying to create the JSON message below for a REST API:

Class REST.Test.Sample.ItemDetails Extends (%Persistent, %JSON.Adaptor)
{

Property ItemId As %String;

Property Item As list Of AllItems;

}

Class AllItems:

Class REST.Test.Sample.AllItems Extends (%JSON.Adaptor, Ens.Response)
{Property ItemtId As %String;

Property itemName As %String(MAXLEN = 100);

Property itemStockNumber As %String(MAXLEN = 150);

Property itemType As %String;

Property itemPriority As %String;

Property itemDetailData As %String(MAXLEN = 10000);
}

7
1 426
Article Yuri Marx · Jan 12, 2022 12m read

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.

About JSON

3
2 1485
Question Ashok Kumar T · Aug 11, 2023

Hi Community,

Whenever I insert a decimal value with trailing zero(ex:12.0000) value in my JSON object dynamically through %Set method. It truncates the trailing zeros. However If I use literal constructors { } It working as expected.  So, In my case the JSON will be generated dynamically. I can't go with "Curly Bracket { } " and the JSON schema not string as well.
Is there any way to fix this?

2
0 332