I'm trying to set up VS Code for ObjectScript using the instructions found here. I've got both Cache 2018.1.2.309.0 and IRIS 2020.1.0.215.0. When I try to connect to either one of them the connection fails, and I get a notification in the bottom right corner that says "Unexpected token < in JSON at position 0". I've checked the JSON settings file that VS Code uses, and they're fine and formatted properly. All of the settings I've entered are correct.

0 20
0 4.8K

Hello,

I am trying to find out if it is possible to decode the Azure access token in IRIS. Has anyone ever tried this before? I need to decode the token to extract the "Scope" details in order to verify the scope to make sure client is permitted to do the request they have done.

If you could point me to any information, that'd be great.

Thank you.

Utsavi

0 7
0 586
Hello! I have a question how to parse Library.ListOfObjects to JSON

I send post data like this from client using rest and want parse "templates", after save "codeForm","codeName" in database

{
    "whoIs": "",
    "templates": [{
            "codeForm": "FORM_FIOGROUP",
            "codeName": "operationDate",
            "orderNumber": "1",
            "codeFormat": "YYYY-MM-DD",
            "header": "DATE",
            "dbfFormatType": "Date",
            "dbfFormatLength": "8",
            "valueFrom": "Payment"
        }, {
            "codeForm": "FORM_FIOGROUP",
0 4
0 426

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.

0 3
0 294

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).

0 6
0 333

Hi!

I am making a request to an API and JSON is coming as follows:

SET %httprequest = ##class(%Net.HttpRequest).%New()
DO %httprequest.Get(URL)
SET %responseBody = %httprequest.HttpResponse.Data.Read()

W %responseBody
{produto:"CHP0001",Local:{IDMV: "000000001",LOTE: "",DtFabric: "null",DtVenc: "null",Atributo06: "0000000002",Atributo07: "",QtdeDisp: "10.00000",QtdeAloc: "0.00000",QtdeSep: "0.00000",QtdeTotal: "10.00000",Status: "OK",Motivo: ""}}

2 9
0 622

Hello,

I am trying to use %ZEN.proxyObject to send out in JSON format so I do:

set tProxyRequest = ##class(%ZEN.proxyObject).%New()
set tProxyRequest.notanumber = "28001"
set tProxyRequest.aboolean = "true"

set tBody = ##class(%GlobalCharacterStream).%New()
do ##class(Ens.Util.JSON).ObjectToJSONStream(tProxyRequest,.tBody,"aelotwu")
w tBody.Read()

and I get:

0 10
0 1.4K

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()?

0 3
0 553

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

0 2
0 623

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.

0 3
0 379

Hi all,

I need some advice about JSON conversions and the outputs. I am being sent a JSON response from an API call and I am struggling to produce an output that I can use from it.

I have used the %FromJSON() method call to take the JSON stream source (pData) and convert it to a Dynamic object (object) but I am a little unsure as to how I can read the dynamic object and use it to extract the values from this and set the values as a property in another class.

The current coding I have for the conversion:

0 21
0 582

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:

0 8
0 385

Hi everyone,

when I'm using the %JSONExport-function on Caché-Objects containing properties of type %integer, %numeric or %boolean, this properties are all automatically converted to Strings in the JSON-Output.

Is there a way to get around this type-cast?

Example:

Result with %JSONExport:

maxOrderable and maxReserveable are of type %integer, deliverable and assembly of type %boolean. All 4 properties are shown as quoted Strings.

0 11
0 433

Running Cache 2017.2.2.

I'm trying to make a REST API call in JSON format. When using the example in the class reference documentation the getJSON method in the %Net.Http class throws the error <METHOD DOES NOT EXIST> on a %Clone() method in the %LIbrary.DynamicObject class. I even changed the parameter to a JSON string to no avail. The code will then fail on the %Compose method (examples below). My workaround is to use the %Net.HttpRequest functionality. Is there another workaround to this?

0 2
0 227

Hello All,

I am compiling a REST Operation to call our hospital Administration system, following tutorials around the REST API's etc. First time we have integrated like this so not much knowledge around our hospital - hoping someone on here can help.

I have been using the JSONStreamToObject Method which is working as i expected, apart from trying to get a specific item in the example JSON Response as follows:

{"test":"abc","name":[{"use":"usual","family":"Matest","given":["Mia"]}]}

0 2
0 520

I am using studio 2015 version which does not have dynamic objects and I need to read xml and convert that to a json I have managed to come close to json string but with little difficulties .I need to be able to identify the root element and specify where to put braces between objects anyone with any idea is welcome he is my code so far

1 12
0 1.4K

Hey Community,

my Caché Version is 2013.1 and I can't update now.

I want to serialize a SQL Answer row into an Array filled with objects and then convert it to json.

Actually I use the following, which is very error prone when I have to do that often:

0 7
0 642
 

Hi,

I know there are several alternatives, but I would like to find the easiest & simpler ones to store data coming in Json format from post requests and also allowing me to do SQL queries.

I want to have a property called favouriteColors. I want to store a few colors, and I want to be able to do queries to get top favorite colors, etc... so not handling the list of colors as just a fixed string or fixed object.

1 4
0 467