9 Followers · 445 Posts

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

Question Jaime Lerga · Feb 8, 2023

Recently i've been using Restforms2 to create a CRUD API for a project. But it lacks some advanced functionality that we need, so we have created a production with a REST WS which handles those advanced methods. That works great but there's a drawback, it does not have authentication. I would want to use the same authentication method as Restforms2 which is a basic auth using IRIS users and passwords. Searching for this, i have found a similar topic. It uses $SYSTEM.Security.Login(user, pass) in a similar manner to create a token. This works flawlessly if you use an account with all

4
0 1035
Article Robert Cemper · Jan 30, 2023 2m read

The similarity between JSON objects + arrays and Globals in IRIS or Caché is evident.
With small and medium size JSON objects navigation across %Dynamic Objects is comfortable.
But with large and/or deep cascaded objects it becomes a challenge.

The presented tool offers 3 variants

  • loading an already existing %Dyamic object or Array into a global of your choice
  • loading a %Stream containing a JSON object into a global of your choice
  • loading an external File containing a JSON object into a global of your choice
1
2 350
Article 王喆 👀 · Oct 18, 2022 4m read

preface

Since the contact with IRIS, it has been used most in hospitals as an ESB integration engine, as a link in the hospital's integration platform+data center. However, you can also develop some restful pis to be used as the backend of front end and back end separation projects

List of articles

Introduction

List of articles

I. Development of technologies and tools

II. Development Path and Relevant Codes

1. database

2. Preparatory work

3. Steps associated with developing an interface

4. Presentation of achievements

Summary

This article will show the CRUD operations related to IRIS in a simple page:

4
0 585
Article Daniel Aguilar · Oct 12, 2022 2m read

Hi Developers!!,

I know what you are thinking... a new feature for ZEN.proxyObject...? NOW..???

In Spain we say that better late than never  ;-)

Have you ever need to send a numeric attribue of a Json in String format?

Did you go crazy casting class objects with fixed typed properties?

Lucky you!!

With this new feature I propose a way to continue working with our loved dynamic object %ZEN.proxyObject, being able to choose whether or not we want to send numeric attributes in String format.

You: "That's great!! but come on, stop rambling and explain to me how it works!!!."

1
0 469
Question Thembelani Mlalazi · Sep 16, 2022

I have a REST Service that I want it to receive a json string request I have set up my URLMap as follows the top URL when populated and requested works fine but I would like my request to be a json string and that is not working I am getting a 500 error am I missing something please advice.

XData UrlMap
{
<Routes>
<Route Url="/:emailAddress/:sendUserEmail/:password" Method="POST" Call="ResetPassword"/>        this works fine
<Route Url="/test" Method="POST" Call="test"/>              I would like this to receive a json formatted string for the above
</Routes>
}

5
0 504
Article Sarah Schlegel · Sep 7, 2022 7m read

 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:

0
1 621
Article Istvan Hahn · Sep 23, 2016 6m read

This is a detailed guide to develop RESTful services using InterSystems Ensemble. The goal of this guide is to make you understanding the basic concept and building blocks of a RESTful service. The service is going to provide a very basic functionality (a “Hello world!”).

You will learn how to create required components as Ensemble classes, configure the run-time as an Ensemble Production and create a service configuration as a web application.

3
0 2846
Question Smythe Smythee · Aug 10, 2022

Hi,

I am receiving a JSON File as Stream container Using  pRequest As Ens.StreamContainer and output as  Output pResponse As %Persistent in a Custom Business Operation 

Please find the code below

Method OnMessage(pRequest As Ens.StreamContainer, Output pResponse As %Persistent) As %Status
{
    Set tFilename=..Adapter.CreateFilename(##class(%File).GetFilename(pRequest.OriginalFilename),..Filename)
    Set tSC=..Adapter.PutStream(tFilename, pRequest.Stream)
    Quit tSC
}

Question:How can i extract name,DOB,SSN from the pRequest and save the same values in SQL persistant table?

5
0 1002
Question Kurro Lopez · Dec 19, 2016

Hi all,

I'm trying to convert a HL7 section to a XML or JSON string.

We need to save the content of PID section into a SQL Column, therefore we need to convert it into a XML o JSON string

is there any easy way to convert it?

I've tried to convert it directly into a DTL, but all my attempts have been unsuccessful

Best regards,

Francisco Lopez

6
0 1601
Question Victor Castanon · Jun 29, 2022

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:

3
0 615
Question Michael Davidovich · Jun 6, 2022

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.

5
0 486
Article Robert Cemper · Mar 24, 2022 3m read

This package offers a utility to export an XLarge Global into a JSON object file and to show
or import it again. In a previous example, this all was processed in memory. But if this is a
large Global you may either experience <MAXSTRING> or an <STORE>  error
if the generated JSON structure exceeds available memory.
 


Academic refers to the structure created.

1
0 450
Question Claus Odgaard · Apr 11, 2022

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? 

14
0 1633
Article Robert Cemper · Jan 24, 2022 1m read

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.

3
0 439
Article Robert Cemper · Mar 23, 2022 1m read

I have a rather simplistic JSON Object of this structure: 

{"id":<someid>,"value":<some string>,"details": 
 [{"id":<someid>,"value":<some string>,"details": 
  [{"id":<someid>,"value":<some string>,"details":  
   [{"id":<someid>,"value"}
   ,{"id":<someid>,"value"} 
   ,{"id":<someid>,"value"} ]
  ,[{"id":<someid>,"value":<some string>,"details":  
     [{"id":<someid>,"value"}
    ,{"id":<someid>,"value"} ] ]
 ,{"id":<someid>,"value":<some string>} ] } 
   
3
0 712
Question Lewis Houlden · Mar 22, 2022

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");

Setting the Property through a custom function which is used in the DTL:

set convertedDateTime= ##class(Ens.Util.Time).ConvertDateTime("202203220800","%q(1)","%q(3)") //Setting to HoroLog format
set pOutput = $PIECE(convertedDateTime,",",*) //splitting to obtain seconds past midnight 

2
0 266
Question Yann Simons · Feb 26, 2022

Hi Community,

for our forms validation we use XData to describe fields on server side.

These XData are in JSON like this

XData FormValidator [ MimeType = application/json ]
{
 {
  "username": {
   "required": true 
  },
  "email": {
   "datatype": "email"
  }
 }
}

When I try to use %JSON.Adaptor in same classes, IRIS throw an error at compile time

ERROR #6301: SAX XML Parser Error: invalid document structure while processing Anonymous Stream at line 1 offset 23
  > ERROR #5490: Error running generator for method '%JSONGenerate:helora.worklist.Group'
8
0 408
Article Robert Cemper · Feb 8, 2022 1m read

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

2
0 663