Whenever I insert a decimal value with trailing zero(ex:12.0000) value in my JSON object dynamically through %Set method. It truncates the trailing zeros. However If I use literal constructors { } It working as expected. So, In my case the JSON will be generated dynamically. I can't go with "Curly Bracket { } " and the JSON schema not string as well. Is there any way to fix this?
I'm doing a REST service. A method has as body parameter a JSON corresponding to a class A.
In my production I have class A so that I retrieve the parameters using a dynamic object, such that:
Set body = ##class(%DynamicObject).%FromJSON(%request.Content)
Set myObjectA = ##class(A).%New()
Set myObjectA.Id = body.Id
Set myObjectA.Name = body.Name
Set myObjectA.Date = body.Date
Set myObjectA.Salary = body.Salary
I would like to know if I can avoid doing the manual mapping, doing a casting, since I am sure that FromJSON will return a class A. Something like this:
I am working on my first REST operation to send a API Request to an internal server within our Network. I have finally got past the point of being able to connect using a SSL/TLS Configuration, but I am getting a ERROR <Ens>ErrHTTPStatus: Received non-OK status 403 from remote HTTP server: 'HTTP/1.1 403 Forbidden'.
We recently had an issue where we weren't able to parse a JSON HTTP request, but the issue went by unnoticed. We also did not have a trace of what the raw HTTP request was that we couldn't parse. I'm looking at improving our this by: Tracing the raw request using $$$TRACE
Raising an alert which will hit our Ens.Alert router which will compose and send an email
Hi, I'd like to ask if it is possible to use an arbitrary JSON as a DTL source. Can the IRIS DTL editor parse JSON of arbitrary structure and display it as a tree?
As it says in documentation %ZEN.Auxiliary.jsonProvider been deprecated. We been using it's functions like %ConvertJSONToObject, WriteJSONFromObject etc. Is there any replacement?
I'm trying to figure out why I'm unable to iterate through a dynamic array and access the nested objects.
Using the NHS PDS FHIR API in the NHS sandbox environment, I'm querying the PDS endpoint using a sample NHS Number to retrieve a patient's demographics. My Business Operation reads the response data and passes it back to my Business Process where I intend on iterating through certain nested objects. The data present in these nested objects will decide what happens next in the process.
I am playing around with trying to make an Epic REST API call from an operation, and from what I understood because the request has to be sent as POST, I need to send the request as JSON. However when I try taking the request and running %ToJSON against it for the payload to be created I am getting an error...
Okay, we've got a quite useful way to very easily Import and export our objects as JSON, similar to what we already had before for XML.
So, It's a %JSON.Adaptor. But the issue here I faced with, working with Stream properties.
I have an example, when I generate an object, with stream binary stream properties. Export and Import the same, but getting the different resulting objects, depends on the original size of streams.
Thank you very much for reading the doubt and above all thank you very much for answering.
Given the following use case:
If we have a Destination Service that through a HTTP GET by REST gives us a certain JSON response, where it should be noted that it is a list of objects where each object in the list does NOT have a key:
I'm trying to sign some custom JWT with x.509 certs but running into a problem with the signed JWT containing some information I need in the JOSE header.
Is there a way to get the "X5C:[]" header included in the signed JTW? IS this as easy as setting something like the following
I am new to ensemble development, Can anyone share me few basic Concepts which will be helpful for Converting JSON message to other message types like HL7,XML
I am trying to read binary data from HTTP Request Stream and build a Dynamic Object with multiple properties. I am getting MAXSTRING error with this code:
Class pbarton.test Extends (%RegisteredObject, %JSON.Adaptor)
{
Property Version As %String;
}
The Version property could be either a string or a number in the JSON source data. If it's a string, importing it will succeed. If it's a number, importing fails.
Hello, I want to show a fellow DC member how to convert JSON file into HL7 message. I personally do not work with HL7. I set up a production with EnsLib.File.PassthroughService. It passes Ens.StreamContainer to BPL process. I call a DTL to transform StreamContainer to HL7 message. I run into an error:
ERROR <Ens>ErrBPTerminated: Terminating BP JSON2HL7 # due to error: ERROR #5035: General exception Name 'Parsing error' Code '3' Data '' > ERROR #5035: General exception Name 'Parsing error' Code '3' Data ''
The idea is that you can post a bundle to a FHIR server with a set of resources. And you can send it as a transaction, so only all the resources will be published or neither.
E.g. I send a bundle of two resources: patient and its observation.
The observation resource should reference an existing patient. But it probably doesn't exist yet on the server and goes within the same bundle.
For this purpose there is a way to have a temporary id in the bundle, to let resources reference ids.
I have a compactJWE that I want to decrypt using a key. I read the key from a .pem file and create a JWK with "RSA-OAEP" algorithm. I have the code below in a routine (.mac) file.
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.
Is there a way to read JSON and transform it (in DTL) by using a VDOC of this JSON (without transform it to internal message) like I can do with HL7 or XML?
If it possible, I guess that I should have a schema of the JSON so the second question is how to build a schema for JSON and load it to the IRIS?
I know json does not impose any order, but for readability I would like to insert a json property at a specific location at the start of a %DynamicObject, not at the end. Is there a known way to do that (other than string manipulation)?