FIrst of all thank you for your time in reading this question and writing a response,

We would need some help,

-> Our objective is to control which method is being used in the service: GET POST PUT

We have tried to understand the example REST Service: Demo.REST.DirectoryService

After that we have tried to create our own custom rest service,

please take a few minutes to examine the following code:

0 12
0 321

Hello,

First of all thanks for your time to read and reply,

We would need some help,

We have an ORM_O01 which has a NTE.3 with a Line Feed

Our Process converts the XML to ER7 using the ITB as follows:

set context.mensajeHL7 = ##class(ITB.HL7.Util.Convert).XMLToER7(hl7,.tSC,"2.5")

When we show the ER7 we observe:

INTE|1||Psa libre\X0A\ Indice psa

We have thought about the following solution, where mensajeXML is the XML representation of the ER7 shown:

0 1
0 371

Good day, developers!

The "apptools-admin" project is not only a set of tools for the administrator, but a platform for the rapid creation of a prototype of any solution.
For example, Photo Album, Music Player, and Personal Library all come together in a user-friendly treasure chest design.

Load http:// your-host:your-port/apptoolsrest/a/infochest

Change the path to your treasure files and start viewing, listening or reading from any convenient device: desktop, tablet or smartphone.

2 0
0 253

Hello everyone,

I have an issue with using "Open" function.

My goal is to execute a shell script with parameters like as:

/trak/FRXX/config/shells/transportIDE.sh "login|password|NOMUSUEL|PRENOM|NOMDENAISSANCE|1234567891320|199999999999999999999999|09%2099%2099%2099%2099|31%2F12%2F1999|242%20IMPASSE%20DES%20MACHINCHOOOOOOOOSE%20||99999|SAINT%20BIDULETRUC%20DE%20MACHINCHOSE|isc%24jhu|123456|123456798"" 2>&1"

But when some parameters are too long, I have a <NAMEADD> error.

0 4
0 298

Hello,

We would need some help,

Our aim is to send an image as binary data using a REST Service

Currently we do the following:

1 We get from the external system a binary image in our REST Operation

2 We encode it to Base64

set linea=""
    while (tResponse.Data.AtEnd = 0) {
        set linea = linea_$system.Encryption.Base64Encode(tResponse.Data.Read(57))
    }

3 We send it to the Process in a Response Message:

1 4
0 855

Hello,

We would need some help, please;

We would like to handle when we have a date with hours:

20201204090000

And when we have it without the hours part, as follows:

20201204

For the first case we used:

##class(Ens.Util.Time).ConvertDateTime(source.{ORCgrp(1).RXA:DateTimeStartofAdministratio},"%Y%m%d%H%M%S","%d/%m/%Y",,.tSC)

For the second one we wrote:

##class(Ens.Util.Time).ConvertDateTime(source.{ORCgrp(1).RXA:DateTimeStartofAdministratio},"%Y%m%d","%d/%m/%Y",,.tSC)
0 1
0 278
Question
· Jan 13, 2021
Handling Errors

I have a case where our EMR is sending data, but not all the values needed for the Ancillary are valued properly and causes that message to error/halt processing on the Ancillary system, not ideal but its what they do. I would expect them to still process the message except that 1 field, but they don't.

I want to add validation to make sure certain fields are valued correctly for the Vendor.

So I add some statements to take those items that don't pass this validation out to a batch file with headers.

0 9
0 734
Discussion
· Jan 10, 2021
Code Golf: Diamonds
To start the year let's have a round of CodeGolf!

You know the drill. Shortest solution wins.

Print a size ascending range of Diamonds using the numbers 1 to 9, ranging from size 1 to size N, each diamond separated by a blank line.

A size 1 diamond should look like this, a single centered 1:

         1

With the size N=9 diamond looking like this:

2 19
0 457

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

Hi,

I seem to be able to execute sqlproc using the convention defined here https://docs.intersystems.com/latest/csp/docbook/Doc.View.cls?KEY=GSQL_q... provided the package/folder is a single level. As, soon I have a nested folder structure I get an error while trying to execute this.

For instance,

select id, Utils.Users_getRole(id) roles from users.users

works fine while,

0 3
0 139

I have multiple files with different columns, first 9 values are fixed, so i want to ignore the first value, and next 8 values i want to combine into one value using ^ sign

Current Format

|||||||||||^^||||||^^|||||||||||||||||
|||||||||||^^||||^^|||||||||||||||||||||||
|||||||||||^^|||^^||||||||

Desired Format

^^^^^^|||^^||||||^^|||||||||||||||||
^^^^^^|||^^||||^^|||||||||||||||||||||||
^^^^^^|||^^|||^^||||||||

Reading each line from the file use below code.

0 11
0 734

Hi

I would like to create a new message of a particular type and append various segments programmatically. I have started with the following snippet. What I am currently finding difficult is to define a segment of a particular segment structure. I would like to append a pid segment of 2.3.1 to my message. I know I could you the importfromstring but I wanted to know whether there was a better way of achieving this.

0 2
0 542
Question
· Aug 3, 2020
INSERT OR UPDATE SQL

Hi, I want to INSERT a customerID and customerName to a table if the customerID does not exist. Or UPDATE if they've changed their name.
I've reviewed the documentation (https://docs.intersystems.com/irislatest/csp/docbook/Doc.View.cls?KEY=RS...) and have confused myself with the INSERT OR UPDATE statement. Rather than using two individual statements , is there a way to get it in one?

What I have at the moment doesn't do anything. In fact it errors.

0 3
0 437

Hello,

We would like to learn how would you approach this task.

We would need to check every day a set of folders which are outside our server (in fact we could see them as if they were "inside" the server), then we need to check for modified or created files in the last day, and move all the ones which match the criteria to just one folder in our server.

We have thought about doing the following:

1) Create a task to run it each day:

0 5
0 573

Hello,

We would need to iterate all over the OBXs list and get their OBX3 CE1 to determine if it is the lab result we need to send to the output system.

We wonder how could we achieve this in a foreach component inside a Bussiness Process.

We think we would need to use a foreach because of it is needed to generate a message, for each one of the OBX which have the OBX3 CE1 that the output systems uses for the lab results.

0 1
0 511
Article
· May 1, 2020 1m read
Code sample to concatenate JSON arrays

ObjectScript doesn't include any built-in method for appending one JSON dynamic array to another. Here's a code snippet I use that's equivalent to the JavaScript concat() method.

Call it with any number of arguments to concatenate them into a new array. If an argument is a dynamic array, its elements will be added. Otherwise the argument itself will be added.

5 2
2 658

Hi!

I believe the simplest is (to work with csv delimited by ";"):


set file = ##class(%File).%New( "data.csv" )
    set sc = file.Open( "R" ) 
    if $$$ISERR(sc) quit    ; or do smth

    while 'file.AtEnd {
        set str=file.ReadLine() 
        for i=1:1:$length( str, ";" ) {
            set id=$piece( str, ";" ,i ) 
            write !, id  // or do smth
        }
    }
    do file.Close()

Possible options:

different variants of error handling with sc code.

Embrace while loop into try/catch block.

And what's yours?

3 16
0 6.5K

The attached code package provides a simple implementation of a web service client that utilizes the USPS Shipping API to normalize an address.

This code requires the developer to obtain a USPS Shipping API user ID which can be obtained from the USPS shipping API website. The assigned User Id can either be passed into the web service call as a parameter or can be coded as a parameter into the Request object.

2 1
0 406

A customer is using Caché online backups and needs to automatically purge the cbk files with a scheduled task.

This is a wheel has been reinvented uncountable times already and I know somebody out there has a well written, extremely robust version that has already stood the test of time.

Does anyone have a nice routine/class/task for purging old Caché backup files?

0 10
1 1.5K

What if you could serialize/deserialize objects in whatever format: JSON, XML, CSV,...; attending different criteria: export/import some properties and not others, transform values in this or that way before exporting/importing,...; and all of this without having to change the class definition? Wouldn't that be great??

Well, perhaps it's a goal too ambitious to reach 100% but, exploring this idea, I've developed a bunch of classes that I thought it was good to share. If you want to test, change, modify or improve the code, or just take a look at it, you can do it here. There you'll find a more detailed explanation (see Readme.md)

Be aware, this is a proof of concept for myself done in spare times, sure it's not robust enough or it can be done much better... but, I was just playing...ok, I could just wait to the new JSON Adaptor (coming soon!) that sure is going to resolve much more scenarios in a cleaner way, but... meanwhile... :-) ...

9 4
4 2.3K
Question
· Feb 28, 2020
SQLCODE Error -400

I have a code block in a BPL. I have the below SQL and code. All variables have been declared and set. When I run the SQL, if there are no values returned, I get 100 for the value of SQLCODE when I perform the FETCH, which is correct. If values are returned, I get a -400 error when I perform the first FETCH. I've investigated, but cannot find the reason for a -400 error. Hoping someone out here understands this and knows what's wrong.

0 2
0 1.6K