#Tips & Tricks

12 Followers · 325 Posts

Pieces of experience in InterSystems Technology which solve some particular problem in elegant or unusual way.

New
Article Alyssa Ross · Feb 20 6m read

One objective of vectorization is to render unstructured text more machine-usable. Vector embeddings accomplish this by encoding the semantics of text as high-dimensional numeric vectors, which can be employed by advanced search algorithms (normally an approximate nearest neighbor algorithm like Hierarchical Navigable Small World). This not only improves our ability to interact with unstructured text programmatically but makes it searchable by context and by meaning beyond what is captured literally by keyword.

In this article I will walk through a simple vector search implementation that Kwabena Ayim-Aboagye and I fleshed out using embedded python in InterSystems IRIS for Health. I'll also dive a bit into how to use embedded python and dynamic SQL generally, and how to take advantage of vector search features offered natively through IRIS.

0
0 123
New
Article David Hockenbroch · Feb 18 7m read

In the previous article, we examined how we can use the %CSP.Request and %CSP.Response classes to test a REST API without having the API fully set up and accessible across a network with an authentication mechanism. In this article, we will build on that foundation to perform some simple unit testing of one of our REST API methods.

The unit testing framework requires a couple of setup steps before we can use it. First, we have to ensure that the unit testing portion of the management portal is enabled so we can review the results of our tests. It is located under System Explorer > Tools > Uni

0
0 53
Article Kurro Lopez · Feb 21, 2018 1m read

Hi all,

I've created a method to calculate the age of a person, or the age of a process, contract or other stuff as you want.

/// Calculate the age from date of birth and other date (by default shoud be today).
/// <b>dateOfBird</b> Date of birth in cache format. ie. $ZDH("1972-01-01",3)
/// <b>day</b> Date to calculate to. ie: $H
ClassMethod AgeAt(dateOfBirth, day) As %Integer{
    quit:dateOfBirth=""
    quit:day=""
    
    set yeardob=$SYSTEM.SQL.DATEPART("year",dateOfBirth)
    set yearday=$SYSTEM.SQL.DATEPART("year",day)
    
    set years=yearday-yeardob
    kill yeardob,
2
0 1887
New
Announcement Ronnie Hershkovitz · Feb 11

Hi Community,

We're pleased to invite you to the upcoming webinar in Hebrew:

👉 Debugging InterSystems IRIS & Health Connect: From VS Code Breakpoints to Interoperability Traces 👈

📅 Date & time: Feb 18th, 3:00 PM IDT

 

When production issues arise, speed and precision matter. This webinar is a practical, tool-driven walkthrough of debugging in InterSystems IRIS (including IRIS for Health) and Health Connect - starting with code-level debugging in VS Code and extending into platform and interoperability diagnostics. We will cover core logging as well as tracing techniques. Attendees will l

0
0 40
Article Ben Schlanger · May 7, 2025 4m read

Here at InterSystems, we often deal with massive datasets of structured data. It’s not uncommon to see customers with tables spanning >100 fields and >1 billion rows, each table totaling hundred of GB of data. Now imagine joining two or three of these tables together, with a schema that wasn’t optimized for this specific use case. Just for fun, let’s say you have 10 years worth of EMR data from 20 different hospitals across your state, and you’ve been tasked with finding….
   every clinician within your network
      who has administered a specific drug
         between the years of 2017-2019
    





3
6 378
Article David Hockenbroch · Jan 7 7m read

There are numerous excellent tools available for testing your REST APIs, especially when they are live. Postman, various web browser extensions, and even custom ObjectScript written with %Net.HttpRequest objects can get the job done. However, it is often difficult to test just the REST API without inadvertently involving the authentication scheme, the web application configuration, or even network connectivity. Those are a lot of hoops to jump through just to test the code within your dispatch class. The good news is that if we take our time to understand the inner workings of the %CSP.REST class, we will find an alternative option suited for testing only the contents of the dispatch class. We can set up the request and response objects to invoke the methods directly.

5
7 265
Article Tani Frankel · Dec 24, 2025 2m read

You send an HTTP request and get back an HTTP error but with an HTML error page which you didn't expect... what's happening?... 🤔

Specifically for example, perhaps you tried to READ a FHIR Resource (e.g. /Patient/123) and you get back a 404 error page, even though with other Patient IDs, you get back the Resource payload, so "the page" definitely does exist... why should you be getting a 404 error page? 🙄

0
0 110
Article Tani Frankel · Dec 22, 2025 1m read

Looking at my database I see I have a very big ^rINDEXSQL global? Why is that? 😬

In the Management Portal SQL page, under "SQL Statements" I see a 'Clean stale' button - what does this do? 🤔

In the list of Statements some have a 'Location' value and some don't? How is that? 🤨

0
1 86
Article Megumi Kakechi · Dec 18, 2025 1m read

InterSystems FAQ rubric

If you try to kill a global that is mapped at the subscript level from the top node, you will get a <SLMSPAN> error and it will not be deleted. This is because the kill command for subscript-level mapped globals cannot be used across mappings.

// Suppose subscript-mapped globals exist in different databases, as shown below:^TEST(A*~K*) -> database A
^TEST(L*~Z*) -> database B

// Trying to kill from the top level will result in a <SLMSPAN> error.
NAMESPACE>Kill^TEST
<SLMSPAN> <- This error is output.

To delete only the global in the current namespace (databas

enlightened

0
0 75
Article Kurro Lopez · Dec 18, 2025 2m read

Hi everyone.

I'm going to give you a quick tip on how to implement an AI agent to search the Intersystems documentation integrated into Teams.

Yes, I know the documentation page has its own AI search engine and it's quite effective, but this way we'd have faster access, especially if Teams is your company's corporate tool.

You can also create another AI agent to search articles published in the developer community (which also has its own integrated AI search engine).

0
1 74
Article Hiroshi Sato · May 16, 2024 1m read

InterSystems FAQ rubric

Too run SQL in Terminal use $system.SQL.Shell().

Please refer to the sample below.

SAMPLES>do $System.SQL.Shell()
SQL Command Line Shell
---------------------------------------------------- The command prefix is currently set to: <>.
Enter q to quit, ? for help.
SAMPLES>>select * from Sample.Vendor
1. select * from Sample.Vendor Vendor Balance Contact DaysClear DiscDays DiscRate LastInvDate LastPayDate MinPayment Name NetDays PayFlag TaxReportingAddress_City Address_State Address_Street Address_Zip
: *If you press Enter without entering anything on the first line, it will
6
0 579
Article David Hockenbroch · Nov 24, 2025 4m read

Inevitably, you will eventually need to move your code up from one version of IRIS or Cache to a more recent version of IRIS. There are a few good steps you can take to set yourself up for success in that process.

Read Documentation Carefully

Before you move anything you should check out the IRIS documentation page for many useful resources on changes made to various versions of IRIS. If you are upgrading through multiple versions, you will want to check on the documentation for all of them, not just the version to which you will upgrade. For each version, if you click on the Maintenance Rel

0
0 199
Article Andrew Sklyarov · Nov 8, 2025 4m read

When I started my journey with InterSystems IRIS, especially in Interoperability, one of the initial and common questions I had was: how can I run something on an interval or schedule? In this topic, I want to share two simple classes that address this issue. I'm surprised that some similar classes are not located somewhere in EnsLib. Or maybe I didn't search well? Anyway, this topic is not meant to be complex work, just a couple of snippets for beginners.

0
0 115
Article Tomoko Furuzono · Nov 6, 2025 2m read

InterSystems FAQ rubric

When exporting using the Export() method of the %Library.Global class, if the export format (fourth argument: OutputFormat) is set to 7, "Block format/Caché block format (%GOF)," mapped globals cannot be exported (only globals in the default global database of the namespace are exported). To export mapped globals in "Block format/Caché block format (%GOF)," specify the database directory to which you want to map them in the first parameter of %Library.Global.Export().

An example of execution is shown below. 

 set DB = "^^c:\InterSystems\Cache\Mgr\Test\"  ; "^^\<path
0
0 114
Article Timothy Scott · Feb 28, 2025 7m read

High-Performance Message Searching in Health Connect

The Problem

Have you ever tried to do a search in Message Viewer on a busy interface and had the query time out? This can become quite a problem as the amount of data increases. For context, the instance of Health Connect I am working with does roughly 155 million Message Headers per day with 21 day message retention. To try and help with search performance, we extended the built-in SearchTable with commonly used fields in hopes that indexing these fields would result in faster query times. Despite this, we still couldn't get some of these queries to finish at all.

1
8 297
Article Andrew Sklyarov · Nov 2, 2025 7m read

Over time, while I was working with Interoperability on the IRIS Data Platform, I developed rules for organizing a project code into packages and classes. That is what is called a Naming Convention, usually. In this topic, I want to organize and share these rules. I hope it can be helpful for somebody.

 

Disclaimer: This guide is a good fit for Interoperability projects. When you have integrations, data flows, when you use IRIS for ETL processes, etc. Overall, when your code is combined with Productions. If you are using the IRIS Data Platform just as a backend, for example, the project str

4
4 162
Article Arsh Hasan · Oct 27, 2025 1m read

I was facing the same issue as Jerry faced when connecting IRIS to SQL server. My ODBC connection is configured to authenticate via windows authentication.

Configure IRIS ODBC connection with Windows authentication using a
 

How I fixed it for myself?

Root cause

  • The SQL Server DSN was set to Windows Integrated Authentication.
  • IRIS opens the ODBC connection via irisdb.exe, which runs under the IRIS Windows services’ logon account.
  • My IRIS services were running as LocalSystem, so SQL saw the machine account<ORGNAME>\<ASSETID>$. SQL had no login for that identity → 18456 / 28000 “Login fa

0
0 81
Article Evgeny Shvarov · Feb 13, 2022 2m read

Folks!

Recently I found several one-line long ObjectScript commands on DC and think that it'd be great not to lose it and to collect more!

So I decided to gather a few first cases, put in one OEX project, and share them with you!

And here is how you can use them.

1. Create client SSL configuration.

set $namespace="%SYS", name="DefaultSSL" do:'##class(Security.SSLConfigs).Exists(name) ##class(Security.SSLConfigs).Create(name)

Useful if you need to read content from an URL.

Don't forget to return to a previous namespace. Or add 

n $namespace

before the call. Once you go up in the stac

23
8 1320
Article Kurro Lopez · Oct 23, 2025 1m read

Hi all,

This is a quick tip about how to use case insensitive URL in REST API.

If you have a class that extends from %CSP.REST and Ens.BusinessService, to create a REST API service, and you have defined your WebApplication in lowercase

XData UrlMap [ XMLNamespace = "http://www.intersystems.com/urlmap" ]
{
<Routes>
    <Route Url="/user" Method="POST" Call="User"/>
    <Route Url="/login" Method="POST" Call="Login"/>
</Routes>
}

Only accepts the url in lowercase, i.e. http://myserver/myproduction/user

If you have any uppercase character, the url doesn't work. http://MyServer/MyProd

2
0 113
Article Pietro Di Leo · Nov 16, 2023 5m read

Introduction

Since InterSystems has recently announced the discontinuation of support for InterSystems Studio starting from version 2023.2 in favor of exclusive development of extensions for the Visual Studio Code (VSC) IDE, believing that the latter offers a superior experience compared to Studio, many of us developers have switched or are beginning to use VSC. Many may have wondered how to open the Terminal to perform operations, as VSC does not have an Output panel like Studio did, nor an integrated feature to open the IRIS terminal, except by downloading the plugins developed by InterSystems.

10
12 2359
Article Megumi Kakechi · Oct 2, 2025 2m read

InterSystems FAQ rubric

The ^%GCMP utility can be used to compare the contents of two globals.

For example, to compare ^test and ^test in the USER and SAMPLES namespaces, it would look like this:
*In the example below, 700 identical globals are created in the two namespaces, and the contents of one of them is changed to make it the detection target.

USER>kill^test
USER>for i=1:1:100 { forj=1:1:7 { set^test(i,j)="Test"_i } }
 
USER>zn"samples"// change namespace to SAMPLES
SAMPLES>kill^test
SAMPLES>for i=1:1:100 { forj=1:1:7 { set^test(i,j)="Test"_i } }
 
SAMPL
0
1 122
Article Kurro Lopez · Sep 29, 2025 13m read

I am truly excited to continue my "InterSystems for Dummies" series of articles, and today, we want to tell you everything about one of the most powerful features we have for interoperability.

Hey, even if you have already had a go, we plan to take a really close look at how to get the most out of them and make our production even better.

2
5 289
Article Megumi Kakechi · Sep 25, 2025 2m read

InterSystems FAQ rubric

One way to optimize query performance is to use query parallelism on a per-query or system-wide basis (a standard feature).

This is a technique for dividing the execution of a particular query among processors on a multi-processor system. The query optimizer will execute parallel processing only if there is a possibility of benefiting from parallel processing. Parallel processing is only applicable to SELECT statements.

Note that the number of parallel processes cannot be specified, as it is automatically adjusted according to the number of CPUs. You can check the cu

0
0 100
Article Victoria Castillo · Mar 19, 2024 5m read

I have been walking through this with a few team members and as such I thought there might be others out there who could use it, especially if you work with HL7 & Ensemble/HealthConnect/HealthShare and never venture out past the Interoperability section. 

First, I would like to establish that this is an extension of the already established documentation on importing and exporting SQL data found here: https://docs.intersystems.com/iris20241/csp/docbook/DocBook.UI.Page.cls?KEY=GSQL_impexp#GSQL_impexp_import

This tutorial will explicitly detail how to create, populate or update a Data LookUp Ta
















2
1 741
Article Derek Gervais · Sep 8, 2025 3m read

Hey folks! Having recently onboarded to InterSystems, I realized that despite having a totally free and awesome Community Edition, it's not super clear how to get it. I decided to write up a guide highlighting all the different ways you can access the Community Edition of InterSystems IRIS:

Get InterSystems IRIS Community Edition as a Container

Working with a containerized instance of the Community Edition is the recommended approach for folks who are new to developing on InterSystems IRIS, and in my opinion it's the most straightforward. InterSystems IRIS Community Edition can be found on DockerHub; if you have an InterSystems SSO account, you can also find it in the InterSystems Container Registry.

In either case, you'll want to pull the image you want using the docker CLI:

docker pull intersystems/iris-community:latest-em
// or
docker pull containers.intersystems.com/intersystems/iris-community:latest-em

Next, you'll need to start the container: In order to interact with IRIS from outside the container (for example, to use the management portal) you'll need to publish some ports. The following command will run the IRIS Community Edition container with the superserver and web server ports published; note that you can't have anything else running that depends on ports 1972 or 52773!

docker run --name iris -d --publish 1972:1972 --publish 52773:52773 intersystems/iris-community:latest-em
0
2 357
Article Megumi Kakechi · Dec 5, 2024 1m read

InterSystems FAQ rubric

If you want to raise an arbitrary custom error in a TRY block, you can pass an exception with a throw as follows. In the following example, a custom error is raised if Stcount is less than 1.

Class User.Test
{

ClassMethod ExceptionTest()
 {
    try
    {
      // : some codesif (Stcount<1) {
          throw##class(%Exception.General).%New("User-defined error", "5001", "location", "Data at location error")
          // User-created errors are 5001 and above
      }
    }
    catch ex
    {
      write"Errors #", ex.Code, ": ", ex.Name, " : ", e
1
2 535
Article Megumi Kakechi · Sep 4, 2025 2m read

InterSystems FAQ rubric

In InterSystems IRIS, you can create linked tables using commands, instead of using System Explorer > SQL > Wizard > Linked Tables in the Management Portal:

To create a linked table, use the CreateLinkedTable method of the %SYSTEM.SQL.Schema class. See the class reference for details.

To execute it, follow these steps:

set sc = $SYSTEM.SQL.Schema.CreateLinkedTable("<dsn>","<Schema>","<Table>","<primaryKeys>","<localClass>","<localTable>","")

/// 1st argument: dsn - SQL Gateway connection name/// 2nd argument: Schema - Source schema name/// 3rd argument: Tab
0
1 120