The utility returns the desired values from the text and display the multiple values if exists based on starting and ending string.
{
/// W !,##class(Test.Utility.FunctionSet).
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.
The utility returns the desired values from the text and display the multiple values if exists based on starting and ending string.
{
/// W !,##class(Test.Utility.FunctionSet).
Finishing my previous example for multiple IRIS instances, I tried
to compose a local single instance version. The step from the external
Python app to a version using embedded Python seemed to be obvious.
This was a wrong assumption, as some Python libraries just refused installation
into my local Windows-based environment.
Let's pretend for a moment that you're an international action spy who's dedicated your life to keeping the people of the world safe from danger. You recieve the following mission:
Good day, Agent IRIS,
We're sorry for interrupting your vacation in the
Bahamas, but we just received word from ourLondonagent that a "time bomb" is set to detonate in a highly populated area inLos Angeles. Our sources say that the "time bomb" is set to trigger at3:14 PMthis afternoon.Hurry, the people are counting on you!
Actually, I want to know specific production component status. I used "Ens.Config.Production" to get the status of component. But it will return only the component enabled/disabled. Anyone is having any Idea to get the specific production component status?
Hi,
so we introduced GIT in our workflow and we exported all files with $SYSTEM.OBJ.ExportUDL
Everything fine so far. But for some reason the export adds an extra line for classes (Routines are OK as far as I can see):
.png)
On Serverside it isn't there
.png)
The Problem is now that when we checkout a branch and a class changed we automatically compile it from the repository to a namespace that is made for the developer. E.g. DEV_001, DEV_002 and so on.
A benefit of using Doxygenerate is that Doxygen does more than just HTML output. Tweak the Doxyfile that tells Doxygen what to do and you can easily create a PDF. Our example MARINA application yielded a 524-page PDF. Here's what page 94 looks like:
.png)
You can browse the whole file here.
In the screenshot above, notice how we only get details of the superclass that is part of the app (AuditHistory). The primary superclass, %Library.SerialObject, is shown faded and with no details of what BankDetails inherits from it.
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 codes
if (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, " : ", ex.Hi folks!
Sometimes, when designing a class method and feeding it with more and more useful features, very soon the number of parameters can reach 10 and even more.
It becomes pretty difficult for users of useful methods to remember the position of the important parameter, and it is very easy to misuse the position and transfer the wrong value to the wrong parameter.
Here is an example of such a method (I asked GPT to create a method with 20 params):
ClassMethod GenerateReportWith20Params(
pTitle As %String = "",
pAuthor As %String = "",
pDate As %String = "", // e.g. 2025-09-03
pCompany As %String = "",
pDepartment As %String = "",
pVersion As %String = "1.0",
pFormat As %String = "pdf", // pdf|html|docx
pIncludeCharts As %Boolean = 1,
pIncludeSummary As %Boolean = 1,
pIncludeAppendix As %Boolean = 0,
pConfidentiality As %String = "Public",
pLanguage As %String = "en",
pReviewers As %String = "", // CSV, e.g. "Alice,Bob"
pApprover As %String = "",
pLogoPath As %String = "",
pWatermarkText As %String = "",
pColorScheme As %String = "default",
pPageSize As %String = "A4",
pOrientation As %String = "Portrait",
pOutputPath As %String = "report.pdf"
) As %Status
{
// implementation
}InterSystems IRIS interoperability production development involves using or writing various types of components. They include services (which handle incoming data), processes (which deal with the data flow and logic), and operations (which manage outgoing data or requests). Messages flowing through those components constantly require being adapted to consuming applications. Therefore,Data transformations are by far the most common component in interoperability productions.
In the early stages of data transformation development, thetest tool from the Management Portal becomes quite handy.
I had a need for a Filter, but did not want to recreate the wheel by creating another Data Lookup Table, so instead I created a Linked Table that points to a MS SQL Table outside of IRIS.
Once I had the Linked Table, I created a Class Method Function that would query the Linked Table and return a 1 if a result came back.
ClassMethod CheckPDMProviderType(pInput As %String) As %Boolean
{
set ExtDisplay = ""
&sql(SELECT SecurityGroup_k INTO :ExtDisplay
FROM osuwmc_CPD_SQL.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
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