JSON

Syndicate content 16 

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

Last answer 22 December 2016 Last comment 20 December 2016
0 0
474

views

0

rating

Is there any way that I can check the native type of an object script variable? (similar to the typeof check in javascript)

 

I see that the DynamicArray class uses the type of the variable for its output, I would like to do something similar when I receive a value as an argument to my method.

USER>s var1 = 123  //No quotes, number type
 
USER>s var2 = "123" //quotes, string type
 

//DynamicArray can tell the difference
USER>s arr = []
 
USER>d arr.%Push(var1)
 
USER>d arr.%Push(var2)
 
USER>w arr.%ToJSON()
[123,"123"] //first value is output without quotes, second value is quoted

 

Last answer 9 December 2016
0 2
0

comments

258

views

+ 1

rating

I'm working on a REST service which will include a binary stream as a request property. I'm currently encoding the stream as BASE64 and passing it as a string value, but I was wondering if there is anything in the Caché JSON support that may be a better fit for encoding this data? Thanks Chris

Last answer 7 November 2016 Last comment 14 November 2016
0 0
403

views

+ 1

rating

Hi, all.
I have CSP application and it needs to get and process data from ajax request with json-content. JSON can be very big.
In this case:
TRY
{
Set RequestObj = ##class(%Object).$fromJSON(%request.Content.Read())
} CATCH(Exception) {
Set Status=Exception.AsStatus()
}
I get just part of getting JSON and validate error in $fromJSON.
If I try to read it all in cycle:
TRY
{
While (%request.Content.AtEnd = 0) {
Set Data=Data_%request.Content.Read()
}
Set RequestObj = ##class(%Object).$fromJSON(Data)
} CATCH(Exception) {
Set Status=Exception.AsStatus()
}
I get error.
Increasing of MaxLocalLengt isn't solution.
Is there some good way parse big JSON?

Last answer 22 August 2016 Last comment 25 August 2016
0 1
553

views

0

rating