Hi,
I need a custom operation on patient type that will receive a business identifier and will search them and for each paient it will return a $everything for all the found patients written with object script
InterSystems ObjectScript is a scripting language to operate with data using any data model of InterSystems Data Platform (Objects, Relational, Key-Value, Document, Globals) and to develop business logic for serverside applications on InterSystems Data Platform.
Hi,
I need a custom operation on patient type that will receive a business identifier and will search them and for each paient it will return a $everything for all the found patients written with object script
Hello,
I'm trying to get the Reply Action Code to work with the error message text.
I have this ACK:
MSH|^~\&|APP|FACIL|||20250821143621||ACK|CUEACK_20250821143621|P|2.4 MSA|AE||Failed to queue message
This is some of the Action Codes I've tried:
It's not suspending the message however.
What am I doing wrong?
Thank you
I’m pleased to announce the release of tree-sitter-objectscript, a new open-source tree-sitter grammar that brings first-class ObjectScript support to modern editors. If you caught the preview at READY ’25, you’ll be glad to know it’s now up on Github:
https://github.com/intersystems/tree-sitter-objectscript
.While starting with Intersystems IRIS or Cache, developers often encounter three core concepts: Dynamic Objects, Globals & Relational Table. Each has its role in building scalable and maintainable solutions. In this article, we'll walk through practical code examples, highlight best practices, and show how these concepts tie together.
1. Working with Dynamic Objects:
Dynamic objects (%DynamicObject and %DynamicArray) allow developers to manipulate JSON-like structures directly in Objectscript. They are especially useful for modern applications that need to parse, transform or generate JSON.
Hi folks!
Consider I have a class "X.Y.Z"
What is the SQL table name for it? How can I obtain it via ObjectScript?
A quick search doesn't show any methods and properties. Documentation is a bit "wrong" here saying that the SQL table name is the same. It will be at least 'x_y.z'.
Any help is very appreciated!)
What's in a name? That which we call a rose
By any other name would smell as sweet
William Shakespeare, "Romeo & Juliet"
In this article, we will describe a set of naming conventions for ObjectScript code.
Hello
I want to get the property of a class, sorted by order in storage.
I know we can use
Set definition = ##class(%Dictionary.ClassDefinition).%OpenId(className)
Set listProperty = definition.Properties
For ii = 1:1:listProperty.Count(){
write listProperty.GetAt(ii).NameBut using GetAt sorts the results alphabetically.
Example :
Class Test.class Extends (%SerialObject, %XML.Adaptor, %JSON.Adaptor)
{
Property tiers As %String;
Property journal As %String;
}listProperty.GetAt(1).Name = "journal" and listProperty.GetAt(2).
This article is a continuation of the IRIS JSON project and features additional methods and insights.
Let's continue with the instance methods
This instance method is used to determine the JSON data type of the %DynamicObject or %DynamicArray.
It returns one of the following strings:
|
|
USER>Set array = [1,"test",true,12.This great article sparked some recent private discussion, and I'd like to share some of my own thoughts from it.
The motivating concern boils down to: Why do we need coding rules or conventions at all? What happened to the wonderful era of the Renaissance artist-programmer forging their own path, prior to being supplanted by the craftsman and now (even worse) by AI?
In short, there are a few reasons why coding standards/guidelines are useful, and the Renaissance artist-programmer is not entirely gone.
Hi Everyone,
Please suggest/share best practices and sample questions that would help me to secure InterSystems HL7 specialist Certification.
I have a custom Buffer class which is designed to capture written/printed statements to the device, to be able to transform the captured text to string or stream type. I have used this in ObjectScript to capture ObjectScript write statements and return a string. I would like to try to use this with a [ Language = python ] method as follows. This class will be called by a scheduled task.
/// ObjectScript code which initializes buffer to capture statements written in nested method call
ClassMethod CollectStringFromBuffer()
{
set buffer = ##class(CustomClass.Buffer).%New()
do buffer.Hello, how are you?
First of all thanks for your time reading this question.
We are investigating how to validate the indexes of a global. We have read:
https://docs.intersystems.com/irisforhealth20251/csp/docbook/DocBook.UI…
And:
https://docs.intersystems.com/irisforhealth20251/csp/documatic/%25CSP.D…
We want to validate the inxedes of the global titled "Ens.Util.LogD". We have executed on the ObjectScript terminal, on the desired namespace:
ESBSSCC>set tSC = $SYSTEM.OBJ.
Reviewing my published packages, I identified a nasty bug in IRIS Native API

In this section, we will explore how to use Python as the primary language in IRIS, allowing you to write your application logic in Python while still leveraging the power of IRIS.
Word documents are widely used in the market. Users frequently create contracts, memos, resumes, reports, analyses, and other documents that may require data from or captured by InterSystems IRIS. However, IRIS does not have an API, SDK, library, or adapter for this. This limitation no longer exists.
The new Open Exchange library iris4word (https://openexchange.intersystems.com/package/iris4word) delivers an ObjectScript SDK where the developer passes any %DynamicObject as a parameter, a Word file template and then receives a ready document, with the structure and formatting defined in its template.
.png)
Let's start with a simple motivating question: over the past 14 days, what are my most common errors in the Application Error Log?
Answering this through the management portal or terminal is an annoying manual process - we should just be able to use SQL. Fortunately, there are a few class queries to help with this in the SYS.ApplicationError class in the %SYS namespace. You can answer the question for a single date with something like:
select "Error message",count(*)
from SYS.Hi,
I have a code that copy a method to another class for analysis purpose.
I also want this method to appear first in the source code to easily use it in VSCode with the classmethod debug button and not search it in the numerous method of the modified class.
Is there a way to do such a thing?
I tried the placeAfter keyword but I can't find a way to make it really work as I want. Is their other ways to control the order of methods?

Now that we have a good understanding of Python and its features, let's explore how we can leverage Python within IRIS.
Sending emails is a common requirement in integration scenarios — whether for client reminders, automatic reports, or transaction confirmations. Static messages quickly become hard to maintain and personalize. This is where the templated_email module comes in, combining InterSystems IRIS Interoperability with the power of Jinja2 templates.
Jinja2 is a popular templating engine from the Python ecosystem that enables fully dynamic content generation.

This will be a short article about Python dunder methods, also known as magic methods.
Dunder methods are special methods in Python that start and end with double underscores (__). They allow you to define the behavior of your objects for built-in operations, such as addition, subtraction, string representation, and more.
Some common dunder methods include:
__init__(self, ...): Called when an object is created.
%OnNew method in ObjectScript.__str__(self): Called by the str() built-in function and print to represent the object as aAre you curious about how to run Python scripts directly in your InterSystems IRIS or Caché terminal? 🤔 Good news it's easy! 😆 IRIS supports Embedded Python, allowing you to use Python interactively within its terminal environment.
How to access the Python Shell?
To launch the Python shell from the IRIS terminal, simply run the following command:
do ##class(%SYS.Python).Shell()This opens an interactive Python shell inside the IRIS terminal. From here, you can write and run Python code just as you would in a normal Python environment.

Modules what a topic! We don't have this notion in ObjectScript, but it's a fundamental concept in Python. Let's discover it together.
I see modules as an intermediate layer between classes and packages. Let see it by example.
A bad example :
# MyClass.py
class MyClass:
def my_method(self):
print("Hello from MyClass!")
When you try to use this class in another script, you would do:
# class_usage.py
from MyClass import MyClass # weird, right?
my_instance = MyClass()
my_instance.my_method()
Why this is a bad example?
Working on wrapping an IRIS Cache ObjectScript method that runs for a few seconds. Trying to get UI updates to show BEFORE the method runs in an async/await function. But it seems to be running synchronously rather than asynchronously . So my question is does IRIS/ObjectScript CSP pages support futures with JavaScript or does it run all synchronously.
InterSystems is pleased to announce that version 3.0.5 of the VS Code - ObjectScript extension has been released. This release includes many bug fixes, as well as changes to the telemetry data we collect. Collecting more product usage data helps InterSystems identify and prioritize fixes and enhancements that will have the most positive impact for you, our users. Personally identifiable information (PII) will never be collected, and telemetry can be disabled using the telemetry.telemetryLevel setting. The full list of data points that are collected can be found here.
I am trying to catch an exception and write it to the Application Error Log, but cant find any details on how to do this in IRIS health.
Catch ex { Set logger = ##class(%Logger).%GetLogger("MyApp") Do logger.Error($ZError) }
Cant seem to find the %Logger class either.

This will be a short article about PEP 8, the Python style guide.
In a nutshell, PEP 8 provides guidelines and best practices on how to write Python code.
I am trying to create users who only have `%SQL` Role for the INSTANCE. But I am unable to find any documentation on the `
See:
// Instantiate the Security.Users object Set userObj = ##class(Security.Users).%New() // Set the username and password Set userObj.Name = userName Set userObj.FullName = userFullName Set userObj.Namespace = "USER" Set userObj.Roles = "%SQL" Set sc = userObj.ChangePassword(passwd) // Save the user to the database Set ss = userObj.
in order to do analysis on huge data volumes, it is better to take you data to a separate machine for analysis away from the operational machine, so trying to write huge globals or tables into files as is would take a huge space, what could be a solution or best practice ?..in python for instance, there is the pickling option (serializes data to byte string and saves it to a file) to save space, what could be best in object script ?

This will be an introduction to Python programming in the context of IRIS.
Before anything I will cover an important topic: How python works, this will help you understand some issues and limitations you may encounter when working with Python in IRIS.
All the articles and examples can be found in this git repository: iris-python-article
Python is an interpreted language, which means that the code is executed line by line at runtime even when you import a script.
What does this mean ? Let's take a look at the following code:
# introduction.