JSON

Syndicate content 16 

Hi Dev Community,

My team is currently working on a project where we need to post pdf documents to a 3rd party REST API.

The API specifies a field in the JSON request message to contain the 'physical content' of the file as an array of bytes, example of the JSON request as follows - data truncated for readability purposes:

{
    "CaptureSource":2,
    "RecipientID":"ID34",
    "Document": {
        "Guid":"5D847A4E9CC1485382DC4A5F5DC80D6C",
        "EventDate":"2019-01-14T13:23:46",
        "FileExtension":"pdf",
        "FileContent":"JVBERi0xLjQNCiXi48/TDQoxIDAgb2JqDQogIDw8DQogICA......"

      },
    "ActionRequired":false,

1 1
0

answers

0

comments

61

views

0

rating

Hi,

we have Angular solution and Cache server. We need to have separate users and sessions on same browser (laptop, table etc) for every user and for one user with many connections.

Thought this was resolved, but unfortunately not.

-----------------------------------------------------------------------------------------------------------------------

I got the code away from here, because it was some how ok.

The session on server mixed, but no any more, thanks our folk and local engineer's tools :)

We had some silly GROUP BY ID %ISCMgtPortal in WebApplication settings and even we had use session Cookie, IE added some cookie., but not any more after they took that setting away.

Last comment 4 September 2018
0 1
0

answers

157

views

0

rating

How can I prevent large number truncation when using the DynamicObject and DynamicArray classes to create JSON in objectscript and then parsing the result in javascript. Are there any global settings that configure the output when using these classes?

 

I am looking at converting to the new DynamicObject and DynamicArray classes to build JSON. Our current (homegrown) JSON library forces string representation of numbers too long because of errors we were seeing with long numbers being truncated on the client, I am hoping to accomplish the same with the new classes.

 

USER>set longNum = 1234567890123456789
 
USER>w longNum
1234567890123456789   //valid cache  number, 19 digits
USER>s arr = [(longNum)]  
 
USER>w arr.%ToJSON()
[1234567890123456789]   //Valid JSON, however I would like this to be a quoted string so it can be parsed in javascript

//Parsed in javascrip

Last comment 9 December 2016
0 3
0

answers

394

views

0

rating

My organization has been tasked with parsing raw EDI 271 messages into JSON strings in order to feed a downstream application.  A few key details about the task:

  • The raw EDI 271 will be coming across as a standard format from a single outbound upstream system
  • The EDI 271 messages adhere to the 5010 standard
  • We do not need EVERY field from the EDI message, only a select number of fields.  However some of the fields we need (e.g. coverage details) are dynamic in size and will be variable in # of segments both on the EDI side as well as the receiving JSON side.
  • We will be looking to build one incoming business operation for the stream of 271 messages which will then be parsed into Medicare and non-Medicare
  • The JSON output has a static format per class of payor (sample can be referenced below for both Medicare and non-Medicare payors):

Medicare Example JSON

Last comment 18 October 2016
0 0
0

answers

1173

views

+ 1

rating

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:

{
        "aboolean":"true",
        "notanumber":28001
}

But I want this:

{
        "aboolean":true,
        "notanumber":"28001"
}

 

Help please !

Last comment 17 February 2016
0 6
0

answers

598

views

0

rating

I'm revisiting some older projects that can benefit from the new JSON support and dynamic object capabilities in 2016.1 FT / 2016.2 FT. (Particularly, some of the really new features in the latest 2016.2 FT.)
For the particular thing I'm working on, it would be very handy to be able to merge objects, similarly to https://api.jquery.com/jquery.extend/. The closest thing I've found so far (in 2016.2 only) is:

Set o1 = {"a":1,"c":2}, o2 = {"b":1,"c":1}
Write "o1: ",o1.$toJSON(),!
Write "o2: ",o2.$toJSON(),!
Write !
Write "Merge two objects into a third (new) object, with values from o2 overwriting those from o1 when property names are shared: ",!
Set o3 = o2.$compose({"returnValue":o1.$clone()})
Write "o3: ",o3.$toJSON(),!
Write "o1: ",o1.$toJSON(),!
Write "o2: ",o2.$toJSON(),!
Write !

Last comment 12 February 2016
0 4
0

answers

241

views

0

rating