Here's a sample code to display JSON or dynamic object.
It shows how to iterate over object, get property values and their paths.
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write.
Here's a sample code to display JSON or dynamic object.
It shows how to iterate over object, get property values and their paths.
Hi everyone,
I’m new to this community and could really use some help with creating a production in InterSystems IRIS for Health Community 2024.3. I have deployed my instance using Docker.
Here’s what I’m trying to do:
EnsLib.HL7.Service.FileService.
Class Demo.MyApp.Messages.JSONEvent5 Extends (%Persistent, %JSON.For a long time I have wanted to learn the Django framework, but another more pressing project has always taken priority. Like many developers, I use python when it comes to machine learning, but when I first learned web programming PHP was still enjoying primacy, and so when it was time for me to pick up a new complicated framework for creating web applications to publish my machine learning work, I still turned to PHP.
IRIS supports CCDA and FHIR transformations out-of-the-box, yet the ability to access and view those features requires considerable setup time and product knowledge. The IRIS Interop DevTools application was designed to bridge that gap, allowing implementers to immediately jump in and view the built-in transformation capabilities of the product.
.png)
Hi Community,
In this article, I will introduce my application iris-fhir-bridge
IRIS-FHIR-Bridge is a robust interoperability engine built on InterSystems IRIS for Health, designed to transform healthcare data across multiple formats into FHIR and vice versa. It leverages the InterSystems FHIR Object Model (HS.FHIRModel.R4.*) to enable smooth data standardization and exchange across modern and legacy healthcare systems.
I am struggling on how to pull out individual fields from a JSON. In a previous post someone had mentioned that I could...
If ((tHttpResponseIsObject) && ($ZCONVERT(tHttpResponseContentType,"L") [ "application/json"))
{
set responseData = {}.%FromJSON(tHTTPResponse.Data)
set pResponse = ##class(osuwmc.COM.Response.StringResponse).%New()
if responseData.count =1{
set pResponse.COMPortalURL = responseData.items.%Get(0).portalUrl
set pResponse.COMPureID = responseData.items.%Get(0).pureId
set pResponse.COMTitle = responseData.items.%Get(0).titles.%Get(0Hi everyone,
It's me again😁. As usual I would like to share something I study recently, and today, I would like to share about the document DB😁.
1st of all, let's go to the documentation https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=GDOCDB_intro
Well, I must say, this one is much better to follow than the others, which I read before. 😭 Finally😭😭
Ok, let's start walking through it together
Here we go😀, we start a terminal from VSCode to connect to our IRIS
.png)
We are going to created Document DB demo.docpatient
InterSystems IRIS versions 2022.2 and newer feature the ability to authenticate to a REST API using JSON web tokens (JWTs). This feature enhances security by limiting where and how often passwords transfer over the network in addition to setting an expiration time on access.
The goal of this article is to serve as a tutorial on how to implement a mock REST API using InterSystems IRIS and lock access to it behind JWTs.
NOTE I am NOT a developer. I make no claims as to the efficiency, scalability, or quality of the code samples I use in this article.
I am running into an issue where a JSON response is missing keys...
{
"count": 0,
"pageInformation": {
"offset": 0,
"size": 10
},
"items": []
}Within the JSON response I am only looking for two fields portalUrl and portalId. I have tried using $LENGTH and %IsDefined to check if they are valued but neither work.
If ((tHttpResponseIsObject) && ($ZCONVERT(tHttpResponseContentType,"L") [ "application/json"))
{
set responseData = {}.%FromJSON(tHTTPResponse.Data)
set pResponse = ##class(osuwmc.COM.Response.Hello Community,
When retrieving strings from the DAO, if the string exceeds the capacity of an ObjectScript string variable, it returns <MAXSTRING>. To prevent this, use dao.%Get(key, default, "stream") to retrieve the value as a stream (%Stream.DynamicBinary). However, Why can't we use other stream objects such as %Stream.TmpCharacter instead of %Stream.DynamicBinary/%Stream.DynamicCharacter (I understand It is not possible to create a direct object instance for %Stream.Dynamic* classes) .
Hello everyone,
I am using a class that inherits from %RegisteredObject and %JSON.Adaptor to generate a JSON string from its instances.
However, one of the properties in my class is of type %Library.DynamicObject, as in the example:
Class Faces.Option Extends (%RegisteredObject, %JSON.Adaptor)
{
Property legend As %String;
Property xAxis As %Library.DynamicObject;
}When calling %JSONExportToString() on an object of this class, the JSON generated for the xAxis property is incomplete or malformed. It seems the default %JSON.Adaptor doesn't correctly handle properties of type %Library.
Hi devs!
Suppose I have an instance of a persistent class:
Set person = ##class(dc.Sample.Person).%OpenId(1)Class is an ancestor of %JSON.Adapter.
How can I convert it to dynamic object with the properties that person.%JSONExport() provides?
{"Name":"Elon Mask","Title":"Associate Accountant","Company":"InterSystems","Phone":"799-933-5569","DOB":"1926-12-11"}Couldn't find a right method.
set dynObj = ##class(%ZEN.Auxiliary.altJSONProvider).%ObjectToAET(person) works, but adds id and classname, which I don't want to be added:
zw dynObj
dynObj={"_class":"dc.Sample.The Good Old Days
The %Library.DynamicObject class has been in IRIS since before it became IRIS. If you have been using it since the Cache days, you may want to brush up on some of its changes.
In Cache 2018, the %Get method only had one argument. It was the key to retrieving from the JSON, meaning that if your JSON object called myObj, it would look like the following:
Hi devs!
What is the best way to return JSON in IRIS for a GET request in a REST app?
This is how I do it now:
ClassMethod GetAllPersons() As %Stream.Object
{
d ..%SetContentType("application/json")
Set rset = ##class(dc.Sample.Person).ExtentFunc()
set stream=##class(%Stream.TmpCharacter).%New()
d stream.Write("[")
if rset.%Next() {
Set person = ##class(dc.Sample.Person).%OpenId(rset.ID)
Do person.%JSONExportToStream(.stream)
}
While rset.%Next() {
d stream.Write(",")
Set person = ##class(dc.Sample.Person).%OpenId(rsetHi Community,
How Can I do to return ID when I call %JSONExport()?
Say I have an ObjectScript object called Book. It has 2 properties title and author. It extends JSON.%Adaptor, so I can call book.
Summary of Alerts
| Alert ID | Product & Versions Affected | Explicit Requirements |
|---|---|---|
| DP-439207 | InterSystems IRIS® data platform 2024.3 (AIX) | AIX installations Using JSON processing and Unicode non-Latin-1 character sets |
| DP-439280 | InterSystems IRIS 2024.3 (containers with IntegratedML) | IntegratedML Containers using TensorFlow |
Detail of Alerts
DP-439207 - AIX JSON Unicode Parsing Issue
A bug has been identified in InterSystems IRIS 2024.3.0 on AIX instances that affects the parsing of JSON Unicode strings.
Background:
This guideline provides an overview of how to design and implement a REST API interface for querying patient demographic data from an Electronic Patient Record (EPR) system using HealthConnect. The process involves sending a query request with the patient's identification number, retrieving the response from the EPR system, extracting the required patient demographic data from the HL7 message, and sending it as a JSON response to the supplier. The high-level process diagram is shown below (Screenshot 1).
JSON Web Token (JWT) Authentication
Hi Everyone,
I would like to share the code and step-by-step instructions/or guideline for generating a JWT (JSON Web Token) signature, as well as how to test it using Postman / HealthConnect.
JWT is an open standard (RFC 7519) that defines a compact, URL-safe method for securely transmitting information between parties in the form of a JSON object.
Structure of a JWT:
A JWT consists of three parts, separated by dots (.):
|
Header |
. |
Payload |
. |
Hi all.
I'm trying to create an indexed table with an vector field so I can search by the vector value.
I've been investigating and found that to get the vector value based on the text (token), use a Python method like the following:
ClassMethod TokenizeData(desc As %String) As %String [ Language = python ]
{
import iris
# Step 2: Generate Document Embeddings
from sentence_transformers import SentenceTransformer
model = SentenceTransformer('/opt/irisbuild/all-MiniLM-L6-v2')
# Generate embeddings for each document
document_embeddings = model.A REST API (Representational State Transfer) is an interface that allows different applications to communicate with each other through the HTTP protocol, using standard operations such as GET, POST, PUT, and DELETE. REST APIs are widely used in software development to expose services accessible by other applications, enabling integration between different systems.
However, to ensure that APIs are easy to understand and use, good documentation is essential. This is where OpenAPI comes in.
OpenAPI is a standard for describing RESTful APIs.
Hello,
I'm trying to POST a Location resource to a FHIR Server, but I get this error:
{
"errors": [
{
"code": 5002,
"domain": "%ObjectErrors",
"error": "ERRORE #5002: Errore di Cach�: <PROTECT>zNewInteractionsInstance+1^HS.FHIRServer.Storage.Json.InteractionsStrategy.1",
"id": "ObjectScriptError",
"params": [
"<PROTECT>zNewInteractionsInstance+1^HS.FHIRServer.Storage.Json.InteractionsStrategy.1"
]
}
],
"summary": "ERRORE #5002: Errore di Cach�: <PROTECT>zNewInteractionsInstance+1^HS.
In the world of APIs, REST is very extended. But what happens when you need more flexibility in your data-fetching strategies? For instance letting the client to choose what fields is going to receive. Enter GraphQL, a query language for your APIs that provides a flexible alternative to REST.
In this post, we will:
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?
REST API with Swagger in InterSystems IRIS
Hello
The HTTP protocol allows you to obtain resources, such as HTML documents. It is the basis of any data exchange on the Web and a client-server protocol, meaning that requests are initiated by the recipient, usually a Web browser.
REST APIs take advantage of this protocol to exchange messages between client and server. This makes REST APIs fast, lightweight, and flexible. REST APIs use the HTTP verbs GET, POST, PUT, DELETE, and others to indicate the actions they want to perform.
Hi community,
I am having a hard time figuring out how to properly use %ZEN.Auxiliary.jsonProvider to serialize a %RegisteredObject to JSON. Would be anyone so kind to share some simple usage example?
Thanks
Jiri
We are trying to create a JWT in order to get oauth2 token from login.microsoftonline.com and then use that token to get key/secret from an Azure Key Vault.
It seemed like it would be quite straightforward by using the Create method of class
But already trying to set the first header parameter alg PS256 as specified by https://learn.microsoft.com/en-us/entra/identity-platform/certificate-c… becomes a problem.
Using Flask, REST API, and IAM with InterSystems IRIS
Part 3 – IAM
InterSystems API Manager (IAM) is a component that allows you to monitor, control, and manage traffic from HTTP-based APIs. It also acts as an API gateway between InterSystems IRIS applications and servers.
Using Flask, REST API, and IAM with InterSystems IRIS
Part 2 – Flask App
Flask is a web development microframework written in Python. It is known for being simple, flexible, and enabling rapid application development.
Installing Flask is very simple. Once you have python installed correctly on your operating system, we need to install the flask library with the pip command. For REST API consumption, it is advisable to use the requests library. The following link provides a guide to installing flask: https://flask.palletsprojects.com/en/stable/installation/
Using Flask, REST API, and IAM with InterSystems IRIS
Part 1 - REST API
Hello
In this article we will see the implementation of a REST API to perform the maintenance of a CRUD, using Flask and IAM.
In this first part of the article we will see the construction and publication of the REST API in Iris.
First, let's create our persistent class to store the data. To do this, we go to Iris and create our class: