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:
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write.
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:
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.
Hello,
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 %Net.JSON.JWT
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. Just to test, I do this:
set JOSE = {
"alg": "PS256"
}
and then using that and an arbitrary claims as parameters in Create method gives this
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:
Using SQL Gateway with Python, Vector Search, and Interoperability in InterSystems Iris
Part 2 – Python and Vector Search
Since we have access to the data from our external table, we can use everything that Iris has to offer with this data. Let's, for example, read the data from our external table and generate a polynomial regression with it.
For more information on using python with Iris, see the documentation available at https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=AFL_epython
I have a scenario where I send a GET request to a broker and receive a FHIR response. When I attempted to use the built-in InterSystems functions to convert this FHIR response into SDA, the transformation failed—likely because it is not a standard FHIR request.
How should I handle this situation? Is there a recommended approach to processing FHIR responses in this context?
I understand that InterSystems provides functions to facilitate transactions between FHIR and HL7 via the SDA segment. My question is:
From the previous article, we identified some issues when working with JSON in SQL.
IRIS offers a dedicated feature for handling JSON documents, called DocDB.
Hello All,
I need help Integrating the vendor-provided code into the current code to check if the data is an array and if it is, iterate through each item using a for each loop. Also, I need to hit every error handler code mentioned at the bottom along with the transform in both instances.
My Current Code:
/// Given a patient number in a JSON string format, this includes required transformations and makes use of
/// the MPI Query Handler to pull basic demographics from Epic.
Class CUH.Proc.DCIQGetPatient Extends Ens.BusinessProcessBPL [ ClassType = persistent, ProcedureBlock ]
{
While working on getting JSON support for some Python libraries, I discovered some capabilities IRIS provided.
Hi, I am currently setting up a new API using %CSP.REST - I've gotten swagger spec generation to work like such:
Hello,
Is there a single ObjectScript operator or method to concatenate two %DynamicArrays?
I'm looking for something that will do the following:
set arr1 = [ 1, 2, 3 ] set arr2 = [ 4, 5, 6 ] set arrcombined = arr1.%Concatenate(arr2)
or
set arrcombined arr1_arr2
With end result:
zw arrcombined arr1=[1,2,3,4,5,6] ; <DYNAMIC ARRAY>
I can iterate and %Pop over the 2nd array and %Push each popped entry to the 1st array, but I was looking for something more succinct.
Thanks in advance.
I tried executing the SQL JSON_TABLE query with large JSON string(more than 200000 characters) and I got the below error. I'm curious about this under the hood workflow and how does it reach reaches MAXSTRING.
Thanks!
Imagine the scene. You are working happily at Widgets Direct, the internet's premier retailer of Widgets and Widget Accessories. Your boss has some devastating news, some customers might not be fully happy with their widgets, and we need a helpdesk application to track these complaints. To makes things interesting, he wants this with a very small code footprint and challenges you to deliver an application in less than 150 lines of code using InterSystems IRIS. Is this even possible?
Last Chapter: Creating a REST client to get Tracks from Spotify REST API - Part4 Save the Search Result
Git link: https://github.com/ecelg/InterSystems-IRIS-as-a-Spotify-REST-client
OK.... based on what I have done.... I am able to
1. Query Track information by making use of the Spotify API
2. Store the necessary data into my own album, artists, and track table
so.... what next?🤔 How about I set up my own REST API service on my IRIS for the other people to query my table?🤔🤨
ok... 1st... start from document Introduction to Creating REST Services
Last Chapter: Creating a REST client to get Tracks from Spotify REST API - Part3 Get some data (e.g. Artists)
Git link: https://github.com/ecelg/InterSystems-IRIS-as-a-Spotify-REST-client
OK we create a method to get data and lets try to get some Tracks 😁
Run the following line
w ##class(rest.utli.requestUtli).getdata("Spotify","/search","offset=5&limit=10&query=Shape%20of%20you&type=track&market=SG")ooooo no seems there is huge among of data returns.....😥
I would like to know what information can be found in 1 track....🤔 how about only query 1 track?
Last Chapter: Creating a REST client to get Tracks from Spotify REST API - Part2 Save and Refresh Token
Git link: https://github.com/ecelg/InterSystems-IRIS-as-a-Spotify-REST-client
Ok, now I am pretty sure i have a valid token for making query.😀
Shall we try to query something from the API.
Again, its time to go through the API document https://developer.spotify.com/documentation/web-api/tutorials/getting-started
Search for Request artist data
the suggested code is like the following
Last Chapter: Creating a REST client to get Tracks from Spotify REST API - Part1 Check out token
Git link: https://github.com/ecelg/InterSystems-IRIS-as-a-Spotify-REST-client
Ok... Now we can check out a token but it will be expired in 3600 seconds.
There are 2 questions come up🤔
1. How to save this token????🙄
2. How to refresh this token????🤨🤔
Lets come back to the API document https://developer.spotify.com/documentation/web-api/tutorials/getting-started
Base on my understanding, this piece of API do not have a token called refresh_token, as a result, we can assume the logic like following
As we keep updating our software, we often realize that we require more and more modern solutions. So far, only one major piece of our software relies on reading barcodes in documents and images. Since Cache did not have a means of reading barcodes in the past, we have always achieved our goals by using a Visual Basic 6 application. However, it is no longer an ideal solution because it is currently complicated to maintain it. IRIS also lacks this capability, but it has recently got an option that makes up for it: embedded Python!
I need to create a JWT to connect to EPIC FHIRserver sandbox.
https://fhir.epic.com/Documentation?docId=oauth2§ion=BackendOAuth2G…
You will generate a one-time use JSON Web Token (JWT) to authenticate your app to the authorization server and obtain an access token that can be used to authenticate your app's web service calls. There are several libraries for creating JWTs. See jwt.io for some examples.
The header and payload are then base64 URL encoded, combined with a period separating them, and cryptographically signed using the private key to generate a signature.
This is a template for a FastApi application that can be deployed in IRIS as an native Web Application.
git clone
cd iris-fastapi-template
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
docker-compose up
The base URL is http://localhost:53795/fastapi/.
Hello to my fellow Cache Gurus:
I ran into two issues with Cache to XML Export and Cache to JSON Export in regard to array sequences. So before I waste time opening a WRC ticket, I figured I would poll the Development Community, since there is always so much wonderful feedback and suggestions via this Developer Community! So much thanks in advance for everyone's input! Go Team!
Hi folks!
Examining FHIR profile validation with InterSystems FHIR server. FHIR profiles is a very useful feature of FHIR standard that helps an organization or solution to establish constraints to a very disperse FHIR standards that are relevant to a particular business solution. Learn more on FHIR profiles.
I created a very simple FHIR profile with the following JSON: