Announcement Angelo Bruno Braga · Apr 25, 2022

Hi Community,

Our 1st InterSystems Portuguese Tech Article Contest ended. We received several interesting content in: 6 amazing articles 🔥

A great thanks to all that participated on our competition !

And now it's time to announce the winners .... 

Meet the winners of the 1st InterSystems Portuguese Tech Article Contest and their amazing articles:

5
0 271
Question Nezla · Apr 27, 2022

Hi guys,

We have created a utility to allow users to create a System task for a list of items the same way it’s done via SMP (attached below), the problem is that there may items and those systems tasks will grow a maybe exceed a couple of thousands so :

  • First, what the maximum of scheduled system tasks we can have ?
  • Then, is there a better way we can do this without having a big list of system tasks ?
  • FYI, the system should be able to have a different scheduling times & intervals for each item

ClassMethod SetupTask(name As %String, descr As %String, code As %String, nspace As %String,

1
0 291
Question Michael Lundberg · Apr 26, 2022

Hello

We have a solution with an EnsLib.EMail.InboundAdapter as services that scan a mailbox on incoming mail with attachments.

When a new email arrives, the service sends the request (with a property %Net.MailMessage) to the process. In the process, we try to loop through and retrieve part 2 which we assume is the file.

set Part = pRequest.Mail.Parts.GetAt (2)

We can read out the file name:
Set FileName = Part.FileName

But how, and is it possible, to save the attached file to disk drive?

I do not see any method that supports that in that class.

Or must we use% Net.POP3 to receive and store the file?


G

4
0 422
Question Nezla · Apr 26, 2022

Hi guys,

I have a %Time filed with (Format=1) to allow showing hh.mm.ss and the field is showing fine in display mode eg:

 

it should show 00:07:30  but the seconds are cut off from it as below :

any ideas pls?

thanks

8
0 329
Question Nicky Zhu · Apr 25, 2022

Hi guys,

How to find out the number of active connections (including SQL, http, tcp and all remote connections) of an IRIS instance? A core based license is used.

I've checked the document and find %SYS.ProcessQuery.

I'm currently using this sql:

select count(distinct Pid) From %SYS.ProcessQuery
where ClientIPAddress is not null
and ClientIPAddress <> '127.0.0.1'
and ClientIPAddress <> 'localhost'
and IsGhost = '0'

Is it accurate or do we have a better option?

Thanks in advance.

4
0 453
Question Kevin McGinn · Apr 26, 2022

I wrote this COS script that I can run in a terminal session to get a view of the cache users:

set hdl = ##class(%Library.ResultSet).%New()
set hdl.ClassName = "Security.Users"
set hdl.QueryName = "Detail"
set sc = hdl.Execute()

while hdl.%Next() { do hdl.%Print() }

I know this is a bit rudimentary  but this seems to be the correct script to get users. But looking at one of the clients AIX based instances there are about 3900 users. But this script returns no results. In fact, after the execute if I issue "w hd.%Next()" it returns 0. I look at "Do DisplayError^%apiOBJ(sc)" and the message is:

ERROR

4
0 318
Question Timothy Leavitt · Apr 25, 2022

I have a .woff2 file I'm trying to serve over CSP.

If I set:
^%SYS("CSP","DefaultFileCharset")="UTF8"

Then it "just works" - but I'd rather not do something so heavy-handed/instance-wide, on principle. (This is for something that will ultimately be published on the Open Exchange.)

A more granular option, it seems, is described in the %CSP.StreamServer class reference:

if you need to define settings per extension (in uppercase) you can use ^%SYS("CSP","MimeFileClassify",$zcvt(ext,"U"))=$listbuild(type,bin,charset) where:

  1. type - Content Type value, e.g. 'text/javascript'
  2. bin - 1 if this is binary
2
0 366
Question Tom Bruce · Apr 25, 2022

Hi everyone, how do you run multiple quires?

I have tried couple of different ways, but not working.

 SET sql = 2

    Set sql(1) = "UPDATE QUERY"

    Set sql(2) = "UPDATE QUERY"

    Set sqlStatement=##class(%SQL.Statement).%New()

    Set sc1=sqlStatement.%Prepare(.sql)

    If $$$ISOK(sc1)     {

       Set tResult = sqlStatement.%Execute()    

    }

    else{

        $$$LOGERROR("Failed")

    }

4
0 1921
Article Nicholai Mitchko · Apr 12, 2022 7m read

Programmatic Production Access

To Programmatically Edit Productions (interfaces) you can use a combination of the interoperability apis and SQL queries.

Current Namespace

At a high level, it is important to know the namespace and production you are working in at the moment.

// Object script 
// The active namespace is stored in this variable
$$$NAMESPACE 
// Print namespace
Write $$$NAMESPACE
# Python
import iris
# The active namespace is returned from this method
iris.utils._OriginalNamespace()
# Print namespace
print(iris.utils._OriginalNamespace())
>>> DEMONSTRATION

Current Production (active

3
4 1077
Question Yone Moreno · Apr 25, 2022

Hello, good morning

First thank you for your time in reading and answering our question.

We have been reading, inquiring, researching about how to make multiple dispatches from 1 Process of type "DICOM.BP.QueryProcess" to several target Operations.

We need some help to further develop this use case, and some advice 🧭, examples or recommendations

Currently we are using the basic example, the one that includes Ensemble, and this has DICOM Process which has a property by which from Web Production we write to which Operation it sends our FIND/QUERY/RETRIEVE messages:

The circuit is shown graphically:

Be

1
0 323
Question Alex Cashell · Apr 22, 2022

I have a linked procedure class and SQL gateway setup and I can't seem to get any response, status or error from using the stored procedure, I think it must be something big I'm missing to not even get a status.

Can someone see what my problem is please, any help would be very much appreciated.

Class generated by linked procedure wizard:

Include %occInclude /// 
Class dbo.MrnLookup [ Not ProcedureBlock ]
{ ClassMethod MrnLookup(pp01 As %String(MAXLEN=8), ByRef mrn As %String(MAXLEN=20)) As %Integer [ ProcedureBlock = 1, ReturnResultsets, SqlName = MrnLookup, SqlProc ]
{
    if
1
0 315
Question Scott Roth · Apr 22, 2022

A question has come up that I am not finding the answer for....Does the daily purge process re-index EnsLib.HL7.SearchTable or other SQL tables? In looking at the purge process documentation I am not seeing anything that mentions EnsLib.HL7.SearchTable.Do we have to manually constantly re-index tables that we create?For example I created another search table based off of EnsLib.HL7.Search table, will I need to constantly watch this as it grows?How do tables get index, is there some kind of mechanism that automatically does it, or are we responsible for indexing tables ourselves?

1
0 363
Question Michael Davidovich · Apr 22, 2022

I am referencing the documentation here: https://docs.intersystems.com/ens201815/csp/docbook/DocBook.UI.Page.cls…

I have embedded html within a <script language="cache" runat="server"> block.  Within that I'm defining and using a macro, but it doesn't display at all. Something like:

<script language="cache" runat="server"> 
s stringData=obj.data 
#Define displayString stringData 
&html< 
<p>$$$displayString</p> 
> 
</script>

If I 'w $$$displayString' outside of the embedded html, the string is written to the page as expected so I know the Macro is being

2
0 359
Question Andy Stobirski · Apr 21, 2022

Hi

I'm using an embedded SQL statement with a a cursor-based Embedded SQL query that uses host variables in the where clause, however, what I'm doing doesn't seem to work. Can anyone help?

The code I'm using is

set tMessageName = "AssessmentsMessage"
set tIdentifier = "SectionCode" 
set ID = 0
&sql(
    Declare IDs Cursor For 
    select  %ID
    INTO :ID
    from GMECC_DocmanConnect_Tables.ParisConnecMessagetSettings
    Where  MessageName = :tMessageName
    and Identifier = :tIdentifier
)

&sql(Open IDs) For {
   &Sql(fetch IDs) If SQLCODE Quit // SQLCODE = 100, now rows found
15
0 439
Question Megumi Kakechi · Apr 18, 2022

How can I get the Python error object(exception return value) from the embedded python method?
I have an embedded Python method like as below;

ClassMethod test2() As XXX [ Language = python ]
{
   try:
    a=1/0
   
   except Exception as ex:
    print("Exception: %s" % str(ex))
    return ex
}

I'm not sure what kind of return type to set for this classmethod.   "As XXX" <--
I tried to set "ClassMethod test2() As %Exception.PythonException [ Language = python ]"
However, I got the following return value when I run the method in the IRIS terminal.

USER>set st=
9
2 953
Question Kevin McGinn · Apr 15, 2022

When looking at the "Current License Usage Summary" web page, there is a line for both local and distributed "Maximum Connections". I have scrutinized every class that seems reasonable to contain this information but have found nothing that matches the values on the web page. I do not believe these are related to license specifically though I did review all of the potential attributes of the license related classes to no avail.

2
0 359
Article Victor Sanner · Apr 20, 2022 2m read

Hi,

I have wrote an article about how to install the intersystems cache driver in a Docker container, and then deploy it using Azure Functions: 

How to run a (Python) Azure Function as a Docker container & Deploy it using Bicep | Victor Sanner
This might be useful to others, especially the dockerfile which I have copied below. This builds a debian docker container and installs the Intersystems Cache driver, which python can then use :)

To enable ssh & remote debugging on app service change the base image to the one below
# FROM mcr.microsoft.com/azure-functions/python:3.0-python3.6-appservice
0
2 706