Discussion
· Feb 2, 2022
Code Golf: Paired Opposites

You will receive a string of comma-separated integers whose elements have both a negative and a positive value, except for one integer that is either only negative or only positive, our challenge will be to find that integer.
As usual shortest solution wins.

Input

"1,-1,2,-2,3"

Output

3

3 has no matching negative appearance

4 34
0 682

DTL Transformations and GetValueAt/SetValueAt calls on HL7 messages will truncate any fields longer than 32K. To avoid this, the methods GetFieldStreamRaw and StoreFieldStreamRaw must be used when dealing with fields that might be larger than 32K. OBX:5 is a frequent example. These methods have some subtleties and must be used carefully.

This can't be done by simply dragging from left to right in a DTL. It must be done with a code action. Also, the StoreFieldStreamRaw call must be the last edit made to the segment because the segment becomes immutable after that.

10 6
6 2.4K

First of all thanks for your help and time

We would need to find inside PID:3 which one meets the following condition:

PID 3.4.1 = "CAC" and PID 3.5 = "JHN"

We have been investigating how could we do it

We have achieved to get single fields in a call request as follows:

request.GetValueAt("ORCgrp(1).ORC:OrderingProvider(1).IDNumber")

##class(Ens.Util.Time).ConvertDateTime(request.GetValueAt("PID:DateTimeofBirth"),"%Y%m%d","%Y-%m-%d")

1 2
0 355
Discussion
· Oct 8, 2021
Code Golf: Just add water...

Have you ever seen those vaccum compressed towels, that look like a pill and after you add water became a towel?

That's our challenge for today. As usual shortest solution wins.

Task

You will receive an integer number and you will return a new number where each digit is repeated a number of times equals to its value.

Input:

42

Output:

444422

Note:

3 11
0 425

Hello

I made for fun a bash script that creates csv files from a %GOGEN exported file.
%GOGEN, the utility for exporting globals for Cache 5.xx

First I thought it would be very simply with bash, but ...
- if I want a header in the csv file
- if you export with GOGEN more globals together not only one
- if I want a csv file for every global/indexes has the global ..

The simply bash script goes up 100 lines of code. If I will start again with this, I would use Python or Go, not bash.

Example:

For a EXPORTED.GLO file

0 5
0 661

Hello,

I'm experiencing a recurrent problem that I haven't found the way to solve, so I'm coming here with the hope somebody can give me a new approach.

To make it short: we are creating categories on-demand to be able to place the maximum numbers of workers in memory, avoiding the limits established by system categories. But from time to time, one of this creation fails and system is no able to start the queue. The error we are getting is:

0 1
0 213

A quine is a computer program which takes no input and produces a copy of its own source code as its only output.

Wikipedia.

How about a fun challenge?

The task is to write a quine in InterSystems ObjectScript. It can be a class, or a method, or a routine, or just a line to be executed in a terminal. You decide!

Here's some resources you might consider useful:

Hard mode: do not use source code access functions.

Here's my (extremely uninspired, I know) attempt:

Class User.Quine
{

/// do ##class(User.Quine).Test()
ClassMethod Test()
{
    set sc = ##class(%Compiler.UDL.TextServices).GetTextAsString($namespace, $classname(), .str)
    write str
}

}

It produces this output:

How many different ways of producing a quine are there in ObjectScript?

9 15
0 490
Question
· Jul 27, 2021
How To Pass Custom Class

I've created a custom class that extends to the standard HS.Message.PatientSearchRequest. Inside the custom class i just want to pass the data as input only.

But i am getting ERROR #6277: Type attribute, s01:AcoPatientSearchRequest, does not specify valid type for XML input tag: pRequest (ending at line 5 character 171)
</error>

I tried adding Parameter XMLIGNOREINVALIDTAG = 1; and

0 8
0 481

Hey everyone as you may know I am a beginner and I am kindly asking for some assistance in a problem I have been solving. The problem is that I am calling a user defined function within a procedure called occupiedseatsAdj and the compiler comes up with this error.

0 2
0 168
Question
· Aug 5, 2021
Convert hexadecimal to base64

Hello, first of all thanks for your time reading our question 💭

We would need to be able to transform a hexadecimal string to a base64 coded one. 🔄

To be specific, our use case is this:

1º We have our hexadecimal as follows:

4C5803040101020179C3913EC3BA7C4C580708010101021824584D4C

2º We convert it to ASCII:

LXyÑ>ú|LX$XML

using this online tool:

0 5
0 1.3K

Recently I wanted to get a list of all cached queries and their texts. Here's how to do that.

First create an SQL Procedure returning Cache Query text from a Cached Query routine name:

Class test.CQ
{

/// SELECT test.CQ_GetText()
ClassMethod GetText(routine As %String) As %String [ CodeMode = expression, SqlProc ]
{
##class(%SQLCatalog).GetCachedQueryInfo(routine)
}

}

And after that you can execute this query:

4 3
0 560

Hi all, I am new to IS Objectscript and I would appreciate some assistance regarding this.

I am trying to find out how to count the number of elements within a dynamic abstract object and I am having some trouble using the size method.

Here is the code below:

The key value pairs are originally in JSON and I would have converted it in to an object for use.

0 7
0 290

Hello,

First of all thank you for your time reading our topic

We would need some help from experienced people

We have a SOAP Service with more than 10 methods

Our aim is to include all classes being used by this SOAP Service, in a Studio project

The challenge is that there are plenty Data classes (which extends from (%SerialObject, %XML.Adaptor))

▶️ Is there a recommended way to include all project's classes in a Studio project?

0 1
0 156

Hi Team,

I have a requirement to delete the Ensemble interfaces , as per User request. I would like to write a routine for that and once I execute, it should remove the interface components through code.
Could you please provide code samples for the following actions ?

  • Deleting an individual rule from a rule class
  • Deleting a class from Ensemble
  • Deleting a Host (Service/Operation/Process) from the Production.

Appreciate the help.

Thanks,

Purushothaman.T

1 6
0 295

Hello everyone,

I have a question, I am trying to use xecute command, but something wrong happen when i was using the command, and i don't know why hahahaha.

I created a file .mac with this code:

label(test) public{
       set routine="variable"
       set call="write routine,!"
       xecute call
       quit
}

But when i run the command, show me this message error:

<UNDEFINED>label+3^tstFJR3 *routine

After that i changed the code to:

0 4
0 202

I have a requirement to update the Ensemble Host Settings Programmatically. Mainly the "AlertOnError,QueueCountAlert,QueueWaitAlert,InactivityTimeout" settings.

I used Ens_Config.Item (persistent) class to get the settings (list object) and then update it. But for some of the Business Host's, I dont see the above settings in the table, but present in Settings of that particular Host in Ensemble Management Portal. So my logic is not working.

1 11
0 486
Question
· Apr 20, 2021
Change DefaultPort Ensemble

Hello,

First of all thanks for your time reading this question,

We would need some help,

The challenge is that our Ensemble does not start.

If we Launch Ensebmle we see:

When we open: C:\InterSystems\HealthShare_2\mgr\cconsole.log

We read:

0 3
0 145
Question
· Apr 15, 2021
Return ACK from Process

Hello,

We would need some help, please

First of all thanks for your time used reading this question

Also, thanks for your patience

We need to generate an ACK in a Process and return it to the Service to reply

We have currently written a code block with:

0 4
0 413

When you have more than ten thousand users in your database, it becomes time-consuming and inconvenient to assign group access rights through the standard IRIS interface. In this artilce I want to introduce you an application to automate this process.

I’ll show you how to assign and change the role lists for the users, selecting them by context, and I will also show you how to expand this application’s functionality. you know how to apply your work as an administrator and developer to the new features of the well-proven apptools software complex. With the addition of an adminLTE template, you can now quickly and easily create interface interactions for any entity and many functional modules.
The goal while developing this toolkit is to write as little JavaScript as possible as well as transfer and implement all the dynamics as much as possible in the ObjectScript.

4 0
0 529